html indent fix

This commit is contained in:
Matthew Scragg 2014-09-04 16:35:28 -05:00
parent 10831a44e9
commit e4afc0fb0d
10 changed files with 171 additions and 188 deletions

View file

@ -1,8 +1,8 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% from 'macros.html' import render_form, render_field %} {% from 'macros.html' import render_form, render_field %}
{% block body %} {% block body %}
{% call render_form(form, action_url=url_for('auth.login'), action_text='Login', btn_class='btn btn-primary') %} {% call render_form(form, action_url=url_for('auth.login'), action_text='Login', btn_class='btn btn-primary') %}
{{ render_field(form.email, placeholder='Email', type='email', required=1) }} {{ render_field(form.email, placeholder='Email', type='email', required=1) }}
{{ render_field(form.password, placeholder='Password', type='password', required=1) }} {{ render_field(form.password, placeholder='Password', type='password', required=1) }}
{% endcall %} {% endcall %}
{% endblock %} {% endblock %}

View file

@ -1,13 +1,13 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% from 'macros.html' import render_form, render_field %} {% from 'macros.html' import render_form, render_field %}
{% block body %} {% block body %}
{% call render_form(form, action_url=url_for('auth.register'), action_text='Register', btn_class='btn btn-primary') %} {% call render_form(form, action_url=url_for('auth.register'), action_text='Register', btn_class='btn btn-primary') %}
{{ render_field(form.username, placeholder='Username', type='username', **{"required": 1, "data-parsley-type": "alphanum"}) }} {{ render_field(form.username, placeholder='Username', type='username', **{"required": 1, "data-parsley-type": "alphanum"}) }}
{{ render_field(form.email, placeholder='Email', type='email', required=1) }} {{ render_field(form.email, placeholder='Email', type='email', required=1) }}
{{ render_field(form.password, placeholder='Password', type='password', **{"required": 1, "data-parsley-minlength": "6"}) }} {{ render_field(form.password, placeholder='Password', type='password', **{"required": 1, "data-parsley-minlength": "6"}) }}
{{ render_field(form.confirm, placeholder='Confirm Password', type='password', **{"required": 1, "data-parsley-minlength": "6"}) }} {{ render_field(form.confirm, placeholder='Confirm Password', type='password', **{"required": 1, "data-parsley-minlength": "6"}) }}
{% if config.RECAPTCHA_ENABLE %} {% if config.RECAPTCHA_ENABLE %}
{{ render_field(form.recaptcha) }} {{ render_field(form.recaptcha) }}
{% endif %} {% endif %}
{% endcall %} {% endcall %}
{% endblock %} {% endblock %}

View file

@ -1,6 +1,6 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% block body %} {% block body %}
<h1>Page Not Found</h1> <h1>Page Not Found</h1>
{% endblock %} {% endblock %}

View file

@ -2,9 +2,9 @@
{% block title %}{{ title|escape }}{% endblock %} {% block title %}{{ title|escape }}{% endblock %}
{% block scripts %} {% block scripts %}
{% if traceback %} {% if traceback %}
<link rel="stylesheet" href="{{ static_url('vendor/highlightjs/default.css') }}" /> <link rel="stylesheet" href="{{ static_url('vendor/highlightjs/default.css') }}" />
<script src="{{ static_url('vendor/highlightjs/highlight.pack.js') }}"></script> <script src="{{ static_url('vendor/highlightjs/highlight.pack.js') }}"></script>
<script>hljs.initHighlightingOnLoad();</script> <script>hljs.initHighlightingOnLoad();</script>
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{% block content %} {% block content %}

View file

@ -12,7 +12,7 @@
{% for bundle in g.assets['css'] %} {% for bundle in g.assets['css'] %}
{% assets bundle %} {% assets bundle %}
<link href="{{ ASSET_URL }}" rel="stylesheet"> <link href="{{ ASSET_URL }}" rel="stylesheet">
{% endassets %} {% endassets %}
{% endfor %} {% endfor %}
{% block css %}{% endblock %} {% block css %}{% endblock %}

View file

