|
40 | 40 | from ietf.idrfc.views_search import SearchForm, search_query |
41 | 41 | from ietf.idrfc.idrfc_wrapper import IdRfcWrapper |
42 | 42 | from ietf.ipr.models import IprDetail |
| 43 | +from redesign.group.models import Group |
43 | 44 |
|
44 | 45 |
|
45 | 46 | def fill_in_charter_info(wg, include_drafts=False): |
@@ -156,3 +157,22 @@ def wg_charter(request, acronym): |
156 | 157 | RequestContext(request)) |
157 | 158 |
|
158 | 159 | return render_to_response('wginfo/wg_charter.html', {'wg': wg, 'concluded':concluded, 'proposed': proposed, 'selected':'charter'}, RequestContext(request)) |
| 160 | + |
| 161 | +def get_wg_menu_context(wg, selected): |
| 162 | + # it would probably be better to refactor this file into rendering |
| 163 | + # the menu separately instead of each view having to include the information |
| 164 | + |
| 165 | + return dict(wg=wg, concluded=wg.state_id == "conclude", proposed=wg.state_id == "proposed", selected=selected) |
| 166 | + |
| 167 | +def history(request, acronym): |
| 168 | + wg = get_object_or_404(Group, acronym=acronym) |
| 169 | + |
| 170 | + events = wg.groupevent_set.all().select_related('by').order_by('-time', '-id') |
| 171 | + |
| 172 | + context = get_wg_menu_context(wg, "history") |
| 173 | + context.update(dict(events=events, |
| 174 | + )) |
| 175 | + |
| 176 | + wg.group_acronym = wg # hack for compatibility with old templates |
| 177 | + |
| 178 | + return render_to_response('wginfo/history.html', context, RequestContext(request)) |
0 commit comments