def get_context_data(self, **kwargs): ret = super(Changes, self).get_context_data(**kwargs) subsection = '' get_type = self.request.GET.get('type') if get_type: get_type = int(get_type) type = CI_CHANGE_TYPES.NameFromID(get_type) subsection += '%s - ' % CI_CHANGE_TYPES.DescFromName(type) subsection += 'Changes' select = { 1: 'repo changes', 2: 'agent events', 3: 'asset attr. changes', 4: 'monitoring events', 5: 'status office events', } sidebar_selected = select.get(get_type, 'all events') ret.update({ 'changes': [(x, get_icon_for(x.ci)) for x in self.changes], 'statistics': self.data, 'form': self.form, 'subsection': subsection, 'sidebar_selected': sidebar_selected, 'jira_url': urljoin(settings.ISSUETRACKERS['default']['URL'], 'browse'), }) return ret
def get_context_data(self, **kwargs): ret = super(Changes, self).get_context_data(**kwargs) ret.update({ 'changes': [(x, get_icon_for(x.ci)) for x in self.changes], 'statistics': self.data, 'form': self.form, }) return ret
def get_context_data(self, **kwargs): ret = super(Changes, self).get_context_data(**kwargs) ret.update( {"changes": [(x, get_icon_for(x.ci)) for x in self.changes], "statistics": self.data, "form": self.form} ) return ret