@ -1,19 +1,16 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% block body %} {% block body %}
<h2>History for <strong>{{ name }}</strong></h2> <h2>History for <strong>{{ name }}</strong></h2>
<div class="pull-right"> <div class="pull-right">
<a href="{{ url_for('wiki.commit', name=name, sha=old) }}" class="btn btn-default btn-sm">View Old</a> <a href="{{ url_for('wiki.commit', name=name, sha=old) }}" class="btn btn-default btn-sm">View Old</a>
<a href="{{ url_for('wiki.commit', name=name, sha=new) }}" class="btn btn-info btn-sm">View New</a> <a href="{{ url_for('wiki.commit', name=name, sha=new) }}" class="btn btn-info btn-sm">View New</a>
</div> </div>
<p> <p>
<a class="btn btn-default btn-sm" href="{{ url_for('wiki.history', name=name) }}">Back to History</a> <a class="btn btn-default btn-sm" href="{{ url_for('wiki.history', name=name) }}">Back to History</a>
</p> </p>
{{ diff|safe }}
<p>
{{ diff|safe }} <a class="btn btn-default btn-sm" href="{{ url_for('wiki.history', name=name) }}">Back to History</a>
</p>
<p>
<a class="btn btn-default btn-sm" href="{{ url_for('wiki.history', name=name) }}">Back to History</a>
</p>
{% endblock %} {% endblock %}

View file

@ -1,18 +1,18 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% block body %} {% block body %}
<form role="form" method="post"> <form role="form" method="post">
<div class="form-group"> <div class="form-group">
<label for="name"></label> <label for="name"></label>
<input id="name" type="text" class="form-control" name="name" placeholder="Page Name" value="{{- name -}}" /> <input id="name" type="text" class="form-control" name="name" placeholder="Page Name" value="{{- name -}}" />
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="content"></label> <label for="content"></label>
<textarea name="content" id="content" class="form-control" placeholder="Content"></textarea> <textarea name="content" id="content" class="form-control" placeholder="Content"></textarea>
</div> </div>
<input type="submit" class="btn btn-primary" value="Save" /> <input type="submit" class="btn btn-primary" value="Save" />
</form> </form>
{% endblock %} {% endblock %}

View file

