many things have occured
This commit is contained in:
parent
02b6b7d592
commit
db70df22a2
23 changed files with 281 additions and 167 deletions
20
realms/templates/wiki/compare.html
Normal file
20
realms/templates/wiki/compare.html
Normal file
|
@ -0,0 +1,20 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% block body %}
|
||||
|
||||
<h2>History for <strong>{{ name }}</strong></h2>
|
||||
<div class="pull-right">
|
||||
<a href="/_commit/{{ old }}/{{ name }}" class="btn btn-default btn-sm">View Old</a>
|
||||
<a href="/_commit/{{ new }}/{{ name }}" class="btn btn-info btn-sm">View New</a>
|
||||
</div>
|
||||
<p>
|
||||
<a class="btn btn-default btn-sm" href="/_history/{{ name }}">Back to History</a>
|
||||
</p>
|
||||
|
||||
|
||||
{{ diff|safe }}
|
||||
<p></p>
|
||||
|
||||
<p>
|
||||
<a class="btn btn-default btn-sm" href="/_history/{{ name }}">Back to History</a>
|
||||
</p>
|
||||
{% endblock %}
|
18
realms/templates/wiki/create.html
Normal file
18
realms/templates/wiki/create.html
Normal file
|
@ -0,0 +1,18 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% block body %}
|
||||
|
||||
<form role="form" method="post">
|
||||
<div class="form-group">
|
||||
<label for="name"></label>
|
||||
<input type="text" class="form-control" id="page" name="name" placeholder="Name" value="{{- name -}}" />
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="content"></label>
|
||||
<textarea name="content" id="content" class="form-control" placeholder="Content"></textarea>
|
||||
</div>
|
||||
|
||||
<input type="submit" class="btn btn-primary" value="Save" />
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
110
realms/templates/wiki/edit.html
Normal file
110
realms/templates/wiki/edit.html
Normal file
|
@ -0,0 +1,110 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% block js %}
|
||||
{% assets "js_editor" %}
|
||||
<script type="text/javascript" src="{{ ASSET_URL }}"></script>
|
||||
{% endassets %}
|
||||
<script>
|
||||
$(function(){
|
||||
$("#start-togetherjs").click(function(){
|
||||
$(this).prop('disabled', true).html("Loading");
|
||||
});
|
||||
MDR.sanitize = false;
|
||||
});
|
||||
TogetherJSConfig_toolName = "Collaboration";
|
||||
TogetherJSConfig_suppressJoinConfirmation = true;
|
||||
{% if session.get('user') %}
|
||||
TogetherJSConfig_getUserName = function () {
|
||||
return {{ session['user'].get('username')|tojson }};
|
||||
};
|
||||
|
||||
TogetherJSConfig_getUserAvatar = function () {
|
||||
return {{ session['user'].get('avatar')|tojson }};
|
||||
};
|
||||
{% endif %}
|
||||
|
||||
TogetherJSConfig_on_ready = function () {
|
||||
MDR.sanitize = true;
|
||||
$("#preview").html('');
|
||||
$("#start-togetherjs").addClass('btn-danger').html('End Collaboration').prop('disabled', false);
|
||||
};
|
||||
TogetherJSConfig_on_close = function () {
|
||||
MDR.sanitize = false;
|
||||
$("#start-togetherjs").removeClass('btn-danger').html('Collaborate').prop('disabled', false);
|
||||
};
|
||||
|
||||
</script>
|
||||
<script src="https://togetherjs.com/togetherjs-min.js"></script>
|
||||
|
||||
{% endblock %}
|
||||
{% block body %}
|
||||
{% block css %}
|
||||
<style>
|
||||
#main-body {
|
||||
background: inherit;
|
||||
border: inherit;
|
||||
padding: 0;
|
||||
-webkit-box-shadow: 0;
|
||||
-moz-box-shadow: 0;
|
||||
box-shadow: 0;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
<div id="app-wrap" class="container-fluid">
|
||||
<div id="app-controls" class="row">
|
||||
<div class="col-xs-3">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon btn-info input-sm">realms.io/</span>
|
||||
<input id="page-name" type="text" class="form-control input-sm" name="name" placeholder="Name" value="{{- name -}}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-3">
|
||||
<input id="page-message" type="text" class="form-control input-sm" name="page-message" placeholder="Comment" value="" />
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6">
|
||||
<div class="pull-right">
|
||||
|
||||
<button class="btn btn-success btn-sm" id="start-togetherjs" type="button"
|
||||
onclick="TogetherJS(this); return false">
|
||||
Collaborate
|
||||
</button>
|
||||
|
||||
<a href="#" id="drop6" role="button" class="dropdown-toggle btn btn-default btn-sm" data-toggle="dropdown">Theme <b class="caret"></b></a>
|
||||
<ul id="theme-list" class="dropdown-menu" role="menu" aria-labelledby="drop6">
|
||||
<li><a tabindex="-1" href="#" data-value="ace/theme/chrome" class="">Chrome</a></li>
|
||||
<li><a tabindex="-1" href="#" data-value="ace/theme/clouds" class="">Clouds</a></li>
|
||||
<li><a tabindex="-1" href="#" data-value="ace/theme/clouds_midnight" class="">Clouds Midnight</a></li>
|
||||
<li><a tabindex="-1" href="#" data-value="ace/theme/cobalt" class="">Cobalt</a></li>
|
||||
<li><a tabindex="-1" href="#" data-value="ace/theme/crimson_editor" class="">Crimson Editor</a></li>
|
||||
<li><a tabindex="-1" href="#" data-value="ace/theme/dawn" class="selected">Dawn</a></li>
|
||||
<li><a tabindex="-1" href="#" data-value="ace/theme/dreamweaver" class="">Dreamweaver</a></li>
|
||||
<li><a tabindex="-1" href="#" data-value="ace/theme/eclipse" class="">Eclipse</a></li>
|
||||
<li><a tabindex="-1" href="#" data-value="ace/theme/idle_fingers" class="">idleFingers</a></li>
|
||||
<li><a tabindex="-1" href="#" data-value="ace/theme/kr_theme" class="">krTheme</a></li>
|
||||
<li><a tabindex="-1" href="#" data-value="ace/theme/merbivore" class="">Merbivore</a></li>
|
||||
<li><a tabindex="-1" href="#" data-value="ace/theme/merbivore_soft" class="">Merbivore Soft</a></li>
|
||||
<li><a tabindex="-1" href="#" data-value="ace/theme/mono_industrial" class="">Mono Industrial</a></li>
|
||||
<li><a tabindex="-1" href="#" data-value="ace/theme/monokai" class="">Monokai</a></li>
|
||||
<li><a tabindex="-1" href="#" data-value="ace/theme/pastel_on_dark">Pastel on Dark</a></li>
|
||||
<li><a tabindex="-1" href="#" data-value="ace/theme/solarized_dark" class="">Solarized Dark</a></li>
|
||||
<li><a tabindex="-1" href="#" data-value="ace/theme/solarized_light" class="">Solarized Light</a></li>
|
||||
<li><a tabindex="-1" href="#" data-value="ace/theme/textmate" class="">TextMate</a></li>
|
||||
<li><a tabindex="-1" href="#" data-value="ace/theme/tomorrow" class="">Tomorrow</a></li>
|
||||
<li><a tabindex="-1" href="#" data-value="ace/theme/tomorrow_night">Tomorrow Night</a></li>
|
||||
<li><a tabindex="-1" href="#" data-value="ace/theme/tomorrow_night_blue" class="">Tomorrow Night Blue</a></li>
|
||||
<li><a tabindex="-1" href="#" data-value="ace/theme/tomorrow_night_bright" class="">Tomorrow Night Bright</a></li>
|
||||
<li><a tabindex="-1" href="#" data-value="ace/theme/tomorrow_night_eighties" class="">Tomorrow Night 80s</a></li>
|
||||
<li><a tabindex="-1" href="#" data-value="ace/theme/twilight" class="">Twilight</a></li>
|
||||
<li><a tabindex="-1" href="#" data-value="ace/theme/vibrant_ink" class="">Vibrant Ink</a></li>
|
||||
</ul>
|
||||
<a id="save-native" class="btn btn-primary btn-sm"><i class="icon-save"></i> Save</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="editor">{{ content }}</div>
|
||||
<div id="preview"></div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
59
realms/templates/wiki/history.html
Normal file
59
realms/templates/wiki/history.html
Normal file
|
@ -0,0 +1,59 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% block body %}
|
||||
|
||||
<h2>History for <strong>{{ name }}</strong></h2>
|
||||
<p>
|
||||
<a class="btn btn-default btn-sm compare-revisions">Compare Revisions</a>
|
||||
</p>
|
||||
|
||||
<table class="table table-bordered revision-tbl">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Name</th>
|
||||
<th>Revision Message</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{% for h in history %}
|
||||
<tr>
|
||||
<td class="checkbox-cell text-center">
|
||||
<input type="checkbox" name="versions[]" value="{{ h.sha }}" />
|
||||
</td>
|
||||
<td>{{ h.author }}</td>
|
||||
<td><a href="/_commit/{{ h.sha }}/{{ name }}" class='label label-primary'>View</a> {{ h.message }} </td>
|
||||
<td>{{ h.time|datetime }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
<p>
|
||||
<a class="btn btn-default btn-sm compare-revisions">Compare Revisions</a>
|
||||
</p>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
<script>
|
||||
$(function(){
|
||||
$('.revision-tbl :checkbox').change(function () {
|
||||
var $cs=$(this).closest('.revision-tbl').find(':checkbox:checked');
|
||||
if ($cs.length > 2) {
|
||||
this.checked=false;
|
||||
}
|
||||
});
|
||||
|
||||
$(".compare-revisions").click(function(){
|
||||
var $cs = $('.revision-tbl').find(':checkbox:checked');
|
||||
console.log($cs.length);
|
||||
if ($cs.length != 2) return;
|
||||
var revs = [];
|
||||
$.each($cs, function(i, v){
|
||||
revs.push(v.value);
|
||||
});
|
||||
revs.reverse();
|
||||
revs = revs.join("..");
|
||||
location.href = "/_compare/{{ name }}/" + revs;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
19
realms/templates/wiki/new.html
Normal file
19
realms/templates/wiki/new.html
Normal file
|
@ -0,0 +1,19 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% block body %}
|
||||
<h2>Create New Site</h2>
|
||||
<div class="row">
|
||||
<div class='col-md-6'>
|
||||
<form method="POST" role="form">
|
||||
<div class="form-group">
|
||||
<label for="wiki" class="control-label">Site Name</label>
|
||||
<div class="input-group">
|
||||
<input id="wiki" name="name" type="text" class="form-control" value="{{ request.args.get('site', '') }}" />
|
||||
<span class="input-group-addon">.realms.io</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="submit" class="btn btn-primary" value="Save">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
30
realms/templates/wiki/page.html
Normal file
30
realms/templates/wiki/page.html
Normal file
|
@ -0,0 +1,30 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% block page_menu %}
|
||||
<div class="controls pull-right">
|
||||
<a class="btn btn-default btn-sm" href="/_edit/{{ name }}">Edit</a>
|
||||
<a class="btn btn-default btn-sm" href="/_history/{{ name }}">History</a>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
{% if commit %}
|
||||
<div id="page-action-bar">
|
||||
<form method="POST" action="/_revert">
|
||||
<input type="hidden" value="{{ name }}" name="name" />
|
||||
<input type="hidden" value="{{ commit }}" name="commit" />
|
||||
<input type="submit" class="btn btn-danger btn-sm" title="Revert back to this revision" value="Revert" />
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div id="page-content" style="display:none">
|
||||
{{ page.data }}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
{% block js %}
|
||||
<script>
|
||||
$(function(){
|
||||
$("#page-content").html(MDR.convert({{ page.data|tojson|safe }})).show();
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue