Changeset 1304:7148358f6d8d
- Timestamp:
- 01/11/10 23:41:00 (2 years ago)
- Branch:
- default
- rebase_source:
- eb8b8bc2f5191339c815cffe75463873380a1be8
- Location:
- zine
- Files:
-
- 3 edited
-
shared/admin/style.css (modified) (2 diffs)
-
shared/js/Admin.js (modified) (3 diffs)
-
views/admin.py (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
zine/shared/admin/style.css
r1294 r1304 829 829 div.contents div.notification-messages { 830 830 position: fixed; 831 top: 10px;832 right: 20px;831 top: 0; 832 right: 10px; 833 833 width: 250px; 834 height: 0px; 834 835 font-size: 13px; 835 836 } … … 837 838 div.contents div.message { 838 839 border: 1px solid #B4D2E7; 839 margin: 0 -10px 10px -10px;840 margin: 10px 0; 840 841 padding: 8px 8px 8px 32px; 841 842 -moz-border-radius: 3px; -
zine/shared/js/Admin.js
r1294 r1304 14 14 (function() { 15 15 var shuttingDown = false; 16 var active = false; 17 var msg = null, left, top, right, bottom; 16 var hiddenMsg = null, left, top, right, bottom; 18 17 var messages = $('div.message').hide().fadeIn('slow'); 19 18 20 19 function fadeInMsg() { 21 if (msg) 22 msg.css('visibility', 'visible').animate({'opacity': '1.0'}, 'fast'); 23 msg = null; 20 hiddenMsg.css('visibility', 'visible').animate({opacity: '1.0'}); 21 hiddenMsg = null; 24 22 } 25 23 … … 27 25 if (shuttingDown && !$(this).is('.message-error')) 28 26 return; 29 if ( msg)27 if (hiddenMsg) 30 28 fadeInMsg(); 31 msg = $(this);29 var msg = $(this); 32 30 var pos = msg.offset(); 33 31 left = pos.left - 2, top = pos.top - 2; … … 36 34 bottom = top + msg.height() + parseInt(msg.css('padding-top')) + 37 35 parseInt(msg.css('padding-bottom')) + 4; 38 msg.animate({ 39 opacity: '0.01' 40 }, 'fast', function() { msg.css('visibility', 'hidden'); }); 36 msg.animate({opacity: '0.01'}, 'fast', function() { 37 hiddenMsg = msg; 38 hiddenMsg.css('visibility', 'hidden'); 39 }); 41 40 }); 42 41 43 42 $(document).mousemove(function(evt) { 44 if (! msg)43 if (!hiddenMsg) 45 44 return; 46 45 if (evt.clientX < left || evt.clientX > right || -
zine/views/admin.py
r1287 r1304 153 153 ('import', url_for('admin/import'), _(u'Import')), 154 154 ('export', url_for('admin/export'), _(u'Export')), 155 ('log', url_for('admin/log'), _( 'Log'))155 ('log', url_for('admin/log'), _(u'Log')) 156 156 ] 157 157 … … 181 181 request.user.has_privilege(BLOG_ADMIN): 182 182 flash(_(u'Zine is in maintenance mode. Don\'t forget to ' 183 u' <a href="%s">turn it off again</a>once you finish your '183 u'turn it off again once you finish your ' 184 184 u'changes.') % url_for('admin/maintenance')) 185 185 … … 251 251 for url in form.find_new_links(): 252 252 host = urlparse(url)[1].decode('utf-8', 'ignore') 253 html_url = '<a href="%s">%s</a>' % (254 escape(url, True),255 escape(host)256 )257 253 try: 258 254 pingback(this_url, url) … … 260 256 if not e.ignore_silently: 261 257 flash(_(u'Could not ping %(url)s: %(error)s') % { 262 'url': html_url,258 'url': escape(host), 263 259 'error': e.message 264 260 }, 'error') … … 380 376 if post is None: 381 377 post = form.make_post() 382 msg = _( 'The entry %swas created successfully.')378 msg = _(u'The entry “%s” was created successfully.') 383 379 else: 384 380 form.save_changes() 385 msg = _('The entry %s was updated successfully.') 386 387 flash(msg % u'<a href="%s">%s</a>' % (escape(url_for(post)), 388 escape(post.title))) 381 msg = _(u'The entry “%s” was updated successfully.') 382 383 flash(msg % escape(post.title)) 389 384 390 385 db.commit() … … 416 411 form.add_invalid_redirect_target('admin/edit_post', post_id=post.id) 417 412 form.delete_post() 418 flash(_(u'The entry %swas deleted successfully.') %413 flash(_(u'The entry “%s” was deleted successfully.') % 419 414 escape(post.title), 'remove') 420 415 db.commit() … … 459 454 if post is None: 460 455 post = form.make_post() 461 msg = _( 'The page %swas created successfully.')456 msg = _(u'The page “%s” was created successfully.') 462 457 else: 463 458 form.save_changes() 464 msg = _('The page %s was updated successfully.') 465 466 flash(msg % u'<a href="%s">%s</a>' % (escape(url_for(post)), 467 escape(post.title))) 459 msg = _(u'The page “%s” was updated successfully.') 460 461 flash(msg % escape(post.title)) 468 462 469 463 db.commit() … … 495 489 form.add_invalid_redirect_target('admin/edit_post', post_id=post.id) 496 490 form.delete_post() 497 flash(_(u'The page %swas deleted successfully.') %491 flash(_(u'The page “%s” was deleted successfully.') % 498 492 escape(post.title), 'remove') 499 493 db.commit() … … 548 542 elif 'delete_all' in request.form: 549 543 if identifier not in ('spam', 'blocked'): 550 flash(_( '“Delete All” can only be issued for “Spam” and '551 '“Blocked” comment types.'), 'error')544 flash(_(u'“Delete All” can only be issued for “Spam” and ' 545 u'“Blocked” comment types.'), 'error') 552 546 elif 'confirm' in request.form: 553 547 comments = query.all() … … 793 787 return render_admin_response('admin/mark_comment.html', 794 788 'comments.overview', form=form.as_widget(), 795 form_action=_( 'Spam'))789 form_action=_(u'Spam')) 796 790 797 791 @require_admin_privilege(MODERATE_COMMENTS | MODERATE_OWN_ENTRIES | … … 850 844 if category is None: 851 845 category = form.make_category() 852 msg = _(u'Category %screated successfully.')846 msg = _(u'Category “%s” created successfully.') 853 847 msg_type = 'add' 854 848 else: 855 849 form.save_changes() 856 msg = _(u'Category %supdated successfully.')850 msg = _(u'Category “%s” updated successfully.') 857 851 msg_type = 'info' 858 852 db.commit() 859 html_category_detail = u'<a href="%s">%s</a>' % ( 860 escape(url_for(category)), 861 escape(category.name) 862 ) 863 flash(msg % html_category_detail, msg_type) 853 flash(msg % escape(category.name), msg_type) 864 854 return redirect_to('admin/manage_categories') 865 855 … … 923 913 if user is None: 924 914 user = form.make_user() 925 msg = _(u'User %screated successfully.')915 msg = _(u'User “%s” created successfully.') 926 916 icon = 'add' 927 917 else: 928 918 form.save_changes() 929 msg = _(u'User %sedited successfully.')919 msg = _(u'User “%s” edited successfully.') 930 920 icon = 'info' 931 921 db.commit() 932 html_user_detail = u'<a href="%s">%s</a>' % ( 933 escape(url_for(user)), 934 escape(user.username) 935 ) 936 flash(msg % html_user_detail, icon) 922 flash(msg % escape(user.username), icon) 937 923 if request.form.get('save'): 938 924 return form.redirect('admin/manage_users') … … 991 977 if group is None: 992 978 group = form.make_group() 993 msg = _(u'Group %screated successfully.')979 msg = _(u'Group “%s” created successfully.') 994 980 icon = 'add' 995 981 else: 996 982 form.save_changes() 997 msg = _(u'Group %sedited successfully.')983 msg = _(u'Group “%s” edited successfully.') 998 984 icon = 'info' 999 985 db.commit() 1000 html_group_detail = u'<a href="%s">%s</a>' % ( 1001 escape(url_for(group)), 1002 escape(group.name)) 1003 flash(msg % html_group_detail, icon) 986 flash(msg % escape(group.name), icon) 1004 987 1005 988 if request.form.get('save'): … … 1123 1106 if request.method == 'POST' and form.validate(request.form): 1124 1107 form.apply() 1125 flash(_( 'Plugin configuration changed'), 'configure')1108 flash(_(u'Plugin configuration changed'), 'configure') 1126 1109 1127 1110 new_plugin = request.files.get('new_plugin') … … 1416 1399 if request.method == 'POST' and form.validate(request.form): 1417 1400 form.apply() 1418 flash(_( 'Log changes saved.'), 'configure')1401 flash(_(u'Log changes saved.'), 'configure') 1419 1402 return redirect_to('admin/log', page=page.number) 1420 1403 return render_admin_response('admin/log.html', 'system.log',
Note: See TracChangeset
for help on using the changeset viewer.