From c2534742977ce6f7f2da4e8b34790851bfe56e76 Mon Sep 17 00:00:00 2001 From: Tom Giannattasio Date: Fri, 17 Aug 2012 15:59:31 -0400 Subject: [PATCH 1/3] added modal functionality for attachments page --- lms/static/sass/course/wiki/_wiki.scss | 66 +++++++++++ .../wiki/plugins/attachments/index.html | 111 ++++++------------ 2 files changed, 104 insertions(+), 73 deletions(-) diff --git a/lms/static/sass/course/wiki/_wiki.scss b/lms/static/sass/course/wiki/_wiki.scss index a5cc307152..a053946a80 100644 --- a/lms/static/sass/course/wiki/_wiki.scss +++ b/lms/static/sass/course/wiki/_wiki.scss @@ -436,6 +436,44 @@ section.wiki { margin-left: -480px; top: 150px; + &.upload-modal, + &.search-file-modal { + width: 400px; + min-height: 0; + margin-left: -200px; + + h4 { + margin-bottom: 20px; + font-weight: bold; + } + + .help-block { + font-size: 0.8em; + } + } + + &.search-file-modal { + width: 500px; + margin-left: -250px; + + p { + font-size: 0.8em; + line-height: 1.4em; + } + + .form-search { + margin: 30px 0 15px; + + input { + width: 350px; + } + + button { + height: 35px; + } + } + } + .modal-header { h1, p { color: #fff; @@ -472,10 +510,17 @@ section.wiki { } } + .modal-inner-wrapper { + background: #fff; + padding: 20px; + } + #previewWindow body { background: #f00 !important; } + + @@ -568,6 +613,27 @@ section.wiki { + /*----------------- + + Attachments + + -----------------*/ + + .attachment-options { + height: 40px; + margin-bottom: 30px; + padding: 20px 0 2px; + border-bottom: 1px solid $light-gray; + border-top: 1px solid $light-gray; + } + + .attachment-list { + + } + + + + /*----------------- diff --git a/lms/templates/wiki/plugins/attachments/index.html b/lms/templates/wiki/plugins/attachments/index.html index e2dab8824f..d110bc709e 100644 --- a/lms/templates/wiki/plugins/attachments/index.html +++ b/lms/templates/wiki/plugins/attachments/index.html @@ -7,14 +7,41 @@ {% block wiki_contents_tab %}
- - {% if article|can_write:user %} + - - {% trans "Upload new file" %} - + + + - - - - - - - - -
-
-
- -
-
- {% 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 %} From 1bd790fabb1805e5969a3f2e4ca4cb8f2e468686 Mon Sep 17 00:00:00 2001 From: Tom Giannattasio Date: Fri, 17 Aug 2012 16:46:40 -0400 Subject: [PATCH 2/3] finished attachment styles --- lms/static/sass/course/wiki/_wiki.scss | 57 ++++++++- .../wiki/plugins/attachments/index.html | 118 +++++++++--------- 2 files changed, 111 insertions(+), 64 deletions(-) diff --git a/lms/static/sass/course/wiki/_wiki.scss b/lms/static/sass/course/wiki/_wiki.scss index a053946a80..23b032a4e9 100644 --- a/lms/static/sass/course/wiki/_wiki.scss +++ b/lms/static/sass/course/wiki/_wiki.scss @@ -1,7 +1,7 @@ section.wiki { padding-top: 25px; - header { + > header { height: 33px; margin-bottom: 36px; padding-bottom: 26px; @@ -406,6 +406,7 @@ section.wiki { letter-spacing: 0 !important; &:hover { + color: $base-font-color; text-decoration: none; } @@ -621,14 +622,58 @@ section.wiki { .attachment-options { height: 40px; - margin-bottom: 30px; - padding: 20px 0 2px; - border-bottom: 1px solid $light-gray; - border-top: 1px solid $light-gray; + margin: 40px 0 30px; } .attachment-list { - + ul { + list-style: none; + padding: 0; + } + + li { + margin-bottom: 15px; + border: 1px solid #DDD; + background: #F9F9F9; + @include border-radius(5px); + } + + header, + .attachment-details { + padding: 12px 15px; + } + + .attachment-details { + background: #eee; + @include border-radius(0 0 5px 5px); + } + + h3 { + a { + font-weight: bold; + font-size: 0.9em; + } + + .badge { + float: right; + font-size: 0.6em; + line-height: 20px; + color: #aaa; + } + } + + .attachment-description { + font-size: 0.8em; + } + + table { + width: 100%; + font-size: 0.8em; + } + + .attachment-actions .btn { + float: right; + } } diff --git a/lms/templates/wiki/plugins/attachments/index.html b/lms/templates/wiki/plugins/attachments/index.html index d110bc709e..d448392933 100644 --- a/lms/templates/wiki/plugins/attachments/index.html +++ b/lms/templates/wiki/plugins/attachments/index.html @@ -62,66 +62,68 @@
-

{% 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" %} + +

[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 %} + +
+ + + + + + + + + + + + + + +
{% trans "Markdown tag" %}{% trans "Uploaded by" %}{% trans "Size" %}{% trans "File History" %} + {% if attachment|can_write:user %} + {% if not attachment.current_revision.deleted %} + {% if attachment.article = article %} + {% trans "Delete" %} + {% else %} + {% trans "Detach" %} + {% endif %} + + {% trans "Replace" %} + + {% else %} + {% if attachment.current_revision.previous_revision.id %} +
+ {% csrf_token %} + +
+ {% endif %} + {% endif %} + {% endif %} +
[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 }}{{ attachment.attachmentrevision_set.all.count }} {% trans "revisions" %}
+
+ + {% empty %} +

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

+ {% endfor %} +
From a2d0ada82cd8d1c8db61f6681f3cfcef2bf2e32a Mon Sep 17 00:00:00 2001 From: Tom Giannattasio Date: Fri, 17 Aug 2012 17:01:45 -0400 Subject: [PATCH 3/3] styled settings page --- lms/static/sass/course/wiki/_wiki.scss | 35 ++++++++++++++++++++++++++ lms/templates/wiki/includes/form.html | 1 + 2 files changed, 36 insertions(+) diff --git a/lms/static/sass/course/wiki/_wiki.scss b/lms/static/sass/course/wiki/_wiki.scss index 23b032a4e9..4173165f1f 100644 --- a/lms/static/sass/course/wiki/_wiki.scss +++ b/lms/static/sass/course/wiki/_wiki.scss @@ -588,6 +588,41 @@ section.wiki { + /*----------------- + + Settings + + -----------------*/ + + #settings_form { + .well { + margin-bottom: 15px; + @include clearfix; + } + + .control-group { + float: left; + margin-bottom: 0; + clear: both; + } + + label { + margin-left: 15px; + } + + .controls { + padding-top: 4px; + } + + label, + .controls { + float: right; + } + } + + + + /*----------------- New diff --git a/lms/templates/wiki/includes/form.html b/lms/templates/wiki/includes/form.html index c274a4d46f..2ab845a689 100644 --- a/lms/templates/wiki/includes/form.html +++ b/lms/templates/wiki/includes/form.html @@ -13,6 +13,7 @@ {% if field.is_hidden %} {{ field }} {% else %} +
{% if field.label %}