Merge branch 'master' into dashboard

This commit is contained in:
decabeza
2019-03-26 16:45:48 +01:00
2476 changed files with 62613 additions and 84405 deletions

41
.coffeelint.json Normal file
View File

@@ -0,0 +1,41 @@
{
"arrow_spacing": {
"level": "error"
},
"braces_spacing": {
"level": "error",
"spaces": 1
},
"colon_assignment_spacing": {
"level": "error",
"spacing": {
"left": 0,
"right": 1
}
},
"eol_last": {
"level": "error"
},
"indentation": {
"value": 2
},
"line_endings": {
"level": "error"
},
"max_line_length": {
"value": 100,
"level": "error",
"limitComments": true
},
"no_trailing_whitespace": {
"level": "error",
"allowed_in_comments": false,
"allowed_in_empty_lines": false
},
"space_operators": {
"level": "error"
},
"spacing_after_comma": {
"level": "error"
}
}

14
.erb-lint.yml Normal file
View File

@@ -0,0 +1,14 @@
---
linters:
FinalNewline:
enabled: true
SpaceAroundErbTag:
enabled: true
SelfClosingTag:
enabled: false
Rubocop:
enabled: true
only:
- Layout/EndOfLine
- Lint/LiteralAsCondition
- Style/PercentLiteralDelimiters

View File

