diff --git a/isso/comment.py b/isso/comment.py index 060ffc9..0feb230 100644 --- a/isso/comment.py +++ b/isso/comment.py @@ -39,7 +39,7 @@ def create(app, environ, request, path): md5 = rv.md5 rv.text = app.markup.convert(rv.text) - response = Response(json.dumps(rv), 201, content_type='application/json') + response = Response(json.dumps(rv), 202 if rv.pending else 201, content_type='application/json') response.set_cookie('session-%s-%s' % (urllib.quote(path, ''), rv.id), app.signer.dumps([path, rv.id, md5]), max_age=app.MAX_AGE) return response diff --git a/isso/js/isso.js b/isso/js/isso.js index 0eec7bb..def054f 100644 --- a/isso/js/isso.js +++ b/isso/js/isso.js @@ -91,7 +91,7 @@ function form(id, appendfunc, eventfunc) { var formid = 'issoform' + (id ? ('_' + id) : ''), form = '
') + return; + } + + $('header', node).append(' '); + if (post['mode'] == 2 ) + $('helpers', node).append('Kommentar muss noch freigeschaltet werden'); + + $('div', node).append(post['text']); + + $('footer', node).append( + 'Antworten' + + '#' + post['id'] + '' + + '' + ) + + // pending notification + if (post['mode'] == 2 ) { + $('#isso_' + post['id'] + ' header') + .append('Kommentar muss noch freigeschaltet werden'); + } if (read('session-' + path + '-' + post['id'])) { $('#isso_' + post['id'] + '> footer > a:first-child') @@ -225,10 +248,11 @@ function insert(post) { parent: post['id'] }, function(status, rv) { $('#issoform_' + post['id']).remove(); - - if (status == 201) { + if (status == 201 || status == 202) { insert(JSON.parse(rv)); - } // XXX else ... + } else { + alert("Mööp."); + }; }); }); } else { @@ -260,7 +284,7 @@ function initialize(thread) { website: $('input[id="website"]').val() || null, parent: null }, function(status, rv) { - if (status == 201) { + if (status == 201 || status == 202) { insert(JSON.parse(rv)); } }); diff --git a/isso/static/style.css b/isso/static/style.css index 7b648eb..5db7228 100644 --- a/isso/static/style.css +++ b/isso/static/style.css @@ -8,18 +8,37 @@ margin-top: 18px; } +.isso footer a, .isso header a { + color: #111111; + font-family: Palatino, "times new roman", serif; + font-weight: bold; + font-size: 0.95em; + text-decoration: none; +} + +.isso footer a:hover, .isso header a:hover { + color: #111111; + text-shadow: #aaaaaa 0px 0px 1px; +} + .isso .author { font-weight: bold; } .isso time { color: lightgray; + float: right; } .isso > header { border-bottom: solid 1px lightgray; } +.isso > header .note { + float: right; + color: gray; +} + .isso > footer > a { padding: 0 10px 10px 0; }