diff --git a/lms/static/sass/course/wiki/_wiki.scss b/lms/static/sass/course/wiki/_wiki.scss index 782792bbbb..bc2cc46700 100644 --- a/lms/static/sass/course/wiki/_wiki.scss +++ b/lms/static/sass/course/wiki/_wiki.scss @@ -466,6 +466,15 @@ section.wiki { } } + .accordion small { + font-size: 0.8em; + color: #aaa; + } + + .accordion-toggle div { + margin-top: 8px; + } + .collapse { display: none; @@ -474,6 +483,28 @@ section.wiki { } } + .diff-container { + overflow-x: scroll; + + table { + min-width: 100%; + } + + th { + font-family: $sans-serif; + font-size: 0.7em; + } + + td { + font-family: $monospace; + } + + .linenumber, + .data { + font-size: 0.75em; + } + } + diff --git a/lms/templates/wiki/includes/anonymous_blocked.html b/lms/templates/wiki/includes/anonymous_blocked.html new file mode 100644 index 0000000000..264579130e --- /dev/null +++ b/lms/templates/wiki/includes/anonymous_blocked.html @@ -0,0 +1,13 @@ +{% load i18n %} +{% load url from future %} + +{% url 'wiki:signup' as signup_url %} +{% url 'wiki:login' as login_url %} +{% if login_url and signup_url %} + {% blocktrans %} + You need to log in or sign up to use this function. + {% endblocktrans %} +{% else %} + {% trans "You need to log in or sign up to use this function." %} +{% endif %} + diff --git a/lms/templates/wiki/plugins/attachments/index.html b/lms/templates/wiki/plugins/attachments/index.html new file mode 100644 index 0000000000..711f54a4af --- /dev/null +++ b/lms/templates/wiki/plugins/attachments/index.html @@ -0,0 +1,132 @@ +{% extends "wiki/article.html" %} +{% load wiki_tags i18n humanize %} +{% load url from future %} + +{% block pagetitle %}{% trans "Attachments" %}: {{ article.current_revision.title }}{% endblock %} + +{% block wiki_contents_tab %} +
+ + + + {% if article|can_write:user %} +
+
+
+ +
+
+ {% if anonymous_disallowed %} + {% include "wiki/includes/anonymous_blocked.html" %} + {% else %} +
+ {% wiki_form form %} + +
+ {% endif %} +
+
+ +
+
+
+
+ + +
+
+

{% trans "You can reuse files from other articles. These files are subject to updates on other articles which may or may not be a good thing." %}

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

{% trans "The following files are available for this article. Copy the markdown tag to directly refer to a file from the article text." %}

+ {% for attachment in attachments %} + + + + + + + + + + + + + + + +
+

+ {{ attachment.current_revision.get_filename }} + {{ attachment.current_revision.created|naturaltime }} + {% if attachment.current_revision.deleted %} + {% trans "deleted" %} + {% endif %} +

+ {{ attachment.current_revision.description }} +
{% trans "Markdown tag" %}{% trans "Uploaded by" %}{% trans "Size" %} + {% if attachment|can_write:user %} +

+ {% if not attachment.current_revision.deleted %} + {% trans "Replace" %} + {% if attachment.article = article %} + {% trans "Delete" %} + {% else %} + {% trans "Detach" %} + {% endif %} + {% else %} + {% if attachment.current_revision.previous_revision.id %} +

+ {% csrf_token %} + +
+ {% endif %} + {% endif %} +

+ {% endif %} +

+ + + {% trans "File history" %} ({{ attachment.attachmentrevision_set.all.count }} {% trans "revisions" %}) + +

+
[attachment:{{ attachment.id }}] + {% if attachment.current_revision.user %}{{ attachment.current_revision.user }}{% else %}{% if user|is_moderator %}{{ attachment.current_revision.ip_address|default:"anonymous (IP not logged)" }}{% else %}{% trans "anonymous (IP logged)" %}{% endif %}{% endif %} + {{ attachment.current_revision.get_size|filesizeformat }}
+ {% empty %} +

{% trans "There are no attachments for this article." %}

+ {% endfor %} +
+ + +
+ +{% endblock %} +