various updates

This commit is contained in:
Matthew Scragg 2013-10-01 20:50:48 -05:00
parent 86cb2d7c13
commit 2233205e0e
14 changed files with 259 additions and 80 deletions

View file

@ -4,27 +4,16 @@
<script src="/static/js/ace/mode-markdown.js"></script>
<script src="/static/js/keymaster.min.js"></script>
<script src="/static/js/dillinger.js"></script>
<script>
$(function(){
$("#save").click(function(){
$(this).prop('disable', true);
var data = {
name: $("#page-name").val(),
content: editor.getSession().getValue()
}
$.post(window.location, data, function(){
location.href = "/" + data['name'];
});
});
});
</script>
{% endblock %}
{% block body %}
<div id="app-wrap" class="container-fluid">
<div id="app-controls" class="row">
<div class="col-xs-6">
<input id="page-name" type="text" class="form-control" id="page" name="name" placeholder="Name" value="{{- name -}}" />
<div class="col-xs-3">
<input id="page-name" type="text" class="form-control" name="name" placeholder="Name" value="{{- name -}}" />
</div>
<div class="col-xs-3">
<input id="page-message" type="text" class="form-control" name="page-message" placeholder="Comment" value="" />
</div>
<div class="col-xs-6">

View file

@ -0,0 +1,16 @@
{% extends 'layout.html' %}
{% block body %}
<h2>History</h2>
<table class="table table-bordered">
{% for h in history %}
<tr>
<td class="checkbox-cell text-center"><input type="checkbox" /></td>
<td>{{ h.author }}</td>
<td><a href="/commit/{{ h.sha }}/{{ name }}" class='label label-primary'>{{ h.sha|truncate(7, True, end="") }}</a> {{ h.message }} </td>
<td>{{ h.time|datetime }}</td>
</tr>
{% endfor %}
</table>
{% endblock %}

View file

@ -1,6 +1,15 @@
{% extends 'layout.html' %}
{% block body %}
<div class="markdown">{{- page.data|safe -}}</div>
<div id="page-content" style="display:none">
{{ page.data|safe }}
</div>
{% endblock %}
{% block js %}
<script>
$(function(){
$("#page-content").html(converter({{ page.data|tojson|safe }})).show();
});
</script>
{% endblock %}