From d892fa8c587f2f0ba7ecf86eb8879f8eacf146d0 Mon Sep 17 00:00:00 2001 From: sshwsfc Date: Mon, 10 Mar 2014 16:16:27 +0800 Subject: [PATCH] Update fontawesome to 4.0.3 --- demo_app/app/adminx.py | 4 +++- demo_app/data.db | Bin 339968 -> 339968 bytes xadmin/adminx.py | 2 +- xadmin/plugins/actions.py | 4 ++-- xadmin/plugins/auth.py | 8 ++++---- xadmin/plugins/bookmark.py | 3 ++- xadmin/plugins/chart.py | 1 + xadmin/plugins/comments.py | 2 +- xadmin/plugins/details.py | 2 +- xadmin/plugins/editable.py | 2 +- xadmin/plugins/images.py | 10 +++++----- xadmin/plugins/layout.py | 4 ++-- xadmin/plugins/passwords.py | 2 +- xadmin/plugins/quickform.py | 2 +- xadmin/plugins/relate.py | 10 +++++----- xadmin/plugins/xversion.py | 8 ++++---- .../static/xadmin/css/xadmin.responsive.css | 2 +- xadmin/static/xadmin/js/xadmin.page.list.js | 3 +++ xadmin/templates/xadmin/base_site.html | 2 +- .../blocks/model_list.nav_menu.filters.html | 2 +- .../model_list.results_bottom.actions.html | 2 +- .../blocks/model_list.results_top.charts.html | 2 +- .../model_list.top_toolbar.layouts.html | 4 ++-- .../xadmin/edit_inline/accordion.html | 4 ++-- xadmin/templates/xadmin/edit_inline/base.html | 2 +- .../templates/xadmin/edit_inline/stacked.html | 4 ++-- xadmin/templates/xadmin/edit_inline/tab.html | 4 ++-- .../templates/xadmin/edit_inline/tabular.html | 6 +++--- xadmin/templates/xadmin/grids/thumbnails.html | 2 +- .../xadmin/includes/sitemenu_accordion.html | 8 ++++---- .../xadmin/includes/sitemenu_default.html | 16 ++++++++-------- .../xadmin/includes/submit_line.html | 4 ++-- .../xadmin/views/batch_change_form.html | 2 +- xadmin/templates/xadmin/views/dashboard.html | 2 +- xadmin/templates/xadmin/views/form.html | 2 +- .../templates/xadmin/views/model_detail.html | 6 +++--- xadmin/templates/xadmin/views/model_form.html | 2 +- xadmin/templates/xadmin/views/model_list.html | 4 ++-- .../templates/xadmin/views/recover_list.html | 2 +- xadmin/templates/xadmin/widgets/base.html | 1 + xadmin/templates/xadmin/widgets/qbutton.html | 2 +- xadmin/views/dashboard.py | 10 +++++++--- xadmin/views/list.py | 6 +++--- xadmin/views/website.py | 2 +- xadmin/widgets.py | 4 ++-- 45 files changed, 94 insertions(+), 82 deletions(-) diff --git a/demo_app/app/adminx.py b/demo_app/app/adminx.py index 8e13dfa0c..81cb7ab0c 100644 --- a/demo_app/app/adminx.py +++ b/demo_app/app/adminx.py @@ -30,8 +30,9 @@ class BaseSetting(object): class GlobalSetting(object): global_search_models = [Host, IDC] global_models_icon = { - Host: 'laptop', IDC: 'cloud' + Host: 'fa fa-laptop', IDC: 'fa fa-cloud' } + menu_style = 'accordion' xadmin.site.register(views.CommAdminView, GlobalSetting) @@ -84,6 +85,7 @@ def open_web(self, instance): save_as = True aggregate_fields = {"guarantee_date": "min"} + grid_layouts = ('table', 'thumbnails') form_layout = ( Main( diff --git a/demo_app/data.db b/demo_app/data.db index d15368d1b0990ebec4b5e50dff2f25d161a9a440..0c51655b07316cd4932da51314dd36eb3b4a3c3e 100644 GIT binary patch delta 352 zcmZp8Aky$aWP&u~+KDpGjB7V0EPc<<(Z;~n$IHOO#nr>n#yM&8LWLp@_7-L?R^N8f z$%a1_&HUW`vVC1ra{OHajiP|qH{91WvMMJlGRw6hG9)D@G9=y9&&AQyFFe#FGS@9L zG9=qDDr9oU&lmNc#h!U71*y4il~Hb%CXwMmC5hpthRH@@l_^F!*-=Je1`$SX*-7C! zr4hz(b-78#UL_I6PQ@wVDFsQHo@S|)UR5dXVdW7TwK6i%Gqp4}GBj!K`PJU@i*b9;FQ%7Ygi+hZ3-mG?M delta 187 zcmZp8Aky$aWP&uK=|mZ4M$?T6OW*TzYBBKj@iOpmarJO&aZcL2P(h57y(ylH)wjiW za_ %s' % (self.get_admin_url('account_password'), _('Change Password')) + return '
  • %s
  • ' % (self.get_admin_url('account_password'), _('Change Password')) site.register_plugin(AccountMenuPlugin, CommAdminView) diff --git a/xadmin/plugins/bookmark.py b/xadmin/plugins/bookmark.py index bb0e7040d..f950adbaf 100644 --- a/xadmin/plugins/bookmark.py +++ b/xadmin/plugins/bookmark.py @@ -141,7 +141,7 @@ def post(self, request): class BookmarkAdmin(object): - model_icon = 'book' + model_icon = 'fa fa-book' list_display = ('title', 'user', 'url_name', 'query') list_display_links = ('title',) user_fields = ['user'] @@ -169,6 +169,7 @@ def has_change_permission(self, obj=None): @widget_manager.register class BookmarkWidget(PartialBaseWidget): widget_type = _('bookmark') + widget_icon = 'fa fa-bookmark' description = _( 'Bookmark Widget, can show user\'s bookmark list data in widget.') template = "xadmin/widgets/list.html" diff --git a/xadmin/plugins/chart.py b/xadmin/plugins/chart.py index 42b223e3c..e83ab8ca9 100644 --- a/xadmin/plugins/chart.py +++ b/xadmin/plugins/chart.py @@ -23,6 +23,7 @@ class ChartWidget(ModelBaseWidget): widget_type = 'chart' description = _('Show models simple chart.') template = 'xadmin/widgets/chart.html' + widget_icon = 'fa fa-bar-chart-o' def convert(self, data): self.list_params = data.pop('params', {}) diff --git a/xadmin/plugins/comments.py b/xadmin/plugins/comments.py index ca9c1db49..0e90462e1 100644 --- a/xadmin/plugins/comments.py +++ b/xadmin/plugins/comments.py @@ -41,7 +41,7 @@ class CommentsAdmin(object): ordering = ('-submit_date',) search_fields = ('comment', UsernameSearch(), 'user_name', 'user_email', 'user_url', 'ip_address') actions = ["flag_comments", "approve_comments", "remove_comments"] - model_icon = 'comment' + model_icon = 'fa fa-comment' def get_actions(self): actions = super(CommentsAdmin, self).get_actions() diff --git a/xadmin/plugins/details.py b/xadmin/plugins/details.py index 97ded075f..5c7ca7577 100644 --- a/xadmin/plugins/details.py +++ b/xadmin/plugins/details.py @@ -48,7 +48,7 @@ def result_item(self, item, obj, field_name, row): args=(getattr(rel_obj, opts.pk.attname),)) else: edit_url = '' - item.btns.append('' + item.btns.append('' % (item_res_uri, edit_url, _(u'Details of %s') % str(rel_obj))) except NoReverseMatch: pass diff --git a/xadmin/plugins/editable.py b/xadmin/plugins/editable.py index 0597856d5..2f7fe7a93 100644 --- a/xadmin/plugins/editable.py +++ b/xadmin/plugins/editable.py @@ -43,7 +43,7 @@ def result_item(self, item, obj, field_name, row): item.wraps.insert(0, '%s') item.btns.append(( ''+ - '') % + '') % (_(u"Enter %s") % field_label, field_name, self.admin_view.model_admin_url('patch', pk) + '?fields=' + field_name)) if field_name not in self.editable_need_fields: diff --git a/xadmin/plugins/images.py b/xadmin/plugins/images.py index babbe475e..1c92bca55 100644 --- a/xadmin/plugins/images.py +++ b/xadmin/plugins/images.py @@ -16,12 +16,12 @@ def get_gallery_modal(): - + diff --git a/xadmin/plugins/layout.py b/xadmin/plugins/layout.py index 59676a08e..2e45d1ab3 100644 --- a/xadmin/plugins/layout.py +++ b/xadmin/plugins/layout.py @@ -11,13 +11,13 @@ DEFAULT_LAYOUTS = { 'table': { 'key': 'table', - 'icon': 'table', + 'icon': 'fa fa-table', 'name': _(u'Table'), 'template': 'views/model_list.html', }, 'thumbnails': { 'key': 'thumbnails', - 'icon': 'th-large', + 'icon': 'fa fa-th-large', 'name': _(u'Thumbnails'), 'template': 'grids/thumbnails.html', }, diff --git a/xadmin/plugins/passwords.py b/xadmin/plugins/passwords.py index f7154c78a..9395d1e60 100644 --- a/xadmin/plugins/passwords.py +++ b/xadmin/plugins/passwords.py @@ -61,7 +61,7 @@ class ResetLinkPlugin(BaseAdminPlugin): def block_form_bottom(self, context, nodes): reset_link = self.get_admin_url('xadmin_password_reset') - return '' % (reset_link, _('Forgotten your password or username?')) + return '' % (reset_link, _('Forgotten your password or username?')) site.register_plugin(ResetLinkPlugin, LoginView) diff --git a/xadmin/plugins/quickform.py b/xadmin/plugins/quickform.py index 55afa217b..823965add 100644 --- a/xadmin/plugins/quickform.py +++ b/xadmin/plugins/quickform.py @@ -72,7 +72,7 @@ def render(self, name, value, *args, **kwargs): self.widget.choices = self.choices output = [] if self.add_url: - output.append(u'' + output.append(u'' % ( self.add_url, (_('Create New %s') % self.rel.to._meta.verbose_name), name, "%s?_field=%s&%s=" % (self.rel_add_url, name, name))) diff --git a/xadmin/plugins/relate.py b/xadmin/plugins/relate.py index 7f24b5f39..37b8aee97 100644 --- a/xadmin/plugins/relate.py +++ b/xadmin/plugins/relate.py @@ -52,14 +52,14 @@ def related_link(self, instance): link = ''.join(('
  • ', - ' %s' % + ' %s' % ( reverse('%s:%s_%s_changelist' % ( self.admin_site.app_name, label, model_name)), RELATE_PREFIX + lookup_name, str(instance.pk), verbose_name, verbose_name) if view_perm else - ' %s' % verbose_name, + ' %s' % verbose_name, - '' % + '' % ( reverse('%s:%s_%s_add' % ( self.admin_site.app_name, label, model_name)), @@ -70,7 +70,7 @@ def related_link(self, instance): links.append(link) ul_html = '' % ''.join( links) - return '' % (_('Related Objects'), ul_html) + return '' % (_('Related Objects'), ul_html) related_link.short_description = ' ' related_link.allow_tags = True related_link.allow_export = False @@ -121,7 +121,7 @@ def get_brand_name(self): else: to_model_name = force_unicode(self.to_model._meta.verbose_name) - return mark_safe(u"%s %s" % (to_model_name, force_unicode(self.opts.verbose_name_plural))) + return mark_safe(u"%s %s" % (to_model_name, force_unicode(self.opts.verbose_name_plural))) class BaseRelateDisplayPlugin(BaseAdminPlugin): diff --git a/xadmin/plugins/xversion.py b/xadmin/plugins/xversion.py index c572b47dc..d4ff5f727 100644 --- a/xadmin/plugins/xversion.py +++ b/xadmin/plugins/xversion.py @@ -163,7 +163,7 @@ def post(self, __, request, *args, **kwargs): # Block Views def block_top_toolbar(self, context, nodes): recoverlist_url = self.admin_view.model_admin_url('recoverlist') - nodes.append(mark_safe('' % (recoverlist_url, _(u"Recover")))) + nodes.append(mark_safe('' % (recoverlist_url, _(u"Recover")))) def block_nav_toggles(self, context, nodes): obj = getattr( @@ -171,7 +171,7 @@ def block_nav_toggles(self, context, nodes): if obj: revisionlist_url = self.admin_view.model_admin_url( 'revisionlist', quote(obj.pk)) - nodes.append(mark_safe('' % revisionlist_url)) + nodes.append(mark_safe('' % revisionlist_url)) def block_nav_btns(self, context, nodes): obj = getattr( @@ -179,7 +179,7 @@ def block_nav_btns(self, context, nodes): if obj: revisionlist_url = self.admin_view.model_admin_url( 'revisionlist', quote(obj.pk)) - nodes.append(mark_safe(' %s' % (revisionlist_url, _(u'History')))) + nodes.append(mark_safe(' %s' % (revisionlist_url, _(u'History')))) class BaseReversionView(ModelAdminView): @@ -628,7 +628,7 @@ class VersionInline(object): style = 'accordion' class ReversionAdmin(object): - model_icon = 'exchange' + model_icon = 'fa fa-exchange' list_display = ('__str__', 'date_created', 'user', 'comment') list_display_links = ('__str__',) diff --git a/xadmin/static/xadmin/css/xadmin.responsive.css b/xadmin/static/xadmin/css/xadmin.responsive.css index 9e8bbe7f3..d6e53153f 100644 --- a/xadmin/static/xadmin/css/xadmin.responsive.css +++ b/xadmin/static/xadmin/css/xadmin.responsive.css @@ -16,7 +16,7 @@ display: none; } ul.nav-sitemenu > li.app_menu>hr{ margin: 0px;} - ul.nav-sitemenu > li.app_menu>a>i[class^="icon-"]{ + ul.nav-sitemenu > li.app_menu>a>i.icon{ font-size: 20px; line-height: 1.7em; } diff --git a/xadmin/static/xadmin/js/xadmin.page.list.js b/xadmin/static/xadmin/js/xadmin.page.list.js index 213e10771..4d8bd7800 100644 --- a/xadmin/static/xadmin/js/xadmin.page.list.js +++ b/xadmin/static/xadmin/js/xadmin.page.list.js @@ -1,15 +1,18 @@ jQuery(function($){ //full screen btn $('.layout-btns .layout-full').click(function(e){ + var icon = $(this).find('i') if($(this).hasClass('active')){ // reset $('#left-side, ul.breadcrumb').show('fast'); $('#content-block').removeClass('col-md-12 col-sm-12 full-content').addClass('col-sm-11 col-md-10'); + icon.removeClass('fa-compress').addClass('fa-expand'); $(window).trigger('resize'); } else { // full screen $('#left-side, ul.breadcrumb').hide('fast', function(){ $('#content-block').removeClass('col-sm-11 col-md-10').addClass('col-md-12 col-sm-12 full-content'); + icon.removeClass('fa-expand').addClass('fa-compress'); $(window).trigger('resize'); }); } diff --git a/xadmin/templates/xadmin/base_site.html b/xadmin/templates/xadmin/base_site.html index bfca813b9..f9332b289 100644 --- a/xadmin/templates/xadmin/base_site.html +++ b/xadmin/templates/xadmin/base_site.html @@ -22,7 +22,7 @@
  • {% endif %} -
  • {% trans 'Log out' %}
  • +
  • {% trans 'Log out' %}
  • {% view_block 'top_navbar' %} diff --git a/xadmin/templates/xadmin/blocks/model_list.nav_menu.filters.html b/xadmin/templates/xadmin/blocks/model_list.nav_menu.filters.html index ada85cb11..4d63dd9b0 100644 --- a/xadmin/templates/xadmin/blocks/model_list.nav_menu.filters.html +++ b/xadmin/templates/xadmin/blocks/model_list.nav_menu.filters.html @@ -5,7 +5,7 @@