Commit 4ca87c44 by Bridger Maxwell

Converting SimpleWiki pages to Mako templates. Moving them to templates. Some bugs remain.

parent f25219cb
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
##Todo The language code isn't defined, so I made it a literal string
<html lang="${"LANGUAGE_CODE"}">
<head>
<title>${"wiki_title"}</title>
<link rel="stylesheet" media="screen,print" href="/static/simplewiki/css/base.css" />
<link rel="stylesheet" media="print" href="/static/simplewiki/css/base_print.css" />
<link rel="stylesheet" href="/static/simplewiki/css/autosuggest_inquisitor.css" />
<link rel="stylesheet" href="/static/css/local.css" type="text/css" media="all" />
<link href="/static/css/jquery-ui-1.8.16.custom.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="/static/simplewiki/js/bsn.AutoSuggest_c_2.0.js"></script>
<script type="text/javascript" src="/static/js/schematic.js"></script>
<script type="text/javascript" src="/static/lib/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="/static/js/video_player.js"></script>
<%!
from django.core.urlresolvers import reverse
%>
<script type="text/javascript">
function set_related_article_id(s) {
document.getElementById('wiki_related_input_id').value = s.id;
document.getElementById('wiki_related_input_submit').disabled=false;
}
var x = window.onload;
window.onload = function(){
var options = {
script: "${reverse("search_related", args=[wiki_article.get_url()] )}/?self=${wiki_article.pk}&",
json: true,
varname: "query",
maxresults: 35,
callback: set_related_article_id,
noresults: "Nothing found!"
};
var as = new AutoSuggest('wiki_related_input', options);
if (typeof x == 'function')
x();
}
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [ ['$','$'], ["\\(","\\)"]],
displayMath: [ ['$$','$$'], ["\\[","\\]"]]}
});
</script> <script type="text/javascript" src="/static/lib/mathjax/MathJax.js?config=TeX-AMS_HTML-full"></script>
<script>
$(function(){
$.ajaxSetup ({
// Disable caching of AJAX responses
cache: false
});
$(".div_wiki_circuit").each(function(d,e) {
id = $(this).attr("id");
name = id.substring(17);
//alert(name);
$("#"+id).load("/edit_circuit/"+name);
f=this;
});
update_schematics();});
</script>
<%block name="wiki_head">
</%block>
</head>
<body>
<style>
#coursenav_wiki {
background-color: #031634;
border-bottom-color: #023063;
border-collapse: separate;
border-left-color: #023063;
border-right-color: #023063;
border-top-color: #023063;
color: #023063;
display: block;
font-family: Helvetica, Arial, sans-serif;
font-size: 13px;
font-style: normal;
font-weight: normal;
height: 19px;
margin-bottom: 8px;
margin-left: 0px;
margin-right: 8px;
margin-top: 4px;
padding-bottom: 8px;
padding-left: 0px;
padding-right: 8px;
padding-top: 4px;
text-align: right;
}
a.navwiki {
background-color: transparent;
border-bottom-color: #ADCC80;
border-collapse: separate;
border-left-color: #ADCC80;
border-right-color: #ADCC80;
border-top-color: #ADCC80;
color: #ADCC80;
cursor: auto;
display: inline;
font-family: Helvetica, Arial, sans-serif;
font-size: 13px;
font-style: normal;
font-weight: normal;
height: 0px;
margin-bottom: 0px;
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
padding-bottom: 0px;
padding-left: 0px;
padding-right: 0px;
padding-top: 0px;
text-align: right;
text-decoration: none;
width: 0px;
}
#footer_wiki {
background-color: #031634;
background-image: url(/static/css/images/css/bottomWrapper-bg.jpg);
background-position: 50% 0%;
background-repeat: repeat-x;
color: #ADCC80;
display: block;
font-family: Helvetica, Arial, sans-serif;
font-size: 13px;
font-style: normal;
font-weight: normal;
height: 140px;
text-align: center;
}
a.footwiki {
background-color: transparent;
background-image: none;
background-position: 0% 0%;
background-repeat: repeat;
color: #ADCC80;
cursor: auto;
display: inline;
font-family: Helvetica, Arial, sans-serif;
font-size: 13px;
font-style: normal;
font-weight: normal;
height: 0px;
letter-spacing: normal;
line-height: 20px;
text-align: center;
text-decoration: none;
}
</style>
<div id="coursenav_wiki" width="100%">
<a class="navwiki" href="/book">Textbook</a>
<span class="ui-icon ui-icon-bullet" style="display:inline-block;"></span>
<a class="navwiki" href="/courseware">Courseware</a>
<span class="ui-icon ui-icon-bullet" style="display:inline-block;"></span>
<a class="navwiki" href="/discussion">Discussion</a>
<span class="ui-icon ui-icon-bullet" style="display:inline-block;"></span>
<a class="navwiki" href="/wiki"><b>Wiki</b></a>
<span class="ui-icon ui-icon-bullet" style="display:inline-block;"></span>
<a class="navwiki" href="/profile">Profile</a>
<span class="ui-icon ui-icon-bullet" style="display:inline-block;"></span>
<a class="navwiki" href="/s/help.html">Help</a> <span class="ui-icon ui-icon-bullet" style="display:inline-block;"></span>
<a class="navwiki" href="/logout">Log out</a>
</div>
<h1><%block name="wiki_page_title"/></h1>
<hr />
<%block name="wiki_panel">
<div id="wiki_panel">
<div class="wiki_box">
<div class="wiki_box_header">
<div class="wiki_box_corner"></div>
<div class="wiki_box_bar"></div>
</div>
<div class="wiki_box_contents" style="position: relative;">
<div style="border: 2px outset #CCC; width: 250px; padding: 10px; background-color: #FFF; position: absolute; right: 100px; top: -80px; display: none; color: #000;" id="wiki_create_form">
<%
theaction = "this.wiki_article_name.value.replace(/([^a-zA-Z0-9\-])/g, '')+'/_create/'"
%>
<form method="GET" onsubmit="this.action='${reverse("wiki_view", args=[wiki_article.get_url()])}/' + ${theaction};">
<h2>Create article</h2>
<p>
<label for="id_wiki_article_name">Title of article</label>
<input type="text" name="wiki_article_name" id="id_wiki_article_name" /><br/>
<label for="id_wiki_article_is_child">Create as a child of current article</label>
<input type="checkbox" name="wiki_article_is_child" id="id_wiki_artcile_is_child" disabled="true" checked=${ "yes" if wiki_article else "no" }>
</p>
<p>
<input type="button" class="button" value="Cancel" style="display: inline-block; margin-right: 2px;" onclick="document.getElementById('wiki_create_form').style.display='none';" />
<input type="submit" class="button" value="Next &gt;" style="display: inline-block; margin-right: 2px; font-weight: bold;" />
</p>
</form>
</div>
<p>
%if wiki_article:
<input type="button" onclick="javascript:location.href='${reverse("wiki_view", args=[wiki_article.get_url()])}'" value="View" style="width: 100%;" /><br />
<input type="button" onclick="javascript:location.href='${reverse("wiki_edit", args=[wiki_article.get_url()])}'" value="Edit" style="width: 100%;"${'disabled="true"' if not wiki_write else ""}/><br />
<input type="button" onclick="javascript:location.href='${reverse("wiki_history", args=[wiki_article.get_url(),1])}'" value="History" style="width: 100%;" />
%endif
<input type="button" onclick="document.getElementById('wiki_create_form').style.display='block';" value="Create article" style="width: 100%; margin-bottom: 2px;" class="button" />
<input type="button" onclick="javascript:location.href='${reverse("wiki_random", args=[wiki_article.get_url()])}'" value="Random article" style="width: 100%; margin-bottom: 2px;" class="button" />
</p>
%if wiki_article:
%if wiki_article.locked:
<p><strong>This article has been locked</strong></p>
%endif
<p>
<i>Last modified: ${wiki_article.modified_on.strftime("%b %d, %Y, %I:%M %p")}</i>
</p>
%endif
</div>
<div class="wiki_box_footer">
<div class="wiki_box_corner"></div>
<div class="wiki_box_bar"></div>
</div>
</div>
</div>
</%block>
<%block name="wiki_body"/>
<br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <div id="footer_wiki"> <p style="padding-top:20px"> Copyright (c). 2011. MIT. <a class="footwiki" href=http://creativecommons.org/licenses/by-sa/3.0/>Some rights reserved.</a> <!-- Template based on a design from http://www.dotemplate.com/ -- Donated $10 (pmitros) so we don't need to include credit. --> </p> </div>
</body>
</html>
<%inherit file="simplewiki_base.html"/>
<%block name="wiki_page_title">
Create article
</%block>
<%block name="wiki_body">
<form method="POST" id="wiki_revision">
<div style="display:none">
<input type="hidden" name="csrfmiddlewaretoken" value="${csrf_token}"/>
</div>
<table id="wiki_revision_table">
${ wiki_form }
<tr>
<td colspan="2" align="right">
<input type="submit" value="Create article" /></td>
</tr>
</table>
</form>
</%block>
<%inherit file="simplewiki_base.html"/>
<%block name="wiki_page_title">
${ wiki_article.title }
</%block>
<%block name="wiki_body">
<form method="POST" id="wiki_revision">
<div style="display:none">
<input type="hidden" name="csrfmiddlewaretoken" value="${csrf_token}"/>
</div>
<table id="wiki_revision_table">
${wiki_form}
<tr>
<td colspan="2" align="right">
<input type="submit" value="Edit article" /></td>
</tr>
</table>
</form>
</%block>
<%inherit file="simplewiki_base.html"/>
<%block name="wiki_page_title">
Oops...
</%block>
<%block name="wiki_body">
<div class="wiki_error">
${wiki_error}
%if wiki_err_notfound:
%endif
%if wiki_err_notfound:
%if wiki_url:
<p>
The page you requested could not be found.
Click <a href="{% url wiki_create wiki_url %}">here</a> to create it.
</p>
%else:
<p>
Or maybe rather: Congratulations! It seems that there's no root
article, which is probably because you just installed simple-wiki
and your installation is working. Now you can create the root article.
Click <a href="{% url wiki_create "" %}">here</a> to create it.
</p>
%endif
%else:
%if wiki_err_noparent:
<p>
You cannot create this page, because its parent
does not exist. Click <a href="${reverse("wiki_create", args=[wiki_url_parent])}">here</a>
to create it.
</p>
%else:
%if wiki_err_keyword:
<p>
The page you're trying to create <b>${wiki_url}</b> starts with <b>_</b>, which is reserved for internal use.
</p>
%else:
%if wiki_err_locked:
<p>
The article you are trying to modify is locked.
</p>
%else:
%if wiki_err_noread:
<p>
You do not have access to read this article.
</p>
%else:
%if wiki_err_nowrite:
<p>
You do not have access to edit this article.
</p>
%else:
%if wiki_err_noanon:
<p>
Anonymous attachments are not allowed. Try logging in.
</p>
%else:
%if wiki_err_create:
<p>
You do not have access to create this article.
</p>
%else:
%if wiki_err_encode:
<p>
The url you requested could not be handled by the wiki.
Probably you used a bad character in the URL.
Only use digits, English letters, underscore and dash. For instance
/wiki/An_Article-1
</p>
%else:
<p>
An error has occured.
</p>
%endif
%endif
%endif
%endif
%endif
%endif
%endif
%endif
%endif
</div>
</%block>
<%inherit file="simplewiki_base.html"/>
<%block name="wiki_page_title">
${ wiki_article.title }
</%block>
<%block name="wiki_body">
<form method="POST">
<div style="display:none">
<input type="hidden" name="csrfmiddlewaretoken" value="${csrf_token}"/>
</div>
<table id="wiki_history_table">
<thead>
<tr>
<th id="revision">Revision</th>
<th id="comment">Comment</th>
<th id="diff">Diff</th>
<th id="modified">Modified</th>
</tr>
</thead>
<tbody>
<% loopCount = 0 %>
%for revision in wiki_history:
<% loopCount += 1 %>
<tr style="border-top: 1px" ${'class="dark"' if (loopCount % 2) == 0 else ''}>
<td width="15px">
<input type="radio" name="revision" id="${revision.id}" value="${revision.id}"${"checked" if wiki_article.current_revision.id == revision.id else ""}/>
<label for="${revision.id}">
${ revision }
%if revision.previous_revision:
%if not revision.counter == revision.previous_revision.counter + 1:
<br/>(based on ${revision.previous_revision})
%endif
%endif
</label>
</td>
<td>
${ revision.revision_text if revision.revision_text else "<i>None</i>" }</td>
<td class="diff">
%for x in revision.get_diff():
${x|h}<br/>
%endfor </td>
<td>${revision.get_user}
<br/>
${revision.revision_date.strftime("%b %d, %Y, %I:%M %p")}
</td>
</tr>
%endfor
</tbody>
%if wiki_prev_page or wiki_next_page:
<tfoot>
<tr>
<td colspan="4">
%if wiki_prev_page:
<a href="${reverse("wiki_history", args=[wiki_article.get_url(), wiki_prev_page])}">trans "Previous page"</a>
%endif
%if wiki_next_page:
<a href="${reverse("wiki_history", args=[wiki_article.get_url(), wiki_next_page])}">"Next page"</a>
%endif
</td>
</tr>
</tfoot>
%endif
</table>
<input type="submit" value="Change revision"
%if not wiki_write:
disabled="true"
%endif
/>
</form>
</%block>
<%inherit file="simplewiki_base.html"/>
<%block name="wiki_page_title">
%if wiki_search_query:
Search results for ${wiki_search_query | h}
%else:
Displaying all articles
%endif
</%block>
<%block name="wiki_body">
%for article in wiki_search_results:
%if article.get_url:
<a href="${reverse("wiki_view", args=[article.get_url()])}">${article.get_url()}</a><br/>
%else:
<a href="${reverse("wiki_view", args=[''])}">/</a><br/>
%endif
%endfor
%if not wiki_search_results:
No articles were found!
%endif
</%block>
<%!
from django.template.defaultfilters import filesizeformat
%>
%if started:
<script type="text/javascript">
parent.document.getElementById("wiki_attach_progress_container").style.display='block';
</script>
%else:
%if finished:
<script type="text/javascript">
parent.document.getElementById("wiki_attach_progress_container").style.display='none';
parent.location.reload();
</script>
%else:
%if overwrite_warning:
<script type="text/javascript">
if (confirm('Warning: The filename already exists? Really overwrite ${ filename }?'))
parent.document.getElementById("wiki_attach_overwrite").checked=true;
parent.document.getElementById("wiki_attach_overwrite").form.submit();
</script>
%else:
%if too_big:
<script type="text/javascript">
alert('File is too big. Maximum: ${filesizeformat(max_size)}\nYour file was: ${filesizeformat(file.size)}');
</script>
%else:
<script type="text/javascript">
parent.document.getElementById("wiki_attach_progress").style.width='${progress_width}%';
</script>
%endif
%endif
%endif
%endif
<%inherit file="simplewiki_base.html"/>
<%block name="wiki_page_title">
${ wiki_article.title }
</%block>
<%block name="wiki_body">
<div id="wiki_article">
${ wiki_article.current_revision.contents_parsed| n}
</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