diff --git a/lms/static/sass/course/wiki/_wiki.scss b/lms/static/sass/course/wiki/_wiki.scss index 73a8268b26..24a556dd13 100644 --- a/lms/static/sass/course/wiki/_wiki.scss +++ b/lms/static/sass/course/wiki/_wiki.scss @@ -359,9 +359,15 @@ section.wiki { display: none; } + button { + font-family: $sans-serif; + } + .btn { @include button(simple, #eee); font-size: 0.8em; + margin-right: 5px; + line-height: 1.2em; &:hover { text-decoration: none; @@ -378,12 +384,29 @@ section.wiki { } } - #previewModal { + .modal { width: 960px; z-index: 9999; min-height: 500px; margin-left: -480px; - top: 200px; + top: 150px; + + .modal-header { + h1, p { + color: #fff; + } + + h1 { + margin: 3px 12px 8px; + font-size: 1.1em; + } + + p { + font-size: 0.9em; + margin: 5px 12px 20px; + line-height: 1em; + } + } .modal-body { padding-bottom: 8px; @@ -395,6 +418,10 @@ section.wiki { border: 0; } + .modal-footer { + margin: 12px; + } + .modal-footer .btn { margin-right: 10px; } @@ -421,6 +448,10 @@ section.wiki { border: 1px solid $light-gray; background: #f9f9f9; border-radius: 5px; + + a:hover { + text-decoration: none; + } } .collapse { @@ -435,6 +466,59 @@ section.wiki { + /*----------------- + + New + + -----------------*/ + + .new-article { + margin: auto; + float: none; + + .add-on { + line-height: 34px; + margin-right: 6px; + } + } + + #hint_id_slug { + display: inline-block; + font-size: 0.9em; + line-height: 1.3em; + margin-top: 9px; + } + + + + + + /*----------------- + + Delete + + -----------------*/ + + #div_id_confirm { + position: relative; + height: 30px; + margin: 40px 0; + + #id_confirm { + position: absolute; + top: 6px; + } + + label { + position: absolute; + left: 25px; + font-size: 1.4em; + } + } + + + + /*----------------- diff --git a/lms/templates/wiki/create.html b/lms/templates/wiki/create.html new file mode 100644 index 0000000000..25cc197bc4 --- /dev/null +++ b/lms/templates/wiki/create.html @@ -0,0 +1,49 @@ +{% extends "wiki/base.html" %} +{% load wiki_tags i18n sekizai_tags %} +{% load url from future %} + +{% block pagetitle %}{% trans "Add new article" %}{% endblock %} + +{% block wiki_contents %} + + {% addtoblock "js" %} + + + {% endaddtoblock %} + +
+ + {% include "wiki/includes/editormedia.html" %} +

{% trans "Add new article" %}

+ +
+ {% wiki_form create_form %} +
+ + + {% trans "Go back" %} + + +
+
+ +
+ +{% endblock %} + diff --git a/lms/templates/wiki/delete.html b/lms/templates/wiki/delete.html new file mode 100644 index 0000000000..acabb79aad --- /dev/null +++ b/lms/templates/wiki/delete.html @@ -0,0 +1,62 @@ +{% extends "wiki/base.html" %} +{% load wiki_tags i18n sekizai_tags %} +{% load url from future %} + +{% block pagetitle %}{% trans "Delete article" %}{% endblock %} + +{% block wiki_contents %} +

{% trans "Delete" %} "{{ article.current_revision.title }}"

+ + {% if cannot_delete_root %} +

{% trans "You cannot delete a root article." %}

+

{% trans "Go back" %}

+ {% else %} + + {% if cannot_delete_children %} + +

{% trans "You cannot delete this article because you do not have permission to delete articles with children. Try to remove the children manually one-by-one." %}

+ + {% endif %} + + {% if delete_children %} + +

{% trans "You are deleting an article. This means that its children will be deleted as well. If you choose to purge, children will also be purged!" %}

+ +

{% trans "Articles that will be deleted" %}

+ + + + {% endif %} + + {% if not cannot_delete_children %} +

{% trans "You are deleting an article. Please confirm." %}

+ +
+ {% wiki_form delete_form %} + +
+ + + {% trans "Go back" %} + + +
+
+ {% endif %} + + {% endif %} + +{% endblock %} + diff --git a/lms/templates/wiki/history.html b/lms/templates/wiki/history.html new file mode 100644 index 0000000000..0c120d5c54 --- /dev/null +++ b/lms/templates/wiki/history.html @@ -0,0 +1,210 @@ +{% extends "wiki/article.html" %} +{% load wiki_tags i18n sekizai_tags %} +{% load url from future %} + +{% block pagetitle %}{% trans "History" %}: {{ article.current_revision.title }}{% endblock %} + +{% block wiki_contents_tab %} + +{% addtoblock "js" %} + + + +{% endaddtoblock %} +{% addtoblock "css" %} + +{% endaddtoblock %} + + +
+
+ {% for revision in revisions %} + + {% endfor %} + + {% include "wiki/includes/pagination.html" %} + + {% if revisions.count > 1 %} +
+
+ {% if article|can_write:user %} + + {% else %} + + {% endif %} + +
+
+ + {% endif %} + +
+ + + + +
+ +{% endblock %} + diff --git a/lms/templates/wiki/includes/editor.html b/lms/templates/wiki/includes/editor.html index 10e2a2b645..736e6e0499 100644 --- a/lms/templates/wiki/includes/editor.html +++ b/lms/templates/wiki/includes/editor.html @@ -11,7 +11,7 @@
-
+
{% for plugin in sidebar %}
diff --git a/lms/templates/wiki/includes/form.html b/lms/templates/wiki/includes/form.html new file mode 100644 index 0000000000..c274a4d46f --- /dev/null +++ b/lms/templates/wiki/includes/form.html @@ -0,0 +1,36 @@ +{% csrf_token %} +{% if form.non_field_errors %} + {% if form_error_title %}

{{ form_error_title }}

{% endif %} + {% for error_message in form.non_field_errors %} +
+ {{ error_message }} +
+ {% endfor %} +{% endif %} + +{% for field in form %} + + {% if field.is_hidden %} + {{ field }} + {% else %} +
+ {% if field.label %} + + {% endif %} +
+ {{ field }} {% if field.field.required %}*{% endif %} + {% if field.errors %} + {% for error in field.errors %} +
{{ error }}
+ {% endfor %} + {% endif %} + {% if field.help_text %} +

{{ field.help_text|safe }}

+ {% endif %} +
+
+ {% endif %} + +{% endfor %}