Skip to content

Commit

Permalink
Fixes the Edit button showing up as view in teacherreg
Browse files Browse the repository at this point in the history
  • Loading branch information
gkanwar committed May 21, 2012
1 parent 40d5403 commit 29eb583
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
6 changes: 4 additions & 2 deletions esp/esp/program/templatetags/class_render_row.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ def render_class_manage_row(klass):


@cache_inclusion_tag(register, 'inclusion/program/class_teacher_list_row.html')
def render_class_teacher_list_row(klass):
def render_class_teacher_list_row(klass, can_edit, friendly_times_with_date):
return {'cls': klass,
'program': klass.parent_program,
'teacherclsmodule': klass.parent_program.getModuleExtension('ClassRegModuleInfo')}
'teacherclsmodule': klass.parent_program.getModuleExtension('ClassRegModuleInfo'),
'can_edit': can_edit,
'friendly_times_with_date': friendly_times_with_date}
render_class_teacher_list_row.cached_function.depend_on_row(ClassSubject, lambda cls: {'klass': cls})
render_class_teacher_list_row.cached_function.depend_on_row(ClassSection, lambda sec: {'klass': sec.parent_class})
render_class_teacher_list_row.cached_function.depend_on_cache(ClassSubject.title, lambda self=wildcard, **kwargs: {'klass': self})
Expand Down
12 changes: 1 addition & 11 deletions esp/templates/inclusion/program/class_copy_row.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,6 @@

{% block cls_row_3_buttons %}{% endblock %}

{% block cls_row_4_buttons %}
{% if cls_manageable %}
<td class="clsright">
<form method="post" action="/teach/{{program.getUrlBase}}/coteachers">
<input type="hidden" name="command" value="edit_class_{{cls.id}}" />
<input type="hidden" name="clsid" value="{{cls.id }}" />
<input class="button" type="submit" value="Modify Coteachers">
</form>
</td>
{% endif %}
{% endblock %}
{% block cls_row_4_buttons %}{% endblock %}

{% block cls_row_5_buttons %}{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
{% endif %}
{% load class_render_row %}
{% for cls in clslist %}
{% render_class_teacher_list_row cls %}
{% render_class_teacher_list_row cls can_edit friendly_times_with_date %}
{% endfor %}

{% if can_create %}
Expand Down

0 comments on commit 29eb583

Please sign in to comment.