예제 #1
0
 def block_nav_menu(self, context, nodes):
     if self.has_filters and len(self.admin_view.filter_specs) > len(
             self.admin_view.filter_default):
         nodes.append(
             render_to_string(
                 'xadmin/blocks/model_list.nav_menu.filters.html',
                 context_instance=context))
예제 #2
0
 def block_submit_line(self, context, nodes):
     context.update(dict(self.storage.extra_data))
     context['wizard'] = {'steps': self.steps}
     nodes.append(
         dutils.render_to_string(
             'xadmin/blocks/model_form.submit_line.wizard.html',
             context_instance=context))
예제 #3
0
 def block_nav_menu(self, context, nodes):
     if self.show_bookmarks:
         nodes.insert(
             0,
             dutils.render_to_string(
                 'xadmin/blocks/model_list.nav_menu.bookmarks.html',
                 context_instance=context))
예제 #4
0
 def block_top_navmenu(self, context, nodes):
     _context = RequestContext(self.request)
     _context.update({
         'redirect_to': self.request.get_full_path(),
     })
     nodes.append(
         dutils.render_to_string('xadmin/blocks/comm.top.setlang.html',
                                 context_instance=_context))
예제 #5
0
 def block_nav_form(self, context, nodes):
     if self.search_fields:
         context.update({'search_var': SEARCH_VAR,
                     'remove_search_url': self.admin_view.get_query_string(remove=[SEARCH_VAR]),
                     'search_form_params': self.admin_view.get_form_params(remove=[SEARCH_VAR,'p'])})
         nodes.append(
             render_to_string(
                 'xadmin/blocks/model_list.nav_form.search_form.html', context_instance=context))
예제 #6
0
 def block_top_toolbar(self, context, nodes):
     if len(self._active_layouts) > 1:
         context.update({
             'layouts': self._active_layouts,
             'current_icon': self._current_icon,
         })
         nodes.append(
             dutils.render_to_string(
                 'xadmin/blocks/model_list.top_toolbar.layouts.html',
                 context_instance=context))
예제 #7
0
파일: chart.py 프로젝트: yuerthe9/DjangoX
 def block_results_top(self, context, nodes):
     context.update({
         'charts': [{
             "name": name,
             "title": v['title'],
             'url': self.get_chart_url(name, v)
         } for name, v in self.data_charts.items()],
     })
     nodes.append(
         dutils.render_to_string(
             'xadmin/blocks/model_list.results_top.charts.html',
             context_instance=context))
예제 #8
0
파일: chart.py 프로젝트: zsjtoby/DjangoX
 def block_results_top(self, context, nodes):
     context.update({
         'charts': [{
             "name": name,
             "title": v['title'],
             'url': self.get_chart_url(name, v)
         } for name, v in self.data_charts.items()],
     })
     box_tpl = self.admin_site.ext_ui and 'xadmin/includes/box_ext.html' or 'xadmin/includes/box.html'
     context['box_tpl'] = box_tpl
     nodes.append(
         dutils.render_to_string(
             'xadmin/blocks/model_list.results_top.charts.html',
             context_instance=context))
예제 #9
0
파일: inline.py 프로젝트: zsjtoby/DjangoX
 def render(self,
            form,
            form_style,
            context,
            template_pack=TEMPLATE_PACK,
            **kwargs):
     context.update(
         dict(
             {
                 'formset': self,
                 'prefix': self.formset.prefix,
                 'inline_style': self.inline_style
             }, **self.extra_attrs))
     return dutils.render_to_string(self.template, context_instance=context)
예제 #10
0
 def block_before_fieldsets(self, context, nodes):
     context.update(dict(self.storage.extra_data))
     context['wizard'] = {
         'steps':
         self.steps,
         'management_form':
         ManagementForm(prefix=self.prefix,
                        initial={
                            'current_step': self.steps.current,
                        }),
     }
     nodes.append(
         dutils.render_to_string(
             'xadmin/blocks/model_form.before_fieldsets.wizard.html',
             context_instance=context))
예제 #11
0
 def block_top_toolbar(self, context, nodes):
     if self.list_export:
         context.update({
             'show_export_all':
             self.admin_view.paginator.count > self.admin_view.list_per_page
             and not ALL_VAR in self.admin_view.request.GET,
             'form_params':
             self.admin_view.get_form_params({'_do_': 'export'},
                                             ('export_type', )),
             'export_types': [{
                 'type': et,
                 'name': self.export_names[et]
             } for et in self.list_export],
         })
         nodes.append(
             render_to_string(
                 'xadmin/blocks/model_list.top_toolbar.exports.html',
                 context_instance=context))
예제 #12
0
 def widget(self):
     '''
     关键方法:输出内容,类似render
     '''
     context = {
         'widget_id': self.id,
         'widget_title': self.title,
         'widget_icon': self.widget_icon,
         'widget_type': self.widget_type,
         'form': self,
         'widget': self
     }
     self.context(context)
     _context = RequestContext(self.request)
     _context.update(context)
     _context[
         'box_tpl'] = self.admin_site.ext_ui and 'xadmin/includes/box_ext.html' or 'xadmin/includes/box.html'
     return dutils.render_to_string(self.template,
                                    context_instance=_context)
예제 #13
0
 def block_top_toolbar(self, context, nodes):
     if self.refresh_times:
         current_refresh = self.request.GET.get(REFRESH_VAR)
         context.update({
             'has_refresh':
             bool(current_refresh),
             'clean_refresh_url':
             self.admin_view.get_query_string(remove=(REFRESH_VAR, )),
             'current_refresh':
             current_refresh,
             'refresh_times': [{
                 'time':
                 r,
                 'url':
                 self.admin_view.get_query_string({REFRESH_VAR: r}),
                 'selected':
                 str(r) == current_refresh,
             } for r in self.refresh_times],
         })
         nodes.append(
             dutils.render_to_string(
                 'xadmin/blocks/model_list.top_toolbar.refresh.html',
                 context_instance=context))
예제 #14
0
 def block_results_bottom(self, context, nodes):
     if self.admin_view.result_count:
         _tpl = 'xadmin/blocks/grid.results_bottom.actions.html' if self.admin_view.grid else 'xadmin/blocks/form.results_bottom.actions.html'
         nodes.append(render_to_string(_tpl, context_instance=context))
예제 #15
0
 def block_left_navbar(self, context, nodes):
     nodes.append(
         render_to_string(
             'xadmin/blocks/modal_list.left_navbar.quickfilter.html',
             context_instance=context))
예제 #16
0
 def block_grid_top(self, context, nodes):
     if self.has_filters and self.filter_list_position:
         nodes.append(
             render_to_string(
                 'xadmin/blocks/model_list.grid_top.filters.html',
                 context_instance=context))
예제 #17
0
 def block_nav_menu(self, context, nodes):
     if self.has_filters:
         nodes.append(
             render_to_string(
                 'xadmin/blocks/model_list.nav_menu.filters.html',
                 context_instance=context))
예제 #18
0
 def block_form_bottom(self, context, nodes):
     _tpl = 'xadmin/auth/login_social_block.html'
     nodes.append(dutils.render_to_string(_tpl, context_instance=context))