Commit b0a6d6eb by benjaoming

bootstrap styling

parent dfb56934
import os
import os.path
from django.db import models
......
......@@ -5,6 +5,9 @@ from django.core.exceptions import ImproperlyConfigured
APP_LABEL = 'wiki'
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)
# WIKI_ATTACHMENTS_ANONYMOUS can override this, otherwise the default
# in wiki.conf.settings is used.
......
# -*- coding: utf-8 -*-
from django.contrib import messages
from django.db import transaction
from django.db.models import Q
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import redirect, get_object_or_404
......@@ -14,7 +13,6 @@ from wiki.core.http import send_file
from wiki.decorators import get_article, response_forbidden
from wiki.plugins.attachments import models, settings, forms
from wiki.views.mixins import ArticleMixin
from django.core.mail import mail_admins
class AttachmentView(ArticleMixin, FormView):
......
{% load i18n wiki_macro_tags %}
{% if article_children %}
<h3>{% trans "Article index" %}</h3>
<div class="article-list">
<ul>
<li class="nav-header">{% trans "Article index" %} <i class="icon-list"></i></li>
{% for child in article_children %}
{% article_list child depth %}
{% empty %}
<i>{% trans "Nothing below this level" %}</i>
{% endfor %}
<ul>
</div>
{% endif %}
{% load wiki_macro_tags %}
{% 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 %}
<div class="wiki-article-sublist">
<ul>
{% for child in parent.children.all %}
<li>{% article_list child depth %}</li>
{% endfor %}
</ul>
</div>
<ul>
{% for child in parent.children.all %}
<li>{% article_list child depth %}</li>
{% endfor %}
</ul>
{% endif %}
</li>
/*!
* Based on Bootstrap v2.2.2
*
* Modified for django-wiki
*/
/*!
* Bootstrap v2.2.2
* Bootstrap Responsive v2.2.2
*
* Copyright 2012 Twitter, Inc
* Licensed under the Apache License v2.0
......@@ -5171,11 +5166,27 @@ h1#article-title {
}
.wiki-article div.toc,
.wiki-article div.article-list {
margin: 10px 0;
background: #f9f9f9;
padding: 10px;
width: 300px;
border: 1px solid #CCC;
min-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;
......@@ -5183,6 +5194,134 @@ h1#article-title {
.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;
......
......@@ -864,9 +864,30 @@ h1#article-title{font-size:2em;margin-top:-5px;}
.settings-form .form-actions{padding-left:270px;}
#attachment_form #id_description{width:95%;}
#edit_sidebar .accordion{margin-bottom:5px;}
.wiki-article div.toc,.wiki-article div.article-list{margin:10px 0;background:#f9f9f9;padding:10px;width:300px;border:1px solid #CCC;}
.wiki-article div.toc,.wiki-article div.article-list{min-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 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;}
.asteriskField{font-size:20px;margin-left:5px;}
.notification-list .since{font-size:80%;color:#CCC;}
......
/*!
* Based on Bootstrap v2.2.2
* Bootstrap 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
{
clear: both;
......@@ -36,19 +93,51 @@ h1#article-title {font-size: 2em; margin-top: -5px;}
.wiki-article div.toc,
.wiki-article div.article-list {
margin: 10px 0;
background: #f9f9f9;
padding: 10px;
width: 300px;
border: 1px solid #CCC;
.well;
.well-small;
max-width: 340px;
}
.wiki-article a.linknotfound {color: #C87;}
.wiki-article pre {
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;}
.asteriskField { font-size: 20px; margin-left: 5px;}
......
$(document).ready(function() {
$('.wiki-article .article-list ul, .wiki-article .toc ul').each(function() {
$(this).addClass('nav');
$(this).addClass('nav-list');
});
});
{% 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">
{% if not preview %}
......@@ -15,3 +19,21 @@
{% endif %}
</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 %}
......@@ -4,24 +4,7 @@
{% block wiki_contents_tab %}
{% 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 %}
{% wiki_render article %}
{% endblock %}
......@@ -37,21 +37,22 @@ def article_for_object(context, obj):
_cache[obj] = article
return _cache[obj]
@register.inclusion_tag('wiki/includes/render.html')
def wiki_render(article, preview_content=None):
@register.inclusion_tag('wiki/includes/render.html', takes_context=True)
def wiki_render(context, article, preview_content=None):
if preview_content:
content = article.render(preview_content=preview_content)
else:
content = None
return {
context.update({
'article': article,
'content': content,
'preview': not preview_content is None,
'plugins': plugin_registry.get_plugins(),
'STATIC_URL': django_settings.STATIC_URL,
'CACHE_TIMEOUT': settings.CACHE_TIMEOUT,
}
})
return context
@register.inclusion_tag('wiki/includes/form.html', takes_context=True)
def wiki_form(context, form_obj):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment