renamed project
This commit is contained in:
parent
cba28239a2
commit
2bbeb52178
307 changed files with 4 additions and 4 deletions
20
realms/templates/account/index.html
Normal file
20
realms/templates/account/index.html
Normal file
|
@ -0,0 +1,20 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% block body %}
|
||||
|
||||
<h2>Account</h2>
|
||||
|
||||
<form method="POST" role="form" class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label for="email" class="col-md-2 control-label">Email</label>
|
||||
<div class="col-md-10">
|
||||
<input id="email" type="text" class="form-control" value="{{ session['user']['email'] }}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
<input type="submit" class="btn btn-primary" value="Save">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
20
realms/templates/account/login.html
Normal file
20
realms/templates/account/login.html
Normal file
|
@ -0,0 +1,20 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% block body %}
|
||||
|
||||
<h2>Login</h2>
|
||||
|
||||
<form role="form" method="post">
|
||||
<div class="form-group">
|
||||
<label for="email">Email Address</label>
|
||||
<input type="text" class="form-control" id="email" name="email" />
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="password">Password</label>
|
||||
<input type="password" name="password" id="password" class="form-control" />
|
||||
</div>
|
||||
|
||||
<input type="submit" class="btn btn-primary" value="Login" />
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
32
realms/templates/account/register.html
Normal file
32
realms/templates/account/register.html
Normal file
|
@ -0,0 +1,32 @@
|
|||
{% import 'macros.html' as macros %}
|
||||
{% extends 'layout.html' %}
|
||||
{% block body %}
|
||||
|
||||
<h2>Register</h2>
|
||||
|
||||
<form role="form" method="post">
|
||||
<div class="form-group">
|
||||
<label for="username">Username</label>
|
||||
<input type="text" class="form-control" id="username" name="username" />
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="email">Email</label>
|
||||
<input type="text" class="form-control" id="email" name="email" />
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="password">Password</label>
|
||||
<input type="password" name="password" id="password" class="form-control" />
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ macros.recaptcha(config) }}
|
||||
</div>
|
||||
|
||||
<input type="submit" class="btn btn-primary" value="Submit" />
|
||||
</form>
|
||||
|
||||
<a href="/login" class="pull-right">Already registered? Login here.</a>
|
||||
|
||||
{% endblock %}
|
6
realms/templates/errors/404.html
Normal file
6
realms/templates/errors/404.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% block body %}
|
||||
|
||||
<h1>Page Not Found</h1>
|
||||
|
||||
{% endblock %}
|
0
realms/templates/errors/500.html
Normal file
0
realms/templates/errors/500.html
Normal file
104
realms/templates/layout.html
Normal file
104
realms/templates/layout.html
Normal file
|
@ -0,0 +1,104 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<title>Realms</title>
|
||||
|
||||
<link href="/static/css/cerulean.bootstrap.min.css" rel="stylesheet">
|
||||
<link href="/static/css/font-awesome.min.css" rel="stylesheet">
|
||||
<link href="/static/css/style.css" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
body {
|
||||
padding-top: 60px;
|
||||
}
|
||||
</style>
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="/static/js/html5shiv.js"></script>
|
||||
<script src="/static/js/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- Fixed navbar -->
|
||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">Realms</a>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse navbar-inverse-collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
</ul>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li><a href="/create/"><i class="icon-plus"></i> Create</a></li>
|
||||
{% if session.get('user') %}
|
||||
<li class="dropdown user-avatar">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<span>
|
||||
<img src="http://static.ffxiah.com/images/avatars/mini/5a85e45e0976c8a96c955e83a9743b47.jpg" class="menu-avatar">
|
||||
<span>{{ session['user'].get('username') }} <i class="icon-caret-down"></i></span>
|
||||
</span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="/account">Account</a></li>
|
||||
<li><a href="/logout">Logout</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
{% else %}
|
||||
<li><a href="/login"><i class="icon-user"></i> Login</a></li>
|
||||
<li><a href="/register"><i class="icon-pencil"></i> Register</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container">
|
||||
<div id="main-body">
|
||||
{% with messages = get_flashed_messages(with_categories=True) %}
|
||||
{% if messages %}
|
||||
{% for category, message in messages %}
|
||||
{% if category == 'message' %}
|
||||
{% set category = "info" %}
|
||||
{% endif %}
|
||||
<div class='alert alert-{{ category }}'>
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
{{ message }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% block body %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/static/js/jquery-1.10.2.min.js"></script>
|
||||
<script src="/static/js/bootstrap.min.js"></script>
|
||||
<script src="/static/js/marked.js"></script>
|
||||
<script>
|
||||
marked.setOptions({
|
||||
gfm: true,
|
||||
tables: true,
|
||||
pedantic: false,
|
||||
sanitize: false,
|
||||
smartLists: true,
|
||||
smartypants: false,
|
||||
langPrefix: 'lang-'
|
||||
});
|
||||
var converter = marked;
|
||||
</script>
|
||||
{% block js %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
9
realms/templates/macros.html
Normal file
9
realms/templates/macros.html
Normal file
|
@ -0,0 +1,9 @@
|
|||
{% 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 %}
|
16
realms/templates/page/compare.html
Normal file
16
realms/templates/page/compare.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% block body %}
|
||||
|
||||
<h2>History for <strong>{{ name }}</strong></h2>
|
||||
<p>
|
||||
<a class="btn btn-default btn-sm" href="/history/{{ name }}">Back to History</a>
|
||||
<a href="" class="btn btn-default btn-sm">Revert Changes</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/page/create.html
Normal file
18
realms/templates/page/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 %}
|
76
realms/templates/page/edit.html
Normal file
76
realms/templates/page/edit.html
Normal file
|
@ -0,0 +1,76 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% block js %}
|
||||
<script src="/static/js/ace/ace.js"></script>
|
||||
<script src="/static/js/ace/mode-markdown.js"></script>
|
||||
<script src="/static/js/keymaster.min.js"></script>
|
||||
<script src="/static/js/dillinger.js"></script>
|
||||
{% endblock %}
|
||||
{% block body %}
|
||||
|
||||
<div id="app-wrap" class="container-fluid">
|
||||
<div id="app-controls" class="row">
|
||||
<div class="col-xs-3">
|
||||
<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="" />
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6">
|
||||
<div class="pull-right">
|
||||
|
||||
<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/dawn" 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>
|
||||
|
||||
|
||||
<!--
|
||||
<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>
|
||||
<div id="epiceditor"></div>
|
||||
<textarea name="content" id="content" class="form-control" placeholder="Content" style="display:none;">{{- content -}}</textarea>
|
||||
</div>
|
||||
|
||||
<input type="submit" class="btn btn-primary" value="Save" />
|
||||
</form>
|
||||
-->
|
||||
|
||||
{% endblock %}
|
58
realms/templates/page/history.html
Normal file
58
realms/templates/page/history.html
Normal file
|
@ -0,0 +1,58 @@
|
|||
{% 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'>{{ h.sha|truncate(7, True, end="") }}</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 = revs.join("...");
|
||||
location.href = "/compare/{{ name }}/" + revs;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
20
realms/templates/page/page.html
Normal file
20
realms/templates/page/page.html
Normal file
|
@ -0,0 +1,20 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% block body %}
|
||||
|
||||
<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>
|
||||
|
||||
<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 %}
|
Loading…
Add table
Add a link
Reference in a new issue