Changeset c4a4d13


Ignore:
Timestamp:
May 24, 2011, 4:07:35 AM (15 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, space-access, stable, stage, test-hooks
Children:
54c467a
Parents:
c2d6f93
git-author:
Alex Dehnert <adehnert@…> (05/24/11 04:07:35)
git-committer:
Alex Dehnert <adehnert@…> (05/24/11 04:07:35)
Message:

Basic group detail page

Location:
asadb
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • asadb/groups/views.py

    r6a9169b rc4a4d13  
    55from django.contrib.auth.decorators import user_passes_test, login_required
    66from django.core.exceptions import PermissionDenied
    7 from django.views.generic import list_detail
     7from django.views.generic import DetailView
    88from django.shortcuts import render_to_response, get_object_or_404
    99from django.template import RequestContext
     
    9090    }
    9191    return render_to_response('groups/group_change_main.html', context, context_instance=RequestContext(request), )
     92
     93class GroupDetailView(DetailView):
     94    context_object_name = "group"
     95    model = groups.models.Group
     96    def get_context_data(self, **kwargs):
     97        # Call the base implementation first to get a context
     98        context = super(GroupDetailView, self).get_context_data(**kwargs)
     99        group = context['group']
     100
     101        # Indicate whether this person should be able to see "private" info
     102        context['viewpriv'] = self.request.user.has_perm('groups.view_group_private_info', group)
     103        return context
  • asadb/media/style/style.css

    r3400018 rc4a4d13  
    77{
    88    border-collapse: collapse;
    9 }
    10 table.pretty-table th, table.pretty-table td
     9    margin: 0.5em;
     10}
     11table.pretty-table th, table.pretty-table td, table.pretty-table caption
    1112{
    1213    border: 1px solid black;
    1314    padding: 2px;
    1415}
    15 table.pretty-table th
    16 {
     16table.pretty-table caption
     17{
     18    border-bottom: none;
     19}
     20table.pretty-table th, table.pretty-table caption
     21{
     22    font-weight: bold;
    1723    background: #BE2933;
    1824}
     
    202208
    203209
     210/*****************
     211 * GROUP DISPLAY *
     212 *****************/
     213tr.private-info th:before
     214{
     215    content: "* ";
     216}
     217
     218
    204219/* Reset some stuff */
    205220h1, h2, h3, th
  • asadb/urls.py

    r0c2a9ea rc4a4d13  
    5050        name='group-list',
    5151    ),
     52    url(r'^group/(?P<pk>\d+)/', groups.views.GroupDetailView.as_view(), ),
    5253
    5354    # Uncomment the admin/doc line below and add 'django.contrib.admindocs'
Note: See TracChangeset for help on using the changeset viewer.