This commit is contained in:
Matthew Scragg 2014-08-20 10:28:25 -05:00
parent d0777e2b85
commit b02d3db684
41 changed files with 426 additions and 647 deletions

View file

@ -1,14 +0,0 @@
{% extends 'layout.html' %}
{% block body %}
<h2>Account</h2>
<form method="POST" role="form">
<div class="form-group">
<label for="email" class="control-label">Email</label>
<input id="email" type="text" class="form-control" value="{{ session['user']['email'] }}" />
</div>
<input type="submit" class="btn btn-primary" value="Save">
</form>
{% endblock %}

View file

@ -1,17 +1,15 @@
{% extends 'layout.html' %}
{% block body %}
<h2>Login</h2>
<form role="form" method="post">
<form role="form" method="post" action="{{ url_for('auth.login') }}" data-parsley-validate>
<div class="form-group">
<label for="email">Email Address</label>
<input type="text" class="form-control" id="email" name="email" />
<label for="email">Email</label>
<input id="email" type="email" class="form-control" name="email" placeholder="Email" required />
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" name="password" id="password" class="form-control" />
<input type="password" name="password" id="password" class="form-control" placeholder="Password" min="6" required />
</div>
<input type="submit" class="btn btn-primary" value="Login" />

View file

@ -1,32 +1,29 @@
{% import 'macros.html' as macros %}
{% extends 'layout.html' %}
{% block body %}
<h2>Register</h2>
<form role="form" method="post">
<form role="form" method="post" action="{{ url_for('auth.register') }}" data-parsley-validate>
<div class="form-group">
<label for="username">Username</label>
<input type="text" class="form-control" id="username" name="username" />
<input id="username" type="text" class="form-control" name="username" placeholder="Username" required data-parsley-type="alphanum" />
</div>
<div class="form-group">
<label for="email">Email</label>
<input type="text" class="form-control" id="email" name="email" />
<input id="email" type="email" class="form-control" name="email" placeholder="Email" required />
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" name="password" id="password" class="form-control" />
<input type="password" name="password" id="password" class="form-control" placeholder="Password" required min="6"/>
</div>
<div class="form-group">
{{ macros.recaptcha(config) }}
<label for="password_again">Confirm Password</label>
<input type="password" name="password_again" id="password_again" class="form-control" placeholder="Password" required min="6"/>
</div>
<input type="submit" class="btn btn-primary" value="Submit" />
<input type="submit" class="btn btn-primary" value="Register" />
</form>
<a href="/login" class="pull-right">Already registered? Login here.</a>
{% endblock %}

View file

@ -8,7 +8,7 @@
<title>Realms</title>
<link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.ico') }}">
<link href="{{ url_for('static', filename='css/bootstrap/spacelab.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='css/bootstrap/flatly.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='css/font-awesome.min.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='vendor/highlightjs/styles/github.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='css/style.css') }}" rel="stylesheet">
@ -24,7 +24,7 @@
<body>
<!-- Fixed navbar -->
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar navbar-inverse">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
@ -36,21 +36,13 @@
</div>
<div class="navbar-collapse collapse navbar-inverse-collapse">
<ul class="nav navbar-nav">
<li><a href="{{ url_for('wiki.create') }}">New</a></li>
{% if name %}
<li><a href="{{ url_for('wiki.edit', name=name) }}">Edit</a></li>
<li><a href="{{ url_for('wiki.history', name=name) }}">History</a></li>
{% endif %}
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" role="menu" data-toggle="dropdown">Write
<i class="icon-caret-down"></i></a>
<ul class="dropdown-menu">
<li class="dropdown-header">Page Options</li>
<li><a href="{{ url_for('wiki.create') }}">Create Page</a></li>
{% if name %}
<li><a href="{{ url_for('wiki.edit', name=name) }}">Edit Page</a></li>
<li><a href="{{ url_for('wiki.history', name=name) }}">History</a></li>
{% endif %}
</ul>
</li>
{% if session.get('user') %}
<li class="dropdown user-avatar">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
@ -65,8 +57,8 @@
</ul>
</li>
{% else %}
<li><a href="{{ url_for('auth.login') }}"><i class="icon-user"></i> Login</a></li>
<li><a href="{{ url_for('auth.register') }}"><i class="icon-pencil"></i> Register</a></li>
<li><a href="{{ url_for('auth.login') }}"><i class="icon-user"></i> &nbsp;Login</a></li>
<li><a href="{{ url_for('auth.register') }}"><i class="icon-pencil"></i> &nbsp;Register</a></li>
{% endif %}
</ul>
</div><!--/.nav-collapse -->
@ -96,8 +88,7 @@
{% block body %}{% endblock %}
</div>
</div>
{% for bundle in bundles %}
{% for bundle in g.assets %}
{% assets bundle %}
<script type="text/javascript" src="{{ ASSET_URL }}"></script>
{% endassets %}