@@ -1,17 +1,17 @@
References
===================
> Add references to related Issues/Pull Requests/Travis Builds/Rollbar errors/etc...
## References
Objectives
===================
> What are the objectives of this changes? (If there is no related Issue with an explanation)
> Related Issues/Pull Requests/Travis Builds/Rollbar errors/etc...
## Objectives
> What are the objectives of these changes?
## Visual Changes
Visual Changes
===================
> Any visual changes? please attach screenshots (or gifs) showing them.
> If modified views are public (not the admin panel), try them in mobile display (with your browser's developer console) and add screenshots.
Notes
===================
## Notes
> Mention rake tasks or actions to be done when deploying this changes to a server (if any).
> Explain any caveats, or important things to notice like deprecations (if any).

1
.gitignore vendored
View File

@@ -34,3 +34,4 @@
public/sitemap.xml
public/system/
/public/ckeditor_assets/

View File

@@ -2,3 +2,8 @@ rubocop:
config_file: .rubocop_basic.yml
scss:
config_file: .scss-lint.yml
coffeescript:
config_file: .coffeelint.json
erblint:
enabled: true
config_file: .erb-lint.yml

View File

@@ -4,12 +4,11 @@ AllCops:
DisplayCopNames: true
DisplayStyleGuide: true
Include:
- '**/Rakefile'
- '**/config.ru'
- "**/Rakefile"
- "**/config.ru"
Exclude:
- 'db/**/*'
- 'config/**/*'
- 'script/**/*'
- "db/migrate/**/*"
- "db/schema.rb"
TargetRubyVersion: 2.3
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
# to ignore them, so only the ones explicitly set in this file are enabled.
@@ -30,6 +29,12 @@ Layout/TrailingBlankLines:
Layout/TrailingWhitespace:
Enabled: true
Lint/LiteralAsCondition:
Enabled: true
Lint/UselessAssignment:
Enabled: true
Metrics/LineLength:
Max: 100

View File

@@ -1,71 +0,0 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2018-02-10 21:25:09 +0100 using RuboCop version 0.52.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
# Offense count: 10
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: normal, rails
Layout/IndentationConsistency:
Exclude:
- 'spec/features/tracks_spec.rb'
- 'spec/models/budget/investment_spec.rb'
- 'spec/models/legislation/draft_version_spec.rb'
- 'spec/models/proposal_spec.rb'
# Offense count: 1225
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Max: 248
# Offense count: 4
# Cop supports --auto-correct.
Performance/RedundantMatch:
Exclude:
- 'app/controllers/valuation/budget_investments_controller.rb'
- 'app/controllers/valuation/spending_proposals_controller.rb'
# Offense count: 11
RSpec/DescribeClass:
Exclude:
- 'spec/customization_engine_spec.rb'
- 'spec/i18n_spec.rb'
- 'spec/lib/acts_as_paranoid_aliases_spec.rb'
- 'spec/lib/cache_spec.rb'
- 'spec/lib/graphql_spec.rb'
- 'spec/lib/tasks/communities_spec.rb'
- 'spec/lib/tasks/dev_seed_spec.rb'
- 'spec/lib/tasks/map_location_spec.rb'
- 'spec/lib/tasks/settings_spec.rb'
- 'spec/models/abilities/organization_spec.rb'
- 'spec/views/welcome/index.html.erb_spec.rb'
# Offense count: 2
# Configuration parameters: SkipBlocks, EnforcedStyle.
# SupportedStyles: described_class, explicit
RSpec/DescribedClass:
Exclude:
- 'spec/controllers/concerns/has_filters_spec.rb'
- 'spec/controllers/concerns/has_orders_spec.rb'
# Offense count: 6
RSpec/ExpectActual:
Exclude:
- 'spec/routing/**/*'
- 'spec/features/admin/budget_investments_spec.rb'
# Offense count: 830
# Configuration parameters: AssignmentOnly.
RSpec/InstanceVariable:
Enabled: false
# Offense count: 1
# Configuration parameters: IgnoreSymbolicNames.
RSpec/VerifiedDoubles:
Exclude:
- 'spec/models/verification/management/email_spec.rb'

View File

@@ -175,7 +175,7 @@ linters:
StringQuotes:
enabled: true
style: single_quotes
style: double_quotes
TrailingSemicolon:
enabled: true

View File

@@ -1,6 +1,6 @@
language: ruby
addons:
postgresql: '9.4'
postgresql: "9.4"
chrome: stable
rvm:
- 2.3.2

View File

@@ -1,7 +1,304 @@
# Changelog
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html)
## [v0.19](https://github.com/consul/consul/compare/v0.18.1...v0.19) (2019-02-27)
### Added
- **Admin:** Add cards to custom pages [\#3149](https://github.com/consul/consul/pull/3149)
- **Design/UX:** Refactor processes header colors and custom pages [\#3249](https://github.com/consul/consul/pull/3249)
- **Legislation:** Add image to legislation processes and banner colors [\#3152](https://github.com/consul/consul/pull/3152)
- **Mails:** Configurable email interceptor by environment [\#3251](https://github.com/consul/consul/pull/3251)
- **Maintenance-Rubocop:** Enable useless assignment rubocop rule [\#3120](https://github.com/consul/consul/pull/3120)
- **Maintenance-Rubocop:** Fix literal as condition [\#3313](https://github.com/consul/consul/pull/3313)
- **Milestones:** Manage milestone progress bars [\#3195](https://github.com/consul/consul/pull/3195)
- **Milestones:** Refactor milestones css [\#3196](https://github.com/consul/consul/pull/3196)
- **Milestones:** Add progress bar dev seeds [\#3197](https://github.com/consul/consul/pull/3197)
- **Milestones:** Add progress bars to milestones public view [\#3228](https://github.com/consul/consul/pull/3228)
- **Multi-language:** Make budgets translatable [\#3296](https://github.com/consul/consul/pull/3296)
- **Polls:** Add a description for open polls [\#3303](https://github.com/consul/consul/pull/3303)
- **Translations:** add new Russian translation [\#3204](https://github.com/consul/consul/pull/3204)
- **Translations:** add new Russian translation [\#3205](https://github.com/consul/consul/pull/3205)
- **Translations:** add new Russian translation [\#3206](https://github.com/consul/consul/pull/3206)
- **Translations:** add new Russian translation [\#3207](https://github.com/consul/consul/pull/3207)
- **Translations:** add new Russian translation [\#3208](https://github.com/consul/consul/pull/3208)
- **Translations:** add new Russian translation [\#3209](https://github.com/consul/consul/pull/3209)
- **Translations:** add new Russian translation [\#3210](https://github.com/consul/consul/pull/3210)
- **Translations:** add new Russian translation [\#3211](https://github.com/consul/consul/pull/3211)
- **Translations:** add new Russian translation [\#3212](https://github.com/consul/consul/pull/3212)
- **Translations:** add new Russian translation [\#3213](https://github.com/consul/consul/pull/3213)
- **Translations:** add new Russian translation [\#3214](https://github.com/consul/consul/pull/3214)
- **Translations:** add new Russian translation [\#3215](https://github.com/consul/consul/pull/3215)
- **Translations:** add new Russian translation [\#3216](https://github.com/consul/consul/pull/3216)
- **Translations:** add new Russian translation [\#3217](https://github.com/consul/consul/pull/3217)
- **Translations:** add new Russian translation [\#3218](https://github.com/consul/consul/pull/3218)
- **Translations:** add new Russian translation [\#3219](https://github.com/consul/consul/pull/3219)
- **Translations:** add new Russian translation [\#3220](https://github.com/consul/consul/pull/3220)
- **Translations:** add new Russian translation [\#3221](https://github.com/consul/consul/pull/3221)
- **Translations:** add new Russian translation [\#3222](https://github.com/consul/consul/pull/3222)
- **Translations:** add new Russian translation [\#3223](https://github.com/consul/consul/pull/3223)
- **Translations:** add new Russian translation [\#3224](https://github.com/consul/consul/pull/3224)
- **Translations:** add new Russian translation [\#3225](https://github.com/consul/consul/pull/3225)
- **Translations:** add new Russian translation [\#3226](https://github.com/consul/consul/pull/3226)
- **Translations:** New Crowdin translations [\#3305](https://github.com/consul/consul/pull/3305)
- **Translations:** Add locales for Indonesian, Russian, Slovak and Somali [\#3309](https://github.com/consul/consul/pull/3309)
- **Translations:** Remove untranslated locales [\#3310](https://github.com/consul/consul/pull/3310)
### Changed
- **Admin:** Admin tables order - sorting [\#3148](https://github.com/consul/consul/pull/3148)
- **Admin:** Hide polls results and stats to admins [\#3229](https://github.com/consul/consul/pull/3229)
- **Admin:** Allow change map image from admin [\#3230](https://github.com/consul/consul/pull/3230)
- **Admin:** Allow admins delete poll answer documents [\#3231](https://github.com/consul/consul/pull/3231)
- **Admin:** Admin polls list [\#3253](https://github.com/consul/consul/pull/3253)
- **Admin:** Show all system emails in Admin section [\#3326](https://github.com/consul/consul/pull/3326)
- **Admin:** Improve Admin settings section [\#3328](https://github.com/consul/consul/pull/3328)
- **Budgets:** Show current phase as selected on phase select on admin budgets form [\#3203](https://github.com/consul/consul/pull/3203)
- **Budgets:** Do not display alert when supporting in a group with a single heading [\#3278](https://github.com/consul/consul/pull/3278)
- **Budgets:** Include heading names in "headings limit reached" alert [\#3290](https://github.com/consul/consul/pull/3290)
- **Budgets:** Consider having valuator group as having valuator [\#3314](https://github.com/consul/consul/pull/3314)
- **Budgets:** Show all investments in the map [\#3318](https://github.com/consul/consul/pull/3318)
- **Design/UX:** Improve UI of budgets index page [\#3250](https://github.com/consul/consul/pull/3250)
- **Design/UX:** Allow select column width for widget cards [\#3252](https://github.com/consul/consul/pull/3252)
- **Design/UX:** Change layout on homepage if feed debates and proposals are enabled [\#3269](https://github.com/consul/consul/pull/3269)
- **Design/UX:** Improve color picker on admin legislation process [\#3277](https://github.com/consul/consul/pull/3277)
- **Design/UX:** Removes next/incoming filters [\#3280](https://github.com/consul/consul/pull/3280)
- **Design/UX:** Add sorting icons to sortable tables [\#3324](https://github.com/consul/consul/pull/3324)
- **Design/UX:** Improve UX on admin section [\#3329](https://github.com/consul/consul/pull/3329)
- **Legislation:** Remove help and recommendations on legislation proposal new form [\#3200](https://github.com/consul/consul/pull/3200)
- **Legislation:** Sort Legislation Processes by descending start date [\#3202](https://github.com/consul/consul/pull/3202)
- **Maps:** Always show markers on budgets index map [\#3267](https://github.com/consul/consul/pull/3267)
- **Maintenance-Refactorings:** Add pending specs proposal notification limits [\#3174](https://github.com/consul/consul/pull/3174)
- **Maintenance-Refactorings:** Refactors images attributes [\#3170](https://github.com/consul/consul/pull/3170)
- **Maintenance-Refactorings:** Use find instead of find\_by\_id [\#3234](https://github.com/consul/consul/pull/3234)
- **Maintenance-Refactorings:** LegacyLegislation migration cleanup [\#3275](https://github.com/consul/consul/pull/3275)
- **Maintenance-Refactorings:** Replace sccs lint string quotes to double quotes [\#3281](https://github.com/consul/consul/pull/3281)
- **Maintenance-Refactorings:** Change single quotes to double quotes in folder /spec [\#3287](https://github.com/consul/consul/pull/3287)
- **Maintenance-Refactorings:** Reuse image attributes in legislation processes [\#3319](https://github.com/consul/consul/pull/3319)
- **Newsletters:** Send newsletter emails in order [\#3274](https://github.com/consul/consul/pull/3274)
- **Tags:** Set tags max length to 160 [\#3264](https://github.com/consul/consul/pull/3264)
- **Translations:** Update budgets confirm group es translation [\#3198](https://github.com/consul/consul/pull/3198)
- **Votes:** Use votes score instead of total votes on debates and legislation proposals [\#3291](https://github.com/consul/consul/pull/3291)
### Fixed
- **Budgets:** Show unfeasible and unselected investments for finished budgets [\#3272](https://github.com/consul/consul/pull/3272)
- **Design/UX:** Fix UI details for a better UX and design [\#3323](https://github.com/consul/consul/pull/3323)
- **Design/UX:** Budgets UI minor fixes [\#3268](https://github.com/consul/consul/pull/3268)
- **Polls:** Delete Booth Shifts with associated data [\#3292](https://github.com/consul/consul/pull/3292)
- **Proposals:** Fix random proposals order in the same session [\#3321](https://github.com/consul/consul/pull/3321)
- **Tags:** Fix valuation tags being overwritten [\#3330](https://github.com/consul/consul/pull/3330)
- **Translations:** Fix i18n and UI minor details [\#3191](https://github.com/consul/consul/pull/3191)
- **Translations:** Return a String in I18n method 'pluralize' [\#3307](https://github.com/consul/consul/pull/3307)
## [0.18.1](https://github.com/consul/consul/compare/v0.18...v0.18.1) (2019-01-17)
### Added
- **Legislation:** Legislation process homepage phase [\#3188](https://github.com/consul/consul/pull/3188)
- **Legislation:** Show documents on processes proposals phase [\#3136](https://github.com/consul/consul/pull/3136)
- **Maintenance-Refactorings:** Remove semicolons from controllers [\#3160](https://github.com/consul/consul/pull/3160)
- **Maintenance-Refactorings:** Remove before action not used [\#3167](https://github.com/consul/consul/pull/3167)
- **Maintenance-Rubocop:** Enable double quotes rubocop rule [\#3175](https://github.com/consul/consul/pull/3175)
- **Maintenance-Rubocop:** Enable line length rubocop rule [\#3165](https://github.com/consul/consul/pull/3165)
- **Maintenance-Rubocop:** Add rubocop rule to indent private methods [\#3134](https://github.com/consul/consul/pull/3134)
### Changed
- **Admin:** Improve CRUD budgets and content blocks [\#3173](https://github.com/consul/consul/pull/3173)
- **Design/UX:** new CRUD budgets, content blocks and heading map [\#3150](https://github.com/consul/consul/pull/3150)
- **Design/UX:** Processes key dates [\#3137](https://github.com/consul/consul/pull/3137)
### Fixed
- **Admin:** checks for deleted proposals [\#3154](https://github.com/consul/consul/pull/3154)
- **Admin:** Add default order for admin budget investments list [\#3151](https://github.com/consul/consul/pull/3151)
- **Budgets:** Bug Management Cannot create Budget Investment without a map location [\#3133](https://github.com/consul/consul/pull/3133)
## [0.18.0](https://github.com/consul/consul/compare/v0.17...v0.18) (2018-12-27)
### Added
- **Admin:** Admin poll questions index [\#3123](https://github.com/consul/consul/pull/3123)
- **Budgets:** Added feature to add content block to headings in sidebar [\#3043](https://github.com/consul/consul/pull/3043)
- **Budgets:** Add map to sidebar on Heading's page [\#3038](https://github.com/consul/consul/pull/3038)
- **Budgets:** Budget executions [\#3023](https://github.com/consul/consul/pull/3023)
- **Budgets:** Budget execution list [\#2864](https://github.com/consul/consul/pull/2864)
- **Design/UX:** Administrator ID [\#3056](https://github.com/consul/consul/pull/3056)
- **Legislation:** Draft phase on legislation processes [\#3105](https://github.com/consul/consul/pull/3105)
- **Legislation:** add homepage for legislation processes [\#3091](https://github.com/consul/consul/pull/3091)
- **Legislation:** Adds draft phase functionality in legislation processes [\#3048](https://github.com/consul/consul/pull/3048)
- **Maintenance:** Widgets dev seeds [\#3104](https://github.com/consul/consul/pull/3104)
- **Maintenance:** Add web sections to seeds [\#3037](https://github.com/consul/consul/pull/3037)
- **Maintenance-Rubocop:** Apply Rubocop not\_to rule [\#3118](https://github.com/consul/consul/pull/3118)
- **Maintenance-Rubocop:** Add not\_to Rubocop rule [\#3112](https://github.com/consul/consul/pull/3112)
- **Maintenance-Rubocop:** Add a "Reviewed by Hound" badge [\#3093](https://github.com/consul/consul/pull/3093)
- **Maintenance-Specs:** Add missing feature spec: Proposal Notifications In-app notifications from the proposal's author group notifications for the same proposal [\#3066](https://github.com/consul/consul/pull/3066)
- **Maintenance-Specs:** Add missing feature spec: Admin poll questions Create from successful proposal show [\#3065](https://github.com/consul/consul/pull/3065)
- **Maintenance-Specs:** Add missing feature spec Admin budget investments Edit Do not display valuators of an assigned group [\#3064](https://github.com/consul/consul/pull/3064)
- **Milestones:** Edit only existing languages in milestones summary [\#3103](https://github.com/consul/consul/pull/3103)
- **Milestones:** Update milestone status texts [\#3102](https://github.com/consul/consul/pull/3102)
- **Milestones:** Fix milestone validation [\#3101](https://github.com/consul/consul/pull/3101)
- **Milestones:** Add milestones to legislation processes [\#3100](https://github.com/consul/consul/pull/3100)
- **Milestones:** Add milestones to proposals [\#3099](https://github.com/consul/consul/pull/3099)
- **Milestones:** Fix budget investment milestone translations migration [\#3097](https://github.com/consul/consul/pull/3097)
- **Milestones:** Make milestones code reusable [\#3095](https://github.com/consul/consul/pull/3095)
- **Milestones:** Make milestones controller polymorphic [\#3083](https://github.com/consul/consul/pull/3083)
- **Milestones:** Make milestones polymorphic [\#3057](https://github.com/consul/consul/pull/3057)
- **Polls:** Polls voted by [\#3089](https://github.com/consul/consul/pull/3089)
- **Proposals:** Featured proposals [\#3081](https://github.com/consul/consul/pull/3081)
- **Translations:** Added Slovenian translations [\#3062](https://github.com/consul/consul/pull/3062)
- **Translations:** New Crowdin translations [\#3050](https://github.com/consul/consul/pull/3050)
- **Translations:** Maintain translations for other languages after updatin main language [\#3046](https://github.com/consul/consul/pull/3046)
- **Translations:** New Crowdin translations [\#3005](https://github.com/consul/consul/pull/3005)
- **Translations:** Update i18n from Crowdin [\#2998](https://github.com/consul/consul/pull/2998)
### Changed
- **Admin:** Improve action buttons aspect for small screens [\#3027](https://github.com/consul/consul/pull/3027)
- **Admin:** Improve visualization for small resolution [\#3025](https://github.com/consul/consul/pull/3025)
- **Admin:** Budgets admin [\#3012](https://github.com/consul/consul/pull/3012)
- **Budgets:** Budget investments social share [\#3053](https://github.com/consul/consul/pull/3053)
- **Design/UX:** Documents title [\#3131](https://github.com/consul/consul/pull/3131)
- **Design/UX:** Proposal create question [\#3122](https://github.com/consul/consul/pull/3122)
- **Design/UX:** Budget investments price explanation [\#3121](https://github.com/consul/consul/pull/3121)
- **Design/UX:** Change CRUD for budget groups and headings [\#3106](https://github.com/consul/consul/pull/3106)
- **Design/UX:** UI design [\#3080](https://github.com/consul/consul/pull/3080)
- **Design/UX:** Budgets unselected message [\#3033](https://github.com/consul/consul/pull/3033)
- **Design/UX:** Hide Featured section on Home Page if there are no cards [\#2899](https://github.com/consul/consul/pull/2899)
- **Maintenance:** Simplify pull request template [\#3088](https://github.com/consul/consul/pull/3088)
- **Maintenance:** Removes references to deleted general terms page [\#3079](https://github.com/consul/consul/pull/3079)
- **Maintenance:** Pages texts [\#3042](https://github.com/consul/consul/pull/3042)
- **Maintenance:** Removed icon\_home and fixed corresponding test [\##2970](https://github.com/consul/consul/pull/2970)
- **Maintenance-Gems:** \[Security\] Bump rails from 4.2.10 to 4.2.11 [\#3070](https://github.com/consul/consul/pull/3070)
- **Maintenance-Gems:** Bump database\_cleaner from 1.6.2 to 1.7.0 [\#3014](https://github.com/consul/consul/pull/3014)
- **Maintenance-Gems:** Bump rspec-rails from 3.7.2 to 3.8.1 [\#3003](https://github.com/consul/consul/pull/3003)
- **Maintenance-Gems:** Bump uglifier from 4.1.3 to 4.1.19 [\#3002](https://github.com/consul/consul/pull/3002)
- **Maintenance-Gems:** \[Security\] Bump rack from 1.6.10 to 1.6.11 [\#3000](https://github.com/consul/consul/pull/3000)
- **Maintenance-Gems:** Bump knapsack\_pro from 0.53.0 to 1.1.0 [\#2999](https://github.com/consul/consul/pull/2999)
- **Maintenance-Gems:** Bump letter\_opener\_web from 1.3.2 to 1.3.4 [\#2957](https://github.com/consul/consul/pull/2957)
- **Maintenance-Gems:** Bump rollbar from 2.15.5 to 2.18.0 [\#2923](https://github.com/consul/consul/pull/2923)
- **Maintenance-Gems:** Bump cancancan from 2.1.2 to 2.3.0 [\#2901](https://github.com/consul/consul/pull/2901)
- **Maintenance-Refactorings:** Remove custom "toda la ciudad" code [\#3111](https://github.com/consul/consul/pull/3111)
- **Maintenance-Refactorings:** Refactor legislation process subnav [\#3074](https://github.com/consul/consul/pull/3074)
- **Maintenance-Refactorings:** Rename Admin::Proposals to Admin::HiddenProposals [\#3073](https://github.com/consul/consul/pull/3073)
- **Maintenance-Refactorings:** Budget investment show [\#3041](https://github.com/consul/consul/pull/3041)
- **Proposals:** Optimize task reset\_hot\_score [\#3116](https://github.com/consul/consul/pull/3116)
- **Proposals:** New algorithm for filter 'most active' [\#3098](https://github.com/consul/consul/pull/3098)
- **Translations:** Bring back date order translations [\#3127](https://github.com/consul/consul/pull/3127)
- **Translations:** i18n remove date.order key [\#3007](https://github.com/consul/consul/pull/3007)
### Fixed
- **Admin:** Fix pagination after selecting/unselecting budget investment [\#3034](https://github.com/consul/consul/pull/3034)
- **Admin:** Admin menu link [\#3032](https://github.com/consul/consul/pull/3032)
- **Design/UX:** Honeypot on users sign up form [\#3124](https://github.com/consul/consul/pull/3124)
- **Design/UX:** Fix scroll jump voting investments [\#3113](https://github.com/consul/consul/pull/3113)
- **Design/UX:** Globalize tabs [\#3054](https://github.com/consul/consul/pull/3054)
- **Design/UX:** Help feature [\#3040](https://github.com/consul/consul/pull/3040)
- **Design/UX:** Fix misleading title on account creation confirmation page (en, fr) [\#2944](https://github.com/consul/consul/pull/2944)
- **Legislation:** Fixes legislation processes key dates active class [\#3020](https://github.com/consul/consul/pull/3020)
- **Maintenance:** Fix scope warning [\#3071](https://github.com/consul/consul/pull/3071)
- **Maintenance** Admin poll officers [\#3055](https://github.com/consul/consul/pull/3055)
- **Maintenance-Rubocop:** Remove trailing whitespace [\#3094](https://github.com/consul/consul/pull/3094)
- **Maintenance-Specs:** Fix flaky spec checking price without currency symbol [\#3115](https://github.com/consul/consul/pull/3115)
- **Maintenance-Specs:** Fix flaky localization specs [\#3096](https://github.com/consul/consul/pull/3096)
- **Maintenance-Specs:** Add frozen time condition to proposals phase spec [\#3090](https://github.com/consul/consul/pull/3090)
- **Maintenance-Specs:** Fix flaky spec: Legislation Proposals Each user has a different and consistent random proposals order [\#3085](https://github.com/consul/consul/pull/3085)
- **Maintenance-Specs:** Fix flaky spec: Each user has a different and consistent random proposals order [\#3076](https://github.com/consul/consul/pull/3076)
- **Maintenance-Specs:** Fix flaky spec: Welcome screen is not shown to organizations [\#3072](https://github.com/consul/consul/pull/3072)
- **Maintenance-Specs:** Fix failing spec: Budget::Investment Reclassification store\_reclassified\_votes stores the votes for a reclassified investment [\#3067](https://github.com/consul/consul/pull/3067)
- **Maintenance-Specs:** Fix failing spec: Poll::Shift officer\_assignments creates and destroy corresponding officer\_assignments [\#3061](https://github.com/consul/consul/pull/3061)
- **Maintenance-Specs:** Update debates\_spec.rb [\#3029](https://github.com/consul/consul/pull/3029)
- **Maintenance-Specs:** Fix flaky spec: Admin budget investment mark/unmark visible to valuators [\#3008](https://github.com/consul/consul/pull/3008)
- **Polls:** Fix poll results accuracy [\#3030](https://github.com/consul/consul/pull/3030)
- **Translations:** Legislation dates [\#3039](https://github.com/consul/consul/pull/3039)
- **Translations:** Fixes english translations [\#3011](https://github.com/consul/consul/pull/3011)
- **Translations:** i18n remove duplicate locale folders [\#3006](https://github.com/consul/consul/pull/3006)
- **Valuation:** Fix crash in valuation when there are no budgets [\#3128](https://github.com/consul/consul/pull/3128)
## [0.17.0](https://github.com/consul/consul/compare/v0.16...v0.17) - 2018-10-31
### Added
- **Multi-language:** Migrate globalize data [\#2986](https://github.com/consul/consul/pull/2986)
- **Multi-language:** Update custom pages translations [\#2952](https://github.com/consul/consul/pull/2952)
- **Multi-language:** Make homepage content translatable [\#2924](https://github.com/consul/consul/pull/2924)
- **Multi-language:** Make collaborative legislation translatable [\#2912](https://github.com/consul/consul/pull/2912)
- **Multi-language:** Make admin notifications translatable [\#2910](https://github.com/consul/consul/pull/2910)
- **Multi-language:** Refactor translatable specs [\#2903](https://github.com/consul/consul/pull/2903)
- **Multi-language:** Refactor code shared by admin-translatable resources [\#2896](https://github.com/consul/consul/pull/2896)
- **Multi-language:** Change Translatable implementation to accommodate new requirements [\#2886](https://github.com/consul/consul/pull/2886)
- **Multi-language:** Make banners translatable [\#2865](https://github.com/consul/consul/pull/2865)
- **Multi-language:** Fix translatable bugs [\#2985](https://github.com/consul/consul/pull/2985)
- **Multi-language:** Make polls translatable [\#2914](https://github.com/consul/consul/pull/2914)
- **Multi-language:** Updates translatable custom pages [\#2913](https://github.com/consul/consul/pull/2913)
- **Translations:** Add all available languages [\#2964](https://github.com/consul/consul/pull/2964)
- **Translations:** Fix locale folder names [\#2963](https://github.com/consul/consul/pull/2963)
- **Translations:** Update translations from Crowdin [\#2961](https://github.com/consul/consul/pull/2961)
- **Translations:** Display language name or language key [\#2949](https://github.com/consul/consul/pull/2949)
- **Translations:** Avoid InvalidPluralizationData exception when missing translations [\#2936](https://github.com/consul/consul/pull/2936)
- **Translations:** Changes allegations dates label [\#2915](https://github.com/consul/consul/pull/2915)
- **Maintenance-Rubocop:** Add Hound basic configuration [\#2987](https://github.com/consul/consul/pull/2987)
- **Maintenance-Rubocop:** Update rubocop rules [\#2925](https://github.com/consul/consul/pull/2925)
- **Maintenance-Rubocop:** Fix Rubocop warnings for Admin controllers [\#2880](https://github.com/consul/consul/pull/2880)
- **Design/UX:** Adds status icons on polls poll group [\#2860](https://github.com/consul/consul/pull/2860)
- **Design/UX:** Feature help page [\#2933](https://github.com/consul/consul/pull/2933)
- **Design/UX:** Adds enable help page task [\#2960](https://github.com/consul/consul/pull/2960)
- **Budgets:** Allow select winner legislation proposals [\#2950](https://github.com/consul/consul/pull/2950)
- **Legislation-Proposals:** Add legislation proposal's categories [\#2948](https://github.com/consul/consul/pull/2948)
- **Legislation-Proposals:** Admin permissions in legislation proposals [\#2945](https://github.com/consul/consul/pull/2945)
- **Legislation-Proposals:** Random legislation proposal's order & pagination [\#2942](https://github.com/consul/consul/pull/2942)
- **Legislation-Proposals:** Legislation proposals imageable [\#2922](https://github.com/consul/consul/pull/2922)
- **CKeditor:** Bring back CKEditor images button [\#2977](https://github.com/consul/consul/pull/2977)
- **CKeditor:** Ckeditor4 update [\#2876](https://github.com/consul/consul/pull/2876)
- **Installation:** Add placeholder configuration for SMTP [\#2900](https://github.com/consul/consul/pull/2900)
### Changed
- **Newsletters:** Newsletter updates [\#2992](https://github.com/consul/consul/pull/2992)
- **Maintenance-Gems:** \[Security\] Bump rubyzip from 1.2.1 to 1.2.2 [\#2879](https://github.com/consul/consul/pull/2879)
- **Maintenance-Gems:** \[Security\] Bump nokogiri from 1.8.2 to 1.8.4 [\#2878](https://github.com/consul/consul/pull/2878)
- **Maintenance-Gems:** \[Security\] Bump ffi from 1.9.23 to 1.9.25 [\#2877](https://github.com/consul/consul/pull/2877)
- **Maintenance-Gems:** Bump jquery-rails from 4.3.1 to 4.3.3 [\#2929](https://github.com/consul/consul/pull/2929)
- **Maintenance-Gems:** Bump browser from 2.5.2 to 2.5.3 [\#2928](https://github.com/consul/consul/pull/2928)
- **Maintenance-Gems:** Bump delayed\_job\_active\_record from 4.1.2 to 4.1.3 [\#2927](https://github.com/consul/consul/pull/2927)
- **Maintenance-Gems:** Bump rubocop-rspec from 1.24.0 to 1.26.0 [\#2926](https://github.com/consul/consul/pull/2926)
- **Maintenance-Gems:** Bump paranoia from 2.4.0 to 2.4.1 [\#2909](https://github.com/consul/consul/pull/2909)
- **Maintenance-Gems:** Bump ancestry from 3.0.1 to 3.0.2 [\#2908](https://github.com/consul/consul/pull/2908)
- **Maintenance-Gems:** Bump i18n-tasks from 0.9.20 to 0.9.25 [\#2906](https://github.com/consul/consul/pull/2906)
- **Maintenance-Gems:** Bump coveralls from 0.8.21 to 0.8.22 [\#2905](https://github.com/consul/consul/pull/2905)
- **Maintenance-Gems:** Bump scss\_lint from 0.54.0 to 0.55.0 [\#2895](https://github.com/consul/consul/pull/2895)
- **Maintenance-Gems:** Bump unicorn from 5.4.0 to 5.4.1 [\#2894](https://github.com/consul/consul/pull/2894)
- **Maintenance-Gems:** Bump mdl from 0.4.0 to 0.5.0 [\#2892](https://github.com/consul/consul/pull/2892)
- **Maintenance-Gems:** Bump savon from 2.11.2 to 2.12.0 [\#2891](https://github.com/consul/consul/pull/2891)
- **Maintenance-Gems:** Bump capistrano-rails from 1.3.1 to 1.4.0 [\#2884](https://github.com/consul/consul/pull/2884)
- **Maintenance-Gems:** Bump autoprefixer-rails from 8.2.0 to 9.1.4 [\#2881](https://github.com/consul/consul/pull/2881)
- **Maintenance-Gems:** Upgrade gem coffee-rails to version 4.2.2 [\#2837](https://github.com/consul/consul/pull/2837)
- **Maintenance-Refactorings:** Adds custom javascripts folder [\#2921](https://github.com/consul/consul/pull/2921)
- **Maintenance-Refactorings:** Test suite maintenance [\#2888](https://github.com/consul/consul/pull/2888)
- **Maintenance-Refactorings:** Replace `.all.each` with `.find\_each` to reduce memory usage [\#2887](https://github.com/consul/consul/pull/2887)
- **Maintenance-Refactorings:** Split factories [\#2838](https://github.com/consul/consul/pull/2838)
- **Maintenance-Refactorings:** Change spelling for constant to TITLE\_LENGTH\_RANGE [\#2966](https://github.com/consul/consul/pull/2966)
- **Maintenance-Refactorings:** Remove described class cop [\#2990](https://github.com/consul/consul/pull/2990)
- **Maintenance-Refactorings:** Ease customization in processes controller [\#2982](https://github.com/consul/consul/pull/2982)
- **Maintenance-Refactorings:** Fix a misleading comment [\#2844](https://github.com/consul/consul/pull/2844)
- **Maintenance-Refactorings:** Simplify legislation proposals customization [\#2946](https://github.com/consul/consul/pull/2946)
- **Social-Share:** Improves social share messages for proposals [\#2994](https://github.com/consul/consul/pull/2994)
### Fixed
- **Maintenance-Specs:** Fix flaky specs: proposals and legislation Voting comments Update [\#2989](https://github.com/consul/consul/pull/2989)
- **Maintenance-Specs:** Fix flaky spec: Admin legislation questions Update Valid legislation question [\#2976](https://github.com/consul/consul/pull/2976)
- **Maintenance-Specs:** Fix flaky spec: Admin feature flags Enable a disabled feature [\#2967](https://github.com/consul/consul/pull/2967)
- **Maintenance-Specs:** Fix flaky spec for translations [\#2962](https://github.com/consul/consul/pull/2962)
- **Maintenance-Specs:** Fix flaky spec: Admin legislation draft versions Update Valid legislation draft version [\#2995](https://github.com/consul/consul/pull/2995)
- **Maintenance-Specs:** Fix pluralization spec when using different default locale [\#2973](https://github.com/consul/consul/pull/2973)
- **Maintenance-Specs:** Fix time related specs [\#2911](https://github.com/consul/consul/pull/2911)
- **Design/UX:** UI design [\#2983](https://github.com/consul/consul/pull/2983)
- **Design/UX:** Custom fonts [\#2916](https://github.com/consul/consul/pull/2916)
- **Design/UX:** Show active tab in custom info texts [\#2898](https://github.com/consul/consul/pull/2898)
- **Design/UX:** Fix navigation menu under Legislation::Proposal show view [\#2835](https://github.com/consul/consul/pull/2835)
- **Social-Share:** Fix bug in facebook share link [\#2852](https://github.com/consul/consul/pull/2852)
## [0.16.0](https://github.com/consul/consul/compare/v0.15...v0.16) - 2018-07-16
@@ -416,7 +713,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Rails 4.2.6
- Ruby 2.2.3
[Unreleased]: https://github.com/consul/consul/compare/v0.16...consul:master
[Unreleased]: https://github.com/consul/consul/compare/v0.18...consul:master
[0.18.0]: https://github.com/consul/consul/compare/v0.17...v.018
[0.17.0]: https://github.com/consul/consul/compare/v0.16...v.017
[0.16.0]: https://github.com/consul/consul/compare/v0.15...v.016
[0.15.0]: https://github.com/consul/consul/compare/v0.14...v0.15
[0.14.0]: https://github.com/consul/consul/compare/v0.13...v0.14

22
Capfile
View File

@@ -1,22 +1,22 @@
# Load DSL and set up stages
require 'capistrano/setup'
require "capistrano/setup"
# Include default deployment tasks
require 'capistrano/deploy'
require "capistrano/deploy"
require "capistrano/bundler"
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
#require 'capistrano/passenger'
require 'capistrano/delayed_job'
require 'whenever/capistrano'
require 'rvm1/capistrano3'
require "capistrano/rails/assets"
require "capistrano/rails/migrations"
#require "capistrano/passenger"
require "capistrano/delayed_job"
require "whenever/capistrano"
require "rvm1/capistrano3"
#SCM: Git
require "capistrano/scm/git"
install_plugin Capistrano::SCM::Git
# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
Dir.glob('lib/capistrano/**/*.rb').each { |r| import r }
Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }
Dir.glob("lib/capistrano/tasks/*.cap").each { |r| import r }
Dir.glob("lib/capistrano/**/*.rb").each { |r| import r }

179
Gemfile
View File

@@ -1,103 +1,104 @@
source 'https://rubygems.org'
source "https://rubygems.org"
gem 'rails', '4.2.10'
gem "rails", "4.2.11.1"
gem 'acts-as-taggable-on', '~> 5.0.0'
gem 'acts_as_votable', '~> 0.11.1'
gem 'ahoy_matey', '~> 1.6.0'
gem 'ancestry', '~> 3.0.2'
gem 'autoprefixer-rails', '~> 9.1.4'
gem 'best_in_place', '~> 3.0.1'
gem 'browser', '~> 2.5.3'
gem 'cancancan', '~> 2.1.2'
gem 'ckeditor', '~> 4.2.3'
gem 'cocoon', '~> 1.2.9'
gem 'coffee-rails', '~> 4.2.2'
gem 'daemons', '~> 1.2.4'
gem 'dalli', '~> 2.7.6'
gem 'delayed_job_active_record', '~> 4.1.3'
gem 'devise', '~> 3.5.7'
gem 'devise-async', '~> 0.10.2'
gem 'devise_security_extension', '~> 0.10.0'
gem 'faker', '~> 1.8.7'
gem 'foundation-rails', '~> 6.4.3.0'
gem 'foundation_rails_helper', '~> 2.0.0'
gem 'graphiql-rails', '~> 1.4.1'
gem 'graphql', '~> 1.7.8'
gem 'groupdate', '~> 3.2.0'
gem 'initialjs-rails', '~> 0.2.0.5'
gem 'invisible_captcha', '~> 0.10.0'
gem 'jquery-fileupload-rails'
gem 'jquery-rails', '~> 4.3.3'
gem 'jquery-ui-rails', '~> 6.0.1'
gem 'kaminari', '~> 1.1.1'
gem 'newrelic_rpm', '~> 4.1.0.333'
gem 'omniauth', '~> 1.8.1'
gem 'omniauth-facebook', '~> 4.0.0'
gem 'omniauth-google-oauth2', '~> 0.4.0'
gem 'omniauth-twitter', '~> 1.4.0'
gem 'paperclip', '~> 5.2.1'
gem 'paranoia', '~> 2.4.1'
gem 'pg', '~> 0.21.0'
gem 'pg_search', '~> 2.0.1'
gem 'redcarpet', '~> 3.4.0'
gem 'responders', '~> 2.4.0'
gem 'rinku', '~> 2.0.2', require: 'rails_rinku'
gem 'rollbar', '~> 2.15.5'
gem 'sass-rails', '~> 5.0', '>= 5.0.4'
gem 'savon', '~> 2.12.0'
gem 'sitemap_generator', '~> 6.0.1'
gem 'social-share-button', '~> 1.1'
gem 'sprockets', '~> 3.7.2'
gem 'turbolinks', '~> 2.5.3'
gem 'turnout', '~> 2.4.0'
gem 'uglifier', '~> 4.1.2'
gem 'unicorn', '~> 5.4.1'
gem 'whenever', '~> 0.10.0', require: false
gem 'globalize', '~> 5.0.0'
gem 'globalize-accessors', '~> 0.2.1'
gem 'wkhtmltopdf-binary', '~> 0.12.4'
gem 'wicked_pdf', '~> 1.1.0'
gem "acts-as-taggable-on", "~> 5.0.0"
gem "acts_as_votable", "~> 0.11.1"
gem "ahoy_matey", "~> 1.6.0"
gem "ancestry", "~> 3.0.2"
gem "autoprefixer-rails", "~> 9.1.4"
gem "best_in_place", "~> 3.0.1"
gem "browser", "~> 2.5.3"
gem "cancancan", "~> 2.3.0"
gem "ckeditor", "~> 4.2.3"
gem "cocoon", "~> 1.2.9"
gem "coffee-rails", "~> 4.2.2"
gem "daemons", "~> 1.2.4"
gem "dalli", "~> 2.7.6"
gem "delayed_job_active_record", "~> 4.1.3"
gem "devise", "~> 3.5.7"
gem "devise-async", "~> 0.10.2"
gem "devise_security_extension", "~> 0.10.0"
gem "foundation-rails", "~> 6.4.3.0"
gem "foundation_rails_helper", "~> 2.0.0"
gem "graphiql-rails", "~> 1.4.1"
gem "graphql", "~> 1.7.8"
gem "groupdate", "~> 3.2.0"
gem "initialjs-rails", "~> 0.2.0.5"
gem "invisible_captcha", "~> 0.10.0"
gem "jquery-fileupload-rails"
gem "jquery-rails", "~> 4.3.3"
gem "jquery-ui-rails", "~> 6.0.1"
gem "kaminari", "~> 1.1.1"
gem "newrelic_rpm", "~> 4.1.0.333"
gem "omniauth", "~> 1.8.1"
gem "omniauth-facebook", "~> 4.0.0"
gem "omniauth-google-oauth2", "~> 0.4.0"
gem "omniauth-twitter", "~> 1.4.0"
gem "paperclip", "~> 5.2.1"
gem "paranoia", "~> 2.4.1"
gem "pg", "~> 0.21.0"
gem "pg_search", "~> 2.0.1"
gem "redcarpet", "~> 3.4.0"
gem "responders", "~> 2.4.0"
gem "rinku", "~> 2.0.2", require: "rails_rinku"
gem "rollbar", "~> 2.18.0"
gem "sass-rails", "~> 5.0", ">= 5.0.4"
gem "savon", "~> 2.12.0"
gem "sitemap_generator", "~> 6.0.1"
gem "social-share-button", "~> 1.1"
gem "sprockets", "~> 3.7.2"
gem "turbolinks", "~> 2.5.3"
gem "turnout", "~> 2.4.0"
gem "uglifier", "~> 4.1.2"
gem "unicorn", "~> 5.4.1"
gem "whenever", "~> 0.10.0", require: false
gem "globalize", "~> 5.0.0"
gem "globalize-accessors", "~> 0.2.1"
gem "recipient_interceptor", "~> 0.2.0"
gem "wkhtmltopdf-binary", "~> 0.12.4"
gem "wicked_pdf", "~> 1.1.0"
source 'https://rails-assets.org' do
gem 'rails-assets-leaflet'
gem 'rails-assets-markdown-it', '~> 8.2.1'
source "https://rails-assets.org" do
gem "rails-assets-leaflet"
gem "rails-assets-markdown-it", "~> 8.2.1"
end
group :development, :test do
gem 'bullet', '~> 5.7.0'
gem 'byebug', '~> 10.0.0'
gem 'factory_bot_rails', '~> 4.8.2'
gem 'faker', '~> 1.8.7'
gem 'i18n-tasks', '~> 0.9.25'
gem 'knapsack_pro', '~> 0.53.0'
gem 'launchy', '~> 2.4.3'
gem 'letter_opener_web', '~> 1.3.2'
gem 'quiet_assets', '~> 1.1.0'
gem 'spring', '~> 2.0.1'
gem 'spring-commands-rspec', '~> 1.0.4'
gem "bullet", "~> 5.7.0"
gem "byebug", "~> 10.0.0"
gem "factory_bot_rails", "~> 4.8.2"
gem "faker", "~> 1.8.7"
gem "i18n-tasks", "~> 0.9.25"
gem "knapsack_pro", "~> 1.1.0"
gem "launchy", "~> 2.4.3"
gem "letter_opener_web", "~> 1.3.4"
gem "quiet_assets", "~> 1.1.0"
gem "spring", "~> 2.0.1"
gem "spring-commands-rspec", "~> 1.0.4"
end
group :test do
gem 'capybara', '~> 2.17.0'
gem 'coveralls', '~> 0.8.22', require: false
gem 'database_cleaner', '~> 1.6.1'
gem 'email_spec', '~> 2.1.0'
gem 'rspec-rails', '~> 3.6'
gem 'selenium-webdriver', '~> 3.10'
gem "capybara", "~> 2.17.0"
gem "coveralls", "~> 0.8.22", require: false
gem "database_cleaner", "~> 1.7.0"
gem "email_spec", "~> 2.1.0"
gem "rspec-rails", "~> 3.8"
gem "selenium-webdriver", "~> 3.10"
end
group :development do
gem 'capistrano', '~> 3.10.1', require: false
gem 'capistrano-bundler', '~> 1.2', require: false
gem 'capistrano-rails', '~> 1.4.0', require: false
gem 'capistrano3-delayed-job', '~> 1.7.3'
gem 'mdl', '~> 0.5.0', require: false
gem 'rubocop', '~> 0.54.0', require: false
gem 'rubocop-rspec', '~> 1.26.0', require: false
gem 'rvm1-capistrano3', '~> 1.4.0', require: false
gem 'scss_lint', '~> 0.55.0', require: false
gem 'web-console', '~> 3.3.0'
gem "capistrano", "~> 3.10.1", require: false
gem "capistrano-bundler", "~> 1.2", require: false
gem "capistrano-rails", "~> 1.4.0", require: false
gem "capistrano3-delayed-job", "~> 1.7.3"
gem "erb_lint", require: false
gem "mdl", "~> 0.5.0", require: false
gem "rubocop", "~> 0.54.0", require: false
gem "rubocop-rspec", "~> 1.26.0", require: false
gem "rvm1-capistrano3", "~> 1.4.0", require: false
gem "scss_lint", "~> 0.55.0", require: false
gem "web-console", "~> 3.3.0"
end
eval_gemfile './Gemfile_custom'
eval_gemfile "./Gemfile_custom"

View File

@@ -2,36 +2,36 @@ GEM
remote: https://rubygems.org/
remote: https://rails-assets.org/
specs:
actionmailer (4.2.10)
actionpack (= 4.2.10)
actionview (= 4.2.10)
activejob (= 4.2.10)
actionmailer (4.2.11.1)
actionpack (= 4.2.11.1)
actionview (= 4.2.11.1)
activejob (= 4.2.11.1)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.10)
actionview (= 4.2.10)
activesupport (= 4.2.10)
actionpack (4.2.11.1)
actionview (= 4.2.11.1)
activesupport (= 4.2.11.1)
rack (~> 1.6)
rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.10)
activesupport (= 4.2.10)
actionview (4.2.11.1)
activesupport (= 4.2.11.1)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (4.2.10)
activesupport (= 4.2.10)
activejob (4.2.11.1)
activesupport (= 4.2.11.1)
globalid (>= 0.3.0)
activemodel (4.2.10)
activesupport (= 4.2.10)
activemodel (4.2.11.1)
activesupport (= 4.2.11.1)
builder (~> 3.1)
activerecord (4.2.10)
activemodel (= 4.2.10)
activesupport (= 4.2.10)
activerecord (4.2.11.1)
activemodel (= 4.2.11.1)
activesupport (= 4.2.11.1)
arel (~> 6.0)
activesupport (4.2.10)
activesupport (4.2.11.1)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
@@ -71,13 +71,21 @@ GEM
best_in_place (3.0.3)
actionpack (>= 3.2)
railties (>= 3.2)
better_html (1.0.13)
actionview (>= 4.0)
activesupport (>= 4.0)
ast (~> 2.0)
erubi (~> 1.4)
html_tokenizer (~> 0.0.6)
parser (>= 2.4)
smart_properties
browser (2.5.3)
builder (3.2.3)
bullet (5.7.1)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11.0)
byebug (10.0.0)
cancancan (2.1.2)
cancancan (2.3.0)
capistrano (3.10.1)
airbrussh (>= 1.0.0)
i18n
@@ -116,7 +124,7 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.0.5)
concurrent-ruby (1.1.5)
coveralls (0.8.22)
json (>= 1.8, < 3)
simplecov (~> 0.16.1)
@@ -126,7 +134,7 @@ GEM
crass (1.0.4)
daemons (1.2.6)
dalli (2.7.6)
database_cleaner (1.6.2)
database_cleaner (1.7.0)
debug_inspector (0.0.3)
delayed_job (4.1.5)
activesupport (>= 3.0, < 5.3)
@@ -151,6 +159,13 @@ GEM
htmlentities (~> 4.3.3)
launchy (~> 2.1)
mail (~> 2.6)
erb_lint (0.0.28)
activesupport
better_html (~> 1.0.7)
html_tokenizer
rainbow
rubocop (~> 0.51)
smart_properties
errbase (0.0.3)
erubi (1.7.1)
erubis (2.7.0)
@@ -176,7 +191,7 @@ GEM
railties (>= 4.1)
tzinfo (~> 1.2, >= 1.2.2)
geocoder (1.4.4)
globalid (0.4.1)
globalid (0.4.2)
activesupport (>= 4.2.0)
globalize (5.0.1)
activemodel (>= 4.2.0, < 4.3)
@@ -192,6 +207,7 @@ GEM
builder (>= 2.1.2)
hashie (3.5.7)
highline (2.0.0)
html_tokenizer (0.0.7)
htmlentities (4.3.4)
httpi (2.4.4)
rack
@@ -236,21 +252,21 @@ GEM
kaminari-core (= 1.1.1)
kaminari-core (1.1.1)
kgio (2.11.2)
knapsack_pro (0.53.0)
knapsack_pro (1.1.0)
rake
kramdown (1.17.0)
launchy (2.4.3)
addressable (~> 2.3)
letter_opener (1.6.0)
launchy (~> 2.2)
letter_opener_web (1.3.2)
letter_opener_web (1.3.4)
actionmailer (>= 3.2)
letter_opener (~> 1.0)
railties (>= 3.2)
loofah (2.2.2)
loofah (2.2.3)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.0)
mail (2.7.1)
mini_mime (>= 0.1.1)
mdl (0.5.0)
kramdown (~> 1.12, >= 1.12.0)
@@ -260,21 +276,21 @@ GEM
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mimemagic (0.3.2)
mini_mime (1.0.0)
mini_portile2 (2.3.0)
mini_mime (1.0.1)
mini_portile2 (2.4.0)
minitest (5.11.3)
mixlib-cli (1.7.0)
mixlib-config (2.2.13)
tomlrb
multi_json (1.12.2)
multi_json (1.13.1)
multi_xml (0.6.0)
multipart-post (2.0.0)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (5.0.2)
newrelic_rpm (4.1.0.333)
nokogiri (1.8.4)
mini_portile2 (~> 2.3.0)
nokogiri (1.10.1)
mini_portile2 (~> 2.4.0)
nori (2.6.0)
oauth (0.5.3)
oauth2 (1.4.0)
@@ -320,26 +336,26 @@ GEM
activesupport (>= 4.2)
arel (>= 6)
powerpack (0.1.2)
public_suffix (3.0.1)
public_suffix (3.0.3)
quiet_assets (1.1.0)
railties (>= 3.1, < 5.0)
rack (1.6.10)
rack (1.6.11)
rack-accept (0.4.5)
rack (>= 0.4)
rack-attack (5.0.1)
rack
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.10)
actionmailer (= 4.2.10)
actionpack (= 4.2.10)
actionview (= 4.2.10)
activejob (= 4.2.10)
activemodel (= 4.2.10)
activerecord (= 4.2.10)
activesupport (= 4.2.10)
rails (4.2.11.1)
actionmailer (= 4.2.11.1)
actionpack (= 4.2.11.1)
actionview (= 4.2.11.1)
activejob (= 4.2.11.1)
activemodel (= 4.2.11.1)
activerecord (= 4.2.11.1)
activesupport (= 4.2.11.1)
bundler (>= 1.3.0, < 2.0)
railties (= 4.2.10)
railties (= 4.2.11.1)
sprockets-rails
rails-assets-leaflet (1.1.0)
rails-assets-markdown-it (8.2.2)
@@ -351,14 +367,16 @@ GEM
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.4)
loofah (~> 2.2, >= 2.2.2)
railties (4.2.10)
actionpack (= 4.2.10)
activesupport (= 4.2.10)
railties (4.2.11.1)
actionpack (= 4.2.11.1)
activesupport (= 4.2.11.1)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rainbow (3.0.0)
raindrops (0.19.0)
rake (12.3.1)
rake (12.3.2)
recipient_interceptor (0.2.0)
mail
redcarpet (3.4.0)
referer-parser (0.3.0)
request_store (1.3.2)
@@ -366,25 +384,25 @@ GEM
actionpack (>= 4.2.0, < 5.3)
railties (>= 4.2.0, < 5.3)
rinku (2.0.4)
rollbar (2.15.5)
rollbar (2.18.0)
multi_json
rspec-core (3.7.1)
rspec-support (~> 3.7.0)
rspec-expectations (3.7.0)
rspec-core (3.8.0)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-mocks (3.7.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-rails (3.7.2)
rspec-support (~> 3.8.0)
rspec-rails (3.8.1)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.7.0)
rspec-expectations (~> 3.7.0)
rspec-mocks (~> 3.7.0)
rspec-support (~> 3.7.0)
rspec-support (3.7.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.0)
rubocop (0.54.0)
parallel (~> 1.10)
parser (>= 2.5)
@@ -429,6 +447,7 @@ GEM
simplecov-html (0.10.2)
sitemap_generator (6.0.1)
builder (~> 3.0)
smart_properties (1.13.1)
social-share-button (1.1.0)
coffee-rails
socksify (1.7.1)
@@ -468,7 +487,7 @@ GEM
tilt (>= 1.4, < 3)
tzinfo (1.2.5)
thread_safe (~> 0.1)
uglifier (4.1.3)
uglifier (4.1.19)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.4.0)
unicorn (5.4.1)
@@ -506,7 +525,7 @@ DEPENDENCIES
browser (~> 2.5.3)
bullet (~> 5.7.0)
byebug (~> 10.0.0)
cancancan (~> 2.1.2)
cancancan (~> 2.3.0)
capistrano (~> 3.10.1)
capistrano-bundler (~> 1.2)
capistrano-rails (~> 1.4.0)
@@ -518,12 +537,13 @@ DEPENDENCIES
coveralls (~> 0.8.22)
daemons (~> 1.2.4)
dalli (~> 2.7.6)
database_cleaner (~> 1.6.1)
database_cleaner (~> 1.7.0)
delayed_job_active_record (~> 4.1.3)
devise (~> 3.5.7)
devise-async (~> 0.10.2)
devise_security_extension (~> 0.10.0)
email_spec (~> 2.1.0)
erb_lint
factory_bot_rails (~> 4.8.2)
faker (~> 1.8.7)
foundation-rails (~> 6.4.3.0)
@@ -540,9 +560,9 @@ DEPENDENCIES
jquery-rails (~> 4.3.3)
jquery-ui-rails (~> 6.0.1)
kaminari (~> 1.1.1)
knapsack_pro (~> 0.53.0)
knapsack_pro (~> 1.1.0)
launchy (~> 2.4.3)
letter_opener_web (~> 1.3.2)
letter_opener_web (~> 1.3.4)
mdl (~> 0.5.0)
newrelic_rpm (~> 4.1.0.333)
omniauth (~> 1.8.1)
@@ -554,14 +574,15 @@ DEPENDENCIES
pg (~> 0.21.0)
pg_search (~> 2.0.1)
quiet_assets (~> 1.1.0)
rails (= 4.2.10)
rails (= 4.2.11.1)
rails-assets-leaflet!
rails-assets-markdown-it (~> 8.2.1)!
recipient_interceptor (~> 0.2.0)
redcarpet (~> 3.4.0)
responders (~> 2.4.0)
rinku (~> 2.0.2)
rollbar (~> 2.15.5)
rspec-rails (~> 3.6)
rollbar (~> 2.18.0)
rspec-rails (~> 3.8)
rubocop (~> 0.54.0)
rubocop-rspec (~> 1.26.0)
rvm1-capistrano3 (~> 1.4.0)
@@ -584,4 +605,4 @@ DEPENDENCIES
wkhtmltopdf-binary (~> 0.12.4)
BUNDLED WITH
1.16.2
1.17.1

View File

@@ -9,6 +9,7 @@ Citizen Participation and Open Government Application
[![Coverage Status](https://coveralls.io/repos/github/consul/consul/badge.svg)](https://coveralls.io/github/consul/consul?branch=master)
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/consul/localized.svg)](https://crowdin.com/project/consul)
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](http://www.gnu.org/licenses/agpl-3.0)
[![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com)
[![Accessibility conformance](https://img.shields.io/badge/accessibility-WAI:AA-green.svg)](https://www.w3.org/WAI/eval/Overview)
[![A11y issues checked with Rocket Validator](https://rocketvalidator.com/badges/checked_with_rocket_validator.svg?url=https://rocketvalidator.com)](https://rocketvalidator.com/opensource)
@@ -78,4 +79,4 @@ Code published under AFFERO GPL v3 (see [LICENSE-AGPLv3.txt](LICENSE-AGPLv3.txt)
## Contributions
See [CONTRIBUTING.md](CONTRIBUTING.md)
See [CONTRIBUTING.md](CONTRIBUTING.md)

View File

@@ -1,7 +1,7 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
require File.expand_path("../config/application", __FILE__)
Rails.application.load_tasks
Rails.application.load_tasks if Rake::Task.tasks.empty?
KnapsackPro.load_tasks if defined?(KnapsackPro)

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 85 KiB

View File

@@ -1,42 +1,42 @@
App.AdvancedSearch =
advanced_search_terms: ->
$('#js-advanced-search').data('advanced-search-terms')
$("#js-advanced-search").data("advanced-search-terms")
toggle_form: (event) ->
event.preventDefault()
$('#js-advanced-search').slideToggle()
$("#js-advanced-search").slideToggle()
toggle_date_options: ->
if $('#js-advanced-search-date-min').val() == 'custom'
$('#js-custom-date').show()
if $("#js-advanced-search-date-min").val() == "custom"
$("#js-custom-date").show()
$( ".js-calendar" ).datepicker( "option", "disabled", false )
else
$('#js-custom-date').hide()
$("#js-custom-date").hide()
$( ".js-calendar" ).datepicker( "option", "disabled", true )
init_calendar: ->
locale = $('#js-locale').data('current-locale')
if locale == 'en'
locale = ''
locale = $("#js-locale").data("current-locale")
if locale == "en"
locale = ""
$('.js-calendar').datepicker
$(".js-calendar").datepicker
regional: locale
maxDate: "+0d"
$('.js-calendar-full').datepicker
$(".js-calendar-full").datepicker
regional: locale
initialize: ->
App.AdvancedSearch.init_calendar()
if App.AdvancedSearch.advanced_search_terms()
$('#js-advanced-search').show()
$("#js-advanced-search").show()
App.AdvancedSearch.toggle_date_options()
$('#js-advanced-search-title').on
$("#js-advanced-search-title").on
click: (event) ->
App.AdvancedSearch.toggle_form(event)
$('#js-advanced-search-date-min').on
$("#js-advanced-search-date-min").on
change: ->
App.AdvancedSearch.toggle_date_options()

View File

@@ -2,7 +2,7 @@ App.AllowParticipation =
initialize: ->
$(document).on {
'mouseenter focus': ->
"mouseenter focus": ->
$(this).find(".js-participation-not-allowed").show()
$(this).find(".js-participation-allowed").hide()
mouseleave: ->

View File

@@ -2,18 +2,18 @@ _t = (key) -> new Gettext().gettext(key)
App.Annotatable =
initialize: ->
current_user_id = $('html').data('current-user-id')
current_user_id = $("html").data("current-user-id")
if current_user_id == ""
annotator.ui.editor.Editor.template = [
'<div class="annotator-outer annotator-editor annotator-hide">',
' <form class="annotator-widget">',
' ' + _t('Unregistered'),
" #{_t("Unregistered")}",
' <div class="annotator-controls">',
' <a href="#cancel" class="annotator-cancel">' + _t('Cancel') + '</a>',
' </div>',
' </form>',
'</div>'
].join('\n')
" <a href='#cancel' class='annotator-cancel'>#{_t("Cancel")}</a>",
" </div>",
" </form>",
"</div>"
].join("\n")
$("[data-annotatable-type]").each ->
$this = $(this)
@@ -23,7 +23,7 @@ App.Annotatable =
app = new annotator.App()
.include ->
beforeAnnotationCreated: (ann) ->
ann[ann_type + "_id"] = ann_id
ann["#{ann_type}_id"] = ann_id
ann.permissions = ann.permissions || {}
ann.permissions.admin = []
.include(annotator.ui.main, { element: this })
@@ -34,5 +34,5 @@ App.Annotatable =
app.ident.identity = current_user_id
options = {}
options[ann_type + "_id"] = ann_id
options["#{ann_type}_id"] = ann_id
app.annotations.load(options)

View File

@@ -87,6 +87,7 @@
//= require clipboard_button
//= require best_in_place_initialize
//= require send_admin_notification_alert
//= require settings
var initialize_modules = function() {
App.Answers.initialize();
@@ -137,12 +138,13 @@ var initialize_modules = function() {
App.ClipboardButton.initialize();
App.BestInPlace.initialize();
App.SendAdminNotificationAlert.initialize();
App.Settings.initialize();
};
$(function(){
Turbolinks.enableProgressBar();
$(document).ready(initialize_modules);
$(document).on('page:load', initialize_modules);
$(document).on('ajax:complete', initialize_modules);
$(document).on("page:load", initialize_modules);
$(document).on("ajax:complete", initialize_modules);
});

View File

@@ -7,37 +7,26 @@ App.Banners =
$(selector).removeClass($(selector).attr("class"), true)
.addClass(style, true)
update_background_color: (selector, text_selector, background_color) ->
$(selector).css('background-color', background_color);
$(text_selector).val(background_color);
update_background_color: (selector, background_color) ->
$(selector).css("background-color", background_color)
update_font_color: (selector, text_selector, font_color) ->
$(selector).css('color', font_color);
$(text_selector).val(font_color);
update_font_color: (selector, font_color) ->
$(selector).css("color", font_color)
initialize: ->
$('[data-js-banner-title]').on
$("[data-js-banner-title]").on
change: ->
App.Banners.update_banner("#js-banner-title", $(this).val())
$('[data-js-banner-description]').on
$("[data-js-banner-description]").on
change: ->
App.Banners.update_banner("#js-banner-description", $(this).val())
$("#banner_background_color_picker").on
$("[name='banner[background_color]']").on
change: ->
App.Banners.update_background_color("#js-banner-background", "#banner_background_color", $(this).val());
App.Banners.update_background_color("#js-banner-background", $(this).val())
$("#banner_background_color").on
$("[name='banner[font_color]']").on
change: ->
App.Banners.update_background_color("#js-banner-background", "#banner_background_color_picker", $(this).val());
$("#banner_font_color_picker").on
change: ->
App.Banners.update_font_color("#js-banner-title", "#banner_font_color", $(this).val());
App.Banners.update_font_color("#js-banner-description", "#banner_font_color", $(this).val());
$("#banner_font_color").on
change: ->
App.Banners.update_font_color("#js-banner-title", "#banner_font_color_picker", $(this).val());
App.Banners.update_font_color("#js-banner-description", "#banner_font_color_picker", $(this).val());
App.Banners.update_font_color("#js-banner-title", $(this).val())
App.Banners.update_font_color("#js-banner-description", $(this).val())

View File

@@ -1,3 +1,3 @@
App.BestInPlace =
initialize: ->
$('.best_in_place').best_in_place();
$(".best_in_place").best_in_place()

View File

@@ -1,13 +1,10 @@
App.CheckAllNone =
initialize: ->
$('[data-check-all]').on 'click', ->
target_name = $(this).data('check-all')
$("[name='" + target_name + "']").prop('checked', true)
$('[data-check-none]').on 'click', ->
target_name = $(this).data('check-none')
$("[name='" + target_name + "']").prop('checked', false)
$("[data-check-all]").on "click", ->
target_name = $(this).data("check-all")
$("[name='#{target_name}']").prop("checked", true)
$("[data-check-none]").on "click", ->
target_name = $(this).data("check-none")
$("[name='#{target_name}']").prop("checked", false)

View File

@@ -1,12 +1,10 @@
App.CheckboxToggle =
initialize: ->
$('[data-checkbox-toggle]').on 'change', ->
$("[data-checkbox-toggle]").on "change", ->
$this = $(this)
$target = $($this.data('checkbox-toggle'))
if $this.is(':checked')
$target = $($this.data("checkbox-toggle"))
if $this.is(":checked")
$target.show()
else
$target.hide()

View File

@@ -22,7 +22,7 @@ CKEDITOR.editorConfig = function( config )
// Rails CSRF token
config.filebrowserParams = function(){
var csrf_token, csrf_param, meta,
metas = document.getElementsByTagName('meta'),
metas = document.getElementsByTagName("meta"),
params = new Object();
for ( var i = 0 ; i < metas.length ; i++ ){
@@ -61,47 +61,47 @@ CKEDITOR.editorConfig = function( config )
};
// Integrate Rails CSRF token into file upload dialogs (link, image, attachment and flash)
CKEDITOR.on( 'dialogDefinition', function( ev ){
CKEDITOR.on( "dialogDefinition", function( ev ){
// Take the dialog name and its definition from the event data.
var dialogName = ev.data.name;
var dialogDefinition = ev.data.definition;
var content, upload;
if (CKEDITOR.tools.indexOf(['link', 'image', 'attachment', 'flash'], dialogName) > -1) {
content = (dialogDefinition.getContents('Upload') || dialogDefinition.getContents('upload'));
upload = (content == null ? null : content.get('upload'));
if (CKEDITOR.tools.indexOf(["link", "image", "attachment", "flash"], dialogName) > -1) {
content = (dialogDefinition.getContents("Upload") || dialogDefinition.getContents("upload"));
upload = (content == null ? null : content.get("upload"));
if (upload && upload.filebrowser && upload.filebrowser['params'] === undefined) {
upload.filebrowser['params'] = config.filebrowserParams();
upload.action = config.addQueryString(upload.action, upload.filebrowser['params']);
if (upload && upload.filebrowser && upload.filebrowser["params"] === undefined) {
upload.filebrowser["params"] = config.filebrowserParams();
upload.action = config.addQueryString(upload.action, upload.filebrowser["params"]);
}
}
});
// Toolbar groups configuration.
config.toolbar = [
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Source'] },
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] },
// { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ], items: [ 'Find', 'Replace', '-', 'SelectAll', '-', 'Scayt' ] },
// { name: 'forms', items: [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField' ] },
{ name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] },
{ name: 'insert', items: [ 'Image', 'Flash', 'Table', 'HorizontalRule', 'SpecialChar' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock' ] },
'/',
{ name: 'styles', items: [ 'Styles', 'Format', 'Font', 'FontSize' ] },
{ name: 'colors', items: [ 'TextColor', 'BGColor' ] },
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] }
{ name: "document", groups: [ "mode", "document", "doctools" ], items: [ "Source"] },
{ name: "clipboard", groups: [ "clipboard", "undo" ], items: [ "Cut", "Copy", "Paste", "PasteText", "PasteFromWord", "-", "Undo", "Redo" ] },
// { name: "editing", groups: [ "find", "selection", "spellchecker" ], items: [ "Find", "Replace", "-", "SelectAll", "-", "Scayt" ] },
// { name: "forms", items: [ "Form", "Checkbox", "Radio", "TextField", "Textarea", "Select", "Button", "ImageButton", "HiddenField" ] },
{ name: "links", items: [ "Link", "Unlink", "Anchor" ] },
{ name: "insert", items: [ "Image", "Flash", "Table", "HorizontalRule", "SpecialChar" ] },
{ name: "paragraph", groups: [ "list", "indent", "blocks", "align", "bidi" ], items: [ "NumberedList", "BulletedList", "-", "Outdent", "Indent", "-", "Blockquote", "CreateDiv", "-", "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock" ] },
"/",
{ name: "styles", items: [ "Styles", "Format", "Font", "FontSize" ] },
{ name: "colors", items: [ "TextColor", "BGColor" ] },
{ name: "basicstyles", groups: [ "basicstyles", "cleanup" ], items: [ "Bold", "Italic", "Underline", "Strike", "Subscript", "Superscript", "-", "RemoveFormat" ] }
];
config.toolbar_mini = [
{ name: 'paragraph', groups: [ 'list' ], items: [ 'NumberedList', 'BulletedList' ] },
{ name: 'links', items: [ 'Link', 'Unlink' ] },
{ name: 'styles', items: [ 'Format' ] },
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike' ] }
{ name: "paragraph", groups: [ "list" ], items: [ "NumberedList", "BulletedList" ] },
{ name: "links", items: [ "Link", "Unlink" ] },
{ name: "styles", items: [ "Format" ] },
{ name: "basicstyles", groups: [ "basicstyles", "cleanup" ], items: [ "Bold", "Italic", "Underline", "Strike" ] }
];
config.toolbar_admin = config.toolbar_mini.concat([
{ name: 'insert', items: [ 'Image' ] }
{ name: "insert", items: [ "Image", "Table" ] }
]);
config.toolbar = "mini";

View File

@@ -1,3 +1,3 @@
//= require ckeditor/init
CKEDITOR.config.customConfig = '<%= javascript_path 'ckeditor/config.js' %>';
CKEDITOR.config.customConfig = "<%= javascript_path 'ckeditor/config.js' %>";

View File

@@ -1,7 +1,7 @@
$(document).bind('page:change', function() {
$(document).bind("page:change", function() {
if (typeof(CKEDITOR) != "undefined"){
for(name in CKEDITOR.instances){
try{CKEDITOR.replace(name);}catch(err){};
}
}
});
});

View File

@@ -1,4 +1,4 @@
App.ClipboardButton =
initialize: ->
clipboard = new ClipboardJS('.js-clipboard');
console.log(clipboard);
clipboard = new ClipboardJS(".js-clipboard")
console.log(clipboard)

View File

@@ -21,12 +21,12 @@ App.Comments =
reset_and_hide_form: (id) ->
form_container = $("#js-comment-form-#{id}")
input = form_container.find("form textarea")
input.val('')
input.val("")
form_container.hide()
reset_form: (id) ->
input = $("#js-comment-form-#{id} form textarea")
input.val('')
input.val("")
toggle_form: (id) ->
$("#js-comment-form-#{id}").toggle()
@@ -39,21 +39,21 @@ App.Comments =
$(arrow).removeClass("icon-arrow-down").addClass("icon-arrow-right")
initialize: ->
$('body .js-add-comment-link').each ->
$("body .js-add-comment-link").each ->
$this = $(this)
unless $this.data('initialized') is 'yes'
$this.on('click', ->
unless $this.data("initialized") is "yes"
$this.on("click", ->
id = $(this).data().id
App.Comments.toggle_form(id)
false
).data 'initialized', 'yes'
).data "initialized", "yes"
$('body .js-toggle-children').each ->
$(this).on('click', ->
$("body .js-toggle-children").each ->
$(this).on("click", ->
children_container_id = "#{$(this).data().id}_children"
$("##{children_container_id}").toggle('slow')
$("##{children_container_id}").toggle("slow")
App.Comments.toggle_arrow(children_container_id)
$(this).children('.js-child-toggle').toggle()
$(this).children(".js-child-toggle").toggle()
false
)

View File

@@ -70,7 +70,7 @@
ProposalGraph.prototype.parseData = function(data) {
var key;
this.xColumnValues = [ ];
this.progressColumnValues = [ this.progressLabel ];
@@ -101,7 +101,7 @@
ProposalGraph.prototype.parseSuccessfulProposalData = function(data) {
var key;
this.successfulColumnValues = [ this.successLabel ];
for (key in data) {
@@ -152,7 +152,7 @@
maximumValue = this.maximumValue === 0 ? this.proposalSuccess : Math.round(this.maximumValue * 1.10);
this.formatXColumnValues();
colors[this.progressColumnValues[0]] = '#004a83';
colors[this.successfulColumnValues[0]] = '#ff7f0e';
@@ -191,7 +191,7 @@
},
min: (this.maximumValue === 0 ? Math.round(this.proposalSuccess * 0.10) : 0),
max: maximumValue,
label: {
label: {
text: this.supportsLabel,
position: 'outer-middle'
}
@@ -214,7 +214,7 @@
},
tooltip: {
format: {
title: function (d) {
title: function (d) {
var achievement = this.achievements.find(function (element) {
return element.value === this.xColumnValues[d + 1];
}.bind(this));
@@ -283,10 +283,10 @@
}
return group;
}
};
ProposalGraph.prototype.isDailyGrouped = function() {
return this.groupBy === undefined || this.groupBy === '' || this.groupBy === null
return this.groupBy === undefined || this.groupBy === '' || this.groupBy === null;
};
$(document).ready(function () {

View File

@@ -2,16 +2,16 @@ App.Documentable =
initialize: ->
inputFiles = $('.js-document-attachment')
inputFiles = $(".js-document-attachment")
$.each inputFiles, (index, input) ->
App.Documentable.initializeDirectUploadInput(input)
$('#nested-documents').on 'cocoon:after-remove', (e, insertedItem) ->
$("#nested-documents").on "cocoon:after-remove", (e, insertedItem) ->
App.Documentable.unlockUploads()
$('#nested-documents').on 'cocoon:after-insert', (e, nested_document) ->
input = $(nested_document).find('.js-document-attachment')
input["lockUpload"] = $(nested_document).closest('#nested-documents').find('.document:visible').length >= $('#nested-documents').data('max-documents-allowed')
$("#nested-documents").on "cocoon:after-insert", (e, nested_document) ->
input = $(nested_document).find(".js-document-attachment")
input["lockUpload"] = $(nested_document).closest("#nested-documents").find(".document:visible").length >= $("#nested-documents").data("max-documents-allowed")
App.Documentable.initializeDirectUploadInput(input)
App.Documentable.lockUploads() if input["lockUpload"]
@@ -30,7 +30,7 @@ App.Documentable =
add: (e, data) ->
data = App.Documentable.buildFileUploadData(e, data)
App.Documentable.clearProgressBar(data)
App.Documentable.setProgressBar(data, 'uploading')
App.Documentable.setProgressBar(data, "uploading")
data.submit()
change: (e, data) ->
@@ -40,26 +40,26 @@ App.Documentable =
fail: (e, data) ->
$(data.cachedAttachmentField).val("")
App.Documentable.clearFilename(data)
App.Documentable.setProgressBar(data, 'errors')
App.Documentable.setProgressBar(data, "errors")
App.Documentable.clearInputErrors(data)
App.Documentable.setInputErrors(data)
$(data.destroyAttachmentLinkContainer).find("a.delete:not(.remove-nested)").remove()
$(data.addAttachmentLabel).addClass('error')
$(data.addAttachmentLabel).addClass("error")
$(data.addAttachmentLabel).show()
done: (e, data) ->
$(data.cachedAttachmentField).val(data.result.cached_attachment)
App.Documentable.setTitleFromFile(data, data.result.filename)
App.Documentable.setProgressBar(data, 'complete')
App.Documentable.setProgressBar(data, "complete")
App.Documentable.setFilename(data, data.result.filename)
App.Documentable.clearInputErrors(data)
$(data.addAttachmentLabel).hide()
$(data.wrapper).find(".attachment-actions").removeClass('small-12').addClass('small-6 float-right')
$(data.wrapper).find(".attachment-actions .action-remove").removeClass('small-3').addClass('small-12')
$(data.wrapper).find(".attachment-actions").removeClass("small-12").addClass("small-6 float-right")
$(data.wrapper).find(".attachment-actions .action-remove").removeClass("small-3").addClass("small-12")
destroyAttachmentLink = $(data.result.destroy_link)
$(data.destroyAttachmentLinkContainer).html(destroyAttachmentLink)
$(destroyAttachmentLink).on 'click', (e) ->
$(destroyAttachmentLink).on "click", (e) ->
e.preventDefault()
e.stopPropagation()
App.Documentable.doDeleteCachedAttachmentRequest(this.href, data)
@@ -69,7 +69,7 @@ App.Documentable =
progress: (e, data) ->
progress = parseInt(data.loaded / data.total * 100, 10)
$(data.progressBar).find('.loading-bar').css 'width', progress + '%'
$(data.progressBar).find(".loading-bar").css "width", "#{progress}%"
return
buildFileUploadData: (e, data) ->
@@ -77,53 +77,53 @@ App.Documentable =
return data
buildData: (data, input) ->
wrapper = $(input).closest('.direct-upload')
wrapper = $(input).closest(".direct-upload")
data.input = input
data.wrapper = wrapper
data.progressBar = $(wrapper).find('.progress-bar-placeholder')
data.errorContainer = $(wrapper).find('.attachment-errors')
data.fileNameContainer = $(wrapper).find('p.file-name')
data.destroyAttachmentLinkContainer = $(wrapper).find('.action-remove')
data.addAttachmentLabel = $(wrapper).find('.action-add label')
data.progressBar = $(wrapper).find(".progress-bar-placeholder")
data.errorContainer = $(wrapper).find(".attachment-errors")
data.fileNameContainer = $(wrapper).find("p.file-name")
data.destroyAttachmentLinkContainer = $(wrapper).find(".action-remove")
data.addAttachmentLabel = $(wrapper).find(".action-add label")
data.cachedAttachmentField = $(wrapper).find("input[name$='[cached_attachment]']")
data.titleField = $(wrapper).find("input[name$='[title]']")
$(wrapper).find('.progress-bar-placeholder').css('display', 'block')
$(wrapper).find(".progress-bar-placeholder").css("display", "block")
return data
clearFilename: (data) ->
$(data.fileNameContainer).text('')
$(data.fileNameContainer).text("")
$(data.fileNameContainer).hide()
clearInputErrors: (data) ->
$(data.errorContainer).find('small.error').remove()
$(data.errorContainer).find("small.error").remove()
clearProgressBar: (data) ->
$(data.progressBar).find('.loading-bar').removeClass('complete errors uploading').css('width', "0px")
$(data.progressBar).find(".loading-bar").removeClass("complete errors uploading").css("width", "0px")
setFilename: (data, file_name) ->
$(data.fileNameContainer).text(file_name)
$(data.fileNameContainer).show()
setProgressBar: (data, klass) ->
$(data.progressBar).find('.loading-bar').addClass(klass)
$(data.progressBar).find(".loading-bar").addClass(klass)
setTitleFromFile: (data, title) ->
if $(data.titleField).val() == ""
$(data.titleField).val(title)
setInputErrors: (data) ->
errors = '<small class="error">' + data.jqXHR.responseJSON.errors + '</small>'
errors = "<small class='error'>#{data.jqXHR.responseJSON.errors}</small>"
$(data.errorContainer).append(errors)
lockUploads: ->
$('#new_document_link').addClass('hide')
$("#new_document_link").addClass("hide")
unlockUploads: ->
$('#max-documents-notice').addClass('hide')
$('#new_document_link').removeClass('hide')
$("#max-documents-notice").addClass("hide")
$("#new_document_link").removeClass("hide")
showNotice: ->
$('#max-documents-notice').removeClass('hide')
$("#max-documents-notice").removeClass("hide")
doDeleteCachedAttachmentRequest: (url, data) ->
$.ajax
@@ -140,21 +140,21 @@ App.Documentable =
App.Documentable.clearProgressBar(data)
App.Documentable.unlockUploads()
$(data.wrapper).find(".attachment-actions").addClass('small-12').removeClass('small-6 float-right')
$(data.wrapper).find(".attachment-actions .action-remove").addClass('small-3').removeClass('small-12')
$(data.wrapper).find(".attachment-actions").addClass("small-12").removeClass("small-6 float-right")
$(data.wrapper).find(".attachment-actions .action-remove").addClass("small-3").removeClass("small-12")
if $(data.input).data('nested-document') == true
if $(data.input).data("nested-document") == true
$(data.wrapper).remove()
else
$(data.wrapper).find('a.remove-cached-attachment').remove()
$(data.wrapper).find("a.remove-cached-attachment").remove()
initializeRemoveCachedDocumentLink: (input, data) ->
wrapper = $(input).closest(".direct-upload")
remove_document_link = $(wrapper).find('a.remove-cached-attachment')
$(remove_document_link).on 'click', (e) ->
remove_document_link = $(wrapper).find("a.remove-cached-attachment")
$(remove_document_link).on "click", (e) ->
e.preventDefault()
e.stopPropagation()
App.Documentable.doDeleteCachedAttachmentRequest(this.href, data)
removeDocument: (id) ->
$('#' + id).remove()
$("##{id}").remove()

View File

@@ -1,6 +1,6 @@
App.EmbedVideo =
initialize: ->
$('#js-embedded-video').each ->
$("#js-embedded-video").each ->
code = $(this).data("video-code")
$('#js-embedded-video').html(code)
$("#js-embedded-video").html(code)

View File

@@ -1,13 +1,13 @@
App.FixedBar =
initialize: ->
$('[data-fixed-bar]').each ->
$("[data-fixed-bar]").each ->
$this = $(this)
fixedBarTopPosition = $this.offset().top
$(window).on 'scroll', ->
$(window).on "scroll", ->
if $(window).scrollTop() > fixedBarTopPosition
$this.addClass('is-fixed')
$("#check-ballot").css({ 'display': "inline-block" })
$this.addClass("is-fixed")
$("#check-ballot").css({ "display": "inline-block" })
else
$this.removeClass('is-fixed')
$this.removeClass("is-fixed")
$("#check-ballot").hide()

View File

@@ -1,4 +1,4 @@
App.Flaggable =
update: (resource_id, button) ->
$("#" + resource_id + " .js-flag-actions").html(button).foundation()
$("##{resource_id} .js-flag-actions").html(button).foundation()

View File

@@ -1,8 +1,8 @@
App.Followable =
update: (followable_id, button, notice) ->
$("#" + followable_id + " .js-follow").html(button)
if ($('[data-alert]').length > 0)
$('[data-alert]').replaceWith(notice)
$("##{followable_id} .js-follow").html(button)
if ($("[data-alert]").length > 0)
$("[data-alert]").replaceWith(notice)
else
$("body").append(notice)

View File

@@ -1,30 +1,60 @@
App.Forms =
disableEnter: ->
$('form.js-enter-disabled').on('keyup keypress', (event) ->
$("form.js-enter-disabled").on("keyup keypress", (event) ->
if event.which == 13
e.preventDefault()
)
submitOnChange: ->
$('.js-submit-on-change').unbind('change').on('change', ->
$(this).closest('form').submit()
$(".js-submit-on-change").unbind("change").on("change", ->
$(this).closest("form").submit()
false
)
toggleLink: ->
$('.js-toggle-link').unbind('click').on('click', ->
$($(this).data('toggle-selector')).toggle("down")
if $(this).data('toggle-text') isnt undefined
$(".js-toggle-link").unbind("click").on("click", ->
$($(this).data("toggle-selector")).toggle("down")
if $(this).data("toggle-text") isnt undefined
toggle_txt = $(this).text()
$(this).text( $(this).data('toggle-text') )
$(this).data('toggle-text', toggle_txt)
$(this).text( $(this).data("toggle-text") )
$(this).data("toggle-text", toggle_txt)
false
)
synchronizeInputs: ->
progress_bar = "[name='progress_bar[percentage]']"
process_background = "[name='legislation_process[background_color]']"
process_font = ", [name='legislation_process[font_color]']"
processes = process_background + process_font
banners = "[name='banner[background_color]'], [name='banner[font_color]']"
inputs = $("#{progress_bar}, #{processes}, #{banners}")
inputs.on
input: ->
$("[name='#{this.name}']").val($(this).val())
inputs.trigger("input")
hideOrShowFieldsAfterSelection: ->
$("[name='progress_bar[kind]']").on
change: ->
title_field = $("[name^='progress_bar'][name$='[title]']").parent()
if this.value == "primary"
title_field.hide()
$("#globalize_locales").hide()
else
title_field.show()
$("#globalize_locales").show()
$("[name='progress_bar[kind]']").change()
initialize: ->
App.Forms.disableEnter()
App.Forms.submitOnChange()
App.Forms.toggleLink()
App.Forms.synchronizeInputs()
App.Forms.hideOrShowFieldsAfterSelection()
false

View File

@@ -21,7 +21,7 @@ i18n = {
window.Gettext = (key) ->
gettext: (key) ->
locale_id = $('html').attr('lang')
locale_id = $("html").attr("lang")
locale = i18n[locale_id]
if locale && locale[key]
return locale[key]

View File

@@ -6,7 +6,7 @@ App.Globalize =
if $(this).data("locale") == locale
$(this).show()
App.Globalize.highlight_locale($(this))
$(".js-globalize-locale option:selected").removeAttr("selected");
$(".js-globalize-locale option:selected").removeAttr("selected")
return
display_translations: (locale) ->
@@ -15,46 +15,65 @@ App.Globalize =
$(this).show()
else
$(this).hide()
$('.js-delete-language').hide()
$('#delete-' + locale).show()
$(".js-delete-language").hide()
$("#js_delete_#{locale}").show()
highlight_locale: (element) ->
$('.js-globalize-locale-link').removeClass('is-active');
element.addClass('is-active');
$(".js-globalize-locale-link").removeClass("is-active")
element.addClass("is-active")
remove_language: (locale) ->
$(".js-globalize-attribute[data-locale=" + locale + "]").each ->
$(this).val('').hide()
if CKEDITOR.instances[$(this).attr('id')]
CKEDITOR.instances[$(this).attr('id')].setData('')
$(".js-globalize-locale-link[data-locale=" + locale + "]").hide()
$(".js-globalize-attribute[data-locale=#{locale}]").each ->
$(this).val("").hide()
if CKEDITOR.instances[$(this).attr("id")]
CKEDITOR.instances[$(this).attr("id")].setData("")
$(".js-globalize-locale-link[data-locale=#{locale}]").hide()
next = $(".js-globalize-locale-link:visible").first()
App.Globalize.highlight_locale(next)
App.Globalize.display_translations(next.data("locale"))
App.Globalize.disable_locale(locale)
enable_locale: (locale) ->
$("#enabled_translations_" + locale).val(1)
App.Globalize.destroy_locale_field(locale).val(false)
App.Globalize.site_customization_enable_locale_field(locale).val(1)
disable_locale: (locale) ->
$("#enabled_translations_" + locale).val(0)
App.Globalize.destroy_locale_field(locale).val(true)
App.Globalize.site_customization_enable_locale_field(locale).val(0)
enabled_locales: ->
$.map(
$(".js-globalize-locale-link:visible"),
(element) -> $(element).data("locale")
)
destroy_locale_field: (locale) ->
$("input[id$=_destroy][data-locale=#{locale}]")
site_customization_enable_locale_field: (locale) ->
$("#enabled_translations_#{locale}")
refresh_visible_translations: ->
locale = $('.js-globalize-locale-link.is-active').data("locale")
locale = $(".js-globalize-locale-link.is-active").data("locale")
App.Globalize.display_translations(locale)
initialize: ->
$('.js-globalize-locale').on 'change', ->
$(".js-globalize-locale").on "change", ->
App.Globalize.display_translations($(this).val())
App.Globalize.display_locale($(this).val())
$('.js-globalize-locale-link').on 'click', ->
$(".js-globalize-locale-link").on "click", ->
locale = $(this).data("locale")
App.Globalize.display_translations(locale)
App.Globalize.highlight_locale($(this))
$('.js-delete-language').on 'click', ->
$(".js-delete-language").on "click", ->
locale = $(this).data("locale")
$(this).hide()
App.Globalize.remove_language(locale)
$(".js-add-fields-container").on "cocoon:after-insert", ->
$.each(
App.Globalize.enabled_locales(),
(index, locale) -> App.Globalize.enable_locale(locale)
)

View File

@@ -1,9 +1,9 @@
App.IeAlert =
set_cookie_and_hide: (event) ->
event.preventDefault()
$.cookie('ie_alert_closed', 'true', { path: '/', expires: 365 })
$('.ie-callout').remove()
$.cookie("ie_alert_closed", "true", { path: "/", expires: 365 })
$(".ie-callout").remove()
initialize: ->
$('.ie-callout-close-js').on 'click', (event) ->
$(".ie-callout-close-js").on "click", (event) ->
App.IeAlert.set_cookie_and_hide(event)

View File

@@ -1,20 +1,20 @@
App.Imageable =
initialize: ->
inputFiles = $('.js-image-attachment')
inputFiles = $(".js-image-attachment")
$.each inputFiles, (index, input) ->
App.Imageable.initializeDirectUploadInput(input)
$('#nested-image').on 'cocoon:after-remove', (e, item) ->
$("#new_image_link").removeClass('hide')
$("#nested-image").on "cocoon:after-remove", (e, item) ->
$("#new_image_link").removeClass("hide")
$('#nested-image').on 'cocoon:before-insert', (e, nested_image) ->
$("#nested-image").on "cocoon:before-insert", (e, nested_image) ->
if $(".js-image-attachment").length > 0
$(".js-image-attachment").closest('.image').remove()
$(".js-image-attachment").closest(".image").remove()
$('#nested-image').on 'cocoon:after-insert', (e, nested_image) ->
$("#new_image_link").addClass('hide')
input = $(nested_image).find('.js-image-attachment')
$("#nested-image").on "cocoon:after-insert", (e, nested_image) ->
$("#new_image_link").addClass("hide")
input = $(nested_image).find(".js-image-attachment")
App.Imageable.initializeDirectUploadInput(input)
initializeDirectUploadInput: (input) ->
@@ -32,7 +32,7 @@ App.Imageable =
add: (e, data) ->
data = App.Imageable.buildFileUploadData(e, data)
App.Imageable.clearProgressBar(data)
App.Imageable.setProgressBar(data, 'uploading')
App.Imageable.setProgressBar(data, "uploading")
data.submit()
change: (e, data) ->
@@ -42,35 +42,35 @@ App.Imageable =
fail: (e, data) ->
$(data.cachedAttachmentField).val("")
App.Imageable.clearFilename(data)
App.Imageable.setProgressBar(data, 'errors')
App.Imageable.setProgressBar(data, "errors")
App.Imageable.clearInputErrors(data)
App.Imageable.setInputErrors(data)
App.Imageable.clearPreview(data)
$(data.destroyAttachmentLinkContainer).find("a.delete:not(.remove-nested)").remove()
$(data.addAttachmentLabel).addClass('error')
$(data.addAttachmentLabel).addClass("error")
$(data.addAttachmentLabel).show()
done: (e, data) ->
$(data.cachedAttachmentField).val(data.result.cached_attachment)
App.Imageable.setTitleFromFile(data, data.result.filename)
App.Imageable.setProgressBar(data, 'complete')
App.Imageable.setProgressBar(data, "complete")
App.Imageable.setFilename(data, data.result.filename)
App.Imageable.clearInputErrors(data)
$(data.addAttachmentLabel).hide()
$(data.wrapper).find(".attachment-actions").removeClass('small-12').addClass('small-6 float-right')
$(data.wrapper).find(".attachment-actions .action-remove").removeClass('small-3').addClass('small-12')
$(data.wrapper).find(".attachment-actions").removeClass("small-12").addClass("small-6 float-right")
$(data.wrapper).find(".attachment-actions .action-remove").removeClass("small-3").addClass("small-12")
App.Imageable.setPreview(data)
destroyAttachmentLink = $(data.result.destroy_link)
$(data.destroyAttachmentLinkContainer).html(destroyAttachmentLink)
$(destroyAttachmentLink).on 'click', (e) ->
$(destroyAttachmentLink).on "click", (e) ->
e.preventDefault()
e.stopPropagation()
App.Imageable.doDeleteCachedAttachmentRequest(this.href, data)
progress: (e, data) ->
progress = parseInt(data.loaded / data.total * 100, 10)
$(data.progressBar).find('.loading-bar').css 'width', progress + '%'
$(data.progressBar).find(".loading-bar").css "width", "#{progress}%"
return
buildFileUploadData: (e, data) ->
@@ -78,55 +78,55 @@ App.Imageable =
return data
buildData: (data, input) ->
wrapper = $(input).closest('.direct-upload')
wrapper = $(input).closest(".direct-upload")
data.input = input
data.wrapper = wrapper
data.progressBar = $(wrapper).find('.progress-bar-placeholder')
data.preview = $(wrapper).find('.image-preview')
data.errorContainer = $(wrapper).find('.attachment-errors')
data.fileNameContainer = $(wrapper).find('p.file-name')
data.destroyAttachmentLinkContainer = $(wrapper).find('.action-remove')
data.addAttachmentLabel = $(wrapper).find('.action-add label')
data.progressBar = $(wrapper).find(".progress-bar-placeholder")
data.preview = $(wrapper).find(".image-preview")
data.errorContainer = $(wrapper).find(".attachment-errors")
data.fileNameContainer = $(wrapper).find("p.file-name")
data.destroyAttachmentLinkContainer = $(wrapper).find(".action-remove")
data.addAttachmentLabel = $(wrapper).find(".action-add label")
data.cachedAttachmentField = $(wrapper).find("input[name$='[cached_attachment]']")
data.titleField = $(wrapper).find("input[name$='[title]']")
$(wrapper).find('.progress-bar-placeholder').css('display', 'block')
$(wrapper).find(".progress-bar-placeholder").css("display", "block")
return data
clearFilename: (data) ->
$(data.fileNameContainer).text('')
$(data.fileNameContainer).text("")
$(data.fileNameContainer).hide()
clearInputErrors: (data) ->
$(data.errorContainer).find('small.error').remove()
$(data.errorContainer).find("small.error").remove()
clearProgressBar: (data) ->
$(data.progressBar).find('.loading-bar').removeClass('complete errors uploading').css('width', "0px")
$(data.progressBar).find(".loading-bar").removeClass("complete errors uploading").css("width", "0px")
clearPreview: (data) ->
$(data.wrapper).find('.image-preview').remove()
$(data.wrapper).find(".image-preview").remove()
setFilename: (data, file_name) ->
$(data.fileNameContainer).text(file_name)
$(data.fileNameContainer).show()
setProgressBar: (data, klass) ->
$(data.progressBar).find('.loading-bar').addClass(klass)
$(data.progressBar).find(".loading-bar").addClass(klass)
setTitleFromFile: (data, title) ->
if $(data.titleField).val() == ""
$(data.titleField).val(title)
setInputErrors: (data) ->
errors = '<small class="error">' + data.jqXHR.responseJSON.errors + '</small>'
errors = "<small class='error'>#{data.jqXHR.responseJSON.errors}</small>"
$(data.errorContainer).append(errors)
setPreview: (data) ->
image_preview = '<div class="small-12 column text-center image-preview"><figure><img src="' + data.result.attachment_url + '" class="cached-image"/></figure></div>'
image_preview = "<div class='small-12 column text-center image-preview'><figure><img src='#{data.result.attachment_url}' class='cached-image'></figure></div>"
if $(data.preview).length > 0
$(data.preview).replaceWith(image_preview)
else
$(image_preview).insertBefore($(data.wrapper).find(".attachment-actions"))
data.preview = $(data.wrapper).find('.image-preview')
data.preview = $(data.wrapper).find(".image-preview")
doDeleteCachedAttachmentRequest: (url, data) ->
$.ajax
@@ -143,24 +143,24 @@ App.Imageable =
App.Imageable.clearProgressBar(data)
App.Imageable.clearPreview(data)
$('#new_image_link').removeClass('hide')
$("#new_image_link").removeClass("hide")
$(data.wrapper).find(".attachment-actions").addClass('small-12').removeClass('small-6 float-right')
$(data.wrapper).find(".attachment-actions .action-remove").addClass('small-3').removeClass('small-12')
$(data.wrapper).find(".attachment-actions").addClass("small-12").removeClass("small-6 float-right")
$(data.wrapper).find(".attachment-actions .action-remove").addClass("small-3").removeClass("small-12")
if $(data.input).data('nested-image') == true
if $(data.input).data("nested-image") == true
$(data.wrapper).remove()
else
$(data.wrapper).find('a.remove-cached-attachment').remove()
$(data.wrapper).find("a.remove-cached-attachment").remove()
initializeRemoveCachedImageLink: (input, data) ->
wrapper = $(input).closest(".direct-upload")
remove_image_link = $(wrapper).find('a.remove-cached-attachment')
$(remove_image_link).on 'click', (e) ->
remove_image_link = $(wrapper).find("a.remove-cached-attachment")
$(remove_image_link).on "click", (e) ->
e.preventDefault()
e.stopPropagation()
App.Imageable.doDeleteCachedAttachmentRequest(this.href, data)
removeImage: (id) ->
$('#' + id).remove()
$("#new_image_link").removeClass('hide')
$("##{id}").remove()
$("#new_image_link").removeClass("hide")

View File

@@ -1,7 +1,7 @@
App.InvestmentReportAlert =
initialize: ->
$('#js-investment-report-alert').on 'click', ->
if this.checked && $('#budget_investment_feasibility_unfeasible').is(':checked')
confirm(this.dataset.alert + "\n" + this.dataset.notFeasibleAlert);
$("#js-investment-report-alert").on "click", ->
if this.checked && $("#budget_investment_feasibility_unfeasible").is(":checked")
confirm("#{this.dataset.alert}\n#{this.dataset.notFeasibleAlert}")
else if this.checked
confirm(this.dataset.alert);
confirm(this.dataset.alert)

View File

@@ -1,12 +1,12 @@
App.Legislation =
initialize: ->
$('form#new_legislation_answer input.button').hide()
$('form#new_legislation_answer input[type=radio]').on
$("form#new_legislation_answer input.button").hide()
$("form#new_legislation_answer input[type=radio]").on
click: ->
$('form#new_legislation_answer').submit()
$("form#new_legislation_answer").submit()
$('form#draft_version_go_to_version input.button').hide()
$('form#draft_version_go_to_version select').on
$("form#draft_version_go_to_version input.button").hide()
$("form#draft_version_go_to_version select").on
change: ->
$('form#draft_version_go_to_version').submit()
$("form#draft_version_go_to_version").submit()

View File

@@ -4,13 +4,13 @@ App.LegislationAdmin =
$("input[type='checkbox'][data-disable-date]").on
change: ->
checkbox = $(this)
parent = $(this).parents('.row:eq(0)')
date_selector = $(this).data('disable-date')
parent.find("input[type='text'][id^='" + date_selector + "']").each ->
if checkbox.is(':checked')
parent = $(this).parents(".row:eq(0)")
date_selector = $(this).data("disable-date")
parent.find("input[type='text'][id^='#{date_selector}']").each ->
if checkbox.is(":checked")
$(this).removeAttr("disabled")
else
$(this).val("")
$("#nested-question-options").on "cocoon:after-insert", ->
$("#nested_question_options").on "cocoon:after-insert", ->
App.Globalize.refresh_visible_translations()

View File

@@ -2,24 +2,24 @@ App.LegislationAllegations =
toggle_comments: ->
if !App.LegislationAnnotatable.isMobile()
$('.draft-allegation').toggleClass('comments-on')
$('#comments-box').html('').hide()
$(".draft-allegation").toggleClass("comments-on")
$("#comments-box").html("").hide()
show_comments: ->
if !App.LegislationAnnotatable.isMobile()
$('.draft-allegation').addClass('comments-on')
$(".draft-allegation").addClass("comments-on")
initialize: ->
$('.js-toggle-allegations .draft-panel').on
$(".js-toggle-allegations .draft-panel").on
click: (e) ->
e.preventDefault()
e.stopPropagation()
if !App.LegislationAnnotatable.isMobile()
App.LegislationAllegations.toggle_comments()
$('.js-toggle-allegations').on
$(".js-toggle-allegations").on
click: (e) ->
# Toggle comments when the section title is visible
if !App.LegislationAnnotatable.isMobile()
if $(this).find('.draft-panel .panel-title:visible').length == 0
if $(this).find(".draft-panel .panel-title:visible").length == 0
App.LegislationAllegations.toggle_comments()

View File

@@ -6,47 +6,47 @@ App.LegislationAnnotatable =
sel = window.getSelection()
if sel.rangeCount and sel.getRangeAt
range = sel.getRangeAt(0)
document.designMode = 'on'
document.designMode = "on"
if range
sel.removeAllRanges()
sel.addRange range
# Use HiliteColor since some browsers apply BackColor to the whole block
if !document.execCommand('HiliteColor', false, colour)
document.execCommand 'BackColor', false, colour
document.designMode = 'off'
if !document.execCommand("HiliteColor", false, colour)
document.execCommand "BackColor", false, colour
document.designMode = "off"
return
highlight: (colour) ->
if window.getSelection
# IE9 and non-IE
try
if !document.execCommand('BackColor', false, colour)
if !document.execCommand("BackColor", false, colour)
App.LegislationAnnotatable.makeEditableAndHighlight colour
catch ex
App.LegislationAnnotatable.makeEditableAndHighlight colour
else if document.selection and document.selection.createRange
# IE <= 8 case
range = document.selection.createRange()
range.execCommand 'BackColor', false, colour
range.execCommand "BackColor", false, colour
return
remove_highlight: ->
$('[data-legislation-draft-version-id] span[style]').replaceWith(->
$("[data-legislation-draft-version-id] span[style]").replaceWith(->
return $(this).contents()
)
return
renderAnnotationComments: (event) ->
if event.offset
$("#comments-box").css({top: event.offset - $('.calc-comments').offset().top})
$("#comments-box").css({ top: event.offset - $(".calc-comments").offset().top })
if App.LegislationAnnotatable.isMobile()
return
$.ajax
method: "GET"
url: event.annotation_url + "/annotations/" + event.annotation_id + "/comments"
dataType: 'script'
url: "#{event.annotation_url}/annotations/#{event.annotation_id}/comments"
dataType: "script"
onClick: (event) ->
event.preventDefault()
@@ -54,21 +54,21 @@ App.LegislationAnnotatable =
if App.LegislationAnnotatable.isMobile()
annotation_url = $(event.target).closest(".legislation-annotatable").data("legislation-annotatable-base-url")
window.location.href = annotation_url + "/annotations/" + $(this).data('annotation-id')
window.location.href = "#{annotation_url}/annotations/#{$(this).data("annotation-id")}"
return
$('[data-annotation-id]').removeClass('current-annotation')
$("[data-annotation-id]").removeClass("current-annotation")
target = $(this)
parents = target.parents('.annotator-hl')
parents = target.parents(".annotator-hl")
parents_ids = parents.map (_, elem) ->
$(elem).data("annotation-id")
annotation_id = target.data('annotation-id')
$('[data-annotation-id="' + annotation_id + '"]').addClass('current-annotation')
annotation_id = target.data("annotation-id")
$("[data-annotation-id='#{annotation_id}']").addClass("current-annotation")
$('#comments-box').html('')
$("#comments-box").html("")
App.LegislationAllegations.show_comments()
$("#comments-box").show()
@@ -92,24 +92,24 @@ App.LegislationAnnotatable =
return
customShow: (position) ->
$(@element).html ''
$(@element).html ""
# Clean comments section and open it
$('#comments-box').html ''
$("#comments-box").html ""
App.LegislationAllegations.show_comments()
$('#comments-box').show()
$("#comments-box").show()
annotation_url = $('[data-legislation-annotatable-base-url]').data('legislation-annotatable-base-url')
annotation_url = $("[data-legislation-annotatable-base-url]").data("legislation-annotatable-base-url")
$.ajax(
method: 'GET'
url: annotation_url + '/annotations/new'
dataType: 'script').done (->
$('#new_legislation_annotation #legislation_annotation_quote').val(@annotation.quote)
$('#new_legislation_annotation #legislation_annotation_ranges').val(JSON.stringify(@annotation.ranges))
$('#comments-box').css({top: position.top - $('.calc-comments').offset().top})
method: "GET"
url: "#{annotation_url}/annotations/new"
dataType: "script").done (->
$("#new_legislation_annotation #legislation_annotation_quote").val(@annotation.quote)
$("#new_legislation_annotation #legislation_annotation_ranges").val(JSON.stringify(@annotation.ranges))
$("#comments-box").css({ top: position.top - $(".calc-comments").offset().top })
unless $('[data-legislation-open-phase]').data('legislation-open-phase') == false
App.LegislationAnnotatable.highlight('#7fff9a')
$('#comments-box textarea').focus()
unless $("[data-legislation-open-phase]").data("legislation-open-phase") == false
App.LegislationAnnotatable.highlight("#7fff9a")
$("#comments-box textarea").focus()
$("#new_legislation_annotation").on("ajax:complete", (e, data, status, xhr) ->
App.LegislationAnnotatable.app.destroy()
@@ -118,11 +118,11 @@ App.LegislationAnnotatable =
$("#comments-box").html("").hide()
$.ajax
method: "GET"
url: annotation_url + "/annotations/" + data.responseJSON.id + "/comments"
dataType: 'script'
url: "#{annotation_url}/annotations/#{data.responseJSON.id}/comments"
dataType: "script"
else
$(e.target).find('label').addClass('error')
$('<small class="error">' + data.responseJSON[0] + '</small>').insertAfter($(e.target).find('textarea'))
$(e.target).find("label").addClass("error")
$("<small class='error'>#{data.responseJSON[0]}</small>").insertAfter($(e.target).find("textarea"))
return true
)
return
@@ -133,17 +133,17 @@ App.LegislationAnnotatable =
scrollToAnchor: ->
annotationsLoaded: (annotations) ->
anchor = $(location).attr('hash')
if anchor && anchor.startsWith('#annotation')
anchor = $(location).attr("hash")
if anchor && anchor.startsWith("#annotation")
ann_id = anchor.split("-")[-1..]
checkExist = setInterval((->
if $("span[data-annotation-id='" + ann_id + "']").length
el = $("span[data-annotation-id='" + ann_id + "']")
el.addClass('current-annotation')
$('#comments-box').html('')
if $("span[data-annotation-id='#{ann_id}']").length
el = $("span[data-annotation-id='#{ann_id}']")
el.addClass("current-annotation")
$("#comments-box").html("")
App.LegislationAllegations.show_comments()
$('html,body').animate({scrollTop: el.offset().top})
$("html,body").animate({ scrollTop: el.offset().top })
$.event.trigger
type: "renderLegislationAnnotation"
annotation_id: ann_id
@@ -164,27 +164,27 @@ App.LegislationAnnotatable =
last_annotation = annotations[annotations.length - 1]
checkExist = setInterval((->
if $("span[data-annotation-id='" + last_annotation.id + "']").length
if $("span[data-annotation-id='#{last_annotation.id}']").length
for annotation in annotations
ann_weight = App.LegislationAnnotatable.propotionalWeight(annotation.weight, max_weight)
el = $("span[data-annotation-id='" + annotation.id + "']")
el.addClass('weight-' + ann_weight)
el = $("span[data-annotation-id='#{annotation.id}']")
el.addClass("weight-#{ann_weight}")
clearInterval checkExist
return
), 100)
initialize: ->
$(document).off("renderLegislationAnnotation").on("renderLegislationAnnotation", App.LegislationAnnotatable.renderAnnotationComments)
$(document).off('click', '[data-annotation-id]').on('click', '[data-annotation-id]', App.LegislationAnnotatable.onClick)
$(document).off('click', '[data-cancel-annotation]').on('click', '[data-cancel-annotation]', (e) ->
$(document).off("click", "[data-annotation-id]").on("click", "[data-annotation-id]", App.LegislationAnnotatable.onClick)
$(document).off("click", "[data-cancel-annotation]").on("click", "[data-cancel-annotation]", (e) ->
e.preventDefault()
$('#comments-box').html('')
$('#comments-box').hide()
$("#comments-box").html("")
$("#comments-box").hide()
App.LegislationAnnotatable.remove_highlight()
return
)
current_user_id = $('html').data('current-user-id')
current_user_id = $("html").data("current-user-id")
$(".legislation-annotatable").each ->
$this = $(this)

View File

@@ -1,8 +1,5 @@
App.LocationChanger =
initialize: ->
$('.js-location-changer').on 'change', ->
$(".js-location-changer").on "change", ->
window.location.assign($(this).val())

View File

@@ -1,8 +1,8 @@
App.Managers =
generatePassword: ->
chars = 'aAbcdeEfghiJkmnpqrstuUvwxyz23456789'
pass = ''
chars = "aAbcdeEfghiJkmnpqrstuUvwxyz23456789"
pass = ""
x = 0
while x < 12
i = Math.floor(Math.random() * chars.length)
@@ -11,15 +11,15 @@ App.Managers =
return pass
togglePassword: (type) ->
$('#user_password').prop 'type', type
$("#user_password").prop "type", type
initialize: ->
$(".generate-random-value").on "click", (event) ->
password = App.Managers.generatePassword()
$('#user_password').val(password)
$("#user_password").val(password)
$(".show-password").on "click", (event) ->
if $("#user_password").is("input[type='password']")
App.Managers.togglePassword('text')
App.Managers.togglePassword("text")
else
App.Managers.togglePassword('password')
App.Managers.togglePassword("password")

View File

@@ -1,44 +1,45 @@
App.Map =
initialize: ->
maps = $('*[data-map]')
maps = $("*[data-map]")
if maps.length > 0
$.each maps, (index, map) ->
App.Map.initializeMap map
$('.js-toggle-map').on
click: ->
App.Map.toggleMap()
$(".js-toggle-map").on
click: ->
App.Map.toggleMap()
initializeMap: (element) ->
App.Map.cleanInvestmentCoordinates(element)
mapCenterLatitude = $(element).data('map-center-latitude')
mapCenterLongitude = $(element).data('map-center-longitude')
markerLatitude = $(element).data('marker-latitude')
markerLongitude = $(element).data('marker-longitude')
zoom = $(element).data('map-zoom')
mapTilesProvider = $(element).data('map-tiles-provider')
mapAttribution = $(element).data('map-tiles-provider-attribution')
latitudeInputSelector = $(element).data('latitude-input-selector')
longitudeInputSelector = $(element).data('longitude-input-selector')
zoomInputSelector = $(element).data('zoom-input-selector')
removeMarkerSelector = $(element).data('marker-remove-selector')
addMarkerInvestments = $(element).data('marker-investments-coordinates')
editable = $(element).data('marker-editable')
marker = null;
mapCenterLatitude = $(element).data("map-center-latitude")
mapCenterLongitude = $(element).data("map-center-longitude")
markerLatitude = $(element).data("marker-latitude")
markerLongitude = $(element).data("marker-longitude")
zoom = $(element).data("map-zoom")
mapTilesProvider = $(element).data("map-tiles-provider")
mapAttribution = $(element).data("map-tiles-provider-attribution")
latitudeInputSelector = $(element).data("latitude-input-selector")
longitudeInputSelector = $(element).data("longitude-input-selector")
zoomInputSelector = $(element).data("zoom-input-selector")
removeMarkerSelector = $(element).data("marker-remove-selector")
addMarkerInvestments = $(element).data("marker-investments-coordinates")
editable = $(element).data("marker-editable")
marker = null
markerIcon = L.divIcon(
className: 'map-marker'
iconSize: [30, 30]
iconAnchor: [15, 40]
html: '<div class="map-icon"></div>')
className: "map-marker"
iconSize: [30, 30]
iconAnchor: [15, 40]
html: '<div class="map-icon"></div>'
)
createMarker = (latitude, longitude) ->
markerLatLng = new (L.LatLng)(latitude, longitude)
marker = L.marker(markerLatLng, { icon: markerIcon, draggable: editable })
if editable
marker.on 'dragend', updateFormfields
marker.on "dragend", updateFormfields
marker.addTo(map)
return marker
@@ -46,7 +47,7 @@ App.Map =
e.preventDefault()
if marker
map.removeLayer(marker)
marker = null;
marker = null
clearFormfields()
return
@@ -66,22 +67,22 @@ App.Map =
return
clearFormfields = ->
$(latitudeInputSelector).val ''
$(longitudeInputSelector).val ''
$(zoomInputSelector).val ''
$(latitudeInputSelector).val ""
$(longitudeInputSelector).val ""
$(zoomInputSelector).val ""
return
openMarkerPopup = (e) ->
marker = e.target
$.ajax 'investments/' + marker.options['id'] + '/json_data',
type: 'GET'
dataType: 'json'
$.ajax "/investments/#{marker.options["id"]}/json_data",
type: "GET"
dataType: "json"
success: (data) ->
e.target.bindPopup(getPopupContent(data)).openPopup()
getPopupContent = (data) ->
content = "<a href='/budgets/#{data['budget_id']}/investments/#{data['investment_id']}'>#{data['investment_title']}</a>"
content = "<a href='/budgets/#{data["budget_id"]}/investments/#{data["investment_id"]}'>#{data["investment_title"]}</a>"
return content
mapCenterLatLng = new (L.LatLng)(mapCenterLatitude, mapCenterLongitude)
@@ -92,27 +93,27 @@ App.Map =
marker = createMarker(markerLatitude, markerLongitude)
if editable
$(removeMarkerSelector).on 'click', removeMarker
map.on 'zoomend', updateFormfields
map.on 'click', moveOrPlaceMarker
$(removeMarkerSelector).on "click", removeMarker
map.on "zoomend", updateFormfields
map.on "click", moveOrPlaceMarker
if addMarkerInvestments
for i in addMarkerInvestments
if App.Map.validCoordinates(i)
marker = createMarker(i.lat, i.long)
marker.options['id'] = i.investment_id
marker.options["id"] = i.investment_id
marker.on 'click', openMarkerPopup
marker.on "click", openMarkerPopup
toggleMap: ->
$('.map').toggle()
$('.js-location-map-remove-marker').toggle()
$(".map").toggle()
$(".js-location-map-remove-marker").toggle()
cleanInvestmentCoordinates: (element) ->
markers = $(element).attr('data-marker-investments-coordinates')
markers = $(element).attr("data-marker-investments-coordinates")
if markers?
clean_markers = markers.replace(/-?(\*+)/g, null)
$(element).attr('data-marker-investments-coordinates', clean_markers)
$(element).attr("data-marker-investments-coordinates", clean_markers)
validCoordinates: (coordinates) ->
App.Map.isNumeric(coordinates.lat) && App.Map.isNumeric(coordinates.long)

View File

@@ -3,15 +3,15 @@ App.MarkdownEditor =
refresh_preview: (element, md) ->
textarea_content = App.MarkdownEditor.find_textarea(element).val()
result = md.render(textarea_content)
element.find('#markdown-preview').html(result)
element.find(".markdown-preview").html(result)
# Multi-locale (translatable) form fields work by hiding inputs of locales
# which are not "active".
find_textarea: (editor) ->
editor.find('textarea:visible')
editor.find("textarea")
initialize: ->
$('.markdown-editor').each ->
$(".markdown-editor").each ->
md = window.markdownit({
html: true,
breaks: true,
@@ -20,25 +20,25 @@ App.MarkdownEditor =
editor = $(this)
editor.on 'input', ->
editor.on "input", ->
App.MarkdownEditor.refresh_preview($(this), md)
$('.legislation-draft-versions-edit .warning').show()
$(".legislation-draft-versions-edit .warning").show()
return
editor.find('textarea').on 'scroll', ->
$('#markdown-preview').scrollTop($(this).scrollTop())
editor.find("textarea").on "scroll", ->
editor.find(".markdown-preview").scrollTop($(this).scrollTop())
editor.find('.fullscreen-toggle').on 'click', ->
editor.toggleClass('fullscreen')
$('.fullscreen-container').toggleClass('medium-8', 'medium-12')
span = $(this).find('span')
editor.find(".fullscreen-toggle").on "click", ->
editor.toggleClass("fullscreen")
$(".fullscreen-container").toggleClass("medium-8", "medium-12")
span = $(this).find("span")
current_html = span.html()
if(current_html == span.data('open-text'))
span.html(span.data('closed-text'))
if(current_html == span.data("open-text"))
span.html(span.data("closed-text"))
else
span.html(span.data('open-text'))
span.html(span.data("open-text"))
if editor.hasClass('fullscreen')
if editor.hasClass("fullscreen")
App.MarkdownEditor.find_textarea(editor).height($(window).height() - 100)
App.MarkdownEditor.refresh_preview(editor, md)
else

View File

@@ -1,16 +1,16 @@
App.Polls =
generateToken: ->
token = ''
rand = ''
token = ""
rand = ""
for n in [0..5]
rand = Math.random().toString(36).substr(2) # remove `0.`
token = token + rand;
token = token + rand
token = token.substring(0, 64)
return token
replaceToken: ->
for link in $('.js-question-answer')
for link in $(".js-question-answer")
token_param = link.search.slice(-6)
if token_param == "token="
link.href = link.href + @token
@@ -22,23 +22,22 @@ App.Polls =
$(".js-question-answer").on
click: =>
token_message = $(".js-token-message")
if !token_message.is(':visible')
token_message.html(token_message.html() + "<br><strong>" + @token + "</strong>");
if !token_message.is(":visible")
token_message.html("#{token_message.html()}<br><strong>#{@token}</strong>")
token_message.show()
false
$(".zoom-link").on "click", (event) ->
element = event.target
answer = $(element).closest('div.answer')
answer = $(element).closest("div.answer")
if $(answer).hasClass('medium-6')
$(answer).removeClass("medium-6");
$(answer).addClass("answer-divider");
unless $(answer).hasClass('first')
$(answer).insertBefore($(answer).prev('div.answer'));
if $(answer).hasClass("medium-6")
$(answer).removeClass("medium-6")
$(answer).addClass("answer-divider")
unless $(answer).hasClass("first")
$(answer).insertBefore($(answer).prev("div.answer"))
else
$(answer).addClass("medium-6");
$(answer).removeClass("answer-divider");
unless $(answer).hasClass('first')
$(answer).insertAfter($(answer).next('div.answer'));
$(answer).addClass("medium-6")
$(answer).removeClass("answer-divider")
unless $(answer).hasClass("first")
$(answer).insertAfter($(answer).next("div.answer"))

View File

@@ -4,9 +4,9 @@ App.PollsAdmin =
$("select[class='js-poll-shifts']").on
change: ->
switch ($(this).val())
when 'vote_collection'
$("select[class='js-shift-vote-collection-dates']").show();
$("select[class='js-shift-recount-scrutiny-dates']").hide();
when 'recount_scrutiny'
$("select[class='js-shift-recount-scrutiny-dates']").show();
$("select[class='js-shift-vote-collection-dates']").hide();
when "vote_collection"
$("select[class='js-shift-vote-collection-dates']").show()
$("select[class='js-shift-recount-scrutiny-dates']").hide()
when "recount_scrutiny"
$("select[class='js-shift-recount-scrutiny-dates']").show()
$("select[class='js-shift-vote-collection-dates']").hide()

View File

@@ -3,35 +3,35 @@ App.PreventDoubleSubmission =
setTimeout ->
buttons.each ->
button = $(this)
unless button.hasClass('disabled')
loading = button.data('loading') ? '...'
button.addClass('disabled').attr('disabled', 'disabled')
button.data('text', button.val())
unless button.hasClass("disabled")
loading = button.data("loading") ? "..."
button.addClass("disabled").attr("disabled", "disabled")
button.data("text", button.val())
button.val(loading)
, 1
reset_buttons: (buttons) ->
buttons.each ->
button = $(this)
if button.hasClass('disabled')
button_text = button.data('text')
button.removeClass('disabled').attr('disabled', null)
if button.hasClass("disabled")
button_text = button.data("text")
button.removeClass("disabled").attr("disabled", null)
if button_text
button.val(button_text)
button.data('text', null)
button.data("text", null)
initialize: ->
$('form').on('submit', (event) ->
unless event.target.id == "new_officing_voter" ||
$("form").on("submit", (event) ->
unless event.target.id == "new_officing_voter" ||
event.target.id == "admin_download_emails"
buttons = $(this).find(':button, :submit')
buttons = $(this).find(":button, :submit")
App.PreventDoubleSubmission.disable_buttons(buttons)
).on('ajax:success', (event) ->
unless event.target.id == "new_officing_voter" ||
).on("ajax:success", (event) ->
unless event.target.id == "new_officing_voter" ||
event.target.id == "admin_download_emails"
buttons = $(this).find(':button, :submit')
buttons = $(this).find(":button, :submit")
App.PreventDoubleSubmission.reset_buttons(buttons)
)

View File

@@ -1,4 +1,4 @@
App.SendAdminNotificationAlert =
initialize: ->
$('#js-send-admin_notification-alert').on 'click', ->
confirm(this.dataset.alert);
$("#js-send-admin_notification-alert").on "click", ->
confirm(this.dataset.alert)

View File

@@ -1,4 +1,4 @@
App.SendNewsletterAlert =
initialize: ->
$('#js-send-newsletter-alert').on 'click', ->
confirm(this.dataset.alert);
$("#js-send-newsletter-alert").on "click", ->
confirm(this.dataset.alert)

View File

@@ -0,0 +1,10 @@
App.Settings =
initialize: ->
$("#settings-tabs").on "change.zf.tabs", ->
if $("#tab-map-configuration:visible").length
map_container = L.DomUtil.get "admin-map"
unless map_container is null
map_container._leaflet_id = null
App.Map.initialize()

View File

@@ -3,5 +3,5 @@ App.SocialShare =
initialize: ->
$(".social-share-button a").each ->
element = $(this)
site = element.data('site')
element.append("<span class='show-for-sr'>#{site}</span>")
site = element.data("site")
element.append("<span class='show-for-sr'>#{site}</span>")

View File

@@ -2,8 +2,8 @@ App.Sortable =
initialize: ->
$(".sortable").sortable
update: (event, ui) ->
new_order = $(this).sortable('toArray', {attribute: 'data-answer-id'});
new_order = $(this).sortable("toArray", { attribute: "data-answer-id" })
$.ajax
url: $('.sortable').data('js-url'),
data: {ordered_list: new_order},
type: 'POST'
url: $(".sortable").data("js-url"),
data: { ordered_list: new_order },
type: "POST"

View File

@@ -9,6 +9,6 @@ var initialize_stats_modules = function() {
$(function(){
$(document).ready(initialize_stats_modules);
$(document).on('page:load', initialize_stats_modules);
$(document).on('ajax:complete', initialize_stats_modules);
$(document).on("page:load", initialize_stats_modules);
$(document).on("ajax:complete", initialize_stats_modules);
});

View File

@@ -2,8 +2,8 @@
#----------------------------------------------------------------------
buildGraph = (el) ->
url = $(el).data 'graph'
conf = bindto: el, data: {x: 'x', url: url, mimeType: 'json'}, axis: { x: {type: 'timeseries',tick: { format: '%Y-%m-%d' } }}
url = $(el).data "graph"
conf = bindto: el, data: { x: "x", url: url, mimeType: "json" }, axis: { x: { type: "timeseries", tick: { format: "%Y-%m-%d" } } }
graph = c3.generate conf
App.Stats =

View File

@@ -2,24 +2,24 @@ App.Suggest =
initialize: ->
$('[data-js-suggest-result]').each ->
$("[data-js-suggest-result]").each ->
$this = $(this)
callback = ->
$.ajax
url: $this.data('js-url')
data: {search: $this.val()},
type: 'GET',
dataType: 'html'
url: $this.data("js-url")
data: { search: $this.val() },
type: "GET",
dataType: "html"
success: (stHtml) ->
js_suggest_selector = $this.data('js-suggest')
js_suggest_selector = $this.data("js-suggest")
$(js_suggest_selector).html(stHtml)
timer = null
$this.on 'keyup', ->
$this.on "keyup", ->
window.clearTimeout(timer)
timer = window.setTimeout(callback, 1000)
$this.on 'change', callback
$this.on "change", callback

View File

@@ -1,6 +1,6 @@
App.TableSortable =
getCellValue: (row, index) ->
$(row).children('td').eq(index).text()
$(row).children("td").eq(index).text()
comparer: (index) ->
(a, b) ->
@@ -9,9 +9,9 @@ App.TableSortable =
return if $.isNumeric(valA) and $.isNumeric(valB) then valA - valB else valA.localeCompare(valB)
initialize: ->
$('table.sortable th').click ->
table = $(this).parents('table').eq(0)
rows = table.find('tr:gt(0)').not('tfoot tr').toArray().sort(App.TableSortable.comparer($(this).index()))
$("table.sortable th").click ->
table = $(this).parents("table").eq(0)
rows = table.find("tr:gt(0)").not("tfoot tr").toArray().sort(App.TableSortable.comparer($(this).index()))
@asc = !@asc
if !@asc
rows = rows.reverse()
@@ -20,4 +20,3 @@ App.TableSortable =
table.append rows[i]
i++
return

View File

@@ -7,28 +7,28 @@ App.TagAutocomplete =
return (App.TagAutocomplete.split( term ).pop())
init_autocomplete: ->
$('.tag-autocomplete').autocomplete
$(".tag-autocomplete").autocomplete
source: (request, response) ->
$.ajax
url: $('.tag-autocomplete').data('js-url'),
data: {search: App.TagAutocomplete.extractLast( request.term )},
type: 'GET',
dataType: 'json'
url: $(".tag-autocomplete").data("js-url"),
data: { search: App.TagAutocomplete.extractLast( request.term ) },
type: "GET",
dataType: "json"
success: ( data ) ->
response( data );
response( data )
minLength: 0,
search: ->
App.TagAutocomplete.extractLast( this.value );
App.TagAutocomplete.extractLast( this.value )
focus: ->
return false;
return false
select: ( event, ui ) -> (
terms = App.TagAutocomplete.split( this.value );
terms.pop();
terms.push( ui.item.value );
terms.push( "" );
this.value = terms.join( ", " );
return false;);
terms = App.TagAutocomplete.split( this.value )
terms.pop()
terms.push( ui.item.value )
terms.push( "" )
this.value = terms.join( ", " )
return false;)
initialize: ->
App.TagAutocomplete.init_autocomplete();
App.TagAutocomplete.init_autocomplete()

View File

@@ -1,21 +1,21 @@
App.Tags =
initialize: ->
$tag_input = $('input.js-tag-list')
$tag_input = $("input.js-tag-list")
$('body .js-add-tag-link').each ->
$("body .js-add-tag-link").each ->
$this = $(this)
unless $this.data('initialized') is 'yes'
$this.on('click', ->
name = $(this).text()
current_tags = $tag_input.val().split(',').filter(Boolean)
unless $this.data("initialized") is "yes"
$this.on("click", ->
name = "\"#{$(this).text()}\""
current_tags = $tag_input.val().split(",").filter(Boolean)
if $.inArray(name, current_tags) >= 0
current_tags.splice($.inArray(name, current_tags), 1)
else
current_tags.push name
$tag_input.val(current_tags.join(','))
$tag_input.val(current_tags.join(","))
false
).data 'initialized', 'yes'
).data "initialized", "yes"

View File

@@ -4,25 +4,25 @@ App.Tracks =
_paq?
set_custom_var: (id, name, value, scope) ->
_paq.push(['setCustomVariable', id, name, value, scope])
_paq.push(['trackPageView'])
_paq.push(["setCustomVariable", id, name, value, scope])
_paq.push(["trackPageView"])
track_event: ($this) ->
category = $this.data('track-event-category')
action = $this.data('track-event-action')
_paq.push(['trackEvent', category, action])
category = $this.data("track-event-category")
action = $this.data("track-event-action")
_paq.push(["trackEvent", category, action])
initialize: ->
if App.Tracks.tracking_enabled()
$('[data-track-usertype]').each ->
$("[data-track-usertype]").each ->
$this = $(this)
usertype = $this.data('track-usertype')
usertype = $this.data("track-usertype")
App.Tracks.set_custom_var(1, "usertype", usertype, "visit")
$('[data-track-event-category]').each ->
$("[data-track-event-category]").each ->
$this = $(this)
App.Tracks.track_event($this)
$('[data-track-click]').on 'click', ->
$("[data-track-click]").on "click", ->
$this = $(this)
App.Tracks.track_event($this)

View File

@@ -1,37 +1,36 @@
App.TreeNavigator =
setNodes: (nodes) ->
children = nodes.children('ul')
children = nodes.children("ul")
if(children.length == 0)
return
children.each ->
link = $(this).prev('a')
link = $(this).prev("a")
$('<span class="open"></span>').insertBefore(link)
App.TreeNavigator.setNodes($(this).children())
initialize: ->
elem = $('[data-tree-navigator]')
elem = $("[data-tree-navigator]")
if(elem.length == 0)
return
ul = elem.find('ul:eq(0)')
ul = elem.find("ul:eq(0)")
if(ul.length && ul.children().length)
App.TreeNavigator.setNodes(ul.children())
$('[data-tree-navigator] span').on
$("[data-tree-navigator] span").on
click: (e) ->
elem = $(this)
if(elem.hasClass('open'))
elem.removeClass('open').addClass('closed')
elem.siblings('ul').hide()
else if(elem.hasClass('closed'))
elem.removeClass('closed').addClass('open')
elem.siblings('ul').show()
if(elem.hasClass("open"))
elem.removeClass("open").addClass("closed")
elem.siblings("ul").hide()
else if(elem.hasClass("closed"))
elem.removeClass("closed").addClass("open")
elem.siblings("ul").show()
if anchor = $(location).attr('hash')
if link = elem.find('a[href="' + anchor + '"]')
link.parents('ul').each ->
if anchor = $(location).attr("hash")
if link = elem.find("a[href='#{anchor}']")
link.parents("ul").each ->
$(this).show()
$(this).siblings('span').removeClass('closed').addClass('open')
$(this).siblings("span").removeClass("closed").addClass("open")

View File

@@ -1,5 +1,5 @@
App.Users =
initialize: ->
$('.initialjs-avatar').initial()
$(".initialjs-avatar").initial()
false

View File

@@ -1,22 +1,22 @@
App.ValuationBudgetInvestmentForm =
showFeasibleFields: ->
$('#valuation_budget_investment_edit_form #unfeasible_fields').hide('down')
$('#valuation_budget_investment_edit_form #feasible_fields').show()
$("#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()
$("#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')
$("#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'
if feasibility == "feasible"
App.ValuationBudgetInvestmentForm.showFeasibleFields()
else if feasibility == 'unfeasible'
else if feasibility == "unfeasible"
App.ValuationBudgetInvestmentForm.showNotFeasibleFields()
@@ -29,4 +29,4 @@ App.ValuationBudgetInvestmentForm =
initialize: ->
App.ValuationBudgetInvestmentForm.showFeasibilityFields()
App.ValuationBudgetInvestmentForm.showFeasibilityFieldsOnChange()
false
false

View File

@@ -1,22 +1,22 @@
App.ValuationSpendingProposalForm =
showFeasibleFields: ->
$('#valuation_spending_proposal_edit_form #not_feasible_fields').hide('down')
$('#valuation_spending_proposal_edit_form #feasible_fields').show()
$("#valuation_spending_proposal_edit_form #not_feasible_fields").hide("down")
$("#valuation_spending_proposal_edit_form #feasible_fields").show()
showNotFeasibleFields: ->
$('#valuation_spending_proposal_edit_form #feasible_fields').hide('down')
$('#valuation_spending_proposal_edit_form #not_feasible_fields').show()
$("#valuation_spending_proposal_edit_form #feasible_fields").hide("down")
$("#valuation_spending_proposal_edit_form #not_feasible_fields").show()
showAllFields: ->
$('#valuation_spending_proposal_edit_form #feasible_fields').show('down')
$('#valuation_spending_proposal_edit_form #not_feasible_fields').show('down')
$("#valuation_spending_proposal_edit_form #feasible_fields").show("down")
$("#valuation_spending_proposal_edit_form #not_feasible_fields").show("down")
showFeasibilityFields: ->
feasible = $("#valuation_spending_proposal_edit_form input[type=radio][name='spending_proposal[feasible]']:checked").val()
if feasible == 'true'
if feasible == "true"
App.ValuationSpendingProposalForm.showFeasibleFields()
else if feasible == 'false'
else if feasible == "false"
App.ValuationSpendingProposalForm.showNotFeasibleFields()
@@ -29,4 +29,4 @@ App.ValuationSpendingProposalForm =
initialize: ->
App.ValuationSpendingProposalForm.showFeasibilityFields()
App.ValuationSpendingProposalForm.showFeasibilityFieldsOnChange()
false
false

View File

@@ -2,7 +2,7 @@ App.Votes =
hoverize: (votes) ->
$(document).on {
'mouseenter focus': ->
"mouseenter focus": ->
$("div.participation-not-allowed", this).show()
$("div.participation-allowed", this).hide()
mouseleave: ->

View File

@@ -1,16 +1,16 @@
App.WatchFormChanges =
forms: ->
return $('form[data-watch-changes]')
return $("form[data-watch-changes]")
msg: ->
if($('[data-watch-form-message]').length)
return $('[data-watch-form-message]').data('watch-form-message')
if($("[data-watch-form-message]").length)
return $("[data-watch-form-message]").data("watch-form-message")
checkChanges: (event) ->
changes = false
App.WatchFormChanges.forms().each ->
form = $(this)
if form.serialize() != form.data('watchChanges')
if form.serialize() != form.data("watchChanges")
changes = true
if changes
return confirm(App.WatchFormChanges.msg())
@@ -21,10 +21,10 @@ App.WatchFormChanges =
if App.WatchFormChanges.forms().length == 0 || App.WatchFormChanges.msg() == undefined
return
$(document).off('page:before-change').on('page:before-change', (e) -> App.WatchFormChanges.checkChanges(e))
$(document).off("page:before-change").on("page:before-change", (e) -> App.WatchFormChanges.checkChanges(e))
App.WatchFormChanges.forms().each ->
form = $(this)
form.data('watchChanges', form.serialize())
form.data("watchChanges", form.serialize())
false

View File

@@ -74,7 +74,7 @@ $pdf-secondary: #ff9e00;
$black: #222;
$white: #fff;
$body-font-family: 'Source Sans Pro', 'Helvetica', 'Arial', sans-serif !important;
$body-font-family: "Source Sans Pro", "Helvetica", "Arial", sans-serif !important;
$header-font-family: $body-font-family;
@@ -82,24 +82,24 @@ $global-radius: rem-calc(3);
$button-radius: $global-radius;
$font-family-serif: Georgia, 'Times New Roman', Times, serif;
$font-family-serif: Georgia, "Times New Roman", Times, serif;
$header-styles: (
small: (
'h1': ('font-size': 34),
'h2': ('font-size': 24),
'h3': ('font-size': 20),
'h4': ('font-size': 18),
'h5': ('font-size': 16),
'h6': ('font-size': 14),
"h1": ("font-size": 34),
"h2": ("font-size": 24),
"h3": ("font-size": 20),
"h4": ("font-size": 18),
"h5": ("font-size": 16),
"h6": ("font-size": 14),
),
medium: (
'h1': ('font-size': 44),
'h2': ('font-size': 34),
'h3': ('font-size': 24),
'h4': ('font-size': 19),
'h5': ('font-size': 16),
'h6': ('font-size': 13),
"h1": ("font-size": 44),
"h2": ("font-size": 34),
"h3": ("font-size": 24),
"h4": ("font-size": 19),
"h5": ("font-size": 16),
"h6": ("font-size": 13),
),
);

View File

@@ -60,7 +60,7 @@
// 55. Top Bar
// 56. Xy Grid
@import 'util/util';
@import "util/util";
// 1. Global
// ---------
@@ -82,7 +82,7 @@ $black: #0a0a0a;
$white: #fefefe;
$body-background: $white;
$body-font-color: $black;
$body-font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;
$body-font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
$body-antialiased: true;
$global-margin: 1rem;
$global-padding: 1rem;
@@ -124,7 +124,7 @@ $grid-column-gutter: (
medium: 30px,
);
$grid-column-align-edge: true;
$grid-column-alias: 'columns';
$grid-column-alias: "columns";
$block-grid-max: 8;
// 4. Base Typography
@@ -133,26 +133,26 @@ $block-grid-max: 8;
$header-font-family: $body-font-family;
$header-font-weight: $global-weight-normal;
$header-font-style: normal;
$font-family-monospace: Consolas, 'Liberation Mono', Courier, monospace;
$font-family-monospace: Consolas, "Liberation Mono", Courier, monospace;
$header-color: inherit;
$header-lineheight: 1.4;
$header-margin-bottom: 0.5rem;
$header-styles: (
small: (
'h1': ('font-size': 24),
'h2': ('font-size': 20),
'h3': ('font-size': 19),
'h4': ('font-size': 18),
'h5': ('font-size': 17),
'h6': ('font-size': 16),
"h1": ("font-size": 24),
"h2": ("font-size": 20),
"h3": ("font-size": 19),
"h4": ("font-size": 18),
"h5": ("font-size": 17),
"h6": ("font-size": 16),
),
medium: (
'h1': ('font-size': 48),
'h2': ('font-size': 40),
'h3': ('font-size': 31),
'h4': ('font-size': 25),
'h5': ('font-size': 20),
'h6': ('font-size': 16),
"h1": ("font-size": 48),
"h2": ("font-size": 40),
"h3": ("font-size": 31),
"h4": ("font-size": 25),
"h5": ("font-size": 20),
"h6": ("font-size": 16),
),
);
$header-text-rendering: optimizeLegibility;
@@ -188,7 +188,7 @@ $blockquote-padding: rem-calc(9 20 0 19);
$blockquote-border: 1px solid $medium-gray;
$cite-font-size: rem-calc(13);
$cite-color: $dark-gray;
$cite-pseudo-content: '\2014 \0020';
$cite-pseudo-content: "\2014 \0020";
$keystroke-font: $font-family-monospace;
$keystroke-color: $black;
$keystroke-background: $light-gray;
@@ -271,8 +271,8 @@ $breadcrumbs-item-color-disabled: $medium-gray;
$breadcrumbs-item-margin: 0.75rem;
$breadcrumbs-item-uppercase: true;
$breadcrumbs-item-separator: true;
$breadcrumbs-item-separator-item: '/';
$breadcrumbs-item-separator-item-rtl: '\\';
$breadcrumbs-item-separator-item: "/";
$breadcrumbs-item-separator-item-rtl: "\\";
$breadcrumbs-item-separator-color: $medium-gray;
// 11. Button
@@ -305,7 +305,7 @@ $button-transition: background-color 0.25s ease-out, color 0.25s ease-out;
$buttongroup-margin: 1rem;
$buttongroup-spacing: 1px;
$buttongroup-child-selector: '.button';
$buttongroup-child-selector: ".button";
$buttongroup-expand-max: 6;
$buttongroup-radius-on-each: true;
@@ -511,7 +511,7 @@ $offcanvas-transition-length: 0.5s;
$offcanvas-transition-timing: ease;
$offcanvas-fixed-reveal: true;
$offcanvas-exit-background: rgba($white, 0.25);
$maincontent-class: 'off-canvas-content';
$maincontent-class: "off-canvas-content";
// 26. Orbit
// ---------

View File

@@ -224,6 +224,11 @@ $sidebar-active: #f4fcd0;
label {
color: #fff;
}
a {
color: inherit;
white-space: nowrap;
}
}
.break {
@@ -251,6 +256,13 @@ $sidebar-active: #f4fcd0;
max-width: none;
}
form {
.input-group-label {
height: $line-height * 2;
}
}
.menu.simple {
margin-bottom: $line-height / 2;
@@ -284,10 +296,6 @@ $sidebar-active: #f4fcd0;
.proposal-form {
padding-top: 0;
}
.proposal-show {
padding-top: rem-calc(54);
}
}
.is-featured {
@@ -364,6 +372,48 @@ $sidebar-active: #f4fcd0;
color: $text-medium;
}
.icon-sortable {
font-family: "icons";
font-size: $small-font-size;
padding-right: $line-height / 2;
position: relative;
&::before,
&::after {
left: 6px;
opacity: 0.25;
position: absolute;
}
&::before {
content: "\57";
top: -2px;
}
&::after {
content: "\52";
bottom: -10px;
}
&.asc {
&::after {
opacity: 1;
}
}
&.desc {
&::before {
opacity: 1;
}
}
}
code {
word-break: break-all;
}
// 02. Sidebar
// -----------
@@ -428,7 +478,7 @@ $sidebar-active: #f4fcd0;
> a::after {
border: 0;
content: '\61' !important;
content: "\61" !important;
font-family: "icons" !important;
height: auto;
position: absolute !important;
@@ -1110,7 +1160,7 @@ table {
}
.map-icon::after {
content: '';
content: "";
width: 14px;
height: 14px;
margin: 8px 0 0 8px;
@@ -1170,7 +1220,7 @@ table {
&.enabled::before,
&.disabled::before {
font-family: 'icons';
font-family: "icons";
left: 0;
position: absolute;
}
@@ -1180,7 +1230,7 @@ table {
&::before {
color: $check;
content: '\6c';
content: "\6c";
}
}
@@ -1189,22 +1239,11 @@ table {
&::before {
color: #000;
content: '\76';
content: "\76";
}
}
}
.max-headings-label {
color: $text-medium;
font-size: $small-font-size;
margin-left: $line-height / 2;
}
.current-of-max-headings {
color: #000;
font-weight: bold;
}
// 11. Newsletters
// -----------------

View File

@@ -14,7 +14,7 @@
}
.annotator-adder {
background-image: image-url('annotator_adder.png');
background-image: image-url("annotator_adder.png");
margin-top: -52px;
}
@@ -43,7 +43,7 @@
.annotator-widget::after,
.annotator-editor.annotator-invert-y .annotator-widget::after {
background-image: image-url('annotator_items.png');
background-image: image-url("annotator_items.png");
}
.annotator-editor a,

View File

@@ -1,23 +1,24 @@
@import 'social-share-button';
@import 'foundation_and_overrides';
@import 'fonts';
@import 'icons';
@import 'mixins';
@import 'admin';
@import 'layout';
@import 'participation';
@import 'pages';
@import 'dashboard';
@import 'legislation';
@import 'legislation_process';
@import 'community';
@import 'custom';
@import 'c3';
@import 'annotator.min';
@import 'annotator_overrides';
@import 'jquery-ui/datepicker';
@import 'datepicker_overrides';
@import 'jquery-ui/autocomplete';
@import 'autocomplete_overrides';
@import 'jquery-ui/sortable';
@import 'leaflet';
@import "social-share-button";
@import "foundation_and_overrides";
@import "fonts";
@import "icons";
@import "mixins";
@import "admin";
@import "layout";
@import "participation";
@import "milestones";
@import "pages";
@import "dashboard";
@import "legislation";
@import "legislation_process";
@import "community";
@import "custom";
@import "c3";
@import "annotator.min";
@import "annotator_overrides";
@import "jquery-ui/datepicker";
@import "datepicker_overrides";
@import "jquery-ui/autocomplete";
@import "autocomplete_overrides";
@import "jquery-ui/sortable";
@import "leaflet";

View File

@@ -108,7 +108,7 @@
a {
display: block;
}
h4,
p {
margin-bottom: 0;
@@ -158,7 +158,7 @@
&::before {
border: 2px solid #fb9497;
color: #fb9497;
content: '\74';
content: "\74";
}
}
@@ -166,8 +166,8 @@
border: 2px solid #00cb96;
border-radius: rem-calc(40);
color: #00cb96;
content: '\6c';
font-family: 'icons';
content: "\6c";
font-family: "icons";
font-size: rem-calc(20);
height: rem-calc(36);
position: absolute;
@@ -185,6 +185,7 @@
h4 {
margin-top: $line-height;
}
.resource-description {
min-height: $line-height * 4;
}
@@ -212,8 +213,8 @@
border: 1px solid $border;
border-radius: rem-calc(36);
color: #000;
content: '\77';
font-family: 'icons';
content: "\77";
font-family: "icons";
font-size: rem-calc(24);
height: rem-calc(36);
left: -18px;
@@ -239,7 +240,7 @@
&::before {
color: #000;
font-family: 'icons';
font-family: "icons";
font-size: rem-calc(24);
left: 6px;
position: absolute;
@@ -250,21 +251,21 @@
.goal-supports {
&::before {
content: '\77';
content: "\77";
}
}
.goal-resource {
&::before {
content: '\74';
content: "\74";
}
}
.goal-days {
&::before {
content: '\67';
content: "\67";
}
}
@@ -313,7 +314,7 @@
&::before {
background: linear-gradient(to right, rgba(231, 236, 240, 1) 0%, rgba(251, 251, 251, 1) 90%);
border-left: 4px solid $brand;
content: '';
content: "";
height: rem-calc(48);
left: 0;
padding-left: rem-calc(20);
@@ -431,8 +432,8 @@
&::before {
color: $brand;
content: '\6d';
font-family: 'icons';
content: "\6d";
font-family: "icons";
left: 6px;
position: absolute;
}
@@ -527,7 +528,7 @@
&::before {
background: $pdf-secondary;
content: '';
content: "";
position: absolute;
}

View File

@@ -23,7 +23,7 @@
thead {
tr th {
color: $dark;
border: 1px solid $brand;
}
}
}
@@ -51,11 +51,11 @@
}
.ui-datepicker-prev::after {
content: '\62';
content: "\62";
}
.ui-datepicker-next::after {
content: '\63';
content: "\63";
}
table {

View File

@@ -8,88 +8,88 @@
// - - - - - - - - - - - - - - - - - - - - - - - - -
@font-face {
font-family: 'Source Sans Pro';
font-family: "Source Sans Pro";
font-style: normal;
font-weight: 300;
src: font-url('sourcesanspro-light-webfont.eot');
src: font-url('sourcesanspro-light-webfont.eot?#iefix') format('embedded-opentype'),
font-url('sourcesanspro-light-webfont.woff2') format('woff2'),
font-url('sourcesanspro-light-webfont.woff') format('woff'),
font-url('sourcesanspro-light-webfont.ttf') format('truetype'),
font-url('sourcesanspro-light-webfont.svg#source_sans_prolight') format('svg');
src: font-url("sourcesanspro-light-webfont.eot");
src: font-url("sourcesanspro-light-webfont.eot?#iefix") format("embedded-opentype"),
font-url("sourcesanspro-light-webfont.woff2") format("woff2"),
font-url("sourcesanspro-light-webfont.woff") format("woff"),
font-url("sourcesanspro-light-webfont.ttf") format("truetype"),
font-url("sourcesanspro-light-webfont.svg#source_sans_prolight") format("svg");
}
@font-face {
font-family: 'Source Sans Pro';
font-family: "Source Sans Pro";
font-style: normal;
font-weight: 400;
src: font-url('sourcesanspro-regular-webfont.eot');
src: font-url('sourcesanspro-regular-webfont.eot?#iefix') format('embedded-opentype'),
font-url('sourcesanspro-regular-webfont.woff2') format('woff2'),
font-url('sourcesanspro-regular-webfont.woff') format('woff'),
font-url('sourcesanspro-regular-webfont.ttf') format('truetype'),
font-url('sourcesanspro-regular-webfont.svg#source_sans_proregular') format('svg');
src: font-url("sourcesanspro-regular-webfont.eot");
src: font-url("sourcesanspro-regular-webfont.eot?#iefix") format("embedded-opentype"),
font-url("sourcesanspro-regular-webfont.woff2") format("woff2"),
font-url("sourcesanspro-regular-webfont.woff") format("woff"),
font-url("sourcesanspro-regular-webfont.ttf") format("truetype"),
font-url("sourcesanspro-regular-webfont.svg#source_sans_proregular") format("svg");
}
@font-face {
font-family: 'Source Sans Pro';
font-family: "Source Sans Pro";
font-style: italic;
font-weight: 400;
src: font-url('sourcesanspro-italic-webfont.eot');
src: font-url('sourcesanspro-italic-webfont.eot?#iefix') format('embedded-opentype'),
font-url('sourcesanspro-italic-webfont.woff2') format('woff2'),
font-url('sourcesanspro-italic-webfont.woff') format('woff'),
font-url('sourcesanspro-italic-webfont.ttf') format('truetype'),
font-url('sourcesanspro-italic-webfont.svg#source_sans_proitalic') format('svg');
src: font-url("sourcesanspro-italic-webfont.eot");
src: font-url("sourcesanspro-italic-webfont.eot?#iefix") format("embedded-opentype"),
font-url("sourcesanspro-italic-webfont.woff2") format("woff2"),
font-url("sourcesanspro-italic-webfont.woff") format("woff"),
font-url("sourcesanspro-italic-webfont.ttf") format("truetype"),
font-url("sourcesanspro-italic-webfont.svg#source_sans_proitalic") format("svg");
}
@font-face {
font-family: 'Source Sans Pro';
font-family: "Source Sans Pro";
font-style: normal;
font-weight: 700;
src: font-url('sourcesanspro-bold-webfont.eot');
src: font-url('sourcesanspro-bold-webfont.eot?#iefix') format('embedded-opentype'),
font-url('sourcesanspro-bold-webfont.woff2') format('woff2'),
font-url('sourcesanspro-bold-webfont.woff') format('woff'),
font-url('sourcesanspro-bold-webfont.ttf') format('truetype'),
font-url('sourcesanspro-bold-webfont.svg#source_sans_probold') format('svg');
src: font-url("sourcesanspro-bold-webfont.eot");
src: font-url("sourcesanspro-bold-webfont.eot?#iefix") format("embedded-opentype"),
font-url("sourcesanspro-bold-webfont.woff2") format("woff2"),
font-url("sourcesanspro-bold-webfont.woff") format("woff"),
font-url("sourcesanspro-bold-webfont.ttf") format("truetype"),
font-url("sourcesanspro-bold-webfont.svg#source_sans_probold") format("svg");
}
// 02. Lato
// - - - - - - - - - - - - - - - - - - - - - - - - -
@font-face {
font-family: 'Lato';
src: font-url('lato-light.eot');
src: font-url('lato-light.eot?#iefix') format('embedded-opentype'),
font-url('lato-light.woff2') format('woff2'),
font-url('lato-light.woff') format('woff'),
font-url('lato-light.ttf') format('truetype'),
font-url('lato-light.svg#latolight') format('svg');
font-family: "Lato";
src: font-url("lato-light.eot");
src: font-url("lato-light.eot?#iefix") format("embedded-opentype"),
font-url("lato-light.woff2") format("woff2"),
font-url("lato-light.woff") format("woff"),
font-url("lato-light.ttf") format("truetype"),
font-url("lato-light.svg#latolight") format("svg");
font-weight: lighter;
font-style: normal;
}
@font-face {
font-family: 'Lato';
src: font-url('lato-regular.eot');
src: font-url('lato-regular.eot?#iefix') format('embedded-opentype'),
font-url('lato-regular.woff2') format('woff2'),
font-url('lato-regular.woff') format('woff'),
font-url('lato-regular.ttf') format('truetype'),
font-url('lato-regular.svg#latoregular') format('svg');
font-family: "Lato";
src: font-url("lato-regular.eot");
src: font-url("lato-regular.eot?#iefix") format("embedded-opentype"),
font-url("lato-regular.woff2") format("woff2"),
font-url("lato-regular.woff") format("woff"),
font-url("lato-regular.ttf") format("truetype"),
font-url("lato-regular.svg#latoregular") format("svg");
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Lato';
src: font-url('lato-bold.eot');
src: font-url('lato-bold.eot?#iefix') format('embedded-opentype'),
font-url('lato-bold.woff2') format('woff2'),
font-url('lato-bold.woff') format('woff'),
font-url('lato-bold.ttf') format('truetype'),
font-url('lato-bold.svg#latobold') format('svg');
font-family: "Lato";
src: font-url("lato-bold.eot");
src: font-url("lato-bold.eot?#iefix") format("embedded-opentype"),
font-url("lato-bold.woff2") format("woff2"),
font-url("lato-bold.woff") format("woff"),
font-url("lato-bold.ttf") format("truetype"),
font-url("lato-bold.svg#latobold") format("svg");
font-weight: bold;
font-style: normal;
}

View File

@@ -1,11 +1,11 @@
@charset 'utf-8';
@charset "utf-8";
@import 'settings';
@import 'consul_settings';
@import 'custom_settings';
@import 'foundation';
@import "settings";
@import "consul_settings";
@import "custom_settings";
@import "foundation";
@import 'motion-ui/motion-ui';
@import "motion-ui/motion-ui";
@include foundation-global-styles;
// @include foundation-xy-grid-classes;

View File

@@ -1,12 +1,12 @@
@charset "UTF-8";
@font-face {
font-family: 'icons';
src: font-url('icons.eot');
src: font-url('icons.eot?#iefix') format('embedded-opentype'),
font-url('icons.woff') format('woff'),
font-url('icons.ttf') format('truetype'),
font-url('icons.svg#icons') format('svg');
font-family: "icons";
src: font-url("icons.eot");
src: font-url("icons.eot?#iefix") format("embedded-opentype"),
font-url("icons.woff") format("woff"),
font-url("icons.ttf") format("truetype"),
font-url("icons.svg#icons") format("svg");
font-weight: normal;
font-style: normal;
}
@@ -38,263 +38,263 @@
}
.icon-angle-down::before {
content: '\61';
content: "\61";
}
.icon-angle-left::before {
content: '\62';
content: "\62";
}
.icon-angle-right::before {
content: '\63';
content: "\63";
}
.icon-angle-up::before {
content: '\64';
content: "\64";
}
.icon-comments::before {
content: '\65';
content: "\65";
}
.icon-twitter::before {
content: '\66';
content: "\66";
}
.icon-calendar::before {
content: '\67';
content: "\67";
}
.icon-debates::before {
content: '\69';
content: "\69";
}
.icon-unlike::before {
content: '\6a';
content: "\6a";
}
.icon-like::before {
content: '\6b';
content: "\6b";
}
.icon-check::before {
content: '\6c';
content: "\6c";
}
.icon-edit::before {
content: '\6d';
content: "\6d";
}
.icon-user::before {
content: '\6f';
content: "\6f";
}
.icon-settings::before {
content: '\71';
content: "\71";
}
.icon-stats::before {
content: '\72';
content: "\72";
}
.icon-proposals::before {
content: '\68';
content: "\68";
}
.icon-organizations::before {
content: '\73';
content: "\73";
}
.icon-deleted::before {
content: '\74';
content: "\74";
}
.icon-tag::before {
content: '\75';
content: "\75";
}
.icon-eye::before {
content: '\70';
content: "\70";
}
.icon-x::before {
content: '\76';
content: "\76";
}
.icon-flag::before {
content: '\77';
content: "\77";
}
.icon-comment::before {
content: '\79';
content: "\79";
}
.icon-reply::before {
content: '\7a';
content: "\7a";
}
.icon-facebook::before {
content: '\41';
content: "\41";
}
.icon-google-plus::before {
content: '\42';
content: "\42";
}
.icon-search::before {
content: '\45';
content: "\45";
}
.icon-external::before {
content: '\46';
content: "\46";
}
.icon-video::before {
content: '\44';
content: "\44";
}
.icon-document::before {
content: '\47';
content: "\47";
}
.icon-print::before {
content: '\48';
content: "\48";
}
.icon-blog::before {
content: '\4a';
content: "\4a";
}
.icon-box::before {
content: '\49';
content: "\49";
}
.icon-youtube::before {
content: '\4b';
content: "\4b";
}
.icon-letter::before {
content: '\4c';
content: "\4c";
}
.icon-circle::before {
content: '\43';
content: "\43";
}
.icon-circle-o::before {
content: '\4d';
content: "\4d";
}
.icon-help::before {
content: '\4e';
content: "\4e";
}
.icon-budget::before {
content: '\53';
content: "\53";
}
.icon-notification::before {
content: '\6e';
content: "\6e";
}
.icon-no-notification::before {
content: '\78';
content: "\78";
}
.icon-whatsapp::before {
content: '\50';
content: "\50";
}
.icon-zip::before {
content: '\4f';
content: "\4f";
}
.icon-banner::before {
content: '\51';
content: "\51";
}
.icon-arrow-down::before {
content: '\52';
content: "\52";
}
.icon-arrow-left::before {
content: '\54';
content: "\54";
}
.icon-arrow-right::before {
content: '\55';
content: "\55";
}
.icon-check-circle::before {
content: '\56';
content: "\56";
}
.icon-arrow-top::before {
content: '\57';
content: "\57";
}
.icon-checkmark-circle::before {
content: '\59';
content: "\59";
}
.icon-minus-square::before {
content: '\58';
content: "\58";
}
.icon-plus-square::before {
content: '\5a';
content: "\5a";
}
.icon-expand::before {
content: '\30';
content: "\30";
}
.icon-telegram::before {
content: '\31';
content: "\31";
}
.icon-instagram::before {
content: '\32';
content: "\32";
}
.icon-image::before {
content: '\33';
content: "\33";
}
.icon-search-plus::before {
content: '\34';
content: "\34";
}
.icon-search-minus::before {
content: '\35';
content: "\35";
}
.icon-calculator::before {
content: '\36';
content: "\36";
}
.icon-map-marker::before {
content: '\37';
content: "\37";
}
.icon-user-plus::before {
content: '\38';
content: "\38";
}
.icon-file-text-o::before {
content: '\39';
content: "\39";
}
.icon-file-text::before {
content: '\21';
content: "\21";
}
.icon-bars::before {
content: '\22';
content: "\22";
}
.icon-quote-before::before {
content: '';
content: "";
background-size: cover;
display: block;
width: 60px;
@@ -304,7 +304,7 @@
}
.icon-quote-after::before {
content: '';
content: "";
background-size: cover;
display: block;
width: 60px;
@@ -314,7 +314,7 @@
}
.icon-finger::before {
content: '';
content: "";
background-size: cover;
display: inline-block;
width: 50px;

View File

@@ -359,19 +359,34 @@ a {
.tabs-title {
font-size: $base-font-size;
margin-bottom: 0;
margin-right: $line-height;
}
.tabs-title > a {
color: $text-medium;
margin-bottom: rem-calc(-1);
margin-right: $line-height;
position: relative;
&[aria-selected='true'],
&.is-active {
&:hover {
background: none;
color: $brand;
text-decoration: none;
}
&[aria-selected="true"],
&.is-active {
border-bottom: 0;
color: $brand;
border-bottom: 2px solid $brand;
font-weight: bold;
&::after {
background: $brand;
border-bottom: 2px solid $brand;
bottom: 0;
content: "";
left: 0;
position: absolute;
width: 100%;
}
}
}
@@ -419,6 +434,11 @@ a {
text-transform: uppercase;
}
.help-text {
line-height: rem-calc(20);
margin-top: 0;
}
// 02. Header
// ----------
@@ -435,6 +455,18 @@ header {
float: left;
height: $line-height * 1.5;
margin-left: $line-height / 2;
position: relative;
&::after {
color: #808080;
content: "\61";
font-family: "icons" !important;
font-size: $small-font-size;
pointer-events: none;
position: absolute;
right: 2px;
top: 9px;
}
}
.external-links {
@@ -469,7 +501,7 @@ header {
a {
color: #fff;
display: inline-block;
font-family: 'Lato' !important;
font-family: "Lato" !important;
font-size: rem-calc(24);
font-weight: lighter;
line-height: $line-height * 2;
@@ -614,7 +646,7 @@ header {
display: inline-block;
&::after {
content: '|';
content: "|";
}
&:last-child::after {
@@ -762,7 +794,7 @@ footer {
color: $text;
.logo a {
font-family: 'Lato' !important;
font-family: "Lato" !important;
text-decoration: none;
&:hover {
@@ -846,6 +878,13 @@ footer {
}
}
.sidebar-map {
.map {
z-index: 0;
}
}
.sidebar-title {
border-top: 2px solid $brand;
display: inline-block;
@@ -867,7 +906,7 @@ footer {
}
.auth-image {
background: $brand image-url('auth_bg.jpg');
background: $brand image-url("auth_bg.jpg");
background-repeat: no-repeat;
background-size: cover;
@@ -881,7 +920,6 @@ footer {
a {
color: #fff;
display: block;
line-height: rem-calc(80); // Same as logo image height
text-align: center;
@include breakpoint(medium) {
@@ -927,15 +965,11 @@ footer {
label {
color: #fff;
font-size: $small-font-size;
font-size: $tiny-font-size;
font-weight: normal;
}
select {
background-image: image-url('language_select.png');
background-origin: border-box;
background-position: right;
background-size: 24px 24px;
option {
background: #fff;
@@ -946,14 +980,16 @@ footer {
}
.locale-switcher {
background-color: transparent;
background: #001d33;
border: 0;
border-radius: rem-calc(4);
color: #fff;
font-size: $small-font-size;
height: $line-height;
margin-bottom: 0;
margin-top: $line-height / 4;
outline: none;
padding-left: rem-calc(3);
padding-right: $line-height;
padding: 0 $line-height / 4;
width: auto;
&:focus {
@@ -1056,6 +1092,7 @@ form {
.callout {
font-size: $small-font-size;
overflow: hidden;
a:not(.button) {
font-weight: bold;
@@ -1095,6 +1132,10 @@ form {
.close {
text-decoration: none !important;
}
.button {
margin-bottom: 0;
}
}
.no-error {
@@ -1238,7 +1279,7 @@ form {
&::before {
background: $border;
content: '';
content: "";
height: 100%;
left: 7px;
position: absolute;
@@ -1284,14 +1325,14 @@ form {
}
&::before {
content: '\43';
content: "\43";
}
}
&::before {
background: #fff;
color: $brand;
content: '\4d';
content: "\4d";
font-family: "icons" !important;
font-size: $small-font-size;
height: rem-calc(20);
@@ -1446,7 +1487,7 @@ table {
&::before {
color: #45b0e3;
content: 'f';
content: "f";
font-family: "icons" !important;
font-size: rem-calc(24);
left: 0;
@@ -1466,7 +1507,7 @@ table {
width: $line-height * 2 !important;
&::before {
content: 'f';
content: "f";
font-family: "icons" !important;
font-size: rem-calc(24);
left: 50%;
@@ -1489,7 +1530,7 @@ table {
&::before {
color: #3b5998;
content: 'A';
content: "A";
font-family: "icons" !important;
font-size: rem-calc(24);
left: 0;
@@ -1509,7 +1550,7 @@ table {
width: rem-calc(48) !important;
&::before {
content: 'A';
content: "A";
font-family: "icons" !important;
font-size: rem-calc(24);
left: 50%;
@@ -1532,7 +1573,7 @@ table {
&::before {
color: #de4c34;
content: 'B';
content: "B";
font-family: "icons" !important;
font-size: rem-calc(24);
left: 0;
@@ -1552,7 +1593,7 @@ table {
width: $line-height * 2 !important;
&::before {
content: 'B';
content: "B";
font-family: "icons" !important;
font-size: rem-calc(24);
left: 50%;
@@ -1575,7 +1616,7 @@ table {
&::before {
color: #08c;
content: '1';
content: "1";
font-family: "icons" !important;
font-size: rem-calc(24);
left: 0;
@@ -1595,7 +1636,7 @@ table {
width: $line-height * 2 !important;
&::before {
content: '1';
content: "1";
font-family: "icons" !important;
font-size: rem-calc(24);
left: 50%;
@@ -1648,7 +1689,7 @@ table {
width: $line-height * 2;
&::before {
content: 'f';
content: "f";
font-family: "icons" !important;
font-size: rem-calc(24);
left: 50%;
@@ -1673,7 +1714,7 @@ table {
width: rem-calc(48);
&::before {
content: 'A';
content: "A";
font-family: "icons" !important;
font-size: rem-calc(24);
left: 50%;
@@ -1698,7 +1739,7 @@ table {
width: rem-calc(48);
&::before {
content: 'B';
content: "B";
font-family: "icons" !important;
font-size: rem-calc(24);
left: 50%;
@@ -1723,7 +1764,7 @@ table {
width: $line-height * 2;
&::before {
content: '1';
content: "1";
font-family: "icons" !important;
font-size: rem-calc(24);
left: 50%;
@@ -1767,7 +1808,7 @@ table {
top: 24px;
@include breakpoint(medium) {
content: 'c';
content: "c";
}
}
}
@@ -2204,76 +2245,6 @@ table {
// 18. Banners
// -----------
.banner-style-one {
background-color: $brand;
}
.banner-style-two {
background-color: $budget;
}
.banner-style-three {
background-color: #33dadf;
}
@include breakpoint(large) {
.banner-img-one {
background-image: image-url('banners/banner1.png');
}
.banner-img-two {
background-image: image-url('banners/banner2.png');
}
.banner-img-three {
background-image: image-url('banners/banner3.png');
}
}
.banner-img-one,
.banner-img-two,
.banner-img-three {
background-position: bottom right;
background-repeat: no-repeat;
}
.banner-style-one,
.banner-style-two,
.banner-style-three,
.banner {
margin: 0;
margin-bottom: $line-height;
@include breakpoint(large) {
h3 {
width: 80%;
}
}
h2,
h3,
a {
color: #eaeaf2;
}
h2 {
padding: $line-height / 2;
padding-bottom: 0;
}
h3 {
padding: $line-height / 2;
padding-top: 0;
}
a:hover h2,
a:hover h3 {
color: #eaeaf2 !important;
text-decoration: none;
}
}
// 19. Recommendations
// -------------------
@@ -2344,7 +2315,7 @@ table {
}
.card .orbit .orbit-wrapper .truncate {
background: image-url('truncate.png');
background: image-url("truncate.png");
background-repeat: repeat-x;
bottom: 0;
height: rem-calc(20);
@@ -2494,7 +2465,7 @@ table {
border-radius: rem-calc(5);
display: block;
margin: $line-height / 2 0;
padding: 0 $line-height / 2;
padding: $line-height / 2;
position: relative;
.icon-document {
@@ -2627,7 +2598,7 @@ table {
&.score-positive::before,
&.score-negative::before {
font-family: 'icons';
font-family: "icons";
left: 0;
position: absolute;
}
@@ -2637,7 +2608,7 @@ table {
&::before {
color: $color-success;
content: '\6c';
content: "\6c";
}
}
@@ -2646,7 +2617,7 @@ table {
&::before {
color: $color-alert;
content: '\76';
content: "\76";
}
}
}
@@ -2684,10 +2655,22 @@ table {
}
}
.leaflet-container {
.leaflet-control-attribution {
background: rgba(255, 255, 255, 0.9) !important;
}
a {
color: $link !important;
}
}
// 24. Homepage
// ------------
.home-page {
.home-page,
.custom-page {
a {
@@ -2794,15 +2777,15 @@ table {
display: inline-block;
height: rem-calc(120);
overflow: hidden;
width: 100%;
@include breakpoint(medium) {
height: rem-calc(96);
}
img {
margin-left: rem-calc(-15);
max-width: none;
width: rem-calc(120);
width: 100%;
}
}
@@ -2827,11 +2810,19 @@ table {
.figure-card {
display: flex;
margin: 0 0 $line-height;
overflow: hidden;
position: relative;
@include breakpoint(medium down) {
min-height: $line-height * 4;
}
@include breakpoint(medium) {
max-height: rem-calc(185);
overflow: hidden;
}
@include breakpoint(large) {
min-height: rem-calc(185);
}
a {
@@ -2863,8 +2854,16 @@ table {
h3,
.title {
font-size: rem-calc(24);
line-height: rem-calc(24);
font-size: $base-font-size;
@include breakpoint(medium) {
font-size: rem-calc(20);
}
@include breakpoint(large) {
font-size: rem-calc(24);
line-height: rem-calc(24);
}
}
span {

View File

@@ -24,7 +24,7 @@
&::before {
color: #8aa8be;
content: '';
content: "";
padding-right: $line-height / 4;
vertical-align: text-bottom;
}
@@ -44,63 +44,101 @@
// 02. Legislation process navigation
// ----------------------------------
.legislation-process-categories {
position: relative;
.legislation-process-list {
border-bottom: 1px solid $border;
}
.legislation-process-list {
border-bottom: 1px solid $medium-gray;
margin: 0 rem-calc(16) rem-calc(16);
.key-dates {
list-style-type: none;
margin: 0 rem-calc(-10);
ul {
list-style: none;
margin: 0 auto;
margin-bottom: 0;
padding-left: 0;
@include breakpoint(large) {
margin: 0;
}
li {
border: 1px solid $border;
display: block;
margin: rem-calc(-1) 0;
min-height: $line-height * 3;
position: relative;
vertical-align: top;
@include breakpoint(large down) {
&::after {
content: "\63";
font-family: "icons" !important;
font-size: rem-calc(24);
pointer-events: none;
position: absolute;
right: 12px;
top: 12px;
}
}
li {
border-bottom: 2px solid transparent;
cursor: pointer;
@include breakpoint(large) {
background: #fafafa;
display: inline-block;
margin-bottom: $line-height;
margin-right: $line-height;
transition: all 0.4s;
border-bottom: 0;
border-top-left-radius: rem-calc(6);
border-top-right-radius: rem-calc(6);
margin-bottom: 0;
margin-right: $line-height / 4;
margin-top: 0;
@include breakpoint(medium) {
margin-bottom: 0;
&:hover:not(.is-active) {
background: $highlight;
}
&:hover,
&:active,
&:focus {
border-bottom: 2px solid $brand;
}
a,
h4 {
display: block;
color: #6d6d6d;
margin-bottom: 0;
&::after {
content: "";
}
}
a {
&:hover,
&:active {
display: block;
padding: $line-height / 4 $line-height / 2;
@include breakpoint(large) {
display: inline-block;
}
&:hover {
text-decoration: none;
}
p {
h4 {
margin-bottom: 0;
}
}
}
@include breakpoint(medium) {
margin-bottom: rem-calc(16);
}
span {
color: $text-medium;
font-size: $small-font-size;
}
.is-active {
background: $highlight;
position: relative;
@include breakpoint(large) {
background: none;
border: 1px solid $border;
border-bottom: 0;
&::after {
border-bottom: 1px solid #fefefe;
bottom: -1px;
left: 0;
position: absolute;
width: 100%;
}
}
.is-active {
border-bottom: 2px solid $brand;
&::after {
content: "";
}
}
}
@@ -430,8 +468,8 @@
cursor: pointer;
position: absolute;
margin-left: rem-calc(-20);
font-family: 'icons';
content: '\58';
font-family: "icons";
content: "\58";
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
@@ -440,8 +478,8 @@
cursor: pointer;
position: absolute;
margin-left: rem-calc(-20);
font-family: 'icons';
content: '\5a';
font-family: "icons";
content: "\5a";
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
@@ -469,7 +507,7 @@
.anchor::before {
display: none;
content: '#';
content: "#";
color: $text-medium;
position: absolute;
left: 0;
@@ -721,7 +759,7 @@
display: inline-block;
&::after {
content: '|';
content: "|";
color: #838383;
}
}
@@ -742,7 +780,7 @@
&::after {
margin-left: rem-calc(4);
content: '|';
content: "|";
}
}
@@ -792,7 +830,7 @@
&::before {
margin-right: rem-calc(4);
content: '';
content: "";
}
}
}
@@ -943,4 +981,4 @@
font-size: rem-calc(20);
margin-top: 0;
}
}
}

View File

@@ -0,0 +1,127 @@
$progress-bar-background: #fef0e2;
$progress-bar-color: #fea230;
.tab-milestones {
.progress-bars {
margin-bottom: $line-height * 2;
margin-top: $line-height;
h5 {
font-size: rem-calc(24);
}
.progress {
background: $progress-bar-background;
border-radius: rem-calc(6);
position: relative;
}
.progress-meter {
background: $progress-bar-color;
border-radius: rem-calc(6);
}
.progress-meter-text {
color: #000;
right: 12px;
text-align: right;
transform: translate(0%, -50%);
}
.milestone-progress .row {
margin-bottom: $line-height / 2;
}
}
}
.tab-milestones .timeline li {
margin: 0 auto;
position: relative;
width: 0;
@include breakpoint(small only) {
width: 100%;
}
&::before {
background: $budget;
border-radius: rem-calc(20);
content: "";
height: rem-calc(20);
position: absolute;
top: 5px;
transform: translateX(-50%);
width: rem-calc(20);
z-index: 2;
}
&::after {
background: $light-gray;
bottom: 100%;
content: "";
height: 100%;
position: absolute;
top: 25px;
width: 1px;
z-index: 1;
}
.milestone-content {
padding: $line-height / 6 $line-height / 2;
position: relative;
@include breakpoint(medium) {
width: rem-calc(300);
}
@include breakpoint(large) {
width: rem-calc(450);
}
h3 {
margin-bottom: 0;
}
.milestone-date {
color: $text-medium;
font-size: $small-font-size;
}
}
&:nth-child(odd) {
.milestone-content {
text-align: right;
@include breakpoint(medium) {
margin-left: rem-calc(-315);
}
@include breakpoint(large) {
margin-left: rem-calc(-465);
}
@include breakpoint(small only) {
left: 15px;
text-align: left;
}
}
}
&:nth-child(even) {
.milestone-content {
left: 15px;
}
}
}
.milestone-status {
background: $budget;
border-radius: rem-calc(4);
color: #fff;
display: inline-block;
margin-top: $line-height / 6;
padding: $line-height / 4 $line-height / 2;
}

View File

@@ -11,7 +11,7 @@
@mixin logo {
color: #fff;
display: inline-block;
font-family: 'Lato' !important;
font-family: "Lato" !important;
font-size: rem-calc(24);
font-weight: lighter;
@@ -19,18 +19,6 @@
line-height: $line-height * 2;
margin-top: 0;
}
img {
height: 48px;
width: 48px;
@include breakpoint(medium) {
height: 80px;
margin-right: $line-height / 2;
margin-top: 0;
width: 80px;
}
}
}
// 02. Orbit bullet

View File

@@ -23,11 +23,6 @@
&.light {
background: #ecf0f1;
}
h1,
p {
color: $text;
}
}
.lead {

View File

@@ -287,7 +287,7 @@
margin: $line-height / 2 0;
&::before {
content: 'l ';
content: "l ";
font-family: "icons" !important;
}
}
@@ -524,118 +524,6 @@
}
}
.tab-milestones ul {
margin-top: rem-calc(40);
position: relative;
li {
margin: 0 auto;
position: relative;
width: 0;
}
li::before {
background: $budget;
border-radius: rem-calc(20);
content: '';
height: rem-calc(20);
position: absolute;
top: 5px;
transform: translateX(-50%);
width: rem-calc(20);
z-index: 2;
}
li::after {
background: $light-gray;
bottom: 100%;
content: '';
height: 100%;
position: absolute;
top: 25px;
width: 1px;
z-index: 1;
}
}
.tab-milestones ul .milestone-content {
padding: $line-height / 6 $line-height / 2;
position: relative;
h3 {
margin-bottom: 0;
}
.milestone-date {
color: $text-medium;
font-size: $small-font-size;
}
}
.tab-milestones .timeline ul li:nth-child(odd),
.tab-milestones .timeline ul li:nth-child(even) {
.milestone-content {
@include breakpoint(medium) {
width: rem-calc(300);
}
@include breakpoint(large) {
width: rem-calc(450);
}
}
}
.tab-milestones .timeline ul li:nth-child(odd) {
.milestone-content {
text-align: right;
@include breakpoint(medium) {
margin-left: rem-calc(-315);
}
@include breakpoint(large) {
margin-left: rem-calc(-465);
}
}
}
.tab-milestones .timeline ul li:nth-child(even) {
.milestone-content {
left: 15px;
}
}
.tab-milestones {
@include breakpoint(small only) {
.timeline ul li {
width: 100%;
&:nth-child(odd),
&:nth-child(even) {
.milestone-content {
left: 15px;
text-align: left;
}
}
}
}
}
.milestone-status {
background: $budget;
border-radius: rem-calc(4);
color: #fff;
display: inline-block;
margin-top: $line-height / 6;
padding: $line-height / 4 $line-height / 2;
}
.show-actions-menu {
[class^="icon-"] {
@@ -761,6 +649,10 @@
&.past-budgets {
min-height: 0;
.button ~ .button {
margin-left: $line-height / 2;
}
}
}
@@ -842,7 +734,7 @@
}
.truncate {
background: image-url('truncate.png');
background: image-url("truncate.png");
background-repeat: repeat-x;
bottom: 0;
height: rem-calc(24);
@@ -1047,7 +939,7 @@
&::before {
color: $text;
font-family: 'icons';
font-family: "icons";
}
}
@@ -1056,7 +948,7 @@
.button {
&::before {
content: '\51';
content: "\51";
}
}
}
@@ -1066,7 +958,7 @@
.button {
&::before {
content: '\22';
content: "\22";
}
}
}
@@ -1075,8 +967,8 @@
position: relative;
&::before {
content: '\22';
font-family: 'icons';
content: "\22";
font-family: "icons";
left: 0;
position: absolute;
top: 6px;
@@ -1087,20 +979,20 @@
position: relative;
&::before {
content: '\51';
font-family: 'icons';
content: "\51";
font-family: "icons";
left: 0;
position: absolute;
top: 6px;
}
}
.active {
.is-active {
color: $brand;
&::after {
content: '\6c';
font-family: 'icons';
content: "\6c";
font-family: "icons";
font-size: $tiny-font-size;
}
}
@@ -1362,16 +1254,12 @@
display: inline-block;
margin-bottom: $line-height / 2;
&:hover {
background: $highlight;
text-decoration: none;
}
a {
display: block;
padding: $line-height / 2;
&:hover {
background: $highlight;
text-decoration: none;
}
}
@@ -1419,8 +1307,8 @@
&::before {
color: #a5a1ff;
content: '\57';
font-family: 'icons';
content: "\57";
font-family: "icons";
font-size: $small-font-size;
position: absolute;
right: -6px;
@@ -1563,8 +1451,8 @@
font-weight: bold;
&::after {
content: '\56';
font-family: 'icons';
content: "\56";
font-family: "icons";
font-size: $small-font-size;
font-weight: normal;
line-height: $line-height;
@@ -1578,7 +1466,6 @@
}
.progress-bar-nav {
padding: $line-height 0;
position: relative;
z-index: 3;
@@ -1640,7 +1527,7 @@
background-color: #fff;
border: 4px solid $budget;
border-radius: 100%;
content: '';
content: "";
height: 16px;
left: -22px;
position: absolute;
@@ -1681,6 +1568,60 @@
}
}
.budget-execution {
border: 1px solid $border;
overflow: hidden;
position: relative;
a {
color: $text;
display: block;
img {
height: $line-height * 9;
min-width: 100%;
max-width: none;
transition-duration: 0.3s;
transition-property: transform;
}
&:hover {
text-decoration: none;
img {
transform: scale(1.05);
}
}
}
h5 {
font-size: $base-font-size;
margin-bottom: 0;
}
.budget-execution-info {
padding: $line-height / 2;
}
.author {
color: $text-medium;
font-size: $small-font-size;
}
.budget-execution-content {
min-height: $line-height * 3;
}
.price {
color: $budget;
font-size: rem-calc(24);
}
&:hover {
box-shadow: 0 0 12px 0 rgba(0, 0, 0, 0.2);
}
}
// 07. Proposals successful
// -------------------------
@@ -1728,7 +1669,7 @@
&::after {
color: #1b254c;
content: '\59';
content: "\59";
font-family: "icons" !important;
left: 34px;
position: absolute;
@@ -1832,10 +1773,6 @@
.orbit-slide {
max-height: none !important;
img {
image-rendering: pixelated;
}
}
.orbit-caption {
@@ -1925,7 +1862,7 @@
&::after {
color: $color-info;
content: '\6c';
content: "\6c";
}
}
@@ -1934,7 +1871,7 @@
&::after {
color: $color-alert;
content: '\74';
content: "\74";
}
}
@@ -1943,7 +1880,7 @@
&::after {
color: $color-info;
content: '\6f';
content: "\6f";
}
}
@@ -1952,7 +1889,7 @@
&::after {
color: $color-warning;
content: '\6f';
content: "\6f";
}
}
@@ -1961,7 +1898,7 @@
&::after {
color: $color-success;
content: '\59';
content: "\59";
}
}
}
@@ -2027,7 +1964,7 @@
&::after {
background: #92ba48;
border-radius: rem-calc(20);
content: '\6c';
content: "\6c";
color: #fff;
font-family: "icons" !important;
font-size: rem-calc(12);

View File

@@ -63,8 +63,7 @@ class Admin::AdminNotificationsController < Admin::BaseController
private
def admin_notification_params
attributes = [:title, :body, :link, :segment_recipient,
*translation_params(AdminNotification)]
attributes = [:link, :segment_recipient, translation_params(AdminNotification)]
params.require(:admin_notification).permit(attributes)
end

View File

@@ -11,7 +11,7 @@ class Admin::Api::StatsController < Admin::Api::BaseController
ds = Ahoy::DataSource.new
if params[:events].present?
event_types = params[:events].split ','
event_types = params[:events].split ","
event_types.each do |event|
ds.add event.titleize, Ahoy::Event.where(name: event).group_by_day(:time).count
end

View File

@@ -38,23 +38,22 @@ class Admin::BannersController < Admin::BaseController
private
def banner_params
attributes = [:title, :description, :target_url,
:post_started_at, :post_ended_at,
attributes = [:target_url, :post_started_at, :post_ended_at,
:background_color, :font_color,
*translation_params(Banner),
translation_params(Banner),
web_section_ids: []]
params.require(:banner).permit(*attributes)
end
def banner_styles
@banner_styles = Setting.all.banner_style.map do |banner_style|
[banner_style.value, banner_style.key.split('.')[1]]
[banner_style.value, banner_style.key.split(".")[1]]
end
end
def banner_imgs
@banner_imgs = Setting.all.banner_img.map do |banner_img|
[banner_img.value, banner_img.key.split('.')[1]]
[banner_img.value, banner_img.key.split(".")[1]]
end
end

View File

@@ -1,5 +1,5 @@
class Admin::BaseController < ApplicationController
layout 'admin'
layout "admin"
before_action :authenticate_user!
skip_authorization_check

View File

@@ -1,23 +1,65 @@
class Admin::BudgetGroupsController < Admin::BaseController
include Translatable
include FeatureFlags
feature_flag :budgets
before_action :load_budget
before_action :load_group, except: [:index, :new, :create]
def index
@groups = @budget.groups.order(:id)
end
def new
@group = @budget.groups.new
end
def edit
end
def create
@budget = Budget.find(params[:budget_id])
@budget.groups.create(budget_group_params)
@groups = @budget.groups.includes(:headings)
@group = @budget.groups.new(budget_group_params)
if @group.save
redirect_to groups_index, notice: t("admin.budget_groups.create.notice")
else
render :new
end
end
def update
@budget = Budget.find(params[:budget_id])
@group = @budget.groups.find(params[:id])
@group.update(budget_group_params)
if @group.update(budget_group_params)
redirect_to groups_index, notice: t("admin.budget_groups.update.notice")
else
render :edit
end
end
def destroy
if @group.headings.any?
redirect_to groups_index, alert: t("admin.budget_groups.destroy.unable_notice")
else
@group.destroy
redirect_to groups_index, notice: t("admin.budget_groups.destroy.success_notice")
end
end
private
def load_budget
@budget = Budget.includes(:groups).find(params[:budget_id])
end
def load_group
@group = @budget.groups.find(params[:id])
end
def groups_index
admin_budget_groups_path(@budget)
end
def budget_group_params
params.require(:budget_group).permit(:name, :max_votable_headings)
valid_attributes = [:max_votable_headings]
params.require(:budget_group).permit(*valid_attributes, translation_params(Budget::Group))
end
end

View File

@@ -1,39 +1,70 @@
class Admin::BudgetHeadingsController < Admin::BaseController
include Translatable
include FeatureFlags
feature_flag :budgets
def create
@budget = Budget.find(params[:budget_id])
@budget_group = @budget.groups.find(params[:budget_group_id])
@budget_group.headings.create(budget_heading_params)
@headings = @budget_group.headings
before_action :load_budget
before_action :load_group
before_action :load_heading, except: [:index, :new, :create]
def index
@headings = @group.headings.order(:id)
end
def new
@heading = @group.headings.new
end
def edit
@budget = Budget.find(params[:budget_id])
@budget_group = @budget.groups.find(params[:budget_group_id])
@heading = Budget::Heading.find(params[:id])
end
def create
@heading = @group.headings.new(budget_heading_params)
if @heading.save
redirect_to headings_index, notice: t("admin.budget_headings.create.notice")
else
render :new
end
end
def update
@budget = Budget.find(params[:budget_id])
@budget_group = @budget.groups.find(params[:budget_group_id])
@heading = Budget::Heading.find(params[:id])
@heading.assign_attributes(budget_heading_params)
render :edit unless @heading.save
if @heading.update(budget_heading_params)
redirect_to headings_index, notice: t("admin.budget_headings.update.notice")
else
render :edit
end
end
def destroy
@heading = Budget::Heading.find(params[:id])
@heading.destroy
@budget = Budget.find(params[:budget_id])
redirect_to admin_budget_path(@budget)
if @heading.can_be_deleted?
@heading.destroy
redirect_to headings_index, notice: t("admin.budget_headings.destroy.success_notice")
else
redirect_to headings_index, alert: t("admin.budget_headings.destroy.unable_notice")
end
end
private
def load_budget
@budget = Budget.includes(:groups).find(params[:budget_id])
end
def load_group
@group = @budget.groups.find(params[:group_id])
end
def load_heading
@heading = @group.headings.find(params[:id])
end
def headings_index
admin_budget_group_headings_path(@budget, @group)
end
def budget_heading_params
params.require(:budget_heading).permit(:name, :price, :population)
valid_attributes = [:price, :population, :allow_custom_content, :latitude, :longitude]
params.require(:budget_heading).permit(*valid_attributes, translation_params(Budget::Heading))
end
end

View File

@@ -1,76 +1,8 @@
class Admin::BudgetInvestmentMilestonesController < Admin::BaseController
include Translatable
before_action :load_budget_investment, only: [:index, :new, :create, :edit, :update, :destroy]
before_action :load_budget_investment_milestone, only: [:edit, :update, :destroy]
before_action :load_statuses, only: [:index, :new, :create, :edit, :update]
def index
end
def new
@milestone = Budget::Investment::Milestone.new
end
def create
@milestone = Budget::Investment::Milestone.new(milestone_params)
@milestone.investment = @investment
if @milestone.save
redirect_to admin_budget_budget_investment_path(@investment.budget, @investment),
notice: t('admin.milestones.create.notice')
else
render :new
end
end
def edit
end
def update
if @milestone.update(milestone_params)
redirect_to admin_budget_budget_investment_path(@investment.budget, @investment),
notice: t('admin.milestones.update.notice')
else
render :edit
end
end
def destroy
@milestone.destroy
redirect_to admin_budget_budget_investment_path(@investment.budget, @investment),
notice: t('admin.milestones.delete.notice')
end
class Admin::BudgetInvestmentMilestonesController < Admin::MilestonesController
private
def milestone_params
image_attributes = [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy]
documents_attributes = [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy]
attributes = [:title, :description, :publication_date, :budget_investment_id, :status_id,
*translation_params(Budget::Investment::Milestone),
image_attributes: image_attributes, documents_attributes: documents_attributes]
params.require(:budget_investment_milestone).permit(*attributes)
def milestoneable
Budget::Investment.find(params[:budget_investment_id])
end
def load_budget_investment
@investment = Budget::Investment.find(params[:budget_investment_id])
end
def load_budget_investment_milestone
@milestone = get_milestone
end
def get_milestone
Budget::Investment::Milestone.find(params[:id])
end
def resource
get_milestone
end
def load_statuses
@statuses = Budget::Investment::Status.all
end
end

View File

@@ -0,0 +1,8 @@
class Admin::BudgetInvestmentProgressBarsController < Admin::ProgressBarsController
private
def progressable
Budget::Investment.find(params[:budget_investment_id])
end
end

View File

@@ -1,51 +0,0 @@
class Admin::BudgetInvestmentStatusesController < Admin::BaseController
before_action :load_status, only: [:edit, :update, :destroy]
def index
@statuses = Budget::Investment::Status.all
end
def new
@status = Budget::Investment::Status.new
end
def create
@status = Budget::Investment::Status.new(status_params)
if @status.save
redirect_to admin_budget_investment_statuses_path,
notice: t('admin.statuses.create.notice')
else
render :new
end
end
def edit
end
def update
if @status.update(status_params)
redirect_to admin_budget_investment_statuses_path,
notice: t('admin.statuses.update.notice')
else
render :edit
end
end
def destroy
@status.destroy
redirect_to admin_budget_investment_statuses_path,
notice: t('admin.statuses.delete.notice')
end
private
def load_status
@status = Budget::Investment::Status.find(params[:id])
end
def status_params
params.require(:budget_investment_status).permit([:name, :description])
end
end

View File

@@ -21,7 +21,7 @@ class Admin::BudgetInvestmentsController < Admin::BaseController
format.js
format.csv do
send_data Budget::Investment::Exporter.new(@investments).to_csv,
filename: 'budget_investments.csv'
filename: "budget_investments.csv"
end
end
end
@@ -38,7 +38,6 @@ class Admin::BudgetInvestmentsController < Admin::BaseController
end
def update
set_valuation_tags
if @investment.update(budget_investment_params)
redirect_to admin_budget_budget_investment_path(@budget,
@investment,
@@ -72,12 +71,13 @@ class Admin::BudgetInvestmentsController < Admin::BaseController
end
def resource_name
resource_model.parameterize('_')
resource_model.parameterize("_")
end
def load_investments
@investments = Budget::Investment.scoped_filter(params, @current_filter)
@investments = @investments.order_filter(params[:sort_by]) if params[:sort_by].present?
.order_filter(params)
@investments = @investments.page(params[:page]) unless request.format.csv?
end
@@ -117,11 +117,6 @@ class Admin::BudgetInvestmentsController < Admin::BaseController
@ballot = @budget.balloting? ? query.first_or_create : query.first_or_initialize
end
def set_valuation_tags
@investment.set_tag_list_on(:valuation, budget_investment_params[:valuation_tag_list])
params[:budget_investment] = params[:budget_investment].except(:valuation_tag_list)
end
def parse_valuation_filters
if params[:valuator_or_group_id]
model, id = params[:valuator_or_group_id].split("_")
@@ -133,5 +128,4 @@ class Admin::BudgetInvestmentsController < Admin::BaseController
end
end
end
end

View File

@@ -1,8 +1,10 @@
class Admin::BudgetPhasesController < Admin::BaseController
include Translatable
before_action :load_phase, only: [:edit, :update]
def edit; end
def edit
end
def update
if @phase.update(budget_phase_params)
@@ -20,8 +22,8 @@ class Admin::BudgetPhasesController < Admin::BaseController
end
def budget_phase_params
valid_attributes = [:starts_at, :ends_at, :summary, :description, :enabled]
params.require(:budget_phase).permit(*valid_attributes)
valid_attributes = [:starts_at, :ends_at, :enabled]
params.require(:budget_phase).permit(*valid_attributes, translation_params(Budget::Phase))
end
end

View File

@@ -1,4 +1,5 @@
class Admin::BudgetsController < Admin::BaseController
include Translatable
include FeatureFlags
feature_flag :budgets
@@ -11,23 +12,24 @@ class Admin::BudgetsController < Admin::BaseController
end
def show
@budget = Budget.includes(groups: :headings).find(params[:id])
end
def new; end
def new
end
def edit; end
def edit
end
def calculate_winners
return unless @budget.balloting_process?
@budget.headings.each { |heading| Budget::Result.new(@budget, heading).delay.calculate_winners }
redirect_to admin_budget_budget_investments_path(budget_id: @budget.id, filter: 'winners'),
redirect_to admin_budget_budget_investments_path(budget_id: @budget.id, filter: "winners"),
notice: I18n.t("admin.budgets.winners.calculated")
end
def update
if @budget.update(budget_params)
redirect_to admin_budgets_path, notice: t('admin.budgets.update.notice')
redirect_to admin_budgets_path, notice: t("admin.budgets.update.notice")
else
render :edit
end
@@ -36,7 +38,7 @@ class Admin::BudgetsController < Admin::BaseController
def create
@budget = Budget.new(budget_params)
if @budget.save
redirect_to admin_budget_path(@budget), notice: t('admin.budgets.create.notice')
redirect_to admin_budget_path(@budget), notice: t("admin.budgets.create.notice")
else
render :new
end
@@ -44,10 +46,10 @@ class Admin::BudgetsController < Admin::BaseController
def destroy
if @budget.investments.any?
redirect_to admin_budgets_path, alert: t('admin.budgets.destroy.unable_notice')
redirect_to admin_budgets_path, alert: t("admin.budgets.destroy.unable_notice")
else
@budget.destroy
redirect_to admin_budgets_path, notice: t('admin.budgets.destroy.success_notice')
redirect_to admin_budgets_path, notice: t("admin.budgets.destroy.success_notice")
end
end
@@ -55,8 +57,8 @@ class Admin::BudgetsController < Admin::BaseController
def budget_params
descriptions = Budget::Phase::PHASE_KINDS.map{|p| "description_#{p}"}.map(&:to_sym)
valid_attributes = [:name, :phase, :currency_symbol] + descriptions
params.require(:budget).permit(*valid_attributes)
valid_attributes = [:phase, :currency_symbol] + descriptions
params.require(:budget).permit(*valid_attributes, translation_params(Budget))
end
end

Some files were not shown because too many files have changed in this diff Show More