various updates
This commit is contained in:
parent
86cb2d7c13
commit
2233205e0e
14 changed files with 259 additions and 80 deletions
20
reimagine/templates/account/login.html
Normal file
20
reimagine/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="username">Username or Email</label>
|
||||
<input type="text" class="form-control" id="username" name="username" />
|
||||
</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 %}
|
30
reimagine/templates/account/register.html
Normal file
30
reimagine/templates/account/register.html
Normal file
|
@ -0,0 +1,30 @@
|
|||
{% 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>
|
||||
|
||||
{% endblock %}
|
|
@ -6,7 +6,7 @@
|
|||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<title>Reborn</title>
|
||||
<title>ReImagine</title>
|
||||
|
||||
<link href="/static/css/cerulean.bootstrap.min.css" rel="stylesheet">
|
||||
<link href="/static/css/font-awesome.min.css" rel="stylesheet">
|
||||
|
@ -14,7 +14,7 @@
|
|||
|
||||
<style>
|
||||
body {
|
||||
padding-top: 70px;
|
||||
padding-top: 60px;
|
||||
}
|
||||
</style>
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
|
@ -35,15 +35,18 @@
|
|||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">Reimagine</a>
|
||||
<a class="navbar-brand" href="/">ReImagine</a>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
</ul>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li><a>Create</a></li>
|
||||
<li><a href="/edit{{- request.path -}}">Edit</a></li>
|
||||
<li><a href="/login">Login</a></li>
|
||||
<li><a href="/create/"><i class="icon-plus"></i> Create</a></li>
|
||||
{% if name %}
|
||||
<li><a href="/edit/{{- name -}}"><i class="icon-edit"></i> Edit</a></li>
|
||||
<li><a href="/history/{{- name -}}"><i class="icon-time"></i> History</a></li>
|
||||
{% endif %}
|
||||
<li><a href="/login"><i class="icon-user"></i> Login</a></li>
|
||||
</ul>
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
|
@ -54,15 +57,18 @@
|
|||
<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>
|
||||
{% block js %}{% endblock %}
|
||||
<script>
|
||||
marked.setOptions({
|
||||
gfm: true,
|
||||
tables: true,
|
||||
pedantic: false,
|
||||
sanitize: false,
|
||||
smartLists: true,
|
||||
smartypants: false,
|
||||
langPrefix: 'lang-'
|
||||
});
|
||||
var converter = marked;
|
||||
$(function(){
|
||||
$(".markdown").each(function(){
|
||||
var md = converter($(this).html());
|
||||
$(this).html(md);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% block js %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
|
|
9
reimagine/templates/macros.html
Normal file
9
reimagine/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 %}
|
|
@ -4,27 +4,16 @@
|
|||
<script src="/static/js/ace/mode-markdown.js"></script>
|
||||
<script src="/static/js/keymaster.min.js"></script>
|
||||
<script src="/static/js/dillinger.js"></script>
|
||||
<script>
|
||||
$(function(){
|
||||
$("#save").click(function(){
|
||||
$(this).prop('disable', true);
|
||||
var data = {
|
||||
name: $("#page-name").val(),
|
||||
content: editor.getSession().getValue()
|
||||
}
|
||||
$.post(window.location, data, function(){
|
||||
location.href = "/" + data['name'];
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% block body %}
|
||||
|
||||
<div id="app-wrap" class="container-fluid">
|
||||
<div id="app-controls" class="row">
|
||||
<div class="col-xs-6">
|
||||
<input id="page-name" type="text" class="form-control" id="page" name="name" placeholder="Name" value="{{- name -}}" />
|
||||
<div class="col-xs-3">
|
||||
<input id="page-name" type="text" class="form-control" name="name" placeholder="Name" value="{{- name -}}" />
|
||||
</div>
|
||||
<div class="col-xs-3">
|
||||
<input id="page-message" type="text" class="form-control" name="page-message" placeholder="Comment" value="" />
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6">
|
||||
|
|
16
reimagine/templates/page/history.html
Normal file
16
reimagine/templates/page/history.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% block body %}
|
||||
|
||||
<h2>History</h2>
|
||||
<table class="table table-bordered">
|
||||
{% for h in history %}
|
||||
<tr>
|
||||
<td class="checkbox-cell text-center"><input type="checkbox" /></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>
|
||||
|
||||
{% endblock %}
|
|
@ -1,6 +1,15 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% block body %}
|
||||
|
||||
<div class="markdown">{{- page.data|safe -}}</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