Skip to content

Commit

Permalink
Fix moderator forms on admin coteachers page (#3318)
Browse files Browse the repository at this point in the history
* Fix moderator forms on admin coteachers page

* remove unneeded data attr
  • Loading branch information
willgearty authored May 27, 2021
1 parent f18bfae commit e6e242f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function setup_autocomplete()
}
});

$j("#moderator_name").autocomplete({
$j("[name=moderator_name]").autocomplete({
source: function(request, response) {
$j.ajax({
url: "/teach/"+base_url+"/moderatorlookup/",
Expand All @@ -61,7 +61,7 @@ function setup_autocomplete()
});
},
select: function(event, ui) {
$j("#moderator_id").val(ui.item.id);
$j("#moderator_id_" + $j(this).data("secid")).val(ui.item.id);
}
});
}
10 changes: 5 additions & 5 deletions esp/templates/program/modules/adminclass/coteachers.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ <h1>Setting Teachers for &quot;<u>{{ class|escape }}</u>&quot;</h1>
</tr>
</table>
</form>
<form action="{{request.path}}" method="post" name="addteacher" onsubmit="cleanTeacherSubmit($j(this))">
<form action="{{request.path}}" method="post" name="addteacher">
<table align="center" width="400">
<tr>
<th colspan="2">Add a coteacher</th>
Expand Down Expand Up @@ -113,7 +113,7 @@ <h1>Setting Teachers for &quot;<u>{{ class|escape }}</u>&quot;</h1>
<input type="hidden" name="secid" value="{{ section.id }}" />
<input type="hidden" name="moderators" value="{% for moderator in section.get_moderators %}{{ moderator.id }}{% if not forloop.last %},{% endif %}{% endfor %}" />

<select id="current_moderators"
<select id="current_moderators_{{ section.id }}"
class="moderators" name="delete_moderators"
size="5" multiple="multiple">
{% for moderator in section.get_moderators %}
Expand All @@ -131,7 +131,7 @@ <h1>Setting Teachers for &quot;<u>{{ class|escape }}</u>&quot;</h1>
</tr>
</table>
</form>
<form action="{{request.path}}" method="post" name="addmoderator" onsubmit="cleanTeacherSubmit($j(this))">
<form action="{{request.path}}" method="post" name="addmoderator">
<table align="center" width="400">
<tr>
<th colspan="2">Add a {{ program.getModeratorTitle|lower }}</th>
Expand All @@ -146,8 +146,8 @@ <h1>Setting Teachers for &quot;<u>{{ class|escape }}</u>&quot;</h1>
<input type="hidden" name="op" value="addmod" />
<input type="hidden" name="moderators" value="{% for moderator in section.get_moderators %}{{ moderator.id }}{% if not forloop.last %},{% endif %}{% endfor %}" />

<input type="text" name="moderator_name" id="moderator_name" />
<input type="hidden" name="moderator_selected" id="moderator_id" />
<input type="text" name="moderator_name" id="moderator_name_{{ section.id }}" data-secid="{{ section.id }}"/>
<input type="hidden" name="moderator_selected" id="moderator_id_{{ section.id }}"/>
</td>
<td>
<input type="submit" class="button" value="Add {{ program.getModeratorTitle }}" />
Expand Down

0 comments on commit e6e242f

Please sign in to comment.