@ -1,112 +1,98 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% block js %} {% block js %}
<script> <script>
$(function(){ $(function(){
$("#start-togetherjs").click(function(){ $("#start-togetherjs").click(function(){
$(this).prop('disabled', true).html("Loading"); $(this).prop('disabled', true).html("Loading");
});
}); });
TogetherJSConfig_toolName = "Collaboration"; });
TogetherJSConfig_suppressJoinConfirmation = true; TogetherJSConfig_toolName = "Collaboration";
{% if session.get('user') %} TogetherJSConfig_suppressJoinConfirmation = true;
TogetherJSConfig_getUserName = function () { {% if current_user.is_authenticated() %}
return {{ session['user'].get('username')|tojson }}; TogetherJSConfig_getUserName = function () {
}; return {{ current_user.username|tojson }};
};
TogetherJSConfig_getUserAvatar = function () { TogetherJSConfig_getUserAvatar = function () {
return {{ session['user'].get('avatar')|tojson }}; return {{ current_user.avatar|tojson }};
}; };
{% endif %} {% endif %}
TogetherJSConfig_on_ready = function () { TogetherJSConfig_on_ready = function () {
MDR.sanitize = true; MDR.sanitize = true;
$("#preview").html(''); $("#preview").html('');
$("#start-togetherjs").addClass('btn-danger').html('End Collaboration').prop('disabled', false); $("#start-togetherjs").addClass('btn-danger').html('End Collaboration').prop('disabled', false);
}; };
TogetherJSConfig_on_close = function () { TogetherJSConfig_on_close = function () {
MDR.sanitize = false; MDR.sanitize = false;
$("#start-togetherjs").removeClass('btn-danger').html('Collaborate').prop('disabled', false); $("#start-togetherjs").removeClass('btn-danger').html('Collaborate').prop('disabled', false);
}; };
</script> </script>
<script src="https://togetherjs.com/togetherjs-min.js"></script> <script src="https://togetherjs.com/togetherjs-min.js"></script>
{% endblock %} {% endblock %}
{% block body %} {% block body %}
{% block css %} <div id="app-wrap">
<style> <div id="app-controls" class="row">
#main-body { <div class="col-xs-3">
background: inherit; <input id="page-name" type="text" class="form-control input-sm" name="name" placeholder="Name" value="{{- name -}}" />
border: inherit; </div>
padding: 0; <div class="col-xs-3">
-webkit-box-shadow: 0; <input id="page-message" type="text" class="form-control input-sm" name="page-message" placeholder="Comment" value="" />
-moz-box-shadow: 0; </div>
box-shadow: 0;
}
</style>
{% endblock %}
<div class="col-xs-6">
<div class="pull-right">
<div id="app-wrap"> <button class="btn btn-success btn-sm" id="start-togetherjs" type="button"
<div id="app-controls" class="row"> onclick="TogetherJS(this); return false">
<div class="col-xs-3"> Collaborate
<input id="page-name" type="text" class="form-control input-sm" name="name" placeholder="Name" value="{{- name -}}" /> </button>
</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"> <a href="#" id="drop6" role="button" class="dropdown-toggle btn btn-default btn-sm" data-toggle="dropdown">Theme <b class="caret"></b></a>
<div class="pull-right"> <ul id="theme-list" class="dropdown-menu" role="menu" aria-labelledby="drop6">
<li><a tabindex="-1" href="#" data-value="ace/theme/chrome" >Chrome</a></li>
<button class="btn btn-success btn-sm" id="start-togetherjs" type="button" <li><a tabindex="-1" href="#" data-value="ace/theme/clouds" >Clouds</a></li>
onclick="TogetherJS(this); return false"> <li><a tabindex="-1" href="#" data-value="ace/theme/clouds_midnight" >Clouds Midnight</a></li>
Collaborate <li><a tabindex="-1" href="#" data-value="ace/theme/cobalt" >Cobalt</a></li>
</button> <li><a tabindex="-1" href="#" data-value="ace/theme/crimson_editor" >Crimson Editor</a></li>
<li><a tabindex="-1" href="#" data-value="ace/theme/dawn" class="selected">Dawn</a></li>
<a href="#" id="drop6" role="button" class="dropdown-toggle btn btn-default btn-sm" data-toggle="dropdown">Theme <b class="caret"></b></a> <li><a tabindex="-1" href="#" data-value="ace/theme/dreamweaver" >Dreamweaver</a></li>
<ul id="theme-list" class="dropdown-menu" role="menu" aria-labelledby="drop6"> <li><a tabindex="-1" href="#" data-value="ace/theme/eclipse" >Eclipse</a></li>
<li><a tabindex="-1" href="#" data-value="ace/theme/chrome" >Chrome</a></li> <li><a tabindex="-1" href="#" data-value="ace/theme/idle_fingers" >idleFingers</a></li>
<li><a tabindex="-1" href="#" data-value="ace/theme/clouds" >Clouds</a></li> <li><a tabindex="-1" href="#" data-value="ace/theme/kr_theme" >krTheme</a></li>
<li><a tabindex="-1" href="#" data-value="ace/theme/clouds_midnight" >Clouds Midnight</a></li> <li><a tabindex="-1" href="#" data-value="ace/theme/merbivore" >Merbivore</a></li>
<li><a tabindex="-1" href="#" data-value="ace/theme/cobalt" >Cobalt</a></li> <li><a tabindex="-1" href="#" data-value="ace/theme/merbivore_soft" >Merbivore Soft</a></li>
<li><a tabindex="-1" href="#" data-value="ace/theme/crimson_editor" >Crimson Editor</a></li> <li><a tabindex="-1" href="#" data-value="ace/theme/mono_industrial" >Mono Industrial</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/monokai" >Monokai</a></li>
<li><a tabindex="-1" href="#" data-value="ace/theme/dreamweaver" >Dreamweaver</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/eclipse" >Eclipse</a></li> <li><a tabindex="-1" href="#" data-value="ace/theme/solarized_dark" >Solarized Dark</a></li>
<li><a tabindex="-1" href="#" data-value="ace/theme/idle_fingers" >idleFingers</a></li> <li><a tabindex="-1" href="#" data-value="ace/theme/solarized_light" >Solarized Light</a></li>
<li><a tabindex="-1" href="#" data-value="ace/theme/kr_theme" >krTheme</a></li> <li><a tabindex="-1" href="#" data-value="ace/theme/textmate" >TextMate</a></li>
<li><a tabindex="-1" href="#" data-value="ace/theme/merbivore" >Merbivore</a></li> <li><a tabindex="-1" href="#" data-value="ace/theme/tomorrow" >Tomorrow</a></li>
<li><a tabindex="-1" href="#" data-value="ace/theme/merbivore_soft" >Merbivore Soft</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/mono_industrial" >Mono Industrial</a></li> <li><a tabindex="-1" href="#" data-value="ace/theme/tomorrow_night_blue" >Tomorrow Night Blue</a></li>
<li><a tabindex="-1" href="#" data-value="ace/theme/monokai" >Monokai</a></li> <li><a tabindex="-1" href="#" data-value="ace/theme/tomorrow_night_bright" >Tomorrow Night Bright</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/tomorrow_night_eighties" >Tomorrow Night 80s</a></li>
<li><a tabindex="-1" href="#" data-value="ace/theme/solarized_dark" >Solarized Dark</a></li> <li><a tabindex="-1" href="#" data-value="ace/theme/twilight" >Twilight</a></li>
<li><a tabindex="-1" href="#" data-value="ace/theme/solarized_light" >Solarized Light</a></li> <li><a tabindex="-1" href="#" data-value="ace/theme/vibrant_ink" >Vibrant Ink</a></li>
<li><a tabindex="-1" href="#" data-value="ace/theme/textmate" >TextMate</a></li> </ul>
<li><a tabindex="-1" href="#" data-value="ace/theme/tomorrow" >Tomorrow</a></li> <a id="save-native" class="btn btn-primary btn-sm"><i class="icon-save"></i> Save</a>
<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" >Tomorrow Night Blue</a></li>
<li><a tabindex="-1" href="#" data-value="ace/theme/tomorrow_night_bright" >Tomorrow Night Bright</a></li>
<li><a tabindex="-1" href="#" data-value="ace/theme/tomorrow_night_eighties" >Tomorrow Night 80s</a></li>
<li><a tabindex="-1" href="#" data-value="ace/theme/twilight" >Twilight</a></li>
<li><a tabindex="-1" href="#" data-value="ace/theme/vibrant_ink" >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>
</div>
<div class="row" style="position: relative; height: 100%; margin-left: 15px; margin-right: 15px;">
<div class="col-xs-6" style="position: absolute; bottom: 20px; top: 10px; left:0;border-right: 2px solid transparent;">
<div id="editor">{{ content }}</div>
</div>
<div class="col-xs-6" style="position: absolute; bottom: 20px; top: 10px; right:0; border-left: 2px solid transparent;">
<div id="preview"></div>
</div>
</div>
</div> </div>
<div class="row" style="position: relative; height: 100%; margin-left: 15px; margin-right: 15px;">
<div class="col-xs-6" style="position: absolute; bottom: 20px; top: 10px; left:0;border-right: 2px solid transparent;">
<div id="editor">{{ content }}</div>
</div>
<div class="col-xs-6" style="position: absolute; bottom: 20px; top: 10px; right:0; border-left: 2px solid transparent;">
<div id="preview"></div>
</div>
</div>
</div>
{% endblock %} {% endblock %}

