Esempio n. 1
0
 def get_context_data(self, **kwargs):
     context = super(DetailView, self).get_context_data(**kwargs)
     instance = self.get_data()
     context["instance"] = instance
     table = project_tables.InstancesTable(self.request)
     context["url"] = reverse(self.redirect_url)
     context["actions"] = table.render_row_actions(instance)
     return context
Esempio n. 2
0
 def get_context_data(self, **kwargs):
     context = super(DetailView, self).get_context_data(**kwargs)
     instance = self.get_data()
     context["instance"] = instance
     table = project_tables.InstancesTable(self.request)
     context["url"] = reverse(self.redirect_url)
     context["actions"] = table.render_row_actions(instance)
     context["page_title"] = _("Instance Details: "
                               "%(instance_name)s") % {
                                   'instance_name': instance.name
                               }
     return context
Esempio n. 3
0
 def get_context_data(self, **kwargs):
     context = super(DetailView, self).get_context_data(**kwargs)
     instance = self.get_data()
     context["instance"] = instance
     table = project_tables.InstancesTable(self.request)
     context["url"] = reverse(self.redirect_url)
     roles = self.request.user.roles
     if len(roles) >= 2:
         role = roles[1]['name'] if roles[0][
             'name'] == '_member_' else roles[0]['name']
     else:
         role = '_member_'
     if policy_is(self.request.user.username, 'admin',
                  'sysadmin') or role != 'admin':
         context["actions"] = table.render_row_actions(instance)
     return context
Esempio n. 4
0
 def _get_actions(self, instance):
     table = project_tables.InstancesTable(self.request)
     return table.render_row_actions(instance)