From 746433218072baa65337895460cc3e4507c54ca7 Mon Sep 17 00:00:00 2001 From: Kyle Fiedler Date: Wed, 22 Aug 2012 15:09:20 -0400 Subject: [PATCH 1/4] added fix for error styles and swapped some the button order --- lms/static/sass/course/wiki/_wiki.scss | 23 ++++++++++++++++++++++- lms/templates/wiki/create.html | 9 +++++---- lms/templates/wiki/edit.html | 17 +++++++++-------- 3 files changed, 36 insertions(+), 13 deletions(-) diff --git a/lms/static/sass/course/wiki/_wiki.scss b/lms/static/sass/course/wiki/_wiki.scss index 6ddfe0caef..9178f7719f 100644 --- a/lms/static/sass/course/wiki/_wiki.scss +++ b/lms/static/sass/course/wiki/_wiki.scss @@ -390,7 +390,6 @@ section.wiki { .CodeMirror { background: #fafafa; border: 1px solid #c8c8c8; - @include border-radius(3px); @include box-shadow(0 1px 0 0 rgba(255, 255, 255, 0.6), inset 0 0 3px 0 rgba(0, 0, 0, 0.1)); } @@ -690,6 +689,28 @@ section.wiki { margin-top: 9px; } + .error { + font-size: 1em; + color: $pink; + + .help-block { + margin-top: 10px; + } + + input { + border-color: $pink; + } + } + + .back { + float: right; + } + + + + + + /*----------------- Directory diff --git a/lms/templates/wiki/create.html b/lms/templates/wiki/create.html index 25cc197bc4..886764ba84 100644 --- a/lms/templates/wiki/create.html +++ b/lms/templates/wiki/create.html @@ -32,14 +32,15 @@
{% wiki_form create_form %}
diff --git a/lms/templates/wiki/edit.html b/lms/templates/wiki/edit.html index e2c6cb64a5..3d36cf2869 100644 --- a/lms/templates/wiki/edit.html +++ b/lms/templates/wiki/edit.html @@ -9,14 +9,14 @@
{% include "wiki/includes/editor.html" %}
- + @@ -29,14 +29,15 @@
From f4f8b7bf73c08ba1cd375b3df9ebd594bb1b5fa4 Mon Sep 17 00:00:00 2001 From: Kyle Fiedler Date: Wed, 22 Aug 2012 15:39:24 -0400 Subject: [PATCH 2/4] Added delete page and padding and hid th on overflow --- lms/static/sass/course/wiki/_wiki.scss | 5 +++++ lms/templates/wiki/edit.html | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lms/static/sass/course/wiki/_wiki.scss b/lms/static/sass/course/wiki/_wiki.scss index 9178f7719f..9868989eff 100644 --- a/lms/static/sass/course/wiki/_wiki.scss +++ b/lms/static/sass/course/wiki/_wiki.scss @@ -757,6 +757,7 @@ section.wiki { th, td { border-bottom: 1px solid $light-gray; padding: 8px; + overflow: hidden; } tr:nth-child(even) { @@ -860,6 +861,10 @@ section.wiki { } } + section.delete { + padding: 40px; + } + diff --git a/lms/templates/wiki/edit.html b/lms/templates/wiki/edit.html index 3d36cf2869..f4bd7d138f 100644 --- a/lms/templates/wiki/edit.html +++ b/lms/templates/wiki/edit.html @@ -39,7 +39,7 @@ {% trans "Back to editor" %} - + {% endblock %} From cca5fe2f040a063d2db267dba263cd3fa23ea257 Mon Sep 17 00:00:00 2001 From: Kyle Fiedler Date: Wed, 22 Aug 2012 15:40:56 -0400 Subject: [PATCH 3/4] Delete page --- lms/templates/wiki/delete.html | 64 ++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 lms/templates/wiki/delete.html diff --git a/lms/templates/wiki/delete.html b/lms/templates/wiki/delete.html new file mode 100644 index 0000000000..6cb2b36707 --- /dev/null +++ b/lms/templates/wiki/delete.html @@ -0,0 +1,64 @@ +{% 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" %}

+ +
    + {% for child in delete_children %} +
  • {{ child.article }}
  • + {% if delete_children_more %} +
  • {% trans "...and more!" %}
  • + {% endif %} + {% endfor %} +
+ + {% endif %} + + {% if not cannot_delete_children %} +

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

+ +
+ {% wiki_form delete_form %} + +
+ + + + {% trans "Go back" %} + +
+
+ {% endif %} + + {% endif %} +
+ +{% endblock %} + From a694d1034ee6ec9ba177bc66fd4296b71e125587 Mon Sep 17 00:00:00 2001 From: Bridger Maxwell Date: Wed, 22 Aug 2012 15:57:44 -0400 Subject: [PATCH 4/4] We use django-wiki's built-in wikilinks markdown extension. They were clashing. --- .../plugins/markdownedx/mdx_wikipath.py | 92 ------------------- .../plugins/markdownedx/wiki_plugin.py | 7 +- lms/envs/common.py | 1 + repo-requirements.txt | 2 +- 4 files changed, 4 insertions(+), 98 deletions(-) delete mode 100755 lms/djangoapps/course_wiki/plugins/markdownedx/mdx_wikipath.py diff --git a/lms/djangoapps/course_wiki/plugins/markdownedx/mdx_wikipath.py b/lms/djangoapps/course_wiki/plugins/markdownedx/mdx_wikipath.py deleted file mode 100755 index 4c6f6fadd7..0000000000 --- a/lms/djangoapps/course_wiki/plugins/markdownedx/mdx_wikipath.py +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/env python - -''' -Wikipath Extension for Python-Markdown -====================================== - -Converts [Link Name](wiki:ArticleName) to relative links pointing to article. Requires Python-Markdown 2.0+ - -Basic usage: - - >>> import markdown - >>> text = "Some text with a [Link Name](wiki:ArticleName)." - >>> html = markdown.markdown(text, ['wikipath(base_url="/wiki/view/")']) - >>> html - u'

Some text with a Link Name.

' - -Dependencies: -* [Python 2.3+](http://python.org) -* [Markdown 2.0+](http://www.freewisdom.org/projects/python-markdown/) -''' - - -import markdown -try: - # Markdown 2.1.0 changed from 2.0.3. We try importing the new version first, - # but import the 2.0.3 version if it fails - from markdown.util import etree -except: - from markdown import etree - - -class WikiPathExtension(markdown.Extension): - def __init__(self, configs): - # set extension defaults - self.config = { - 'base_url' : ['/', 'String to append to beginning of URL.'], - 'html_class' : ['wikipath', 'CSS hook. Leave blank for none.'] - } - - # Override defaults with user settings - for key, value in configs : - # self.config[key][0] = value - self.setConfig(key, value) - - - def extendMarkdown(self, md, md_globals): - self.md = md - - # append to end of inline patterns - WIKI_RE = r'\[(?P.+?)\]\(wiki:(?P[a-zA-Z\d/_-]*)\)' - wikiPathPattern = WikiPath(WIKI_RE, self.config) - wikiPathPattern.md = md - md.inlinePatterns.add('wikipath', wikiPathPattern, "