Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
51768ef8
Commit
51768ef8
authored
Aug 10, 2012
by
Bridger Maxwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Converted wiki edit page and breadcrumbs.
parent
b62869bf
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
150 additions
and
28 deletions
+150
-28
common/lib/mitxmako/mitxmako/templatetag_helpers.py
+5
-0
lms/templates/wiki/article.html
+18
-28
lms/templates/wiki/edit.html
+77
-0
lms/templates/wiki/includes/breadcrumbs.html
+48
-0
lms/urls.py
+2
-0
No files found.
common/lib/mitxmako/mitxmako/templatetag_helpers.py
View file @
51768ef8
from
django.template
import
loader
from
django.template.base
import
Template
,
Context
from
django.template.loader
import
get_template
,
select_template
...
...
@@ -21,3 +22,7 @@ def render_inclusion(func, file_name, *args, **kwargs):
# 'use_tz': context.use_tz,
# })
return
nodelist
.
render
(
new_context
)
def
django_template_include
(
file_name
,
mako_context
):
dictionary
=
dict
(
mako_context
)
return
loader
.
render_to_string
(
file_name
,
dictionary
=
dictionary
)
lms/templates/wiki/article.html
View file @
51768ef8
...
...
@@ -7,45 +7,35 @@
%
>
<
%
namespace
name=
"article_menu"
file=
"includes/article_menu.html"
/>
<
%
namespace
name=
"breadcrumbs"
file=
"includes/breadcrumbs.html"
/>
<
%
block
name=
"title"
><title>
${article.current_revision.title}
</title></
%
block>
<
%
doc
>
<
%
block
name=
"wiki_breadcrumbs"
>
Render "wiki/includes/breadcrumbs.html"
## {% include "wiki/includes/breadcrumbs.html" %}
${breadcrumbs.body(article, urlpath)}
</
%
block>
</
%
doc>
<
%
block
name=
"wiki_contents"
>
<div
class=
"tabbable tabs-top"
style=
"margin-top: 20px;"
>
<ul
class=
"nav nav-tabs"
>
<li
style=
"float: left"
>
<h1
style=
"margin-top: -10px;"
>
${article.current_revision.title}
</h1>
</li>
${article_menu.body('view', article, plugins)}
</ul>
<div
class=
"tabbable tabs-top"
style=
"margin-top: 20px;"
>
<ul
class=
"nav nav-tabs"
>
<li
style=
"float: left"
>
<h1
style=
"margin-top: -10px;"
>
${article.current_revision.title}
</h1>
</li>
${article_menu.body('view', article, plugins)}
</ul>
<div
class=
"tab-content"
>
${ render_inclusion(wiki_render, 'wiki/includes/render.html', article ) }
<div
class=
"tab-content"
>
${ render_inclusion(wiki_render, 'wiki/includes/render.html', article ) }
</div>
</div>
</div>
<div
class=
"tabbable tabs-below"
style=
"margin-top: 20px;"
>
<
%
doc
>
<ul
class=
"nav nav-tabs"
>
{% with "view" as selected %}
{% include "wiki/includes/article_menu.html" %}
{% endwith %}
<li
style=
"margin-top: 10px;"
><em>
{% trans "Article last modified:" %} {{ article.current_revision.modified }}
</em></li>
</ul>
</
%
doc>
</div>
<div
class=
"tabbable tabs-below"
style=
"margin-top: 20px;"
>
<ul
class=
"nav nav-tabs"
>
${article_menu.body('view', article, plugins)}
<li
style=
"margin-top: 10px;"
><em>
Article last modified: ${ article.current_revision.modified }
</em></li>
</ul>
</div>
</
%
block>
lms/templates/wiki/edit.html
0 → 100644
View file @
51768ef8
## mako
<
%
inherit
file=
"mako_base.html"
/>
<
%!
from
django
.
core
.
urlresolvers
import
reverse
from
mitxmako
.
templatetag_helpers
import
django_template_include
%
>
<
%
namespace
name=
"article_menu"
file=
"includes/article_menu.html"
/>
<
%
namespace
name=
"breadcrumbs"
file=
"includes/breadcrumbs.html"
/>
<
%
block
name=
"title"
><title>
Edit: ${article.current_revision.title}
</title></
%
block>
<
%
block
name=
"wiki_breadcrumbs"
>
${breadcrumbs.body(article, urlpath)}
</
%
block>
<
%
block
name=
"wiki_contents"
>
<div
class=
"tabbable tabs-top"
style=
"margin-top: 20px;"
>
<ul
class=
"nav nav-tabs"
>
<li
style=
"float: left"
>
<h1
style=
"margin-top: -10px;"
>
${article.current_revision.title}
</h1>
</li>
${article_menu.body('edit', article, plugins)}
</ul>
<div
class=
"tab-content"
>
<form
method=
"POST"
class=
"form-horizontal"
>
${django_template_include("wiki/includes/editor.html", context)}
<div
class=
"form-actions"
>
<button
type=
"submit"
name=
"preview"
value=
"1"
class=
"btn btn-large"
onclick=
"$('#previewModal').modal('show'); this.form.target='previewWindow'; this.form.action='${reverse('wiki:preview_url', kwargs={'path' : urlpath.path})}'"
>
<span
class=
"icon-eye-open"
></span>
Preview
</button>
<button
type=
"submit"
name=
"save"
value=
"1"
class=
"btn btn-large btn-primary"
onclick=
"this.form.target=''; this.form.action='${reverse('wiki:edit_url', kwargs={'path' : urlpath.path})}'"
>
<span
class=
"icon-ok"
></span>
Save changes
</button>
<a
class=
"pull-right btn btn-danger"
>
<span
class=
"icon-trash"
></span>
Delete article
</a>
</div>
<div
class=
"modal hide fade"
id=
"previewModal"
style=
"width: 80%; min-height: 500px; margin-left: -40%;"
>
<div
class=
"modal-body"
>
<iframe
name=
"previewWindow"
style=
"width: 100%; min-height: 400px; border: 0;"
frameborder=
"0"
></iframe>
</div>
<div
class=
"modal-footer"
>
<a
href=
"#"
class=
"btn btn-large"
data-dismiss=
"modal"
>
<span
class=
"icon-circle-arrow-left"
></span>
Back to editor
</a>
<button
type=
"submit"
name=
"save"
value=
"1"
class=
"btn btn-large btn-primary"
onclick=
"this.form.target=''; this.form.action='${reverse('wiki:edit_url', kwargs={'path' : urlpath.path})}'"
>
<span
class=
"icon-ok"
></span>
Save changes
</button>
</div>
</div>
</form>
</div>
</div>
<div
class=
"tabbable tabs-below"
style=
"margin-top: 20px;"
>
<ul
class=
"nav nav-tabs"
>
${article_menu.body('edit', article, plugins)}
<li
style=
"margin-top: 10px;"
><em>
Article last modified: ${ article.current_revision.modified }
</em></li>
</ul>
</div>
</
%
block>
lms/templates/wiki/includes/breadcrumbs.html
0 → 100644
View file @
51768ef8
## mako
<
%
page
args=
"article, urlpath"
/>
<
%!
from
django
.
core
.
urlresolvers
import
reverse
%
>
%if urlpath:
<ul
class=
"breadcrumb pull-left"
class=
""
>
%for ancestor in urlpath.get_ancestors():
<span
class=
"divider"
>
/
</span>
<li><a
href=
"${reverse('wiki:get_url', ancestor.path)}"
>
${ ancestor.article.current_revision.title }
</a></li>
%endfor
<span
class=
"divider"
>
/
</span>
<li
class=
"active"
><a
href=
"${reverse('wiki:get_url', kwargs={'path' : urlpath.path})}"
>
${ article.current_revision.title }
</a></li>
<span
class=
"divider"
>
/
</span>
</ul>
<div
class=
"pull-left"
style=
"margin-left: 10px;"
>
<div
class=
"btn-group"
>
<a
class=
"btn dropdown-toggle"
data-toggle=
"dropdown"
href=
"#"
style=
"padding: 7px;"
title=
"Sub-articles for ${ article.current_revision.title }"
>
<span
class=
"icon-list"
></span>
<span
class=
"caret"
></span>
</a>
<ul
class=
"dropdown-menu"
>
%if len(urlpath.get_children()) > 0:
%for child in urlpath.get_children():
<li>
<a
href=
"${reverse('wiki:get_url', child.path)}"
>
${child.article.current_revision.title}
</a>
</li>
%endfor
%else:
<li><a
href=
"#"
><em>
No sub-articles
</em></a></li>
%endif
<li
class=
"divider"
></li>
<li>
<a
href=
""
onclick=
"alert('TODO')"
>
List sub-pages
»
</a>
</li>
</ul>
</div>
</div>
<div
class=
"pull-left"
style=
"margin-left: 10px;"
>
<a
class=
"btn"
href=
"${reverse('wiki:create_url', kwargs={'path' : urlpath.path})}"
style=
"padding: 7px;"
>
<span
class=
"icon-plus"
></span>
Add article
</a>
</div>
<div
style=
"clear: both"
></div>
%endif
\ No newline at end of file
lms/urls.py
View file @
51768ef8
...
...
@@ -152,6 +152,8 @@ if settings.WIKI_ENABLED:
# )
urlpatterns
+=
(
#url(r'^courses/(?P<course_id>[^/]+/[^/]+/[^/]+)/wiki/', include('simplewiki.urls')),
url
(
r'wiki/'
,
include
(
wiki_pattern
())),
url
(
r'^notify/'
,
include
(
notify_pattern
())),
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment