Skip to content

Commit

Permalink
fix #28 -- fallback for non-html posts
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jan 12, 2015
1 parent 66f22cc commit 9341eee
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 65 deletions.
50 changes: 0 additions & 50 deletions SITE/comet_users.json

This file was deleted.

17 changes: 17 additions & 0 deletions comet/data/comet_assets/css/comet.css
Expand Up @@ -3,6 +3,8 @@
* See /LICENSE for licensing information.
*/

/* global styles */

.save-btn, .save-icon {
transition: all 0.5s ease;
}
Expand All @@ -11,10 +13,14 @@
text-align: center;
}

/* index */

.list-group.posts, .list-group.pages {
margin-top: 22px;
}

/* edit */

#post-meta-line, #toolbar, #post-meta-panel, #content-area {
margin-top: 10px;
}
Expand Down Expand Up @@ -49,6 +55,13 @@
border-color: #66afe9;
}

.markup-warning {
vertical-align: middle;
float: none !important;
}

/* user management */

.inactive-user .username, .inactive-user .realname {
text-decoration: line-through;
}
Expand All @@ -61,10 +74,14 @@ table.users .uid {
vertical-align: middle !important;
}

/* permission management */

.perm, .select_all {
text-align: center;
}

/* login (copied from Bootstrap example) */

.form-signin {
max-width: 330px;
padding: 15px;
Expand Down
14 changes: 0 additions & 14 deletions comet/data/comet_users.json

This file was deleted.

1 change: 1 addition & 0 deletions comet/data/templates/mako/comet_account.tmpl
@@ -1,3 +1,4 @@
## -*- coding: utf-8 -*-
<%inherit file="base.tmpl"/>
<%block name="extra_js">
% if action == 'save':
Expand Down
1 change: 1 addition & 0 deletions comet/data/templates/mako/comet_error.tmpl
@@ -1,3 +1,4 @@
## -*- coding: utf-8 -*-
<%inherit file="base.tmpl"/>
<%block name="extra_head">
</%block>
Expand Down
1 change: 1 addition & 0 deletions comet/data/templates/mako/comet_index.tmpl
@@ -1,3 +1,4 @@
## -*- coding: utf-8 -*-
<%inherit file="base.tmpl"/>
<%block name="extra_js">
<script>
Expand Down
1 change: 1 addition & 0 deletions comet/data/templates/mako/comet_login.tmpl
@@ -1,3 +1,4 @@
## -*- coding: utf-8 -*-
<%inherit file="base.tmpl"/>
<%block name="content">
% if alert:
Expand Down
9 changes: 8 additions & 1 deletion comet/data/templates/mako/comet_post_edit.tmpl
@@ -1,3 +1,4 @@
## -*- coding: utf-8 -*-
<%inherit file="base.tmpl"/>
<%block name="extra_js">
% if action == 'save':
Expand Down Expand Up @@ -45,6 +46,7 @@
<div id="toolbar" class="btn-toolbar">
<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>

% if is_html:
<div class="btn-group">
<a class="btn btn-default btn-sm" data-wysihtml5-command="bold" title="CTRL+B"><i class="fa fa-bold"></i></a>
<a class="btn btn-default btn-sm" data-wysihtml5-command="italic" title="CTRL+I"><i class="fa fa-italic"></i></a>
Expand Down Expand Up @@ -96,10 +98,14 @@
</select>
</label>
</div>
</div>
% else:
<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>
% endif
</div>

<textarea name="content" id="content-area" class="form-control" rows="24">${post_content}</textarea>
</form>
% if is_html:
<script src="/bower_components/wysihtml/dist/wysihtml5x-toolbar.min.js"></script>
<script src="/bower_components/wysihtml/parser_rules/advanced_and_extended.js"></script>
<script type="text/javascript">
Expand All @@ -109,4 +115,5 @@
stylesheets: ['/comet_assets/css/wysihtml5x.css']
});
</script>
% endif
</%block>
1 change: 1 addition & 0 deletions comet/data/templates/mako/comet_users.tmpl
@@ -1,3 +1,4 @@
## -*- coding: utf-8 -*-
<%inherit file="base.tmpl"/>
<%block name="extra_js">
% if action == 'save':
Expand Down
1 change: 1 addition & 0 deletions comet/data/templates/mako/comet_users_edit.tmpl
@@ -1,3 +1,4 @@
## -*- coding: utf-8 -*-
<%inherit file="base.tmpl"/>
<%block name="extra_js">
% if action == 'save':
Expand Down
1 change: 1 addition & 0 deletions comet/data/templates/mako/comet_users_permissions.tmpl
@@ -1,3 +1,4 @@
## -*- coding: utf-8 -*-
<%inherit file="base.tmpl"/>
<%block name="extra_js">
<script>
Expand Down
1 change: 1 addition & 0 deletions comet/web.py
Expand Up @@ -565,6 +565,7 @@ def edit(path):
context['current_auid'] = int(post.meta('author.uid') or current_user.uid)
context['title'] = 'Editing {0}'.format(post.title())
context['permalink'] = '/edit/' + path
context['is_html'] = post.compiler.name == 'html'
return render('comet_post_edit.tmpl', context)


Expand Down

0 comments on commit 9341eee

Please sign in to comment.