Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-wiki
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
OpenEdx
django-wiki
Commits
d58dcbc7
Commit
d58dcbc7
authored
Aug 17, 2012
by
Bridger Maxwell
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:benjaoming/django-wiki
parents
00728711
1438944f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
76 additions
and
67 deletions
+76
-67
wiki/models/pluginbase.py
+4
-1
wiki/plugins/__init__.py
+1
-1
wiki/templates/wiki/edit.html
+42
-32
wiki/templates/wiki/includes/editor.html
+0
-33
wiki/templates/wiki/includes/editor_sidebar.html
+29
-0
No files found.
wiki/models/pluginbase.py
View file @
d58dcbc7
...
...
@@ -5,7 +5,8 @@ from django.db.models import signals
from
wiki.models.article
import
BaseRevisionMixin
"""
There are three kinds of plugin objects:
There are three kinds of plugin base models:
1) SimplePlugin - an object purely associated with an article. Will bump the
article's revision history upon creation, and rolling back an article will
make it go away (not from the database, you can roll forwards again).
...
...
@@ -20,6 +21,8 @@ There are three kinds of plugin objects:
that the logics for keeping revisions on such plugins are complicated, so you
have to implement that on your own. Furthermore, you need to be aware of
the permission system!
"""
from
article
import
Article
,
ArticleRevision
...
...
wiki/plugins/__init__.py
View file @
d58dcbc7
...
...
@@ -40,7 +40,7 @@ class PluginSidebarFormMixin(object):
pass
class
PluginSettingsFormMixin
(
object
):
settings_form_headline
=
_
(
u'
Notifications
'
)
settings_form_headline
=
_
(
u'
Settings for plugin
'
)
settings_order
=
1
settings_write_access
=
False
...
...
wiki/templates/wiki/edit.html
View file @
d58dcbc7
...
...
@@ -6,41 +6,51 @@
{% block wiki_contents_tab %}
<form
method=
"POST"
class=
"form-horizontal"
id=
"article_edit_form"
enctype=
"multipart/form-data"
>
{% include "wiki/includes/editor.html" %}
<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='{% url 'wiki:preview' path=urlpath.path article_id=article.id %}'"
>
<span
class=
"icon-eye-open"
></span>
{% trans "Preview" %}
</button>
<button
type=
"submit"
name=
"save"
value=
"1"
class=
"btn btn-large btn-primary"
onclick=
"this.form.target=''; this.form.action='{% url 'wiki:edit' path=urlpath.path article_id=article.id %}'"
>
<span
class=
"icon-ok"
></span>
{% trans "Save changes" %}
</button>
<a
href=
"{% url 'wiki:delete' path=urlpath.path article_id=article.id %}"
class=
"pull-right btn btn-danger"
>
<span
class=
"icon-trash"
></span>
{% trans "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
style=
"width: 67%; min-width: 600px; float: left;"
>
<form
method=
"POST"
class=
"form-horizontal"
id=
"article_edit_form"
>
{% include "wiki/includes/editor.html" %}
<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='{% url 'wiki:preview' path=urlpath.path article_id=article.id %}'"
>
<span
class=
"icon-eye-open"
></span>
{% trans "Preview" %}
</button>
<button
type=
"submit"
name=
"save"
value=
"1"
class=
"btn btn-large btn-primary"
onclick=
"this.form.target=''; this.form.action='{% url 'wiki:edit' path=urlpath.path article_id=article.id %}'"
>
<span
class=
"icon-ok"
></span>
{% trans "Save changes" %}
</button>
<a
href=
"{% url 'wiki:delete' path=urlpath.path article_id=article.id %}"
class=
"pull-right btn btn-danger"
>
<span
class=
"icon-trash"
></span>
{% trans "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>
{% trans "Back to editor" %}
</a>
<button
type=
"submit"
name=
"save"
value=
"1"
class=
"btn btn-large btn-primary"
onclick=
"this.form.target=''; this.form.action='{% url 'wiki:edit' path=urlpath.path article_id=article.id %}'"
>
<span
class=
"icon-ok"
></span>
{% trans "Save changes" %}
</button>
</div>
</div>
<div
class=
"modal-footer"
>
<a
href=
"#"
class=
"btn btn-large"
data-dismiss=
"modal"
>
<span
class=
"icon-circle-arrow-left"
></span>
{% trans "Back to editor" %}
</a>
<button
type=
"submit"
name=
"save"
value=
"1"
class=
"btn btn-large btn-primary"
onclick=
"this.form.target=''; this.form.action='{% url 'wiki:edit' path=urlpath.path article_id=article.id %}'"
>
<span
class=
"icon-ok"
></span>
{% trans "Save changes" %}
</button>
</form>
</div>
<div
style=
"width: 33%; min-width: 300px; float: right;"
>
<div
style=
"padding-left: 40px;"
>
{% include "wiki/includes/editor_sidebar.html" %}
</div>
</div>
</form>
<div
style=
"clear: both"
></div>
{% endblock %}
wiki/templates/wiki/includes/editor.html
View file @
d58dcbc7
{% load wiki_tags i18n %}
{% include "wiki/includes/editormedia.html" %}
<div
style=
"width: 67%; min-width: 600px; float: left;"
>
{% wiki_form edit_form %}
<script
language=
"javascript"
>
$
(
document
).
ready
(
function
()
{
$
(
"#id_revision"
).
val
(
'{{ article.current_revision.id }}'
);
});
</script>
</div>
<div
style=
"width: 33%; min-width: 300px; float: right;"
>
<div
style=
"padding-left: 40px;"
>
{% for plugin in sidebar %}
<div
class=
"accordion"
id=
"accordion_{{ plugin.slug }}"
>
<div
class=
"accordion-group"
>
<div
class=
"accordion-heading"
>
<a
class=
"accordion-toggle"
href=
"#collapse_{{ plugin.slug }}"
data-toggle=
"collapse"
>
<h2>
{{ plugin.sidebar.headline }}
<span
class=
"{{ plugin.sidebar.icon_class }}"
></span></h2>
</a>
</div>
<div
id=
"collapse_{{ plugin.slug }}"
class=
"accordion-body collapse{% if form_images.errors %} in{% endif %}"
>
<div
class=
"accordion-inner form-vertical"
>
{% if plugin.sidebar.template %}
{% with form_images as form and plugin as plugin %}
{% include plugin.sidebar.template %}
{% endwith %}
{% endif %}
</div>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
<div
style=
"clear: both"
></div>
wiki/templates/wiki/includes/editor_sidebar.html
0 → 100644
View file @
d58dcbc7
{% for plugin in sidebar %}
<div
class=
"accordion"
id=
"accordion_{{ plugin.slug }}"
>
<div
class=
"accordion-group"
>
<div
class=
"accordion-heading"
>
<a
class=
"accordion-toggle"
href=
"#collapse_{{ plugin.slug }}"
data-toggle=
"collapse"
>
<h2>
{{ plugin.sidebar.headline }}
<span
class=
"{{ plugin.sidebar.icon_class }}"
></span></h2>
</a>
</div>
<div
id=
"collapse_{{ plugin.slug }}"
class=
"accordion-body collapse{% if form_images.errors %} in{% endif %}"
>
<div
class=
"accordion-inner form-vertical"
>
{% if plugin.sidebar.template %}
{% with form_images as form and plugin as plugin %}
<form
method=
"POST"
class=
"form-horizontal"
enctype=
"multipart/form-data"
>
{% include plugin.sidebar.template %}
</form>
{% endwith %}
{% endif %}
</div>
</div>
</div>
</div>
{% endfor %}
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