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
b0a6d6eb
Commit
b0a6d6eb
authored
Feb 14, 2013
by
benjaoming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bootstrap styling
parent
dfb56934
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
319 additions
and
55 deletions
+319
-55
wiki/plugins/attachments/models.py
+0
-1
wiki/plugins/attachments/settings.py
+3
-0
wiki/plugins/attachments/views.py
+0
-2
wiki/plugins/macros/templates/wiki/plugins/macros/article_list.html
+3
-1
wiki/plugins/macros/templates/wiki/plugins/templatetags/article_list.html
+7
-8
wiki/static/wiki/bootstrap/css/wiki-bootstrap.css
+150
-11
wiki/static/wiki/bootstrap/css/wiki-bootstrap.min.css
+22
-1
wiki/static/wiki/bootstrap/less/wiki/wiki-bootstrap.less
+98
-9
wiki/static/wiki/js/article.js
+8
-0
wiki/templates/wiki/includes/render.html
+22
-0
wiki/templates/wiki/view.html
+1
-18
wiki/templatetags/wiki_tags.py
+5
-4
No files found.
wiki/plugins/attachments/models.py
View file @
b0a6d6eb
import
os
import
os.path
import
os.path
from
django.db
import
models
from
django.db
import
models
...
...
wiki/plugins/attachments/settings.py
View file @
b0a6d6eb
...
@@ -5,6 +5,9 @@ from django.core.exceptions import ImproperlyConfigured
...
@@ -5,6 +5,9 @@ from django.core.exceptions import ImproperlyConfigured
APP_LABEL
=
'wiki'
APP_LABEL
=
'wiki'
SLUG
=
"attachments"
SLUG
=
"attachments"
# Please see this note about support for UTF-8 files on django/apache:
# https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/modwsgi/#if-you-get-a-unicodeencodeerror
# Allow anonymous users upload access (not nice on an open network)
# Allow anonymous users upload access (not nice on an open network)
# WIKI_ATTACHMENTS_ANONYMOUS can override this, otherwise the default
# WIKI_ATTACHMENTS_ANONYMOUS can override this, otherwise the default
# in wiki.conf.settings is used.
# in wiki.conf.settings is used.
...
...
wiki/plugins/attachments/views.py
View file @
b0a6d6eb
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
from
django.contrib
import
messages
from
django.contrib
import
messages
from
django.db
import
transaction
from
django.db.models
import
Q
from
django.db.models
import
Q
from
django.http
import
Http404
,
HttpResponseRedirect
from
django.http
import
Http404
,
HttpResponseRedirect
from
django.shortcuts
import
redirect
,
get_object_or_404
from
django.shortcuts
import
redirect
,
get_object_or_404
...
@@ -14,7 +13,6 @@ from wiki.core.http import send_file
...
@@ -14,7 +13,6 @@ from wiki.core.http import send_file
from
wiki.decorators
import
get_article
,
response_forbidden
from
wiki.decorators
import
get_article
,
response_forbidden
from
wiki.plugins.attachments
import
models
,
settings
,
forms
from
wiki.plugins.attachments
import
models
,
settings
,
forms
from
wiki.views.mixins
import
ArticleMixin
from
wiki.views.mixins
import
ArticleMixin
from
django.core.mail
import
mail_admins
class
AttachmentView
(
ArticleMixin
,
FormView
):
class
AttachmentView
(
ArticleMixin
,
FormView
):
...
...
wiki/plugins/macros/templates/wiki/plugins/macros/article_list.html
View file @
b0a6d6eb
{% load i18n wiki_macro_tags %}
{% load i18n wiki_macro_tags %}
{% if article_children %}
{% if article_children %}
<h3>
{% trans "Article index" %}
</h3>
<div
class=
"article-list"
>
<div
class=
"article-list"
>
<ul>
<li
class=
"nav-header"
>
{% trans "Article index" %}
<i
class=
"icon-list"
></i></li>
{% for child in article_children %}
{% for child in article_children %}
{% article_list child depth %}
{% article_list child depth %}
{% empty %}
{% empty %}
<i>
{% trans "Nothing below this level" %}
</i>
<i>
{% trans "Nothing below this level" %}
</i>
{% endfor %}
{% endfor %}
<ul>
</div>
</div>
{% endif %}
{% endif %}
wiki/plugins/macros/templates/wiki/plugins/templatetags/article_list.html
View file @
b0a6d6eb
{% load wiki_macro_tags %}
{% load wiki_macro_tags %}
{% load url from future %}
{% load url from future %}
<
p><a
href=
"{% url 'wiki:get' path=parent.path article_id=parent.article.id %}"
>
{{ parent.article }}
</a></p
>
<
li><a
href=
"{% url 'wiki:get' path=parent.path article_id=parent.article.id %}"
>
{{ parent.article }}
</a
>
{% if parent.children.count and parent.level
<
depth
%}
{% if parent.children.count and parent.level
<
depth
%}
<
div
class=
"wiki-article-sublist"
>
<
ul
>
<ul>
{% for child in parent.children.all %}
{% for child in parent.children.all %}
<li>
{% article_list child depth %}
</li>
<li>
{% article_list child depth %}
</li>
{% endfor %}
{% endfor %}
</ul>
</ul>
</div>
{% endif %}
{% endif %}
</li>
wiki/static/wiki/bootstrap/css/wiki-bootstrap.css
View file @
b0a6d6eb
/*!
/*!
* Based on Bootstrap v2.2.2
* Bootstrap Responsive v2.2.2
*
* Modified for django-wiki
*/
/*!
* Bootstrap v2.2.2
*
*
* Copyright 2012 Twitter, Inc
* Copyright 2012 Twitter, Inc
* Licensed under the Apache License v2.0
* Licensed under the Apache License v2.0
...
@@ -5171,11 +5166,27 @@ h1#article-title {
...
@@ -5171,11 +5166,27 @@ h1#article-title {
}
}
.wiki-article
div
.toc
,
.wiki-article
div
.toc
,
.wiki-article
div
.article-list
{
.wiki-article
div
.article-list
{
margin
:
10px
0
;
min-height
:
20px
;
background
:
#f9f9f9
;
padding
:
19px
;
padding
:
10px
;
margin-bottom
:
20px
;
width
:
300px
;
background-color
:
#f5f5f5
;
border
:
1px
solid
#CCC
;
border
:
1px
solid
#e3e3e3
;
-webkit-border-radius
:
4px
;
-moz-border-radius
:
4px
;
border-radius
:
4px
;
-webkit-box-shadow
:
inset
0
1px
1px
rgba
(
0
,
0
,
0
,
0.05
);
-moz-box-shadow
:
inset
0
1px
1px
rgba
(
0
,
0
,
0
,
0.05
);
box-shadow
:
inset
0
1px
1px
rgba
(
0
,
0
,
0
,
0.05
);
padding
:
9px
;
-webkit-border-radius
:
3px
;
-moz-border-radius
:
3px
;
border-radius
:
3px
;
max-width
:
340px
;
}
.wiki-article
div
.toc
blockquote
,
.wiki-article
div
.article-list
blockquote
{
border-color
:
#ddd
;
border-color
:
rgba
(
0
,
0
,
0
,
0.15
);
}
}
.wiki-article
a
.linknotfound
{
.wiki-article
a
.linknotfound
{
color
:
#C87
;
color
:
#C87
;
...
@@ -5183,6 +5194,134 @@ h1#article-title {
...
@@ -5183,6 +5194,134 @@ h1#article-title {
.wiki-article
pre
{
.wiki-article
pre
{
max-width
:
700px
;
max-width
:
700px
;
}
}
.wiki-article
table
{
width
:
100%
;
margin-bottom
:
20px
;
border
:
1px
solid
#dddddd
;
border-collapse
:
separate
;
*
border-collapse
:
collapse
;
border-left
:
0
;
-webkit-border-radius
:
4px
;
-moz-border-radius
:
4px
;
border-radius
:
4px
;
}
.wiki-article
table
th
,
.wiki-article
table
td
{
padding
:
8px
;
line-height
:
20px
;
text-align
:
left
;
vertical-align
:
top
;
border-top
:
1px
solid
#dddddd
;
}
.wiki-article
table
th
{
font-weight
:
bold
;
}
.wiki-article
table
thead
th
{
vertical-align
:
bottom
;
}
.wiki-article
table
caption
+
thead
tr
:first-child
th
,
.wiki-article
table
caption
+
thead
tr
:first-child
td
,
.wiki-article
table
colgroup
+
thead
tr
:first-child
th
,
.wiki-article
table
colgroup
+
thead
tr
:first-child
td
,
.wiki-article
table
thead
:first-child
tr
:first-child
th
,
.wiki-article
table
thead
:first-child
tr
:first-child
td
{
border-top
:
0
;
}
.wiki-article
table
tbody
+
tbody
{
border-top
:
2px
solid
#dddddd
;
}
.wiki-article
table
.table
{
background-color
:
#ffffff
;
}
.wiki-article
table
th
,
.wiki-article
table
td
{
border-left
:
1px
solid
#dddddd
;
}
.wiki-article
table
caption
+
thead
tr
:first-child
th
,
.wiki-article
table
caption
+
tbody
tr
:first-child
th
,
.wiki-article
table
caption
+
tbody
tr
:first-child
td
,
.wiki-article
table
colgroup
+
thead
tr
:first-child
th
,
.wiki-article
table
colgroup
+
tbody
tr
:first-child
th
,
.wiki-article
table
colgroup
+
tbody
tr
:first-child
td
,
.wiki-article
table
thead
:first-child
tr
:first-child
th
,
.wiki-article
table
tbody
:first-child
tr
:first-child
th
,
.wiki-article
table
tbody
:first-child
tr
:first-child
td
{
border-top
:
0
;
}
.wiki-article
table
thead
:first-child
tr
:first-child
>
th
:first-child
,
.wiki-article
table
tbody
:first-child
tr
:first-child
>
td
:first-child
{
-webkit-border-top-left-radius
:
4px
;
-moz-border-radius-topleft
:
4px
;
border-top-left-radius
:
4px
;
}
.wiki-article
table
thead
:first-child
tr
:first-child
>
th
:last-child
,
.wiki-article
table
tbody
:first-child
tr
:first-child
>
td
:last-child
{
-webkit-border-top-right-radius
:
4px
;
-moz-border-radius-topright
:
4px
;
border-top-right-radius
:
4px
;
}
.wiki-article
table
thead
:last-child
tr
:last-child
>
th
:first-child
,
.wiki-article
table
tbody
:last-child
tr
:last-child
>
td
:first-child
,
.wiki-article
table
tfoot
:last-child
tr
:last-child
>
td
:first-child
{
-webkit-border-bottom-left-radius
:
4px
;
-moz-border-radius-bottomleft
:
4px
;
border-bottom-left-radius
:
4px
;
}
.wiki-article
table
thead
:last-child
tr
:last-child
>
th
:last-child
,
.wiki-article
table
tbody
:last-child
tr
:last-child
>
td
:last-child
,
.wiki-article
table
tfoot
:last-child
tr
:last-child
>
td
:last-child
{
-webkit-border-bottom-right-radius
:
4px
;
-moz-border-radius-bottomright
:
4px
;
border-bottom-right-radius
:
4px
;
}
.wiki-article
table
tfoot
+
tbody
:last-child
tr
:last-child
td
:first-child
{
-webkit-border-bottom-left-radius
:
0
;
-moz-border-radius-bottomleft
:
0
;
border-bottom-left-radius
:
0
;
}
.wiki-article
table
tfoot
+
tbody
:last-child
tr
:last-child
td
:last-child
{
-webkit-border-bottom-right-radius
:
0
;
-moz-border-radius-bottomright
:
0
;
border-bottom-right-radius
:
0
;
}
.wiki-article
table
caption
+
thead
tr
:first-child
th
:first-child
,
.wiki-article
table
caption
+
tbody
tr
:first-child
td
:first-child
,
.wiki-article
table
colgroup
+
thead
tr
:first-child
th
:first-child
,
.wiki-article
table
colgroup
+
tbody
tr
:first-child
td
:first-child
{
-webkit-border-top-left-radius
:
4px
;
-moz-border-radius-topleft
:
4px
;
border-top-left-radius
:
4px
;
}
.wiki-article
table
caption
+
thead
tr
:first-child
th
:last-child
,
.wiki-article
table
caption
+
tbody
tr
:first-child
td
:last-child
,
.wiki-article
table
colgroup
+
thead
tr
:first-child
th
:last-child
,
.wiki-article
table
colgroup
+
tbody
tr
:first-child
td
:last-child
{
-webkit-border-top-right-radius
:
4px
;
-moz-border-radius-topright
:
4px
;
border-top-right-radius
:
4px
;
}
.wiki-article
h1
{
font-size
:
28px
;
padding-bottom
:
9px
;
margin
:
20px
0
30px
;
border-bottom
:
1px
solid
#eeeeee
;
}
.wiki-article
h2
{
font-size
:
24.5px
;
padding-bottom
:
9px
;
margin
:
20px
0
30px
;
border-bottom
:
1px
solid
#eeeeee
;
}
.wiki-article
h3
{
font-size
:
21px
;
}
.wiki-article
h4
{
font-size
:
17.5px
;
}
.wiki-article
h5
,
.wiki-article
h6
{
font-size
:
14px
;
}
input
[
type
=
file
]
{
input
[
type
=
file
]
{
float
:
none
;
float
:
none
;
width
:
auto
;
width
:
auto
;
...
...
wiki/static/wiki/bootstrap/css/wiki-bootstrap.min.css
View file @
b0a6d6eb
...
@@ -864,9 +864,30 @@ h1#article-title{font-size:2em;margin-top:-5px;}
...
@@ -864,9 +864,30 @@ h1#article-title{font-size:2em;margin-top:-5px;}
.settings-form
.form-actions
{
padding-left
:
270px
;}
.settings-form
.form-actions
{
padding-left
:
270px
;}
#attachment_form
#id_description
{
width
:
95%
;}
#attachment_form
#id_description
{
width
:
95%
;}
#edit_sidebar
.accordion
{
margin-bottom
:
5px
;}
#edit_sidebar
.accordion
{
margin-bottom
:
5px
;}
.wiki-article
div
.toc
,
.wiki-article
div
.article-list
{
m
argin
:
10px
0
;
background
:
#f9f9f9
;
padding
:
10px
;
width
:
300px
;
border
:
1px
solid
#CCC
;}
.wiki-article
div
.toc
,
.wiki-article
div
.article-list
{
m
in-height
:
20px
;
padding
:
19px
;
margin-bottom
:
20px
;
background-color
:
#f5f5f5
;
border
:
1px
solid
#e3e3e3
;
-webkit-border-radius
:
4px
;
-moz-border-radius
:
4px
;
border-radius
:
4px
;
-webkit-box-shadow
:
inset
0
1px
1px
rgba
(
0
,
0
,
0
,
0.05
);
-moz-box-shadow
:
inset
0
1px
1px
rgba
(
0
,
0
,
0
,
0.05
);
box-shadow
:
inset
0
1px
1px
rgba
(
0
,
0
,
0
,
0.05
);
padding
:
9px
;
-webkit-border-radius
:
3px
;
-moz-border-radius
:
3px
;
border-radius
:
3px
;
max-width
:
340px
;}
.wiki-article
div
.toc
blockquote
,
.wiki-article
div
.article-list
blockquote
{
border-color
:
#ddd
;
border-color
:
rgba
(
0
,
0
,
0
,
0.15
)
;}
.wiki-article
a
.linknotfound
{
color
:
#C87
;}
.wiki-article
a
.linknotfound
{
color
:
#C87
;}
.wiki-article
pre
{
max-width
:
700px
;}
.wiki-article
pre
{
max-width
:
700px
;}
.wiki-article
table
{
width
:
100%
;
margin-bottom
:
20px
;
border
:
1px
solid
#dddddd
;
border-collapse
:
separate
;
*
border-collapse
:
collapse
;
border-left
:
0
;
-webkit-border-radius
:
4px
;
-moz-border-radius
:
4px
;
border-radius
:
4px
;}
.wiki-article
table
th
,
.wiki-article
table
td
{
padding
:
8px
;
line-height
:
20px
;
text-align
:
left
;
vertical-align
:
top
;
border-top
:
1px
solid
#dddddd
;}
.wiki-article
table
th
{
font-weight
:
bold
;}
.wiki-article
table
thead
th
{
vertical-align
:
bottom
;}
.wiki-article
table
caption
+
thead
tr
:first-child
th
,
.wiki-article
table
caption
+
thead
tr
:first-child
td
,
.wiki-article
table
colgroup
+
thead
tr
:first-child
th
,
.wiki-article
table
colgroup
+
thead
tr
:first-child
td
,
.wiki-article
table
thead
:first-child
tr
:first-child
th
,
.wiki-article
table
thead
:first-child
tr
:first-child
td
{
border-top
:
0
;}
.wiki-article
table
tbody
+
tbody
{
border-top
:
2px
solid
#dddddd
;}
.wiki-article
table
.table
{
background-color
:
#ffffff
;}
.wiki-article
table
th
,
.wiki-article
table
td
{
border-left
:
1px
solid
#dddddd
;}
.wiki-article
table
caption
+
thead
tr
:first-child
th
,
.wiki-article
table
caption
+
tbody
tr
:first-child
th
,
.wiki-article
table
caption
+
tbody
tr
:first-child
td
,
.wiki-article
table
colgroup
+
thead
tr
:first-child
th
,
.wiki-article
table
colgroup
+
tbody
tr
:first-child
th
,
.wiki-article
table
colgroup
+
tbody
tr
:first-child
td
,
.wiki-article
table
thead
:first-child
tr
:first-child
th
,
.wiki-article
table
tbody
:first-child
tr
:first-child
th
,
.wiki-article
table
tbody
:first-child
tr
:first-child
td
{
border-top
:
0
;}
.wiki-article
table
thead
:first-child
tr
:first-child
>
th
:first-child
,
.wiki-article
table
tbody
:first-child
tr
:first-child
>
td
:first-child
{
-webkit-border-top-left-radius
:
4px
;
-moz-border-radius-topleft
:
4px
;
border-top-left-radius
:
4px
;}
.wiki-article
table
thead
:first-child
tr
:first-child
>
th
:last-child
,
.wiki-article
table
tbody
:first-child
tr
:first-child
>
td
:last-child
{
-webkit-border-top-right-radius
:
4px
;
-moz-border-radius-topright
:
4px
;
border-top-right-radius
:
4px
;}
.wiki-article
table
thead
:last-child
tr
:last-child
>
th
:first-child
,
.wiki-article
table
tbody
:last-child
tr
:last-child
>
td
:first-child
,
.wiki-article
table
tfoot
:last-child
tr
:last-child
>
td
:first-child
{
-webkit-border-bottom-left-radius
:
4px
;
-moz-border-radius-bottomleft
:
4px
;
border-bottom-left-radius
:
4px
;}
.wiki-article
table
thead
:last-child
tr
:last-child
>
th
:last-child
,
.wiki-article
table
tbody
:last-child
tr
:last-child
>
td
:last-child
,
.wiki-article
table
tfoot
:last-child
tr
:last-child
>
td
:last-child
{
-webkit-border-bottom-right-radius
:
4px
;
-moz-border-radius-bottomright
:
4px
;
border-bottom-right-radius
:
4px
;}
.wiki-article
table
tfoot
+
tbody
:last-child
tr
:last-child
td
:first-child
{
-webkit-border-bottom-left-radius
:
0
;
-moz-border-radius-bottomleft
:
0
;
border-bottom-left-radius
:
0
;}
.wiki-article
table
tfoot
+
tbody
:last-child
tr
:last-child
td
:last-child
{
-webkit-border-bottom-right-radius
:
0
;
-moz-border-radius-bottomright
:
0
;
border-bottom-right-radius
:
0
;}
.wiki-article
table
caption
+
thead
tr
:first-child
th
:first-child
,
.wiki-article
table
caption
+
tbody
tr
:first-child
td
:first-child
,
.wiki-article
table
colgroup
+
thead
tr
:first-child
th
:first-child
,
.wiki-article
table
colgroup
+
tbody
tr
:first-child
td
:first-child
{
-webkit-border-top-left-radius
:
4px
;
-moz-border-radius-topleft
:
4px
;
border-top-left-radius
:
4px
;}
.wiki-article
table
caption
+
thead
tr
:first-child
th
:last-child
,
.wiki-article
table
caption
+
tbody
tr
:first-child
td
:last-child
,
.wiki-article
table
colgroup
+
thead
tr
:first-child
th
:last-child
,
.wiki-article
table
colgroup
+
tbody
tr
:first-child
td
:last-child
{
-webkit-border-top-right-radius
:
4px
;
-moz-border-radius-topright
:
4px
;
border-top-right-radius
:
4px
;}
.wiki-article
h1
{
font-size
:
28px
;
padding-bottom
:
9px
;
margin
:
20px
0
30px
;
border-bottom
:
1px
solid
#eeeeee
;}
.wiki-article
h2
{
font-size
:
24.5px
;
padding-bottom
:
9px
;
margin
:
20px
0
30px
;
border-bottom
:
1px
solid
#eeeeee
;}
.wiki-article
h3
{
font-size
:
21px
;}
.wiki-article
h4
{
font-size
:
17.5px
;}
.wiki-article
h5
,
.wiki-article
h6
{
font-size
:
14px
;}
input
[
type
=
file
]
{
float
:
none
;
width
:
auto
;}
input
[
type
=
file
]
{
float
:
none
;
width
:
auto
;}
.asteriskField
{
font-size
:
20px
;
margin-left
:
5px
;}
.asteriskField
{
font-size
:
20px
;
margin-left
:
5px
;}
.notification-list
.since
{
font-size
:
80%
;
color
:
#CCC
;}
.notification-list
.since
{
font-size
:
80%
;
color
:
#CCC
;}
...
...
wiki/static/wiki/bootstrap/less/wiki/wiki-bootstrap.less
View file @
b0a6d6eb
/*!
/*!
* B
ased on Bootstrap
v2.2.2
* B
ootstrap Responsive
v2.2.2
*
*
* Modified for django-wiki
* Copyright 2012 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
*/
*/
@import "../bootstrap.less";
// CSS Reset
@import "../reset.less";
// Core variables and mixins
@import "../variables.less"; // Modify this for custom colors, font-sizes, etc
@import "../mixins.less";
// Grid system and page structure
@import "../scaffolding.less";
@import "../grid.less";
@import "../layouts.less";
// Base CSS
@import "../type.less";
@import "../code.less";
@import "../forms.less";
@import "../tables.less";
// Components: common
@import "../sprites.less";
@import "../dropdowns.less";
@import "../wells.less";
@import "../component-animations.less";
@import "../close.less";
// Components: Buttons & Alerts
@import "../buttons.less";
@import "../button-groups.less";
@import "../alerts.less"; // Note: alerts share common CSS with buttons and thus have styles in buttons.less
// Components: Nav
@import "../navs.less";
@import "../navbar.less";
@import "../breadcrumbs.less";
@import "../pagination.less";
@import "../pager.less";
// Components: Popovers
@import "../modals.less";
@import "../tooltip.less";
@import "../popovers.less";
// Components: Misc
@import "../thumbnails.less";
@import "../media.less";
@import "../labels-badges.less";
@import "../progress-bars.less";
@import "../accordion.less";
@import "../carousel.less";
@import "../hero-unit.less";
// Utility classes
@import "../utilities.less"; // Has to be last to override when necessary
.wiki-article .thumbnail
.wiki-article .thumbnail
{
{
clear: both;
clear: both;
...
@@ -36,19 +93,51 @@ h1#article-title {font-size: 2em; margin-top: -5px;}
...
@@ -36,19 +93,51 @@ h1#article-title {font-size: 2em; margin-top: -5px;}
.wiki-article div.toc,
.wiki-article div.toc,
.wiki-article div.article-list {
.wiki-article div.article-list {
margin: 10px 0;
.well;
background: #f9f9f9;
.well-small;
padding: 10px;
max-width: 340px;
width: 300px;
border: 1px solid #CCC;
}
}
.wiki-article a.linknotfound {color: #C87;}
.wiki-article a.linknotfound {color: #C87;}
.wiki-article pre {
.wiki-article pre {
max-width: 700px;
max-width: 700px;
}
}
.wiki-article table
{
.table;
.table-bordered;
}
.wiki-article h1
{
font-size: @baseFontSize * 2;
.page-header;
}
.wiki-article h2
{
font-size: @baseFontSize * 1.75;
.page-header;
}
.wiki-article h3
{
font-size: @baseFontSize * 1.50;
}
.wiki-article h4
{
font-size: @baseFontSize * 1.25;
}
.wiki-article h5,
.wiki-article h6
{
font-size: @baseFontSize;
}
input[type=file] {float: none; width: auto;}
input[type=file] {float: none; width: auto;}
.asteriskField { font-size: 20px; margin-left: 5px;}
.asteriskField { font-size: 20px; margin-left: 5px;}
...
...
wiki/static/wiki/js/article.js
0 → 100644
View file @
b0a6d6eb
$
(
document
).
ready
(
function
()
{
$
(
'.wiki-article .article-list ul, .wiki-article .toc ul'
).
each
(
function
()
{
$
(
this
).
addClass
(
'nav'
);
$
(
this
).
addClass
(
'nav-list'
);
});
});
wiki/templates/wiki/includes/render.html
View file @
b0a6d6eb
{% load wiki_tags i18n cache sekizai_tags %}
{% load wiki_tags i18n cache sekizai_tags %}
{% addtoblock "js" %}
<script
type=
"text/javascript"
src=
"{{ STATIC_URL }}wiki/js/article.js"
></script>
{% endaddtoblock %}
<div
class=
"wiki-article"
>
<div
class=
"wiki-article"
>
{% if not preview %}
{% if not preview %}
...
@@ -15,3 +19,21 @@
...
@@ -15,3 +19,21 @@
{% endif %}
{% endif %}
</div>
</div>
{% for plugin in plugins %}
{% if plugin.RenderMedia.css %}
{% addtoblock "css" %}
{% for media, url in plugin.RenderMedia.css.items %}
<link
rel=
"stylesheet"
href=
"{{ STATIC_URL }}{{ url }}"
/>
{% endfor %}
{% endaddtoblock %}
{% endif %}
{% if plugin.RenderMedia.js %}
{% addtoblock "js" %}
{% for url in plugin.RenderMedia.js %}
<script
type=
"text/javascript"
src=
"{{ STATIC_URL }}{{ url }}"
></script>
{% endfor %}
{% endaddtoblock %}
{% endif %}
{% endfor %}
wiki/templates/wiki/view.html
View file @
b0a6d6eb
...
@@ -4,24 +4,7 @@
...
@@ -4,24 +4,7 @@
{% block wiki_contents_tab %}
{% block wiki_contents_tab %}
{% wiki_render article %}
{% wiki_render article %}
{% for plugin in plugins %}
{% if plugin.RenderMedia.css %}
{% addtoblock "css" %}
{% for media, url in plugin.RenderMedia.css.items %}
<link
rel=
"stylesheet"
href=
"{{ STATIC_URL }}{{ url }}"
/>
{% endfor %}
{% endaddtoblock %}
{% endif %}
{% if plugin.RenderMedia.js %}
{% addtoblock "js" %}
{% for url in plugin.RenderMedia.js %}
<script
type=
"text/javascript"
src=
"{{ STATIC_URL }}{{ url }}"
></script>
{% endfor %}
{% endaddtoblock %}
{% endif %}
{% endfor %}
{% endblock %}
{% endblock %}
wiki/templatetags/wiki_tags.py
View file @
b0a6d6eb
...
@@ -37,21 +37,22 @@ def article_for_object(context, obj):
...
@@ -37,21 +37,22 @@ def article_for_object(context, obj):
_cache
[
obj
]
=
article
_cache
[
obj
]
=
article
return
_cache
[
obj
]
return
_cache
[
obj
]
@register.inclusion_tag
(
'wiki/includes/render.html'
)
@register.inclusion_tag
(
'wiki/includes/render.html'
,
takes_context
=
True
)
def
wiki_render
(
article
,
preview_content
=
None
):
def
wiki_render
(
context
,
article
,
preview_content
=
None
):
if
preview_content
:
if
preview_content
:
content
=
article
.
render
(
preview_content
=
preview_content
)
content
=
article
.
render
(
preview_content
=
preview_content
)
else
:
else
:
content
=
None
content
=
None
return
{
context
.
update
(
{
'article'
:
article
,
'article'
:
article
,
'content'
:
content
,
'content'
:
content
,
'preview'
:
not
preview_content
is
None
,
'preview'
:
not
preview_content
is
None
,
'plugins'
:
plugin_registry
.
get_plugins
(),
'plugins'
:
plugin_registry
.
get_plugins
(),
'STATIC_URL'
:
django_settings
.
STATIC_URL
,
'STATIC_URL'
:
django_settings
.
STATIC_URL
,
'CACHE_TIMEOUT'
:
settings
.
CACHE_TIMEOUT
,
'CACHE_TIMEOUT'
:
settings
.
CACHE_TIMEOUT
,
}
})
return
context
@register.inclusion_tag
(
'wiki/includes/form.html'
,
takes_context
=
True
)
@register.inclusion_tag
(
'wiki/includes/form.html'
,
takes_context
=
True
)
def
wiki_form
(
context
,
form_obj
):
def
wiki_form
(
context
,
form_obj
):
...
...
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