Skip to content

Commit 9341eee

Browse files
committedJan 12, 2015
fix #28 -- fallback for non-html posts
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
1 parent 66f22cc commit 9341eee

12 files changed

+33
-65
lines changed
 

‎SITE/comet_users.json

-50
This file was deleted.

‎comet/data/comet_assets/css/comet.css

+17
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* See /LICENSE for licensing information.
44
*/
55

6+
/* global styles */
7+
68
.save-btn, .save-icon {
79
transition: all 0.5s ease;
810
}
@@ -11,10 +13,14 @@
1113
text-align: center;
1214
}
1315

16+
/* index */
17+
1418
.list-group.posts, .list-group.pages {
1519
margin-top: 22px;
1620
}
1721

22+
/* edit */
23+
1824
#post-meta-line, #toolbar, #post-meta-panel, #content-area {
1925
margin-top: 10px;
2026
}
@@ -49,6 +55,13 @@
4955
border-color: #66afe9;
5056
}
5157

58+
.markup-warning {
59+
vertical-align: middle;
60+
float: none !important;
61+
}
62+
63+
/* user management */
64+
5265
.inactive-user .username, .inactive-user .realname {
5366
text-decoration: line-through;
5467
}
@@ -61,10 +74,14 @@ table.users .uid {
6174
vertical-align: middle !important;
6275
}
6376

77+
/* permission management */
78+
6479
.perm, .select_all {
6580
text-align: center;
6681
}
6782

83+
/* login (copied from Bootstrap example) */
84+
6885
.form-signin {
6986
max-width: 330px;
7087
padding: 15px;

‎comet/data/comet_users.json

-14
This file was deleted.

‎comet/data/templates/mako/comet_account.tmpl

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
## -*- coding: utf-8 -*-
12
<%inherit file="base.tmpl"/>
23
<%block name="extra_js">
34
% if action == 'save':

‎comet/data/templates/mako/comet_error.tmpl

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
## -*- coding: utf-8 -*-
12
<%inherit file="base.tmpl"/>
23
<%block name="extra_head">
34
</%block>

‎comet/data/templates/mako/comet_index.tmpl

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
## -*- coding: utf-8 -*-
12
<%inherit file="base.tmpl"/>
23
<%block name="extra_js">
34
<script>

‎comet/data/templates/mako/comet_login.tmpl

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
## -*- coding: utf-8 -*-
12
<%inherit file="base.tmpl"/>
23
<%block name="content">
34
% if alert:

‎comet/data/templates/mako/comet_post_edit.tmpl

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
## -*- coding: utf-8 -*-
12
<%inherit file="base.tmpl"/>
23
<%block name="extra_js">
34
% if action == 'save':
@@ -45,6 +46,7 @@
4546
<div id="toolbar" class="btn-toolbar">
4647
<div class="btn-group"><button type="submit" class="btn btn-sm btn-primary save-btn"><i class="fa fa-save fa-fw save-icon"></i> Save</button></div>
4748

49+
% if is_html:
4850
<div class="btn-group">
4951
<a class="btn btn-default btn-sm" data-wysihtml5-command="bold" title="CTRL+B"><i class="fa fa-bold"></i></a>
5052
<a class="btn btn-default btn-sm" data-wysihtml5-command="italic" title="CTRL+I"><i class="fa fa-italic"></i></a>
@@ -96,10 +98,14 @@
9698
</select>
9799
</label>
98100
</div>
99-
</div>
101+
% else:
102+
<div class="btn-group btn btn-sm disabled markup-warning text-warning"><i class="fa fa-warning"></i> Format: <strong>${post.compiler.name}</strong> — editor unavailable</div>
103+
% endif
104+
</div>
100105

101106
<textarea name="content" id="content-area" class="form-control" rows="24">${post_content}</textarea>
102107
</form>
108+
% if is_html:
103109
<script src="/bower_components/wysihtml/dist/wysihtml5x-toolbar.min.js"></script>
104110
<script src="/bower_components/wysihtml/parser_rules/advanced_and_extended.js"></script>
105111
<script type="text/javascript">
@@ -109,4 +115,5 @@
109115
stylesheets: ['/comet_assets/css/wysihtml5x.css']
110116
});
111117
</script>
118+
% endif
112119
</%block>

‎comet/data/templates/mako/comet_users.tmpl

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
## -*- coding: utf-8 -*-
12
<%inherit file="base.tmpl"/>
23
<%block name="extra_js">
34
% if action == 'save':

‎comet/data/templates/mako/comet_users_edit.tmpl

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
## -*- coding: utf-8 -*-
12
<%inherit file="base.tmpl"/>
23
<%block name="extra_js">
34
% if action == 'save':

‎comet/data/templates/mako/comet_users_permissions.tmpl

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
## -*- coding: utf-8 -*-
12
<%inherit file="base.tmpl"/>
23
<%block name="extra_js">
34
<script>

‎comet/web.py

+1
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,7 @@ def edit(path):
565565
context['current_auid'] = int(post.meta('author.uid') or current_user.uid)
566566
context['title'] = 'Editing {0}'.format(post.title())
567567
context['permalink'] = '/edit/' + path
568+
context['is_html'] = post.compiler.name == 'html'
568569
return render('comet_post_edit.tmpl', context)
569570

570571

0 commit comments

Comments
 (0)
Please sign in to comment.