From f05fed62f732ef11239980f14e09618766b79a06 Mon Sep 17 00:00:00 2001 From: Ofir Farchy Date: Mon, 13 Jun 2016 19:47:42 +0300 Subject: [PATCH] Added a default 'disabled' state on the committee meeting mk and lobyist addition / removal Added a behavior of disabling a submit button whenever the data is not a valid name (similar to the one in meeting bill addition) Still need to (maybe) only allow removing members actually in the meeting fix#: 618 fix: #618 --- less/footer.less | 1 - static/css/app.css | 6 +----- static/js/committeemeeting_detail.js | 13 +++++++++++++ templates/committees/committeemeeting_detail.html | 12 +++++++----- templates/site_base.html | 6 ------ 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/less/footer.less b/less/footer.less index 0ed55b17..1b2620da 100644 --- a/less/footer.less +++ b/less/footer.less @@ -78,7 +78,6 @@ } - .about-oknesset h3 { border-bottom: 1px solid @grayLight;} .follow-oknesset h3 { margin-top: @gutter * 2; } .hasadna { h3 { diff --git a/static/css/app.css b/static/css/app.css index d4ec1b27..42ad17ea 100644 --- a/static/css/app.css +++ b/static/css/app.css @@ -8379,10 +8379,6 @@ input.tobecopied { margin-top: 0; } -#app-footer .about-oknesset h3 { - border-bottom: 1px solid #707070; -} - #app-footer .follow-oknesset h3 { margin-top: 40px; } @@ -9902,4 +9898,4 @@ body.infinity-protocol #content-main > div > div.row > div.span3 { .video-fb-attachment-elem { max-width: 100%; -} \ No newline at end of file +} diff --git a/static/js/committeemeeting_detail.js b/static/js/committeemeeting_detail.js index f4e71585..697f5e87 100644 --- a/static/js/committeemeeting_detail.js +++ b/static/js/committeemeeting_detail.js @@ -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 = { @@ -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]; diff --git a/templates/committees/committeemeeting_detail.html b/templates/committees/committeemeeting_detail.html index 934dacc7..17a3d489 100644 --- a/templates/committees/committeemeeting_detail.html +++ b/templates/committees/committeemeeting_detail.html @@ -68,26 +68,28 @@

{% trans "MKs attended" %}

- +
{% csrf_token %} - +
{% csrf_token %} - + +
{% csrf_token %} - - + + +
{% endif %} diff --git a/templates/site_base.html b/templates/site_base.html index 2a35bc8b..77f1b586 100644 --- a/templates/site_base.html +++ b/templates/site_base.html @@ -189,12 +189,6 @@

{% trans "Open Knesset is a project aimed to expose Knesset's actions to the public" %}

-

- {% blocktrans %}All the information comes from the Knesset's site. - This site is maintained by volunteers and is not supported by - any political party ...{% endblocktrans %} - {% trans "Read more" %} -