View file

@ -1,58 +1,58 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% block body %} {% block body %}
<h2>History for <strong>{{ name }}</strong></h2> <h2>History for <strong>{{ name }}</strong></h2>
<p> <p>
<a class="btn btn-default btn-sm compare-revisions">Compare Revisions</a> <a class="btn btn-default btn-sm compare-revisions">Compare Revisions</a>
</p> </p>
<table class="table table-bordered revision-tbl"> <table class="table table-bordered revision-tbl">
<thead> <thead>
<tr> <tr>
<th></th> <th></th>
<th>Name</th> <th>Name</th>
<th>Revision Message</th> <th>Revision Message</th>
<th>Date</th> <th>Date</th>
</tr> </tr>
</thead> </thead>
{% for h in history %} {% for h in history %}
<tr> <tr>
<td class="checkbox-cell text-center"> <td class="checkbox-cell text-center">
<input type="checkbox" name="versions[]" value="{{ h.sha }}" /> <input type="checkbox" name="versions[]" value="{{ h.sha }}" />
</td> </td>
<td>{{ h.author }}</td> <td>{{ h.author }}</td>
<td><a href="{{ url_for('wiki.commit', name=name, sha=h.sha) }}" class='label label-primary'>View</a> {{ h.message }} </td> <td><a href="{{ url_for('wiki.commit', name=name, sha=h.sha) }}" class='label label-primary'>View</a> {{ h.message }} </td>
<td>{{ h.time|datetime }}</td> <td>{{ h.time|datetime }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>
<p> <p>
<a class="btn btn-default btn-sm compare-revisions">Compare Revisions</a> <a class="btn btn-default btn-sm compare-revisions">Compare Revisions</a>
</p> </p>
{% endblock %} {% endblock %}
{% block js %} {% block js %}
<script> <script>
$(function(){ $(function(){
$('.revision-tbl :checkbox').change(function () { $('.revision-tbl :checkbox').change(function () {
var $cs=$(this).closest('.revision-tbl').find(':checkbox:checked'); var $cs=$(this).closest('.revision-tbl').find(':checkbox:checked');
if ($cs.length > 2) { if ($cs.length > 2) {
this.checked=false; this.checked=false;
} }
}); });
$(".compare-revisions").click(function(){ $(".compare-revisions").click(function(){
var $cs = $('.revision-tbl').find(':checkbox:checked'); var $cs = $('.revision-tbl').find(':checkbox:checked');
if ($cs.length != 2) return; if ($cs.length != 2) return;
var revs = []; var revs = [];
$.each($cs, function(i, v){ $.each($cs, function(i, v){
revs.push(v.value); revs.push(v.value);
}); });
revs.reverse(); revs.reverse();
revs = revs.join(".."); revs = revs.join("..");
location.href = "{{ config.BASE_URL }}/_compare/{{ name }}/" + revs; location.href = "{{ config.BASE_URL }}/_compare/{{ name }}/" + revs;
});
}); });
}); </script>
</script>
{% endblock %} {% endblock %}

View file

@ -1,30 +1,30 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% block page_menu %} {% block page_menu %}
<div class="controls pull-right"> <div class="controls pull-right">
<a class="btn btn-default btn-sm" href="{{ url_for('wiki.edit', name=name) }}">Edit</a> <a class="btn btn-default btn-sm" href="{{ url_for('wiki.edit', name=name) }}">Edit</a>
<a class="btn btn-default btn-sm" href="{{ url_for('wiki.history', name=name) }}">History</a> <a class="btn btn-default btn-sm" href="{{ url_for('wiki.history', name=name) }}">History</a>
</div> </div>
{% endblock %} {% endblock %}
{% block body %} {% block body %}
{% if commit %} {% if commit %}
<div id="page-action-bar"> <div id="page-action-bar">
<form method="POST" action="{{ url_for('wiki.revert') }}"> <form method="POST" action="{{ url_for('wiki.revert') }}">
<input type="hidden" value="{{ name }}" name="name" /> <input type="hidden" value="{{ name }}" name="name" />
<input type="hidden" value="{{ commit }}" name="commit" /> <input type="hidden" value="{{ commit }}" name="commit" />
<input type="submit" class="btn btn-danger btn-sm" title="Revert back to this revision" value="Revert" /> <input type="submit" class="btn btn-danger btn-sm" title="Revert back to this revision" value="Revert" />
</form> </form>
</div>
{% endif %}
<div id="page-content" style="display:none">
{{ page.data }}
</div> </div>
{% endif %}
<div id="page-content" style="display:none">
{{ page.data }}
</div>
{% endblock %} {% endblock %}
{% block js %} {% block js %}
<script> <script>
$(function(){ $(function(){
$("#page-content").html(MDR.convert({{ page.data|tojson|safe }})).show(); $("#page-content").html(MDR.convert({{ page.data|tojson|safe }})).show();
}); });
</script> </script>
{% endblock %} {% endblock %}