adds dossier editing of investments to valuation

This commit is contained in:
Juanjo Bazán
2016-09-09 15:09:06 +02:00
parent 0fc31b1259
commit 42c705e1e3
9 changed files with 503 additions and 13 deletions

View File

@@ -42,6 +42,7 @@
//= require suggest
//= require forms
//= require tracks
//= require valuation_budget_investment_form
//= require valuation_spending_proposal_form
//= require embed_video
//= require banners
@@ -63,6 +64,7 @@ var initialize_modules = function() {
App.Suggest.initialize();
App.Forms.initialize();
App.Tracks.initialize();
App.ValuationBudgetInvestmentForm.initialize();
App.ValuationSpendingProposalForm.initialize();
App.EmbedVideo.initialize();
App.Banners.initialize();

View File

@@ -0,0 +1,32 @@
App.ValuationBudgetInvestmentForm =
showFeasibleFields: ->
$('#valuation_budget_investment_edit_form #unfeasible_fields').hide('down')
$('#valuation_budget_investment_edit_form #feasible_fields').show()
showNotFeasibleFields: ->
$('#valuation_budget_investment_edit_form #feasible_fields').hide('down')
$('#valuation_budget_investment_edit_form #unfeasible_fields').show()
showAllFields: ->
$('#valuation_budget_investment_edit_form #feasible_fields').show('down')
$('#valuation_budget_investment_edit_form #unfeasible_fields').show('down')
showFeasibilityFields: ->
feasibility = $("#valuation_budget_investment_edit_form input[type=radio][name='budget_investment[feasibility]']:checked").val()
if feasibility == 'feasible'
App.ValuationBudgetInvestmentForm.showFeasibleFields()
else if feasibility == 'unfeasible'
App.ValuationBudgetInvestmentForm.showNotFeasibleFields()
showFeasibilityFieldsOnChange: ->
$("#valuation_budget_investment_edit_form input[type=radio][name='budget_investment[feasibility]']").change ->
App.ValuationBudgetInvestmentForm.showAllFields()
App.ValuationBudgetInvestmentForm.showFeasibilityFields()
initialize: ->
App.ValuationBudgetInvestmentForm.showFeasibilityFields()
App.ValuationBudgetInvestmentForm.showFeasibilityFieldsOnChange()
false