From bb6d6d9ac867f758f18bee2dc44efbb8efc39360 Mon Sep 17 00:00:00 2001 From: Tom Giannattasio Date: Thu, 16 Aug 2012 16:41:41 -0400 Subject: [PATCH] edit page styles --- lms/static/sass/base/_variables.scss | 1 + lms/static/sass/course/wiki/_wiki.scss | 190 +++++++++++++++++++++++- lms/templates/wiki/article.html | 5 +- lms/templates/wiki/base.html | 2 +- lms/templates/wiki/edit.html | 45 ++++++ lms/templates/wiki/includes/editor.html | 42 ++++++ lms/templates/wiki/preview_inline.html | 36 ++--- 7 files changed, 295 insertions(+), 26 deletions(-) create mode 100644 lms/templates/wiki/edit.html create mode 100644 lms/templates/wiki/includes/editor.html diff --git a/lms/static/sass/base/_variables.scss b/lms/static/sass/base/_variables.scss index 7ad30f0c91..8baa2f2d70 100644 --- a/lms/static/sass/base/_variables.scss +++ b/lms/static/sass/base/_variables.scss @@ -10,6 +10,7 @@ $fg-min-width: 810px; $sans-serif: 'Open Sans', $verdana; $body-font-family: $sans-serif; $serif: $georgia; +$monospace: Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; $body-font-size: em(14); $body-line-height: golden-ratio(.875em, 1); diff --git a/lms/static/sass/course/wiki/_wiki.scss b/lms/static/sass/course/wiki/_wiki.scss index 7813158650..73a8268b26 100644 --- a/lms/static/sass/course/wiki/_wiki.scss +++ b/lms/static/sass/course/wiki/_wiki.scss @@ -77,6 +77,10 @@ section.wiki { padding: 7px 15px !important; font-size: 0.72em; font-weight: 600; + + &:hover { + text-decoration: none; + } } .search-wiki { @@ -127,12 +131,14 @@ section.wiki { width: flex-grid(9); margin-left: flex-gutter(); color: $base-font-color; + } + &.view .main-article { h2 { padding-bottom: 8px; margin-bottom: 22px; border-bottom: 1px solid $light-gray; - font-size: 1.33em; + font-size: 1.6em; font-weight: bold; color: $base-font-color; text-transform: none; @@ -143,19 +149,29 @@ section.wiki { margin-top: 40px; margin-bottom: 20px; font-weight: bold; - font-size: 1.1em; + font-size: 1.25em; } h4 { - + margin: 30px 0 10px; + font-size: 1em; + color: #999; + font-weight: bold; } h5 { - + margin: 20px 0 10px; + font-size: .8em; + font-weight: bold; + text-transform: uppercase; } h6 { - + margin: 20px 0 10px; + font-size: .8em; + font-weight: bold; + color: #999; + text-transform: uppercase; } ul { @@ -164,8 +180,18 @@ section.wiki { color: inherit; } - li { + li { margin-bottom: 15px; + line-height: 1.6em; + } + + pre { + padding: 10px; + border: 1px solid #ddd; + background: #f8f8f8; + border-radius: 4px; + font-size: 0.9em; + font-family: Monaco, monospace; } } @@ -283,6 +309,133 @@ section.wiki { + + /*----------------- + + Edit + + -----------------*/ + + label { + font-family: $sans-serif; + font-size: 0.9em; + font-weight: bold; + font-style: normal; + text-transform: uppercase; + color: #aaa; + } + + input { + font-family: $sans-serif; + font-style: normal; + font-weight: normal; + } + + #id_title, + #id_content { + width: 100%; + } + + #id_content { + font-family: $monospace; + } + + .markItUpContainer { + margin-right: 0; + } + + .control-group { + margin-bottom: 20px; + } + + #hint_id_summary { + display: inline-block; + font-size: 0.9em; + line-height: 32px; + margin-left: 15px; + } + + .asteriskField { + display: none; + } + + .btn { + @include button(simple, #eee); + font-size: 0.8em; + + &:hover { + text-decoration: none; + } + + &.btn-primary { + @include button; + font-size: 0.8em; + } + + &.btn-danger { + @include button(simple, $pink); + font-size: 0.8em; + } + } + + #previewModal { + width: 960px; + z-index: 9999; + min-height: 500px; + margin-left: -480px; + top: 200px; + + .modal-body { + padding-bottom: 8px; + } + + iframe { + width: 100%; + min-height: 450px; + border: 0; + } + + .modal-footer .btn { + margin-right: 10px; + } + } + + #previewWindow body { + background: #f00 !important; + } + + + + + + /*----------------- + + Changes + + -----------------*/ + + &.history { + .accordion { + margin-bottom: 15px; + padding: 15px; + border: 1px solid $light-gray; + background: #f9f9f9; + border-radius: 5px; + } + + .collapse { + display: none; + + &.in { + display: block; + } + } + } + + + + + /*----------------- Alerts @@ -291,7 +444,7 @@ section.wiki { .alert { position: relative; - top: -35px; + top: -15px; margin-bottom: 24px; padding: 8px 12px; border: 1px solid #EBE8BF; @@ -308,4 +461,27 @@ section.wiki { text-decoration: none; } } +} + +.modal-backdrop { + position: fixed; + top: 0; + left: 0; + z-index: 999; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, .4); +} + +.modal-preview { + min-width: 0; +} + +.modal-preview .container { + padding: 50px; +} + +.modal-preview .main-article { + width: 100% !important; + margin-left: 0; } \ No newline at end of file diff --git a/lms/templates/wiki/article.html b/lms/templates/wiki/article.html index b377ad284b..7175219f74 100644 --- a/lms/templates/wiki/article.html +++ b/lms/templates/wiki/article.html @@ -13,7 +13,10 @@
-

{{ article.current_revision.title }}

+ {% if selected_tab != "edit" %} +

{{ article.current_revision.title }}

+ {% endif %} + {% block wiki_contents_tab %} {% wiki_render article %} {% endblock %} diff --git a/lms/templates/wiki/base.html b/lms/templates/wiki/base.html index d05512494e..d66833d4c6 100644 --- a/lms/templates/wiki/base.html +++ b/lms/templates/wiki/base.html @@ -14,7 +14,7 @@ {% include "course_navigation.html" with active_page_context="wiki" %} {% endif %} -
+
{% block wiki_body %} diff --git a/lms/templates/wiki/edit.html b/lms/templates/wiki/edit.html new file mode 100644 index 0000000000..e2c6cb64a5 --- /dev/null +++ b/lms/templates/wiki/edit.html @@ -0,0 +1,45 @@ +{% extends "wiki/article.html" %} +{% load wiki_tags i18n %} +{% load url from future %} + +{% block pagetitle %}{% trans "Edit" %}: {{ article.current_revision.title }}{% endblock %} + +{% block wiki_contents_tab %} + +
+ {% include "wiki/includes/editor.html" %} +
+ + + + + + {% trans "Delete article" %} + + +
+ +
+ +{% endblock %} + diff --git a/lms/templates/wiki/includes/editor.html b/lms/templates/wiki/includes/editor.html new file mode 100644 index 0000000000..10e2a2b645 --- /dev/null +++ b/lms/templates/wiki/includes/editor.html @@ -0,0 +1,42 @@ +{% load wiki_tags i18n %} +{% include "wiki/includes/editormedia.html" %} + +
+{% wiki_form edit_form %} + +
+ +
+
+ {% for plugin in sidebar %} + +
+ +
+ + + +
+
+ {% if plugin.sidebar.template %} + {% with form_images as form and plugin as plugin %} + {% include plugin.sidebar.template %} + {% endwith %} + {% endif %} +
+
+ +
+
+ + {% endfor %} +
+
diff --git a/lms/templates/wiki/preview_inline.html b/lms/templates/wiki/preview_inline.html index 42971e5c2d..16a35f6807 100644 --- a/lms/templates/wiki/preview_inline.html +++ b/lms/templates/wiki/preview_inline.html @@ -4,26 +4,28 @@ {% compressed_css 'course' %} - -
- {% if revision %} -
- {% trans "Previewing revision" %}: {{ revision.created }} (#{{ revision.revision_number }}) by {% if revision.user %}{{ revision.user }}{% else %}{% if user|is_moderator %}{{ revision.ip_address|default:"anonymous (IP not logged)" }}{% else %}{% trans "anonymous (IP logged)" %}{% endif %}{% endif %} -
- {% endif %} + +
+
+ {% if revision %} +
+ {% trans "Previewing revision" %}: {{ revision.created }} (#{{ revision.revision_number }}) by {% if revision.user %}{{ revision.user }}{% else %}{% if user|is_moderator %}{{ revision.ip_address|default:"anonymous (IP not logged)" }}{% else %}{% trans "anonymous (IP logged)" %}{% endif %}{% endif %} +
+ {% endif %} - {% if merge %} -
- {% trans "Previewing merge between" %}: - {{ merge1.created }} (#{{ merge1.revision_number }}) by {% if merge1.user %}{{ merge1.user }}{% else %}{% if user|is_moderator %}{{ merge1.ip_address|default:"anonymous (IP not logged)" }}{% else %}{% trans "anonymous (IP logged)" %}{% endif %}{% endif %} - {% trans "and" %} - {{ merge1.created }} (#{{ merge1.revision_number }}) by {% if merge1.user %}{{ merge1.user }}{% else %}{% if user|is_moderator %}{{ merge1.ip_address|default:"anonymous (IP not logged)" }}{% else %}{% trans "anonymous (IP logged)" %}{% endif %}{% endif %} -
- {% endif %} + {% if merge %} +
+ {% trans "Previewing merge between" %}: + {{ merge1.created }} (#{{ merge1.revision_number }}) by {% if merge1.user %}{{ merge1.user }}{% else %}{% if user|is_moderator %}{{ merge1.ip_address|default:"anonymous (IP not logged)" }}{% else %}{% trans "anonymous (IP logged)" %}{% endif %}{% endif %} + {% trans "and" %} + {{ merge1.created }} (#{{ merge1.revision_number }}) by {% if merge1.user %}{{ merge1.user }}{% else %}{% if user|is_moderator %}{{ merge1.ip_address|default:"anonymous (IP not logged)" }}{% else %}{% trans "anonymous (IP logged)" %}{% endif %}{% endif %} +
+ {% endif %} -

{{ title }}

+

{{ title }}

- {% wiki_render article content %} + {% wiki_render article content %} +