Commit 66d1259d by Bridger Maxwell

Created copy of main.html that is django template. Using this for wiki instead…

Created copy of main.html that is django template. Using this for wiki instead of converting every view.
parent 0a9ad1a5
## mako
<%! from django.core.urlresolvers import reverse %>
<%namespace name='static' file='static_content.html'/>
......
<!DOCTYPE html>
{% load compressed %}{% load sekizai_tags i18n %}{% load url from future %}
<html>
<head>
{% block title %}<title>edX</title>{% endblock %}
<link rel="icon" type="image/x-icon" href="${static.url('images/favicon.ico')}" />
{% compressed_css 'application' %}
{% compressed_js 'main_vendor' %}
{% block headextra %}{% endblock %}
{% render_block "css" %}
{% render_block "js" %}
{% comment %}
TODO: We need to figure out how to put the MITX_ROOT_URL in here
<meta name="path_prefix" content="{{MITX_ROOT_URL}}">
{% endcomment %}
</head>
<body class="{% block bodyclass %}{% endblock %}">
{% include "navigation.html" %}
<section class="content-wrapper">
{% block body %}{% endblock %}
{% block bodyextra %}{% endblock %}
</section>
{% include "footer.html" %}
{% compressed_js 'application' %}
{% compressed_js 'module-js' %}
</body>
</html>
## mako
## TODO: Split this into two files, one for people who are authenticated, and
## one for people who aren't. Assume a Course object is passed to the former,
## instead of using settings.COURSE_TITLE
......
## mako
<%inherit file="mako_base.html"/>
<%!
from wiki.templatetags.wiki_tags import wiki_render
from mitxmako.templatetag_helpers import render_inclusion
%>
<%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>
<%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('view', article, plugins)}
</ul>
<div class="tab-content">
${ render_inclusion(wiki_render, 'wiki/includes/render.html', False, django_context, article ) }
</div>
</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>
## mako
<%inherit file="../mako_base.html"/>
<%namespace name='static' file='../../static_content.html'/>
<%!
from wiki.templatetags.wiki_tags import wiki_form
from mitxmako.templatetag_helpers import django_template_include, render_inclusion
%>
<%block name="title"><title>Create root article</title></%block>
<%block name="wiki_headextra">
%for js in editor.Media.js:
<script type="text/javascript" src="${static.url(js)}"></script>
%endfor
%for media, srcs in editor.Media.css.items():
%for src in srcs:
<link rel="stylesheet" media="${ media }" href="${static.url(src)}" />
%endfor
%endfor
</%block>
<%block name="wiki_contents">
<h1>Congratulations!</h1>
<p class="lead"> You have django-wiki installed... but there are no articles. So it's time to create the first one, the root article. In the beginning, it will only be editable by administrators, but you can define permissions after.
</p>
<h2 class="page-header">Root article</h2>
<form method="POST" class="form-horizontal">
${ render_inclusion(wiki_form, 'wiki/includes/form.html', True, django_context, create_form ) }
<div class="form-actions">
<input type="submit" name="save_changes" value="Create root &raquo;" class="btn btn-primary btn-large" />
</div>
</form>
</%block>
{% extends "main_django.html" %}
{% load sekizai_tags i18n %}{% load url from future %}
{% block title %}<title>{% block pagetitle %}{% endblock %} | edX Wiki</title>{% endblock %}
{% block body %}
{% block wiki_body %}
{% if messages %}
{% for message in messages %}
<div class="alert alert-{{ message.tags }}">
<a class="close" data-dismiss="alert" href="#">&times;</a>
{{ message }}
</div>
{% endfor %}
{% endif %}
{% block wiki_breadcrumbs %}{% endblock %}
{% block wiki_contents %}{% endblock %}
{% endblock %}
{% endblock %}
## mako
<%inherit file="mako_base.html"/>
<%!
from django.core.urlresolvers import reverse
from mitxmako.templatetag_helpers import django_template_include, render_inclusion
from wiki.templatetags.wiki_tags import wiki_form
%>
<%block name="title"><title>Add new article</title></%block>
<%block name="wiki_contents">
${django_template_include("wiki/includes/editormedia.html", context)}
<h1 class="page-header">Add new article</h1>
<form method="POST" class="form-horizontal">
${ render_inclusion(wiki_form, 'wiki/includes/form.html', True, django_context, create_form ) }
<div class="form-actions">
<a href="${reverse('wiki:get', kwargs={'path' : parent_urlpath.path})}" class="btn btn-large">
<span class="icon-circle-arrow-left"></span>
Go back
</a>
<button type="submit" name="save_changes" class="btn btn-primary btn-large">
<span class="icon-plus"></span>
Create article
</button>
</div>
</form>
</%block>
## 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', 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', 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', 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>
## mako
<%page args="selected, article, plugins" />
<%! from django.core.urlresolvers import reverse %>
%for plugin in article_tabs:
%if hasattr(plugin, "article_tab"):
<li class="pull-right${"active" if selected == plugin.slug else ""}">
<a href="${reverse('wiki:plugin', kwargs={'slug' : plugin.slug, 'article_id' : article.id, 'path' : urlpath.path}) }">
<span class="${plugin.article_tab[1]}"></span>
${plugin.article_tab[0]}
</a>
</li>
%endif
%endfor
%if not user.is_anonymous():
<li class="pull-right${"active" if selected == "settings" else ""}">
<a href="${reverse('wiki:settings', kwargs={'article_id' : article.id, 'path' : urlpath.path})}">
<span class="icon-wrench"></span>
Settings
</a>
</li>
%endif
<li class="pull-right${"active" if selected == "history" else ""}">
<a href="${reverse('wiki:history', kwargs={'article_id' : article.id, 'path' : urlpath.path})}">
<span class="icon-time"></span>
Changes
</a>
</li>
<li class="pull-right${"active" if selected == "edit" else ""}">
<a href="${reverse('wiki:edit', kwargs={'article_id' : article.id, 'path' : urlpath.path})}">
<span class="icon-edit"></span>
Edit
</a>
</li>
<li class="pull-right${"active" if selected == "view" else ""}">
<a href="${reverse('wiki:get', kwargs={'article_id' : article.id, 'path' : urlpath.path})}">
<span class="icon-home"></span>
View
</a>
</li>
## 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', ancestor.path)}">${ ancestor.article.current_revision.title }</a></li>
%endfor
<span class="divider">/</span>
<li class="active"><a href="${reverse('wiki:get', 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', 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 &raquo;</a>
</li>
</ul>
</div>
</div>
<div class="pull-left" style="margin-left: 10px;">
<a class="btn" href="${reverse('wiki:create', 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
## mako
<%inherit file="../main.html"/>
<%namespace name='static' file='../static_content.html'/>
<%block name="headextra">
<%static:css group='course'/>
<%block name="wiki_headextra" />
</%block>
<%block name="bodyextra">
## %if course:
## <%include file="../course_navigation.html" args="active_page='wiki'" />
## %endif
<div class="container" style="margin-top: 60px;">
<%doc>
{% if messages %}
{% for message in messages %}
<div class="alert alert-{{ message.tags }}">
<a class="close" data-dismiss="alert" href="#">&times;</a>
{{ message }}
</div>
{% endfor %}
{% endif %}
</%doc>
<%block name="wiki_breadcrumbs" />
<%block name="wiki_contents" />
<div style="padding: 50px 0;">
<footer>
<hr />
<a href="https://github.com/benjaoming/django-wiki" class="pull-right"><img src="{{ STATIC_URL }}wiki/img/github_icon.png" /></a>
<p>Powered by <a href="http://www.django-wiki.org">django-wiki</a>, an open source application under the <a href="http://www.gnu.org/licenses/quick-guide-gplv3.html">GPLv3</a> license. Let knowledge be the cure.</p>
<div style="clear: both"></div>
</footer>
</div>
</div> <!-- /container -->
</%block>
## mako
<%inherit file="mako_base.html"/>
<%!
from wiki.templatetags.wiki_tags import wiki_form
from mitxmako.templatetag_helpers import render_inclusion
%>
<%namespace name="article_menu" file="includes/article_menu.html"/>
<%namespace name="breadcrumbs" file="includes/breadcrumbs.html"/>
<%block name="title"><title>Settings: ${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('settings', article, plugins)}
</ul>
<div class="tab-content">
%for form in forms:
<form method="POST" class="form-horizontal" id="settings_form" action="?f=${form.action}">
<h2>${form.settings_form_headline}</h2>
<div class="well">
${ render_inclusion(wiki_form, 'wiki/includes/form.html', True, django_context, form ) }
</div>
<div class="form-actions">
<button type="submit" name="save" value="1" class="btn btn-large btn-primary">
<span class="icon-ok"></span>
Save changes
</button>
</div>
</form>
%endfor
</div>
</div>
<div class="tabbable tabs-below" style="margin-top: 20px;">
<ul class="nav nav-tabs">
${article_menu.body('settings', article, plugins)}
<li style="margin-top: 10px;"><em>Article last modified: ${ article.current_revision.modified }</em></li>
</ul>
</div>
</%block>
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