comparison MoinMoin/theme/__init__.py @ 1808:e43e65d90f26

action menu: speed up, add entry for SyncPages, longer separator
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 24 Feb 2007 15:06:30 +0100
parents 0eca596ce903
children dca96e7c8199
comparison
equal deleted inserted replaced
1807:034cea31b7db 1808:e43e65d90f26
905 'SubscribeUser', 905 'SubscribeUser',
906 '__separator__', 906 '__separator__',
907 'Despam', 907 'Despam',
908 'revert', 908 'revert',
909 'PackagePages', 909 'PackagePages',
910 'SyncPages',
910 ] 911 ]
911 912
912 titles = { 913 titles = {
913 # action: menu title 914 # action: menu title
914 '__title__': _("More Actions:", formatted=False), 915 '__title__': _("More Actions:", formatted=False),
915 # Translation may need longer or shorter separator 916 # Translation may need longer or shorter separator
916 '__separator__': _('------------', formatted=False), 917 '__separator__': _('------------------------', formatted=False),
917 'raw': _('Raw Text', formatted=False), 918 'raw': _('Raw Text', formatted=False),
918 'print': _('Print View', formatted=False), 919 'print': _('Print View', formatted=False),
919 'refresh': _('Delete Cache', formatted=False), 920 'refresh': _('Delete Cache', formatted=False),
920 'SpellCheck': _('Check Spelling', formatted=False), # rename action! 921 'SpellCheck': _('Check Spelling', formatted=False), # rename action!
921 'RenamePage': _('Rename Page', formatted=False), 922 'RenamePage': _('Rename Page', formatted=False),
926 'SubscribeUser': _('Subscribe User', formatted=False), 927 'SubscribeUser': _('Subscribe User', formatted=False),
927 'Despam': _('Remove Spam', formatted=False), 928 'Despam': _('Remove Spam', formatted=False),
928 'revert': _('Revert to this revision', formatted=False), 929 'revert': _('Revert to this revision', formatted=False),
929 'PackagePages': _('Package Pages', formatted=False), 930 'PackagePages': _('Package Pages', formatted=False),
930 'RenderAsDocbook': _('Render as Docbook', formatted=False), 931 'RenderAsDocbook': _('Render as Docbook', formatted=False),
932 'SyncPages': _('Sync Pages', formatted=False),
931 } 933 }
932 934
933 options = [] 935 options = []
934 option = '<option value="%(action)s"%(disabled)s>%(title)s</option>' 936 option = '<option value="%(action)s"%(disabled)s>%(title)s</option>'
935 # class="disabled" is a workaround for browsers that ignore 937 # class="disabled" is a workaround for browsers that ignore
971 options.append(separator) 973 options.append(separator)
972 # Add more actions (all enabled) 974 # Add more actions (all enabled)
973 for action in more: 975 for action in more:
974 data = {'action': action, 'disabled': ''} 976 data = {'action': action, 'disabled': ''}
975 # Always add spaces: AttachFile -> Attach File 977 # Always add spaces: AttachFile -> Attach File
976 # XXX TODO do not create page just for using split_title 978 # XXX do not create page just for using split_title -
977 title = Page(request, action).split_title(force=1) 979 # creating pages for non-existant does 2 storage lookups
980 #title = Page(request, action).split_title(force=1)
981 title = action
978 # Use translated version if available 982 # Use translated version if available
979 data['title'] = _(title, formatted=False) 983 data['title'] = _(title, formatted=False)
980 options.append(option % data) 984 options.append(option % data)
981 985
982 data = { 986 data = {