Changeset 628e06c


Ignore:
Timestamp:
Aug 9, 2011, 2:12:06 AM (15 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, space-access, stable, stage, test-hooks
Children:
9b911db
Parents:
3cad159
git-author:
Alex Dehnert <adehnert@…> (08/09/11 02:08:41)
git-committer:
Alex Dehnert <adehnert@…> (08/09/11 02:12:06)
Message:

Sync the "view group" and "edit group" pages

This really makes me wonder whether I should be making them use the same code,
rather than just looking the same...

Location:
asadb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • asadb/groups/views.py

    r7f16c8e r628e06c  
    3131            del kwargs['change_restricted']
    3232        super(GroupChangeMainForm, self).__init__(*args, **kwargs)
     33        restricted_fields = list(self.nobody_fields)
    3334        if change_restricted:
    34             for field_name in self.exec_only_fields:
    35                 value = getattr(self.instance, field_name)
    36                 formfield = self.fields[field_name]
    37                 formfield.widget = StaticWidget(value=value)
     35            restricted_fields.extend(self.exec_only_fields)
     36        for field_name in restricted_fields:
     37            value = getattr(self.instance, field_name)
     38            formfield = self.fields[field_name]
     39            formfield.widget = StaticWidget(value=value)
    3840
    3941    exec_only_fields = [
    4042        'name', 'abbreviation',
    41         'athena_locker',
     43        'group_status', 'group_class',
     44        'group_funding', 'main_account_id', 'funding_account_id',
     45    ]
     46    nobody_fields = [
     47        'recognition_date', 'updater', 'update_date',
    4248    ]
    4349
     
    4652            ('basic', {
    4753                'legend': 'Basic Information',
    48                 'fields': ['name', 'abbreviation', 'description', 'activity_category', ],
     54                'fields': ['name', 'abbreviation', 'activity_category', 'description', ],
    4955            }),
    5056            ('size', {
     
    5460            ('contact', {
    5561                'legend': 'Contact Information',
    56                 'fields': ['website_url', 'meeting_times', 'group_email', 'officer_email', ],
     62                'fields': ['website_url', 'meeting_times', 'officer_email', 'group_email', ],
     63            }),
     64            ('recognition', {
     65                'legend': 'Recognition',
     66                'fields': ['group_status', 'group_class', 'recognition_date', ],
     67            }),
     68            ('financial', {
     69                'legend': 'Financial Information',
     70                'fields': ['group_funding', 'main_account_id', 'funding_account_id', ],
    5771            }),
    5872            ('more-info', {
    5973                'legend': 'Additional Information',
    60                 'fields': ['constitution_url', 'advisor_name', 'main_account_id', 'funding_account_id', 'athena_locker', 'recognition_date', ],
     74                'fields': ['constitution_url', 'advisor_name', 'athena_locker', 'updater', 'update_date', ],
    6175            }),
    6276        ]
  • asadb/template/groups/group_detail.html

    r3cad159 r628e06c  
    2525</tr>{% endif %}
    2626
     27<tr><th colspan='2'>Recognition</th></tr>
     28<tr><th>Group status</th><td>{{group.group_status.name}}</td></tr>
     29<tr><th>Group class</th><td>{{group.group_class.name}}</td></tr>
     30<tr><th>Recognition date</th><td>{{group.recognition_date}}</td></tr>
     31
     32<tr><th colspan='2'>Financial Information</th></tr>
     33<tr><th>Funding status</th><td>{{group.group_funding}}</td></tr>
     34<tr><th>Main Account</th><td>{{group.main_account_id}}</td></tr>
     35<tr><th>Funding Account</th><td>{{group.funding_account_id}}</td></tr>
     36
    2737<tr><th colspan='2'>Additional Information</th></tr>
    2838<tr>
     
    3646<tr><th>Athena locker</th><td>{{group.athena_locker}}</td></tr>
    3747<tr><th>Last updated</th><td>{{group.update_date}} by {{group.updater}}</td></tr>
    38 
    39 <tr><th colspan='2'>Recognition</th></tr>
    40 <tr><th>Group status</th><td>{{group.group_status.name}}</td></tr>
    41 <tr><th>Group class</th><td>{{group.group_class.name}}</td></tr>
    42 <tr><th>Recognition date</th><td>{{group.recognition_date}}</td></tr>
    43 
    44 <tr><th colspan='2'>Financial Information</th></tr>
    45 <tr><th>Funding status</th><td>{{group.group_funding}}</td></tr>
    46 <tr><th>Main Account</th><td>{{group.main_account_id}}</td></tr>
    47 <tr><th>Funding Account</th><td>{{group.funding_account_id}}</td></tr>
    4848
    4949{% if viewpriv %}
Note: See TracChangeset for help on using the changeset viewer.