Skip to content

Commit

Permalink
Merge pull request #1334 from consul/budgets
Browse files Browse the repository at this point in the history
WIP Budgets
  • Loading branch information
voodoorai2000 committed Jan 10, 2017
2 parents dc4d965 + 7ff2799 commit f2dc822
Show file tree
Hide file tree
Showing 226 changed files with 9,597 additions and 579 deletions.
3 changes: 0 additions & 3 deletions Gemfile.lock
Expand Up @@ -522,6 +522,3 @@ DEPENDENCIES
unicorn (~> 5.2.0)
web-console (= 3.3.0)
whenever

BUNDLED WITH
1.13.6
12 changes: 12 additions & 0 deletions 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
4 changes: 4 additions & 0 deletions app/assets/javascripts/application.js
Expand Up @@ -36,12 +36,14 @@
//= require tags
//= require users
//= require votes
//= require allow_participation
//= require annotatable
//= require advanced_search
//= require registration_form
//= require suggest
//= require forms
//= require tracks
//= require valuation_budget_investment_form
//= require valuation_spending_proposal_form
//= require embed_video
//= require banners
Expand All @@ -52,6 +54,7 @@ var initialize_modules = function() {
App.Comments.initialize();
App.Users.initialize();
App.Votes.initialize();
App.AllowParticipation.initialize();
App.Tags.initialize();
App.Dropdown.initialize();
App.LocationChanger.initialize();
Expand All @@ -64,6 +67,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();
Expand Down
32 changes: 32 additions & 0 deletions app/assets/javascripts/valuation_budget_investment_form.js.coffee
@@ -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
2 changes: 1 addition & 1 deletion app/assets/stylesheets/_settings.scss
Expand Up @@ -76,7 +76,7 @@ $check: #46DB91;
$proposals: #FFA42D;
$proposals-dark: #794500;

$budget: #454372;
$budget: #7E328A;
$budget-hover: #7571BF;

$highlight: #E7F2FC;
Expand Down
11 changes: 10 additions & 1 deletion app/assets/stylesheets/admin.scss
Expand Up @@ -36,12 +36,21 @@ body.admin {
input[type="text"], textarea {
width: 100%;
}

.input-group input[type="text"] {
border-radius: 0;
margin-bottom: 0 !important;
}
}

table {

th {
text-align: left;

&.with-button {
line-height: $line-height*2;
}
}

tr {
Expand Down Expand Up @@ -375,7 +384,7 @@ body.admin {
}
}

.admin-content .select-geozone {
.admin-content .select-geozone, .admin-content .select-heading {

a {
display: block;
Expand Down
9 changes: 9 additions & 0 deletions app/assets/stylesheets/icons.scss
Expand Up @@ -172,6 +172,15 @@
.icon-arrow-right:before {
content: "\55";
}
.icon-check-circle:before {
content: "\56";
}
.icon-arrow-top:before {
content: "\57";
}
.icon-help-1:before {
content: "\58";
}
.icon-checkmark-circle:before {
content: "\59";
}
11 changes: 5 additions & 6 deletions app/assets/stylesheets/layout.scss
Expand Up @@ -805,6 +805,11 @@ form {
.callout {
font-size: $small-font-size;

a {
font-weight: bold;
text-decoration: underline;
}

&.success, &.notice {
background-color: $success-bg;
border-color: $success-border;
Expand All @@ -821,12 +826,6 @@ form {
background-color: $warning-bg;
border-color: $warning-border;
color: $color-warning;

a {
color: $color-warning;
font-weight: bold;
text-decoration: underline;
}
}

&.alert, &.error {
Expand Down

0 comments on commit f2dc822

Please sign in to comment.