View file

@ -1,9 +0,0 @@
{% macro recaptcha(config) -%}
<script>
var RecaptchaOptions = {
theme : "{{ config.RECAPTCHA_OPTIONS['theme'] }}"
};
</script>
<script src="http://www.google.com/recaptcha/api/challenge?k={{ config.RECAPTCHA_PUBLIC_KEY }}">
</script>
{%- endmacro %}

View file

@ -4,7 +4,7 @@
<form role="form" method="post">
<div class="form-group">
<label for="name"></label>
<input id="name" type="text" class="form-control" id="page" name="name" placeholder="Name" value="{{- name -}}" />
<input id="name" type="text" class="form-control" name="name" placeholder="Page Name" value="{{- name -}}" />
</div>
<div class="form-group">

View file

@ -19,8 +19,8 @@
{% endif %}
TogetherJSConfig_on_ready = function () {
MDR.sanitize = true;
$("#preview").html('');
MDR.sanitize = true;
$("#preview").html('');
$("#start-togetherjs").addClass('btn-danger').html('End Collaboration').prop('disabled', false);
};
TogetherJSConfig_on_close = function () {
@ -47,13 +47,10 @@
{% endblock %}
<div id="app-wrap" class="container-fluid">
<div id="app-wrap">
<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/wiki/</span>
<input id="page-name" type="text" class="form-control input-sm" name="name" placeholder="Name" value="{{- name -}}" />
</div>
<input id="page-name" type="text" class="form-control input-sm" name="name" placeholder="Name" value="{{- name -}}" />
</div>
<div class="col-xs-3">
<input id="page-message" type="text" class="form-control input-sm" name="page-message" placeholder="Comment" value="" />
@ -69,38 +66,47 @@
<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/chrome" >Chrome</a></li>
<li><a tabindex="-1" href="#" data-value="ace/theme/clouds" >Clouds</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/cobalt" >Cobalt</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/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/dreamweaver" >Dreamweaver</a></li>
<li><a tabindex="-1" href="#" data-value="ace/theme/eclipse" >Eclipse</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/kr_theme" >krTheme</a></li>
<li><a tabindex="-1" href="#" data-value="ace/theme/merbivore" >Merbivore</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/mono_industrial" >Mono Industrial</a></li>
<li><a tabindex="-1" href="#" data-value="ace/theme/monokai" >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/solarized_dark" >Solarized Dark</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/textmate" >TextMate</a></li>
<li><a tabindex="-1" href="#" data-value="ace/theme/tomorrow" >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>
<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 id="editor">{{ content }}</div>
<div id="preview"></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 %}

View file

@ -44,7 +44,6 @@ $(function(){
$(".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){
@ -52,7 +51,7 @@ $(function(){
});
revs.reverse();
revs = revs.join("..");
location.href = "{{ url_for('wiki.page') }}/_compare/{{ name }}/" + revs;
location.href = "{{ config.BASE_URL }}/_compare/{{ name }}/" + revs;
});
});
</script>

View file

@ -1,19 +0,0 @@
{% 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 %}