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
32416cd1
Commit
32416cd1
authored
Aug 21, 2012
by
Bridger Maxwell
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:benjaoming/django-wiki
parents
ce4fd7a8
59ecabd4
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
28 deletions
+41
-28
wiki/forms.py
+12
-6
wiki/plugins/attachments/templates/wiki/plugins/attachments/index.html
+14
-11
wiki/templates/wiki/article.html
+1
-1
wiki/templates/wiki/base.html
+9
-5
wiki/templates/wiki/edit.html
+1
-1
wiki/templates/wiki/includes/editor_sidebar.html
+4
-4
No files found.
wiki/forms.py
View file @
32416cd1
...
...
@@ -9,6 +9,7 @@ from django.utils.html import escape, conditional_escape
from
itertools
import
chain
from
wiki
import
models
from
wiki.conf
import
settings
from
wiki.editors
import
getEditor
from
wiki.core.diff
import
simple_merge
from
django.forms.widgets
import
HiddenInput
...
...
@@ -190,6 +191,7 @@ class TextInputPrepend(forms.TextInput):
html
=
super
(
TextInputPrepend
,
self
)
.
render
(
*
args
,
**
kwargs
)
return
mark_safe
(
'<div class="input-prepend"><span class="add-on">
%
s</span>
%
s</div>'
%
(
self
.
prepend
,
html
))
class
CreateForm
(
forms
.
Form
):
def
__init__
(
self
,
urlpath_parent
,
*
args
,
**
kwargs
):
...
...
@@ -206,15 +208,19 @@ class CreateForm(forms.Form):
def
clean_slug
(
self
):
slug
=
self
.
cleaned_data
[
'slug'
]
if
slug
[
0
]
==
"_"
:
if
slug
.
startswith
(
"_"
)
:
raise
forms
.
ValidationError
(
_
(
u'A slug may not begin with an underscore.'
))
already_existing_slug
=
models
.
URLPath
.
objects
.
filter
(
slug
=
slug
,
parent
=
self
.
urlpath_parent
)
if
settings
.
URL_CASE_SENSITIVE
:
already_existing_slug
=
models
.
URLPath
.
objects
.
filter
(
slug
=
slug
,
parent
=
self
.
urlpath_parent
)
else
:
already_existing_slug
=
models
.
URLPath
.
objects
.
filter
(
slug__iexact
=
slug
,
parent
=
self
.
urlpath_parent
)
if
already_existing_slug
:
slug
=
already_existing_slug
[
0
]
if
slug
.
article
and
slug
.
article
.
deleted
:
raise
forms
.
ValidationError
(
_
(
u'A deleted article with slug "
%
s" already exists.'
)
%
slug
)
already_urlpath
=
already_existing_slug
[
0
]
if
already_urlpath
.
article
and
already_urlpath
.
article
.
current_revision
.
deleted
:
raise
forms
.
ValidationError
(
_
(
u'A deleted article with slug "
%
s" already exists.'
)
%
already_urlpath
.
slug
)
else
:
raise
forms
.
ValidationError
(
_
(
u'A slug named "
%
s" already exists.'
)
%
slug
)
raise
forms
.
ValidationError
(
_
(
u'A slug named "
%
s" already exists.'
)
%
already_urlpath
.
slug
)
return
slug
...
...
wiki/plugins/attachments/templates/wiki/plugins/attachments/index.html
View file @
32416cd1
...
...
@@ -8,19 +8,20 @@
<div
class=
"row-fluid"
>
<div
class=
"span8"
>
<p
class=
"lead"
>
{% trans "The following files are available for this article. Copy the markdown tag to directly refer to a file from the article text." %}
</p>
<table
class=
"table table-bordered table-striped"
>
{% for attachment in attachments %}
<table
class=
"table table-bordered table-striped"
style=
"width: 100%;"
>
<tr>
<t
d
colspan=
"4"
>
<h4
style=
"margin: 0;"
>
<t
h
colspan=
"4"
>
<h4>
<a
href=
"{% url 'wiki:attachments_download' path=urlpath.path article_id=article.id attachment_id=attachment.id %}"
>
{{ attachment.current_revision.get_filename }}
</a>
<span
class=
"badge"
>
{{ attachment.current_revision.created|naturaltime }}
</span>
{% if attachment.current_revision.deleted %}
<span
class=
"badge badge-important"
>
{% trans "deleted" %}
</span>
{% endif %}
</h4>
{{ attachment.current_revision.description }}
</td>
</th>
</tr>
<tr>
<th>
{% trans "Markdown tag" %}
</th>
...
...
@@ -63,14 +64,18 @@
</td>
<td>
{{ attachment.current_revision.get_size|filesizeformat }}
</td>
</tr>
</table>
{% empty %}
<p
style=
"margin-bottom: 20px;"
><em>
{% trans "There are no attachments for this article." %}
</em></p>
<tr>
<td>
<p
style=
"margin-bottom: 20px;"
><em>
{% trans "There are no attachments for this article." %}
</em></p>
</td>
</tr>
{% endfor %}
</table>
</div>
{% if article|can_write:user %}
<div
class=
"span4"
style=
"min-width: 330px;"
>
<div
class=
"accordion"
id=
"accordion_upload"
>
<div
class=
"accordion"
>
<div
class=
"accordion-group"
>
...
...
@@ -96,11 +101,9 @@
</div>
</div>
</div>
<div
class=
"accordion"
id=
"accordion_add"
>
<div
class=
"accordion-group"
>
<div
class=
"accordion-heading"
>
<a
class=
"accordion-toggle"
href=
"#collapse_add"
data-toggle=
"collapse"
>
<a
class=
"accordion-toggle"
data-toggle=
"collapse"
>
<h3>
{% trans "Search and add file" %}
<span
class=
"icon-plus-sign"
></span></h3>
</a>
</div>
...
...
wiki/templates/wiki/article.html
View file @
32416cd1
...
...
@@ -13,7 +13,7 @@
<div
class=
""
style=
"margin-top: 20px;"
>
<ul
class=
"nav nav-pills"
style=
"border-bottom: 1px solid #EEE;"
>
<li
class=
"pull-left"
>
<h1
style=
"margin-top: -10px;
"
>
<h1
id=
"article-title
"
>
{{ article.current_revision.title }}
<small
style=
"font-size: 14px;"
>
{% if urlpath.parent %}
...
...
wiki/templates/wiki/base.html
View file @
32416cd1
...
...
@@ -9,6 +9,7 @@
<!-- Le styles -->
<link
href=
"{{ STATIC_URL }}wiki/bootstrap/css/bootstrap.css"
rel=
"stylesheet"
>
<link
href=
"{{ STATIC_URL }}wiki/bootstrap/css/bootstrap-responsive.min.css"
rel=
"stylesheet"
>
<!-- TODO: Put all this stuff in Less -->
<style
media=
"print"
>
...
...
@@ -22,7 +23,7 @@
#id_title
{
font-size
:
20px
;
height
:
30px
;
padding
:
6px
;
width
:
98%
;}
#id_summary
{
width
:
98%
;
padding
:
6px
;}
.table
{
font-size
:
90%
;}
h1
#article-title
{
font-size
:
2em
;
margin-top
:
-5px
;}
#article_edit_form
label
{
max-width
:
100px
;}
#article_edit_form
.controls
{
margin-left
:
120px
;}
...
...
@@ -37,6 +38,8 @@
#attachment_form
#id_description
{
width
:
95%
}
#edit_sidebar
.accordion
{
margin-bottom
:
5px
;}
.wiki-article
div
.toc
{
margin
:
10px
0
;
background
:
#f9f9f9
;
...
...
@@ -44,8 +47,8 @@
width
:
300px
;
border
:
1px
solid
#CCC
;
}
.wiki-article
a
.linknotfound
{
color
:
#C
00
;}
.wiki-article
a
.linknotfound
{
color
:
#C
87
;}
.wiki-article
pre
{
max-width
:
700px
;
...
...
@@ -72,7 +75,6 @@
}
.breadcrumb
.icon-bar
:first-child
{
margin-top
:
0
;}
</style>
<link
href=
"{{ STATIC_URL }}wiki/bootstrap/css/bootstrap-responsive.min.css"
rel=
"stylesheet"
>
<script
src=
"{{ STATIC_URL }}wiki/js/jquery.min.js"
></script>
<script
src=
"{{ STATIC_URL }}wiki/js/core.js"
></script>
...
...
@@ -142,7 +144,9 @@
</div>
</div>
{% endblock %}
<header
class=
"jumbotron subhead"
id=
"overview"
>
adasd
</header>
<div
class=
"container"
style=
"margin-top: 60px;"
>
{% if messages %}
{% for message in messages %}
...
...
wiki/templates/wiki/edit.html
View file @
32416cd1
...
...
@@ -18,7 +18,7 @@
</form>
</div>
<div
class=
"span4"
>
<div
class=
"span4"
id=
"edit_sidebar"
>
{% include "wiki/includes/editor_sidebar.html" %}
</div>
...
...
wiki/templates/wiki/includes/editor_sidebar.html
View file @
32416cd1
{% for plugin, plugin_form in sidebar %}
<div
class=
"accordion"
id=
"accordion_{{ plugin.slug }}"
>
{% for plugin, plugin_form in sidebar %}
<div
class=
"accordion-group"
>
<div
class=
"accordion-heading"
>
<a
class=
"accordion-toggle"
href=
"#collapse_{{ plugin.slug }}"
data-toggle=
"collapse"
>
<h3
style=
"margin: 0;"
>
{{ plugin.sidebar.headline }}
<span
class=
"{{ plugin.sidebar.icon_class }}"
></span></h3>
<h3>
{{ plugin.sidebar.headline }}
<span
class=
"{{ plugin.sidebar.icon_class }}"
></span></h3>
</a>
</div>
...
...
@@ -24,7 +24,7 @@
</div>
</div>
{% endfor %}
</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