Converting SimpleWiki pages to Mako templates. Moving them to templates. Some bugs remain.
This commit is contained in:
240
simplewiki_base.html
Normal file
240
simplewiki_base.html
Normal file
@@ -0,0 +1,240 @@
|
||||
<!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 >" 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>
|
||||
Reference in New Issue
Block a user