示例#1
0
文件: admin.py 项目: djangsters/agilo
 def detail_view(self, req, cat, page, name, backlog_config=None):
     backlog_config = self._backlog_config_with_changed_ticket_types(req, cat, page, name, backlog_config=backlog_config)
     
     # REFACT: Maybe we should use JSON here rather than xml?
     if ajax.is_ajax(req):
         # we got called by an Ajax request -> get available fields
         fields_for_selected_types = backlog_config.columns_as_fields(all_fields=False)
         items = [field[Key.NAME] for field in fields_for_selected_types]
         return 'ajax_response.xml', {'items': items}
     
     # TODO: Go for ticket configuration
     agilo_config = AgiloConfig(self.env)
     data = {
         'view': 'detail',
         'backlog': backlog_config,
         'backlog_types' : BacklogType.LABELS,
         't_types' : [(t_type, 
                       t_type in backlog_config.ticket_types,
                       agilo_config.ALIASES.get(t_type, t_type))
                      for t_type in agilo_config.TYPES.keys()],
         'fields' : backlog_config.columns_as_fields(all_fields=True),
     }
     add_script(req, 'agilo/js/backlog_admin.js')
     add_script(req, 'common/js/wikitoolbar.js')
     return 'agilo_admin_backlog.html', data
示例#2
0
文件: admin.py 项目: nagyist/agilo
    def detail_view(self, req, cat, page, name, backlog_config=None):
        backlog_config = self._backlog_config_with_changed_ticket_types(
            req, cat, page, name, backlog_config=backlog_config)

        # REFACT: Maybe we should use JSON here rather than xml?
        if ajax.is_ajax(req):
            # we got called by an Ajax request -> get available fields
            fields_for_selected_types = backlog_config.columns_as_fields(
                all_fields=False)
            items = [field[Key.NAME] for field in fields_for_selected_types]
            return 'ajax_response.xml', {'items': items}

        # TODO: Go for ticket configuration
        agilo_config = AgiloConfig(self.env)
        data = {
            'view':
            'detail',
            'backlog':
            backlog_config,
            'backlog_types':
            BacklogType.LABELS,
            't_types': [(t_type, t_type in backlog_config.ticket_types,
                         agilo_config.ALIASES.get(t_type, t_type))
                        for t_type in agilo_config.TYPES.keys()],
            'fields':
            backlog_config.columns_as_fields(all_fields=True),
        }
        add_script(req, 'agilo/js/backlog_admin.js')
        add_script(req, 'common/js/wikitoolbar.js')
        return 'agilo_admin_backlog.html', data
示例#3
0
 def _inject_agilo_ui_for_this_request(self, req, data):
     # The idea is that all things here are purely for display purposes so 
     # we don't have to bother for ajax requests. This saves us ~0.2 seconds
     # for every request because loading a backlog (even without the real 
     # tickets does some db queries).
     if is_ajax(req):
         return
     add_stylesheet(req, 'agilo/stylesheet/agilo.css')
     
     config = AgiloConfig(self.env)
     self._remove_trac_stylesheet_for_this_request(req)
     # avoid circular imports
     from agilo.scrum.backlog.web_ui import BacklogModule
     # adds to data the info needed to visualize the Backlog list
     BacklogModule(self.env).send_backlog_list_data(req, data)
     add_script(req, 'agilo/js/sidebar.js')
     add_script(req, 'agilo/js/cookies.js')
     add_script(req, 'agilo/js/settings.js')
     add_script(req, 'agilo/js/collapse.js')
     add_script(req, 'agilo/js/ie-patches.js')
示例#4
0
文件: web_ui.py 项目: nagyist/agilo
    def _inject_agilo_ui_for_this_request(self, req, data):
        # The idea is that all things here are purely for display purposes so
        # we don't have to bother for ajax requests. This saves us ~0.2 seconds
        # for every request because loading a backlog (even without the real
        # tickets does some db queries).
        if is_ajax(req):
            return
        add_stylesheet(req, 'agilo/stylesheet/agilo.css')

        config = AgiloConfig(self.env)
        self._remove_trac_stylesheet_for_this_request(req)
        # avoid circular imports
        from agilo.scrum.backlog.web_ui import BacklogModule
        # adds to data the info needed to visualize the Backlog list
        BacklogModule(self.env).send_backlog_list_data(req, data)
        add_script(req, 'agilo/js/sidebar.js')
        add_script(req, 'agilo/js/cookies.js')
        add_script(req, 'agilo/js/settings.js')
        add_script(req, 'agilo/js/collapse.js')
        add_script(req, 'agilo/js/ie-patches.js')