diff --git a/app/assets/javascripts/allow_participation.js.coffee b/app/assets/javascripts/allow_participation.js.coffee new file mode 100644 index 000000000..116e374ca --- /dev/null +++ b/app/assets/javascripts/allow_participation.js.coffee @@ -0,0 +1,12 @@ +App.AllowParticipation = + + initialize: -> + $(document).on { + 'mouseenter focus': -> + $(this).find(".js-participation-not-allowed").show(); + $(this).find(".js-participation-allowed").hide(); + mouseleave: -> + $(this).find(".js-participation-not-allowed").hide(); + $(this).find(".js-participation-allowed").show(); + }, ".js-participation" + false diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 7a6b87095..2445c5f3d 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -36,7 +36,7 @@ //= require tags //= require users //= require votes -//= require supports +//= require allow_participation //= require annotatable //= require advanced_search //= require registration_form @@ -54,7 +54,7 @@ var initialize_modules = function() { App.Comments.initialize(); App.Users.initialize(); App.Votes.initialize(); - App.Supports.initialize(); + App.AllowParticipation.initialize(); App.Tags.initialize(); App.Dropdown.initialize(); App.LocationChanger.initialize(); diff --git a/app/assets/javascripts/supports.js.coffee b/app/assets/javascripts/supports.js.coffee deleted file mode 100644 index 78f7b258c..000000000 --- a/app/assets/javascripts/supports.js.coffee +++ /dev/null @@ -1,12 +0,0 @@ -App.Supports = - - initialize: -> - $(document).on { - 'mouseenter focus': -> - $(this).find(".js-supports-not-allowed").show(); - $(this).find(".js-supports-allowed").hide(); - mouseleave: -> - $(this).find(".js-supports-not-allowed").hide(); - $(this).find(".js-supports-allowed").show(); - }, ".js-supports" - false diff --git a/app/views/budgets/investments/_ballot.html.erb b/app/views/budgets/investments/_ballot.html.erb index bbac474af..6b6d3a668 100644 --- a/app/views/budgets/investments/_ballot.html.erb +++ b/app/views/budgets/investments/_ballot.html.erb @@ -1,5 +1,5 @@ <% reason = investment.reason_for_not_being_ballotable_by(current_user, ballot) %> -
+
<% if ballot.has_investment?(investment) %>
@@ -42,7 +42,7 @@ <% if reason.present? && !ballot.has_investment?(investment) %> -