Skip to content
This repository was archived by the owner on Apr 25, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions static/js/committeemeeting_detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ $(function () {
});
$("input[name$='mk_name']").autocomplete(options_mk);
$("input[name$='mk_name_to_remove']").autocomplete(options_mk);
$("input[name$='mk_name'], input[name$='mk_name_to_remove']").keydown(function () {
$(this).siblings("input[name$='mk_id']").val('');
$(this).siblings("input[type$='submit']").attr('disabled', 'disabled');
});


var options_lobbyists = {
Expand All @@ -61,8 +65,17 @@ $(function () {
maxHeight: 400,
width: 150,
deferRequestBy: 100, //miliseconds
onSelect: function (value, data, me) {
me.siblings("input[name$='lobbyist_id']").val(data);
me.siblings("input[type$='submit']").removeAttr('disabled');
},
};
$("input[name$='lobbyist_name']").autocomplete(options_lobbyists);
$("input[name$='lobbyist_name_to_remove']").autocomplete(options_lobbyists);
$("input[name$='lobbyist_name'], input[name$='lobbyist_name_to_remove']").keydown(function () {
$(this).siblings("input[name$='lobbyist_id']").val('');
$(this).siblings("input[type$='submit']").attr('disabled', 'disabled');
});

$(".annotation-content").each(function () {
var annoid = $(this).attr("id").split("-")[1];
Expand Down
12 changes: 7 additions & 5 deletions templates/committees/committeemeeting_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,26 +68,28 @@ <h2>{% trans "MKs attended" %}</h2>
<label for="id_mk_name">{% trans "Suggest an MK" %}</label>
<input type="text" name="mk_name" id="id_mk_name">
<input type="hidden" name="mk_id">
<input type="submit" value="{% trans "Submit" %}" class="btn">
<input type="submit" value="{% trans "Submit" %}" class="btn" disabled="disabled">
</form>
<form method="post" action="." class="form-inline">{% csrf_token %}
<input type="hidden" name="user_input_type" value="remove-mk">
<label for="id_mk_name_to_remove">{% trans "Remove an MK" %}</label>
<input type="text" name="mk_name_to_remove" id="id_mk_name_to_remove">
<input type="hidden" name="mk_id">
<input type="submit" value="{% trans "Submit" %}" class="btn">
<input type="submit" value="{% trans "Submit" %}" class="btn" disabled="disabled">
</form>
<form method="post" action="." class="form-inline">{% csrf_token %}
<input type="hidden" name="user_input_type" value="add-lobbyist">
<label for="id_lobbyist_name">{% trans "Add a lobbyist" %}</label>
<input type="text" name="lobbyist_name" id="id_lobbyist_name">
<input type="submit" value="{% trans "Submit" %}" class="btn">
<input type="hidden" name="lobbyist_id">
<input type="submit" value="{% trans "Submit" %}" class="btn" disabled="disabled">
</form>
<form method="post" action="." class="form-inline">{% csrf_token %}
<input type="hidden" name="user_input_type" value="remove-lobbyist">
<label for="id_lobbyist_name">{% trans "remove a lobbyist" %}</label>
<input type="text" name="lobbyist_name" id="id_lobbyist_name">
<input type="submit" value="{% trans "Submit" %}" class="btn">
<input type="text" name="lobbyist_name_to_remove" id="id_lobbyist_name_to_remove">
<input type="hidden" name="lobbyist_id">
<input type="submit" value="{% trans "Submit" %}" class="btn" disabled="disabled">
</form>
{% endif %}
</div>
Expand Down