realms-wiki/realms/templates/wiki/edit.html

172 lines
7.6 KiB
HTML
Raw Normal View History

2013-10-01 07:10:10 +03:00
{% extends 'layout.html' %}
{% block js %}
2014-10-02 01:14:54 +03:00
<script>
var Commit = {};
Commit.info = {{ info|tojson }};
2014-10-02 01:14:54 +03:00
</script>
<script src="{{ url_for('static', filename='js/editor.js') }}"></script>
2014-10-02 01:14:54 +03:00
{% if partials %}
<script>
$(function() {
2014-09-07 19:54:51 +03:00
{% for name, value in partials.items() %}
{% if name and value %}
try {
Handlebars.registerPartial({{ name|tojson|safe }}, {{ value.data|tojson|safe }});
2014-10-02 01:14:54 +03:00
} catch (e) {
// no data?
}
{% endif %}
2014-09-07 19:54:51 +03:00
{% endfor %}
2014-10-02 01:14:54 +03:00
});
</script>
{% endif %}
{% if config.get('COLLABORATION') %}
<script src="{{ url_for('static', filename='js/collaboration/main.js') }}"></script>
2014-10-02 01:14:54 +03:00
{% endif %}
{% if config.get('COLLABORATION') == 'firepad' %}
<script>
Config['FIREBASE_HOSTNAME'] = {{ config.get('FIREBASE_HOSTNAME')|tojson }};
2014-10-02 01:14:54 +03:00
</script>
<script src="https://cdn.firebase.com/js/client/1.0.17/firebase.js"></script>
<script src="https://cdn.firebase.com/libs/firepad/1.0.0/firepad.min.js"></script>
<script src="{{ url_for('static', filename='js/collaboration/firepad.js') }}"></script>
2014-10-02 01:14:54 +03:00
{% endif %}
{% if config.get('COLLABORATION') == 'togetherjs' %}
<script src="{{ url_for('static', filename='js/collaboration/togetherjs.js') }}"></script>
<script src="https://togetherjs.com/togetherjs-min.js"></script>
2014-10-02 01:14:54 +03:00
{% endif %}
2013-10-01 07:10:10 +03:00
{% endblock %}
2014-09-10 17:58:35 +03:00
2013-10-01 07:10:10 +03:00
{% block body %}
2014-09-05 00:35:28 +03:00
<div id="app-wrap">
<div id="app-controls" class="row">
<div class="col-xs-4 col-md-3">
<input id="page-name" type="text" class="form-control input-sm" name="name"
placeholder="Name" value="{{- name -}}" />
2014-09-05 00:35:28 +03:00
</div>
<div class="col-xs-4 col-md-3">
<input id="page-message" type="text" class="form-control input-sm" name="page-message"
placeholder="Comment" value="" />
2014-09-05 00:35:28 +03:00
</div>
2013-10-01 07:10:10 +03:00
<div class="col-md-6 col-xs-4 text-right">
2014-10-02 01:14:54 +03:00
{% if config.get('COLLABORATION') %}
<div class="btn-group">
<button style='display:none' class="btn btn-danger btn-sm" id="end-collaboration">
<i class="fa fa-comments-o"></i>
<span class="hidden-xs">End Collaboration</span>
</button>
</div>
<div class="btn-group">
<button style='display:none' class="btn btn-default btn-sm" id="loading-collaboration" type="button">
<i class="fa fa-cog fa-spin"></i>
<span class="hidden-xs">Loading</span>
</button>
</div>
{% endif %}
2014-10-02 01:14:54 +03:00
<div class="dropdown btn-group">
<button class="btn btn-default btn-sm dropdown-toggle" type="button" id="editor-actions"
data-toggle="dropdown" title="Actions">
<i class="fa fa-cog"></i>
2015-12-07 01:17:44 +02:00
<span class="hidden-xs hidden-sm">Actions <i class="fa fa-caret-down"></i></span>
2014-09-05 00:35:28 +03:00
</button>
2013-10-10 01:32:43 +03:00
<ul class="dropdown-menu dropdown-menu-right" role="menu" aria-labelledby="editor-actions">
{% if config.get('COLLABORATION') %}
<li role="presentation">
<a role="menuitem" tabindex="-1" href="#" id="start-collaboration">Collaborate</a>
</li>
<li role="presentation" class="divider"></li>
{% endif %}
<li role="presentation">
<a role="menuitem" tabindex="-1" href="#" id="discard-draft-btn">Delete Draft</a>
</li>
<li role="presentation">
<a role="menuitem" tabindex="-1" href="#" id="delete-page-btn">Delete Page</a>
</li>
</ul>
</div>
2014-10-02 01:14:54 +03:00
<div class="dropdown btn-group">
<button id="theme-list-btn" type="button" class="dropdown-toggle btn btn-default btn-sm"
data-toggle="dropdown" title="Change Theme">
2014-10-02 01:14:54 +03:00
<i class="fa fa-paint-brush"></i>
2015-12-07 01:17:44 +02:00
<span class="hidden-xs hidden-sm">Theme <i class="fa fa-caret-down"></i></span>
</button>
<ul id="theme-list" class="dropdown-menu dropdown-menu-right" role="menu" aria-labelledby="theme-list">
<li><a tabindex="-1" href="#" data-value="chrome" >Chrome</a></li>
<li><a tabindex="-1" href="#" data-value="clouds" >Clouds</a></li>
<li><a tabindex="-1" href="#" data-value="clouds_midnight" >Clouds Midnight</a></li>
<li><a tabindex="-1" href="#" data-value="cobalt" >Cobalt</a></li>
<li><a tabindex="-1" href="#" data-value="crimson_editor" >Crimson Editor</a></li>
<li><a tabindex="-1" href="#" data-value="dawn" class="selected">Dawn</a></li>
<li><a tabindex="-1" href="#" data-value="dreamweaver" >Dreamweaver</a></li>
<li><a tabindex="-1" href="#" data-value="eclipse" >Eclipse</a></li>
<li><a tabindex="-1" href="#" data-value="idle_fingers" >idleFingers</a></li>
<li><a tabindex="-1" href="#" data-value="kr_theme" >krTheme</a></li>
<li><a tabindex="-1" href="#" data-value="merbivore" >Merbivore</a></li>
<li><a tabindex="-1" href="#" data-value="merbivore_soft" >Merbivore Soft</a></li>
<li><a tabindex="-1" href="#" data-value="mono_industrial" >Mono Industrial</a></li>
<li><a tabindex="-1" href="#" data-value="monokai" >Monokai</a></li>
<li><a tabindex="-1" href="#" data-value="pastel_on_dark">Pastel on Dark</a></li>
<li><a tabindex="-1" href="#" data-value="solarized_dark" >Solarized Dark</a></li>
<li><a tabindex="-1" href="#" data-value="solarized_light" >Solarized Light</a></li>
<li><a tabindex="-1" href="#" data-value="textmate" >TextMate</a></li>
<li><a tabindex="-1" href="#" data-value="tomorrow" >Tomorrow</a></li>
<li><a tabindex="-1" href="#" data-value="tomorrow_night">Tomorrow Night</a></li>
<li><a tabindex="-1" href="#" data-value="tomorrow_night_blue" >Tomorrow Night Blue</a></li>
<li><a tabindex="-1" href="#" data-value="tomorrow_night_bright" >Tomorrow Night Bright</a></li>
<li><a tabindex="-1" href="#" data-value="tomorrow_night_eighties" >Tomorrow Night 80s</a></li>
<li><a tabindex="-1" href="#" data-value="twilight" >Twilight</a></li>
<li><a tabindex="-1" href="#" data-value="vibrant_ink" >Vibrant Ink</a></li>
2014-09-05 00:35:28 +03:00
</ul>
</div>
<div class="btn-group">
2014-10-24 22:53:48 +03:00
{% if name in config['WIKI_LOCKED_PAGES'] %}
2014-09-26 19:58:06 +03:00
<a class="btn btn-danger btn-sm">
<i class="fa fa-lock"></i>
<span class="hidden-xs">Locked</span>
</a>
{% else %}
2014-10-02 01:14:54 +03:00
<a id="submit-btn" class="btn btn-primary btn-sm">
2014-09-26 19:58:06 +03:00
<i class="fa fa-save"></i>
2015-12-07 01:17:44 +02:00
<span class="hidden-xs">Save</span>
2014-09-26 19:58:06 +03:00
</a>
{% endif %}
2013-10-01 07:10:10 +03:00
</div>
2014-09-05 00:35:28 +03:00
</div>
</div>
2014-08-20 18:28:25 +03:00
<section class="entry-markdown active">
<header class="floatingheader" id="entry-markdown-header">
<small>Markdown</small>
<a class="markdown-help" href=""><span class="hidden">What is Markdown?</span></a>
</header>
<section id="entry-markdown-content" class="entry-markdown-content">
<div id="editor-{{ name }}" data-submitbtn='submit-btn' data-themeselect="theme-list" data-mode="markdown"
data-preview="preview" class="editor">{{ content }}</div>
</section>
</section>
<section class="entry-preview">
<header class="floatingheader" id="entry-preview-header">
<small>Preview</small>
</header>
<section class="entry-preview-content">
<div id="preview"></div>
</section>
</section>
2014-09-30 04:33:09 +03:00
2014-09-05 00:35:28 +03:00
</div>
2013-10-01 07:10:10 +03:00
{% endblock %}