@@ -1,4 +1,6 @@
|
||||
language: ruby
|
||||
addons:
|
||||
postgresql: "9.4"
|
||||
rvm:
|
||||
- "2.2.2"
|
||||
cache: bundler
|
||||
|
||||
5
Gemfile
5
Gemfile
@@ -34,6 +34,10 @@ gem 'cancancan'
|
||||
gem 'social-share-button'
|
||||
gem 'initialjs-rails'
|
||||
gem 'unicorn'
|
||||
gem 'paranoia'
|
||||
|
||||
gem 'ahoy_matey', '~> 1.2.1'
|
||||
gem 'groupdate' # group temporary data
|
||||
|
||||
group :development, :test do
|
||||
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
|
||||
@@ -45,6 +49,7 @@ group :development, :test do
|
||||
gem 'rspec-rails', '~> 3.0'
|
||||
gem 'capybara'
|
||||
gem 'factory_girl_rails'
|
||||
gem 'fuubar'
|
||||
gem 'launchy'
|
||||
gem 'quiet_assets'
|
||||
gem 'letter_opener_web', '~> 1.2.0'
|
||||
|
||||
33
Gemfile.lock
33
Gemfile.lock
@@ -44,12 +44,23 @@ GEM
|
||||
awesome_nested_set (>= 3.0)
|
||||
acts_as_votable (0.10.0)
|
||||
addressable (2.3.8)
|
||||
ahoy_matey (1.2.1)
|
||||
addressable
|
||||
browser (>= 0.4.0)
|
||||
errbase
|
||||
geocoder
|
||||
rails
|
||||
referer-parser (>= 0.3.0)
|
||||
request_store
|
||||
user_agent_parser
|
||||
uuidtools
|
||||
arel (6.0.3)
|
||||
awesome_nested_set (3.0.2)
|
||||
activerecord (>= 4.0.0, < 5)
|
||||
bcrypt (3.1.10)
|
||||
binding_of_caller (0.7.2)
|
||||
debug_inspector (>= 0.0.1)
|
||||
browser (0.9.1)
|
||||
builder (3.2.2)
|
||||
byebug (5.0.0)
|
||||
columnize (= 0.9.0)
|
||||
@@ -116,6 +127,7 @@ GEM
|
||||
email_spec (1.6.0)
|
||||
launchy (~> 2.1)
|
||||
mail (~> 2.2)
|
||||
errbase (0.0.3)
|
||||
erubis (2.7.0)
|
||||
execjs (2.5.2)
|
||||
factory_girl (4.5.0)
|
||||
@@ -132,8 +144,14 @@ GEM
|
||||
activesupport (~> 4.1, >= 4.1.1)
|
||||
railties (~> 4.1, >= 4.1.1)
|
||||
tzinfo (~> 1.2, >= 1.2.2)
|
||||
fuubar (2.0.0)
|
||||
rspec (~> 3.0)
|
||||
ruby-progressbar (~> 1.4)
|
||||
geocoder (1.2.9)
|
||||
globalid (0.3.6)
|
||||
activesupport (>= 4.1.0)
|
||||
groupdate (2.4.0)
|
||||
activesupport (>= 3)
|
||||
highline (1.7.3)
|
||||
http-cookie (1.0.2)
|
||||
domain_name (~> 0.5)
|
||||
@@ -179,6 +197,8 @@ GEM
|
||||
nokogiri (1.6.6.2)
|
||||
mini_portile (~> 0.6.0)
|
||||
orm_adapter (0.5.0)
|
||||
paranoia (2.1.3)
|
||||
activerecord (~> 4.0)
|
||||
pg (0.18.2)
|
||||
poltergeist (1.6.0)
|
||||
capybara (~> 2.1)
|
||||
@@ -216,12 +236,18 @@ GEM
|
||||
thor (>= 0.18.1, < 2.0)
|
||||
raindrops (0.15.0)
|
||||
rake (10.4.2)
|
||||
referer-parser (0.3.0)
|
||||
request_store (1.2.0)
|
||||
responders (2.1.0)
|
||||
railties (>= 4.2.0, < 5)
|
||||
rest-client (1.8.0)
|
||||
http-cookie (>= 1.0.2, < 2.0)
|
||||
mime-types (>= 1.16, < 3.0)
|
||||
netrc (~> 0.7)
|
||||
rspec (3.3.0)
|
||||
rspec-core (~> 3.3.0)
|
||||
rspec-expectations (~> 3.3.0)
|
||||
rspec-mocks (~> 3.3.0)
|
||||
rspec-core (3.3.2)
|
||||
rspec-support (~> 3.3.0)
|
||||
rspec-expectations (3.3.1)
|
||||
@@ -239,6 +265,7 @@ GEM
|
||||
rspec-mocks (~> 3.3.0)
|
||||
rspec-support (~> 3.3.0)
|
||||
rspec-support (3.3.0)
|
||||
ruby-progressbar (1.7.5)
|
||||
sass (3.4.16)
|
||||
sass-rails (5.0.3)
|
||||
railties (>= 4.0.0, < 5.0)
|
||||
@@ -289,6 +316,8 @@ GEM
|
||||
kgio (~> 2.6)
|
||||
rack
|
||||
raindrops (~> 0.7)
|
||||
user_agent_parser (2.2.0)
|
||||
uuidtools (2.1.5)
|
||||
warden (1.2.3)
|
||||
rack (>= 1.0)
|
||||
web-console (2.2.1)
|
||||
@@ -309,6 +338,7 @@ DEPENDENCIES
|
||||
acts-as-taggable-on
|
||||
acts_as_commentable_with_threading
|
||||
acts_as_votable
|
||||
ahoy_matey (~> 1.2.1)
|
||||
byebug
|
||||
cancancan
|
||||
capistrano (= 3.4.0)
|
||||
@@ -325,12 +355,15 @@ DEPENDENCIES
|
||||
factory_girl_rails
|
||||
foundation-rails
|
||||
foundation_rails_helper
|
||||
fuubar
|
||||
groupdate
|
||||
i18n-tasks
|
||||
initialjs-rails
|
||||
jquery-rails
|
||||
kaminari
|
||||
launchy
|
||||
letter_opener_web (~> 1.2.0)
|
||||
paranoia
|
||||
pg
|
||||
poltergeist
|
||||
quiet_assets
|
||||
|
||||
@@ -20,7 +20,7 @@ Las herramientas utilizadas para el frontend no están cerradas aún. Los estilo
|
||||
|
||||
## Configuración para desarrollo y tests
|
||||
|
||||
Prerequisitos: tener instalado git, ImageMagick, Ruby 2.2.2, la gema `bundler`, y una librería moderna de PostgreSQL.
|
||||
Prerequisitos: tener instalado git, ImageMagick, Ruby 2.2.2, la gema `bundler`, y PostgreSQL (9.4 o superior).
|
||||
|
||||
```
|
||||
cd participacion
|
||||
|
||||
@@ -21,7 +21,7 @@ Frontend tools used include [SCSS](http://sass-lang.com/) over [Foundation](http
|
||||
|
||||
## Configuration for development and test environments
|
||||
|
||||
Prerequisites: install git, ImageMagick, Ruby 2.2.2, bundler gem and PostgreSQL.
|
||||
Prerequisites: install git, ImageMagick, Ruby 2.2.2, bundler gem and PostgreSQL (>=9.4).
|
||||
|
||||
```
|
||||
cd participacion
|
||||
|
||||
Binary file not shown.
@@ -14,11 +14,15 @@
|
||||
<glyph unicode="e" d="M201 402c-29 0-56-5-82-15-25-9-45-23-60-40-15-17-22-35-22-54 0-16 5-31 15-46 10-14 24-27 42-37l28-16-10-24c6 4 12 7 18 11l12 9 15-3c15-3 30-4 44-4 29 0 57 5 82 15 25 10 45 23 60 40 15 17 23 35 23 55 0 19-8 37-23 54-15 17-35 31-60 40-25 10-53 15-82 15z m0 37c37 0 70-7 101-20 31-13 56-31 73-53 18-22 27-47 27-73 0-27-9-51-27-74-17-22-42-40-73-53-31-13-64-20-101-20-16 0-33 2-50 5-24-17-50-29-80-37-6-1-15-3-24-4l-1 0c-2 0-4 0-6 2-2 2-3 4-3 6 0 1 0 1 0 2 0 1 0 1 0 2 0 0 0 1 0 1l1 2c0 0 0 0 1 1 1 1 1 2 1 2 0 0 1 0 1 1 1 1 2 2 2 2 1 1 3 3 6 7 4 3 6 6 8 8 1 2 3 5 6 8 3 4 5 8 7 11 2 4 4 8 6 13-24 14-42 31-56 51-13 20-20 41-20 64 0 26 9 51 27 73 18 22 42 40 73 53 31 13 65 20 101 20z m235-334c2-5 4-9 6-13 2-4 4-7 7-11 3-3 5-6 6-8 2-2 4-5 8-8 3-4 5-6 6-8 1 0 1 0 2-1 0-1 1-1 1-1 0-1 1-1 1-2 0 0 1-1 1-1l1-2c0 0 0 0 0-1 1-2 1-2 0-2 0 0 0-1 0-2 0-3-2-5-4-6-1-2-4-3-6-2-9 1-18 2-24 4-30 8-56 20-80 37-17-3-34-5-50-5-52 0-97 13-135 38 11-1 19-1 25-1 31 0 60 4 88 13 29 8 54 20 76 36 24 18 42 38 55 61 12 23 19 47 19 73 0 14-2 29-7 43 25-14 44-30 59-51 14-20 21-42 21-66 0-22-7-44-20-64-14-20-32-36-56-50z"/>
|
||||
<glyph unicode="f" d="M481 395c-13-18-28-34-46-47 0-3 0-7 0-12 0-25-3-50-11-74-7-25-18-49-33-71-14-23-32-43-52-61-21-17-45-31-74-41-29-11-60-16-92-16-52 0-99 14-142 42 7-1 14-2 22-2 43 0 81 14 115 40-20 0-38 6-54 18-16 12-27 27-33 46 7-1 13-2 18-2 8 0 16 1 24 4-21 4-39 15-53 31-14 17-21 37-21 59l0 1c13-7 27-11 42-11-13 8-23 19-30 32-8 14-11 29-11 44 0 17 4 33 12 47 23-28 51-51 84-68 33-17 69-27 107-29-2 8-3 15-3 22 0 25 9 47 27 65 18 18 40 27 66 27 26 0 49-10 67-29 21 4 40 11 59 22-7-22-21-39-41-51 18 2 35 7 53 14z"/>
|
||||
<glyph unicode="g" d="M55 37l402 0 0 292-402 0z m110 347l0 82c0 3-1 5-3 7-2 2-4 2-7 2l-18 0c-3 0-5 0-6-2-2-2-3-4-3-7l0-82c0-3 1-5 3-7 1-1 3-2 6-2l18 0c3 0 5 1 7 2 2 2 3 4 3 7z m219 0l0 82c0 3-1 5-3 7-1 2-3 2-6 2l-18 0c-3 0-5 0-7-2-2-2-3-4-3-7l0-82c0-3 1-5 3-7 2-1 4-2 7-2l18 0c3 0 5 1 6 2 2 2 3 4 3 7z m110 18l0-365c0-10-4-19-11-26-7-7-16-11-26-11l-402 0c-10 0-19 4-26 11-7 7-11 16-11 26l0 365c0 10 4 19 11 26 7 7 16 11 26 11l36 0 0 27c0 13 5 24 14 33 9 9 20 13 32 13l18 0c13 0 24-4 33-13 9-9 13-20 13-33l0-27 110 0 0 27c0 13 4 24 13 33 9 9 20 13 33 13l18 0c12 0 23-4 32-13 9-9 14-20 14-33l0-27 36 0c10 0 19-4 26-11 7-7 11-16 11-26z"/>
|
||||
<glyph unicode="h" d="M320 347c0-2-1-4-3-6-2-2-4-3-6-3-3 0-5 1-7 3-1 2-2 4-2 6 0 9-5 16-16 21-10 4-20 7-30 7-2 0-5 1-6 3-2 1-3 4-3 6 0 2 1 5 3 6 1 2 4 3 6 3 10 0 19-1 28-4 10-3 18-9 25-16 7-7 11-16 11-26z m46 0c0 14-4 27-10 39-7 12-15 21-26 29-10 7-22 13-35 17-13 5-26 7-39 7-13 0-26-2-39-7-13-4-25-10-35-17-11-8-19-17-26-29-6-12-10-25-10-39 0-19 7-36 20-51 2-2 5-5 8-9 4-5 7-8 9-10 25-29 38-57 40-85l66 0c2 28 15 56 40 85 2 2 5 5 9 10 3 4 6 7 8 9 13 15 20 32 20 51z m36 0c0-29-10-55-29-76-9-9-16-18-21-25-6-7-12-16-17-27-6-11-9-21-10-31 9-5 13-13 13-23 0-7-2-14-7-19 5-5 7-11 7-18 0-10-4-18-13-23 3-5 4-9 4-14 0-8-3-15-9-20-6-5-13-7-22-7-4-8-10-15-17-20-8-5-16-7-25-7-9 0-17 2-25 7-7 5-13 12-17 20-9 0-16 2-22 7-6 5-9 12-9 20 0 5 1 9 4 14-9 5-13 13-13 23 0 7 2 13 7 18-5 5-7 12-7 19 0 10 4 18 13 23-1 10-4 20-10 31-5 11-11 20-17 27-5 7-12 16-21 25-19 21-29 47-29 76 0 19 4 37 12 53 9 16 20 30 34 41 14 10 29 19 47 25 17 6 35 9 53 9 18 0 36-3 53-9 18-6 33-15 47-25 14-11 25-25 34-41 8-16 12-34 12-53z"/>
|
||||
<glyph unicode="i" d="M453 425c-1 9-8 16-17 16l-360 0 0 0c-9 0-16-7-17-16l0 0 0-288 0 0c2-8 9-14 17-14l0 0 59 0 0-35c0-9 8-17 17-17 6 0 11 3 14 8l45 44 225 0c8 0 15 6 17 14l0 0 0 288z m-308-172c-15 0-29 12-29 34 0 25 13 47 34 61l0 0c1 1 1 1 2 1 1 0 1 0 2-1l0 0 14-9 0 0c1 0 1-1 1-3 0-1 0-2-2-3l0 0c0 0 0 0 0 0 0 0 0 0 0 0-10-6-22-19-25-31 2 1 4 1 7 1 13 0 23-10 23-24 0-14-12-26-27-26z m68 0c-15 0-29 12-29 34 0 25 13 47 34 61l0 0c0 1 1 1 2 1 0 0 1 0 2-1l0 0 14-9 0 0c1 0 1-1 1-3 0-1-1-2-2-3l0 0c0 0 0 0 0 0 0 0 0 0 0 0-11-6-22-19-25-31 1 1 4 1 7 1 12 0 22-10 22-24 0-14-12-26-26-26z m81-37l0 0c0 0-1-1-2-1 0 0-1 1-2 1l0 0-14 9 0 0c-1 1-1 2-1 3 0 1 1 3 2 3l0 0c0 0 0 0 0 0 0 0 0 0 0 0 11 6 22 20 25 31-1 0-4-1-7-1-12 0-22 10-22 24 0 15 12 27 26 27 15 0 29-13 29-34 0-25-13-48-34-62z m68 0l0 0c-1 0-1-1-2-1-1 0-1 1-2 1l0 0-14 9 0 0c-1 1-1 2-1 3 0 1 0 3 2 3l0 0c0 0 0 0 0 0 0 0 0 0 0 0 10 6 22 20 25 31-2 0-4-1-7-1-13 0-23 10-23 24 0 15 12 27 27 27 15 0 29-13 29-34 0-25-13-48-34-62z"/>
|
||||
<glyph unicode="j" d="M91 347c0-5-1-9-5-12-4-4-8-6-13-6-5 0-9 2-13 6-3 3-5 7-5 12 0 6 2 10 5 13 4 4 8 6 13 6 5 0 9-2 13-6 4-3 5-7 5-13z m46-146l0 183c0 5-2 9-5 13-4 3-8 5-13 5l-82 0c-5 0-10-2-13-5-4-4-6-8-6-13l0-183c0-5 2-9 6-13 3-3 8-5 13-5l82 0c5 0 9 2 13 5 3 4 5 8 5 13z m323 43c10-12 15-26 15-43 0-15-5-28-16-38-11-11-24-17-38-17l-80 0c1-2 2-5 3-7 0-1 2-4 3-6 1-2 2-4 3-5 3-7 6-12 7-16 2-4 4-10 6-17 2-7 3-15 3-22 0-4 0-8 0-11-1-3-1-7-2-13-1-6-2-10-3-14-2-4-4-8-7-13-3-5-7-9-12-12-4-3-10-5-17-7-7-2-15-3-23-3-5 0-10 2-13 5-4 4-7 9-10 15-3 5-4 10-5 15-1 4-3 10-4 17-2 8-3 14-4 17-1 4-2 8-5 14-2 6-5 10-9 14-6 6-16 18-29 34-9 12-19 24-28 35-10 11-18 16-22 17-5 0-9 2-12 5-4 4-6 8-6 13l0 183c0 5 2 9 6 13 3 3 8 5 13 5 6 0 21 5 45 13 15 5 26 9 34 11 9 3 20 5 35 8 15 3 29 5 41 5l37 0c25-1 44-8 56-22 11-14 16-31 14-52 8-7 13-16 16-27 3-12 3-23 0-33 8-12 13-25 12-40 0-6-1-13-4-21z"/>
|
||||
<glyph unicode="k" d="M91 128c0 5-1 9-5 13-4 3-8 5-13 5-5 0-9-2-13-5-3-4-5-8-5-13 0-5 2-9 5-13 4-4 8-5 13-5 5 0 9 1 13 5 4 4 5 8 5 13z m46 146l0-183c0-5-2-9-5-12-4-4-8-6-13-6l-82 0c-5 0-10 2-13 6-4 3-6 7-6 12l0 183c0 5 2 10 6 13 3 4 8 6 13 6l82 0c5 0 9-2 13-6 3-3 5-8 5-13z m338 0c0-16-5-30-15-42 3-9 4-16 4-22 1-14-4-28-12-39 3-11 3-22 0-34-3-10-8-19-16-26 2-22-3-39-14-52-12-15-31-22-56-22l-37 0c-12 0-26 1-41 4-15 3-26 6-35 8-8 3-19 7-34 12-24 8-39 12-45 12-5 0-10 2-13 6-4 3-6 7-6 12l0 184c0 4 2 8 6 12 3 4 7 5 12 6 4 0 12 6 22 17 9 11 19 22 28 34 13 17 23 28 29 35 4 3 7 8 9 13 3 6 4 11 5 14 1 4 2 9 4 17 1 8 3 14 4 18 1 4 2 9 5 15 3 5 6 10 10 14 3 4 8 5 13 5 8 0 16-1 23-3 7-2 13-4 17-7 5-3 9-7 12-12 3-4 5-9 7-12 1-4 2-9 3-15 1-5 1-10 2-13 0-2 0-6 0-11 0-7-1-14-3-21-2-8-4-13-5-18-2-4-5-9-8-16-1-1-2-2-3-5-1-2-3-4-3-6-1-2-2-4-3-7l80 0c14 0 27-5 38-16 11-11 16-24 16-39z"/>
|
||||
<glyph unicode="l" d="M477 350c0-7-2-14-8-19l-206-207-39-39c-6-5-12-8-20-8-7 0-14 3-19 8l-142 142c-6 6-8 12-8 20 0 7 2 14 8 19l38 39c6 5 12 8 20 8 7 0 14-3 19-8l84-84 188 188c5 5 12 8 19 8 8 0 14-3 20-8l38-39c6-6 8-12 8-20z"/>
|
||||
<glyph unicode="m" d="M140 73l26 26-67 67-26-26 0-30 37 0 0-37z m150 265c0 4-2 7-7 7-1 0-3-1-4-2l-155-155c-2-2-2-3-2-5 0-4 2-6 6-6 2 0 4 0 5 2l155 154c1 2 2 3 2 5z m-16 55l119-119-238-237-118 0 0 118z m195-27c0-10-3-19-10-26l-48-47-118 118 47 48c7 7 15 10 26 10 10 0 18-3 26-10l67-67c7-8 10-16 10-26z"/>
|
||||
<glyph unicode="n" d="M494 327c0-4-3-9-8-14l-103-101 24-143c0-1 0-3 0-5 0-4-1-8-3-10-2-3-4-5-8-5-4 0-8 2-12 4l-128 67-128-67c-4-2-8-4-12-4-4 0-7 2-9 5-2 2-3 6-3 10 0 1 0 3 1 5l24 143-104 101c-4 6-7 10-7 14 0 7 6 12 16 13l144 21 64 130c4 8 8 12 14 12 6 0 10-4 14-12l64-130 144-21c10-1 16-6 16-13z"/>
|
||||
<glyph unicode="p" d="M256 448c-96 0-208-64-256-192 48-96 144-160 256-160 112 0 208 64 256 160-48 128-160 192-256 192z m0-320c-96 0-176 64-192 128 16 64 96 128 192 128 96 0 176-64 192-128-16-64-96-128-192-128z m0 224c-10 0-19-2-28-5 17-7 28-24 28-43 0-27-21-48-48-48-19 0-36 11-43 28-3-9-5-18-5-28 0-53 43-96 96-96 53 0 96 43 96 96 0 53-43 96-96 96z"/>
|
||||
<glyph unicode="o" d="M410 203l-80 38-34 16c15 9 27 24 35 41 6 14 10 29 10 46 0 9-1 18-4 27-10 41-42 72-81 72-38 0-70-30-81-70-2-9-4-19-4-29 0-18 4-34 11-49 8-16 20-30 35-39l-32-15-83-38c-7-4-12-12-12-21l0-91c0-12 8-22 19-22l294 0c11 0 19 10 19 22l0 91c0 9-4 17-12 21z"/>
|
||||
<glyph unicode="q" d="M329 256c0 20-7 37-21 52-15 14-32 21-52 21-20 0-37-7-52-21-14-15-21-32-21-52 0-20 7-37 21-52 15-14 32-21 52-21 20 0 37 7 52 21 14 15 21 32 21 52z m146 31l0-63c0-3 0-5-2-7-1-2-3-3-6-4l-52-8c-4-10-8-19-12-26 7-9 17-22 31-39 2-2 3-5 3-7 0-3-1-5-3-7-5-7-14-17-28-31-14-13-23-20-27-20-2 0-5 1-7 3l-40 31c-8-5-17-8-26-11-3-26-6-44-8-53-1-6-5-8-10-8l-64 0c-2 0-5 0-7 2-2 2-3 4-3 6l-8 53c-9 3-18 6-26 10l-40-30c-2-2-4-3-7-3-3 0-5 1-7 3-24 22-40 38-47 48-2 2-2 4-2 7 0 2 0 4 2 6 3 4 8 11 14 19 7 9 12 16 16 21-5 9-9 19-12 28l-52 8c-3 0-5 1-6 3-2 2-2 4-2 7l0 63c0 3 0 5 2 7 1 2 3 3 5 4l53 8c3 8 7 17 12 26-8 11-18 24-31 39-2 3-3 5-3 7 0 2 1 4 3 7 5 7 14 17 28 30 14 14 23 21 27 21 2 0 5-1 7-3l40-31c8 5 17 8 26 11 3 26 6 44 8 53 1 6 5 8 10 8l64 0c2 0 5 0 7-2 2-2 3-4 3-6l8-53c9-3 18-6 26-10l40 30c2 2 4 3 7 3 3 0 5-1 7-3 25-23 41-39 47-49 2-1 2-3 2-6 0-2 0-4-2-6-3-4-8-11-14-19-7-9-12-16-16-21 5-9 9-18 12-28l52-8c3 0 5-1 6-3 2-2 2-4 2-7z"/>
|
||||
<glyph unicode="r" d="M17 222c-14 4-20 13-16 29 3 14 12 20 27 16 0 0 50-12 50-12 0 0-26-41-26-41 0 0-35 8-35 8m455-6c4 4 10 6 16 6 7-1 12-3 16-8 11-11 11-22-1-33 0 0-128-115-128-115-5-4-10-6-16-6-5 0-9 2-14 5 0 0-146 112-146 112 0 0-28 8-28 8 0 0 26 40 26 40 0 0 18-4 18-4 4-1 7-2 8-4 0 0 135-104 135-104 0 0 114 103 114 103m-251 112c0 0-178-280-178-280-4-8-11-12-20-12-4 0-8 2-12 5-5 3-9 8-10 14-1 7 0 12 3 17 0 0 191 300 191 300 3 6 7 9 14 11 6 2 12 1 19-3 0 0 125-80 125-80 0 0 115 166 115 166 4 6 9 9 15 10 6 1 12-1 17-5 13-8 15-18 6-31 0 0-128-185-128-185-9-12-19-14-32-6 0 0-125 79-125 79"/>
|
||||
<glyph unicode="h" d="M411 415l0 0 0 0c3 3 3 8 0 11l-10 10c-3 3-8 3-11 0l0 0-45-45c-3-3-3-7 0-10l11-11 0 0c2-3 7-3 10 0z m-162-2l0 0 14 0 0 0c4 0 8 3 8 7l0 0 0 64c0 5-3 8-8 8l0 0-14 0 0 0c-5 0-8-3-8-8l0-64 0 0c0-4 4-7 8-7z m220-106c0 4-3 7-7 8l0 0-64 0c-4 0-8-4-8-8l0-15c0-4 4-7 8-7l64 0 0 0c4 0 7 3 7 7z m-213 81c-60 0-109-49-109-109 0-23 8-45 20-63l0 0c17-25 27-59 27-96 2-2 4-4 7-4 0 0 0 0 1 0l0 0 108 0 0 0c0 0 1 0 1 0 3 0 5 2 7 5 0 38 12 73 29 99 11 17 18 37 18 59 0 60-49 109-109 109z m55-336c0 0-1 0-1 0l0 0-108 0 0 0c-1 0-1 0-1 0-4 0-8-3-8-7l0-17c0-5 4-8 8-8 0 0 0 0 1 0l0 0 108 0 0 0c0 0 1 0 1 0 4 0 7 3 7 8l0 17c0 4-3 7-7 7z m0 49c0 0-1 0-1 0l0 0-108 0 0 0c-1 0-1 0-1 0-4 0-7-4-8-8 0 0 0 0 0 0l0-17c0-4 4-8 8-8 0 0 0 0 1 1l0-1 108 0 0 1c0-1 1-1 1-1 4 0 7 4 7 8l0 17c0 4-3 8-7 8z m-197 208l0 0-64 0c-4 0-7-3-7-8l0-14c0-5 3-8 7-8l64 0 0 0c4 0 8 4 8 8l0 14c0 4-4 8-8 8z m-11 109l46-46 0 0c3-2 7-2 10 1l0 0 11 10c2 3 2 8 0 10l0 0-46 46c-2 3-7 3-10 0l-11-11c-2-3-2-7 0-10z"/>
|
||||
</font></defs></svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 10 KiB |
Binary file not shown.
Binary file not shown.
@@ -17,6 +17,10 @@
|
||||
//= require ckeditor/init
|
||||
//= require social-share-button
|
||||
//= require initial
|
||||
//= require ahoy
|
||||
//= require d3
|
||||
//= require c3
|
||||
//= require c3ext
|
||||
//= require app
|
||||
//= require_tree .
|
||||
|
||||
@@ -25,6 +29,7 @@ var initialize_modules = function() {
|
||||
App.Users.initialize();
|
||||
App.Votes.initialize();
|
||||
App.Tags.initialize();
|
||||
App.Stats.initialize();
|
||||
};
|
||||
|
||||
$(function(){
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
App.Comments =
|
||||
|
||||
add_response: (parent_id, response_html) ->
|
||||
add_comment: (parent_id, response_html) ->
|
||||
$(response_html).insertAfter($("#js-comment-form-#{parent_id}"))
|
||||
|
||||
add_reply: (parent_id, response_html) ->
|
||||
$("##{parent_id} .comment-children:first").prepend($(response_html))
|
||||
|
||||
display_error: (field_with_errors, error_html) ->
|
||||
$(error_html).insertAfter($("#{field_with_errors}"))
|
||||
|
||||
|
||||
7
app/assets/javascripts/moderator_comment.js.coffee
Normal file
7
app/assets/javascripts/moderator_comment.js.coffee
Normal file
@@ -0,0 +1,7 @@
|
||||
App.ModeratorComments =
|
||||
|
||||
add_class_faded: (id) ->
|
||||
$("##{id} .comment-body:first").addClass("faded")
|
||||
|
||||
hide_moderator_actions: (id) ->
|
||||
$("##{id} #moderator-comment-actions:first").hide()
|
||||
8
app/assets/javascripts/moderator_debates.js.coffee
Normal file
8
app/assets/javascripts/moderator_debates.js.coffee
Normal file
@@ -0,0 +1,8 @@
|
||||
App.ModeratorDebates =
|
||||
|
||||
add_class_faded: (id) ->
|
||||
$("##{id}").addClass("faded")
|
||||
$("#comments").addClass("faded")
|
||||
|
||||
hide_moderator_actions: (id) ->
|
||||
$("##{id} #moderator-debate-actions:first").hide()
|
||||
11
app/assets/javascripts/stats.js.coffee
Normal file
11
app/assets/javascripts/stats.js.coffee
Normal file
@@ -0,0 +1,11 @@
|
||||
# Helper for generate C3.js graphs
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
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' } }}
|
||||
graph = c3.generate conf
|
||||
|
||||
App.Stats =
|
||||
initialize: ->
|
||||
buildGraph(g) for g in $("[data-graph]")
|
||||
169
app/assets/stylesheets/admin.scss
Normal file
169
app/assets/stylesheets/admin.scss
Normal file
@@ -0,0 +1,169 @@
|
||||
// Table of Contents
|
||||
//
|
||||
// 01. Global styles
|
||||
// 02. Sidebar
|
||||
// 03. List elements
|
||||
// 04. Stats
|
||||
//
|
||||
|
||||
// 01. Global styles
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
body.admin {
|
||||
background: white;
|
||||
|
||||
h2 {
|
||||
font-size: rem-calc(24);
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: rem-calc(14);
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
form {
|
||||
.button {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.button.secondary {
|
||||
margin-right: rem-calc(12);
|
||||
}
|
||||
|
||||
.admin-content {
|
||||
margin-top: rem-calc(24);
|
||||
}
|
||||
|
||||
.is-featured {
|
||||
margin-top: rem-calc(36);
|
||||
}
|
||||
}
|
||||
|
||||
// 02. Sidebar
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
.admin-sidebar {
|
||||
margin-left: rem-calc(-15);
|
||||
margin-top: rem-calc(-48);
|
||||
|
||||
ul {
|
||||
list-style-type: none;
|
||||
margin-left: 0;
|
||||
padding: 0;
|
||||
|
||||
[class^="icon-"] {
|
||||
display: inline-block;
|
||||
font-size: rem-calc(24);
|
||||
padding-right: rem-calc(24);
|
||||
padding-top: rem-calc(4);
|
||||
}
|
||||
|
||||
li {
|
||||
background: #2E343F;
|
||||
border-bottom: 1px solid #292f39;
|
||||
border-top: 1px solid #353c49;
|
||||
margin: 0;
|
||||
outline: 0;
|
||||
|
||||
&:first-child {
|
||||
background: #2B3139;
|
||||
color: rgba(255,255,255,0.3);
|
||||
padding: rem-calc(24) rem-calc(12);
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
&.active{
|
||||
background: #373D47;
|
||||
|
||||
a:not(.button) {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
li a:not(.button) {
|
||||
color: rgba(255,255,255,0.3);
|
||||
line-height: rem-calc(48);
|
||||
padding-left: rem-calc(12);
|
||||
vertical-align: top;
|
||||
|
||||
&:hover {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 03. List elements
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
.admin-list {
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
margin-bottom: rem-calc(48);
|
||||
|
||||
form {
|
||||
clear: both;
|
||||
|
||||
.checkbox {
|
||||
font-size: rem-calc(12);
|
||||
}
|
||||
}
|
||||
|
||||
li {
|
||||
border-bottom: 1px solid #E7E9EC;
|
||||
font-size: rem-calc(14);
|
||||
min-height: rem-calc(72);
|
||||
padding: rem-calc(12);
|
||||
|
||||
&:first-child {
|
||||
border-top: 1px solid #E7E9EC;
|
||||
}
|
||||
|
||||
&:nth-child(odd) {
|
||||
background: #F0F2F6;
|
||||
}
|
||||
}
|
||||
|
||||
.tag {
|
||||
float: left;
|
||||
font-size: rem-calc(18);
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.button {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.delete {
|
||||
border-bottom: 1px dotted #CF2A0E;
|
||||
color: #F04124;
|
||||
font-size: rem-calc(12);
|
||||
|
||||
&:hover, &:active, &:focus {
|
||||
border: 0;
|
||||
color: #cf2a0e;
|
||||
}
|
||||
}
|
||||
|
||||
.level {
|
||||
font-size: rem-calc(12);
|
||||
}
|
||||
|
||||
.official {
|
||||
background-color: #e7e7e7;
|
||||
border-radius: rem-calc(3);
|
||||
font-size: rem-calc(12);
|
||||
font-weight: normal;
|
||||
padding: rem-calc(6) rem-calc(12);
|
||||
}
|
||||
|
||||
// 04. Stats
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
.stats {
|
||||
background: white;
|
||||
}
|
||||
@@ -6,5 +6,7 @@
|
||||
@import "fonts";
|
||||
@import "icons";
|
||||
@import "variables";
|
||||
@import "admin";
|
||||
@import "participacion";
|
||||
@import "debates";
|
||||
@import "c3";
|
||||
|
||||
@@ -138,10 +138,6 @@
|
||||
// 02. Index
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
.featured-debates {
|
||||
margin-top: rem-calc(23);
|
||||
}
|
||||
|
||||
.debate-featured {
|
||||
|
||||
.panel {
|
||||
@@ -244,7 +240,6 @@
|
||||
|
||||
.debates-list {
|
||||
margin-bottom: rem-calc(48);
|
||||
margin-top: rem-calc(24);
|
||||
}
|
||||
|
||||
.debate {
|
||||
@@ -371,10 +366,6 @@
|
||||
color: $text-medium;
|
||||
}
|
||||
|
||||
.bullet {
|
||||
color: $border;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: rem-calc(14);
|
||||
line-height: $line-height;
|
||||
@@ -436,6 +427,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
.bullet {
|
||||
color: $border;
|
||||
}
|
||||
|
||||
// 04. New
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
@@ -571,4 +566,9 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.faded {
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
@@ -58,9 +58,6 @@
|
||||
.icon-calendar:before {
|
||||
content: "g";
|
||||
}
|
||||
.icon-lightbulb:before {
|
||||
content: "h";
|
||||
}
|
||||
.icon-comment-quotes:before {
|
||||
content: "i";
|
||||
}
|
||||
@@ -79,3 +76,18 @@
|
||||
.icon-star:before {
|
||||
content: "n";
|
||||
}
|
||||
.icon-eye:before {
|
||||
content: "p";
|
||||
}
|
||||
.icon-user:before {
|
||||
content: "o";
|
||||
}
|
||||
.icon-settings:before {
|
||||
content: "q";
|
||||
}
|
||||
.icon-stats:before {
|
||||
content: "r";
|
||||
}
|
||||
.icon-initiatives:before {
|
||||
content: "h";
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
// 08. Forms
|
||||
// 09. Alerts
|
||||
// 10. User account
|
||||
// 11. Filters
|
||||
// 12. Official levels
|
||||
//
|
||||
|
||||
// 01. Variables
|
||||
@@ -111,7 +113,6 @@ h1, h2, h3, h4, h5, h6 {
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
margin-top: rem-calc(24);
|
||||
margin-bottom: rem-calc(48);
|
||||
}
|
||||
|
||||
@@ -134,7 +135,7 @@ header {
|
||||
min-height: rem-calc(480);
|
||||
|
||||
&.results {
|
||||
min-height: rem-calc(192);
|
||||
min-height: rem-calc(216);
|
||||
}
|
||||
|
||||
h1 {
|
||||
@@ -276,6 +277,35 @@ header {
|
||||
}
|
||||
}
|
||||
|
||||
.subnavigation {
|
||||
background: white;
|
||||
border-bottom: 1px solid white;
|
||||
clear: both;
|
||||
|
||||
a {
|
||||
color: $link;
|
||||
font-size: rem-calc(14);
|
||||
font-weight: bold;
|
||||
|
||||
&.active {
|
||||
color: $text;
|
||||
|
||||
&:after {
|
||||
bottom: -17px;
|
||||
left: 50%;
|
||||
border: solid transparent;
|
||||
content: " ";
|
||||
height: 0;
|
||||
width: 0;
|
||||
position: absolute;
|
||||
border-top-color: #fff;
|
||||
border-width: 8px;
|
||||
margin-left: -8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 05. Footer
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
@@ -556,3 +586,63 @@ form {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 11. Filters
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
.filters {
|
||||
|
||||
h2 {
|
||||
display: inline-block;
|
||||
font-size: rem-calc(24);
|
||||
margin: rem-calc(24) 0;
|
||||
}
|
||||
|
||||
select {
|
||||
height: auto;
|
||||
margin: rem-calc(24) rem-calc(6);
|
||||
min-width: rem-calc(180);
|
||||
outline: 0;
|
||||
padding: rem-calc(12);
|
||||
width: auto;
|
||||
|
||||
optgroup {
|
||||
font-size: rem-calc(14);
|
||||
}
|
||||
|
||||
option {
|
||||
|
||||
&:after {
|
||||
content: "a";
|
||||
font-family: "icons";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 12. Officials levels
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
.level-0 {
|
||||
background: $level-0;
|
||||
}
|
||||
|
||||
.level-1 {
|
||||
background: $level-1;
|
||||
}
|
||||
|
||||
.level-2 {
|
||||
background: $level-2;
|
||||
}
|
||||
|
||||
.level-3 {
|
||||
background: $level-3;
|
||||
}
|
||||
|
||||
.level-4 {
|
||||
background: $level-4;
|
||||
}
|
||||
|
||||
.level-5 {
|
||||
background: $level-5;
|
||||
}
|
||||
|
||||
@@ -38,6 +38,13 @@ $votes-unlike-act: #BD6A6A;
|
||||
|
||||
$check: #46DB91;
|
||||
|
||||
$level-0: #F08A24;
|
||||
$level-1: #43AC6A;
|
||||
$level-2: #43AC6A;
|
||||
$level-3: #43AC6A;
|
||||
$level-4: #43AC6A;
|
||||
$level-5: #43AC6A;
|
||||
|
||||
// 03. Forms
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ class AccountController < ApplicationController
|
||||
if @account.update(account_params)
|
||||
redirect_to account_path, notice: t("flash.actions.save_changes.notice")
|
||||
else
|
||||
@account.errors.messages.delete(:organization)
|
||||
render :show
|
||||
end
|
||||
end
|
||||
@@ -22,7 +23,11 @@ class AccountController < ApplicationController
|
||||
end
|
||||
|
||||
def account_params
|
||||
params.require(:account).permit(:first_name, :last_name, :nickname, :use_nickname, :email_on_debate_comment, :email_on_comment_reply)
|
||||
if @account.organization?
|
||||
params.require(:account).permit(:phone_number, :email_on_debate_comment, :email_on_comment_reply, organization_attributes: [:name])
|
||||
else
|
||||
params.require(:account).permit(:first_name, :last_name, :phone_number, :nickname, :use_nickname, :email_on_debate_comment, :email_on_comment_reply)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class Admin::BaseController < ApplicationController
|
||||
layout 'admin'
|
||||
before_action :authenticate_user!
|
||||
|
||||
skip_authorization_check
|
||||
|
||||
13
app/controllers/admin/comments_controller.rb
Normal file
13
app/controllers/admin/comments_controller.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
class Admin::CommentsController < Admin::BaseController
|
||||
|
||||
def index
|
||||
@comments = Comment.only_hidden
|
||||
end
|
||||
|
||||
def restore
|
||||
@comment = Comment.with_hidden.find(params[:id])
|
||||
@comment.restore
|
||||
redirect_to admin_comments_path, notice: t('admin.comments.restore.success')
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::DashboardController < Admin::BaseController
|
||||
layout 'admin'
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
16
app/controllers/admin/debates_controller.rb
Normal file
16
app/controllers/admin/debates_controller.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
class Admin::DebatesController < Admin::BaseController
|
||||
|
||||
def index
|
||||
@debates = Debate.only_hidden
|
||||
end
|
||||
|
||||
def show
|
||||
@debate = Debate.with_hidden.find(params[:id])
|
||||
end
|
||||
|
||||
def restore
|
||||
@debate = Debate.with_hidden.find(params[:id])
|
||||
@debate.restore
|
||||
redirect_to admin_debates_path, notice: t('admin.debates.restore.success')
|
||||
end
|
||||
end
|
||||
32
app/controllers/admin/officials_controller.rb
Normal file
32
app/controllers/admin/officials_controller.rb
Normal file
@@ -0,0 +1,32 @@
|
||||
class Admin::OfficialsController < Admin::BaseController
|
||||
|
||||
def index
|
||||
@officials = User.officials.page(params[:page])
|
||||
end
|
||||
|
||||
def search
|
||||
@users = User.with_email(params[:email]).page(params[:page])
|
||||
end
|
||||
|
||||
def edit
|
||||
@user = User.find(params[:id])
|
||||
end
|
||||
|
||||
def update
|
||||
@user = User.find(params[:id])
|
||||
@user.update(user_params)
|
||||
redirect_to admin_officials_path, notice: t("admin.officials.flash.official_updated")
|
||||
end
|
||||
|
||||
def destroy
|
||||
@official = User.officials.find(params[:id])
|
||||
@official.remove_official_position!
|
||||
redirect_to admin_officials_path, notice: t("admin.officials.flash.official_destroyed")
|
||||
end
|
||||
|
||||
private
|
||||
def user_params
|
||||
params.require(:user).permit(:official_position, :official_level)
|
||||
end
|
||||
|
||||
end
|
||||
32
app/controllers/admin/organizations_controller.rb
Normal file
32
app/controllers/admin/organizations_controller.rb
Normal file
@@ -0,0 +1,32 @@
|
||||
class Admin::OrganizationsController < Admin::BaseController
|
||||
before_filter :set_valid_filters
|
||||
before_filter :parse_filter
|
||||
|
||||
load_and_authorize_resource
|
||||
|
||||
def index
|
||||
@organizations = @organizations.send(@filter)
|
||||
@organizations = @organizations.includes(:user).order(:name, 'users.email')
|
||||
end
|
||||
|
||||
def verify
|
||||
@organization.verify
|
||||
redirect_to action: :index, filter: @filter
|
||||
end
|
||||
|
||||
def reject
|
||||
@organization.reject
|
||||
redirect_to action: :index, filter: @filter
|
||||
end
|
||||
|
||||
private
|
||||
def set_valid_filters
|
||||
@valid_filters = %w{all pending verified rejected}
|
||||
end
|
||||
|
||||
def parse_filter
|
||||
@filter = params[:filter]
|
||||
@filter = 'all' unless @valid_filters.include?(@filter)
|
||||
end
|
||||
|
||||
end
|
||||
17
app/controllers/admin/settings_controller.rb
Normal file
17
app/controllers/admin/settings_controller.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
class Admin::SettingsController < Admin::BaseController
|
||||
|
||||
def index
|
||||
@settings = Setting.all
|
||||
end
|
||||
|
||||
def update
|
||||
@setting = Setting.find(params[:id])
|
||||
@setting.update(settings_params)
|
||||
redirect_to admin_settings_path, notice: t("admin.settings.flash.updated")
|
||||
end
|
||||
|
||||
private
|
||||
def settings_params
|
||||
params.require(:setting).permit(:value)
|
||||
end
|
||||
end
|
||||
@@ -1,5 +1,4 @@
|
||||
class Admin::TagsController < Admin::BaseController
|
||||
layout 'admin'
|
||||
before_action :find_tag, only: [:update, :destroy]
|
||||
|
||||
respond_to :html, :js
|
||||
|
||||
13
app/controllers/api/api_controller.rb
Normal file
13
app/controllers/api/api_controller.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
class Api::ApiController < ApplicationController
|
||||
before_action :authenticate_user!
|
||||
protect_from_forgery with: :null_session
|
||||
|
||||
skip_authorization_check
|
||||
before_action :verify_administrator
|
||||
|
||||
private
|
||||
|
||||
def verify_administrator
|
||||
raise CanCan::AccessDenied unless current_user.try(:administrator?)
|
||||
end
|
||||
end
|
||||
22
app/controllers/api/stats_controller.rb
Normal file
22
app/controllers/api/stats_controller.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
class Api::StatsController < Api::ApiController
|
||||
def show
|
||||
unless params[:events].present? || params[:visits].present?
|
||||
return render json: {}, status: :bad_request
|
||||
end
|
||||
|
||||
ds = Ahoy::DataSource.new
|
||||
|
||||
if params[:events].present?
|
||||
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
|
||||
end
|
||||
|
||||
if params[:visits].present?
|
||||
ds.add "Visits", Visit.group_by_day(:started_at).count
|
||||
end
|
||||
|
||||
render json: ds.build
|
||||
end
|
||||
end
|
||||
@@ -2,6 +2,7 @@ class CommentsController < ApplicationController
|
||||
before_action :authenticate_user!
|
||||
before_action :build_comment, only: :create
|
||||
before_action :parent, only: :create
|
||||
|
||||
load_and_authorize_resource
|
||||
respond_to :html, :js
|
||||
|
||||
@@ -50,4 +51,5 @@ class CommentsController < ApplicationController
|
||||
def email_on_comment_reply?
|
||||
reply? && parent.author.email_on_comment_reply?
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
class DebatesController < ApplicationController
|
||||
before_action :authenticate_user!, except: [:index, :show]
|
||||
|
||||
load_and_authorize_resource
|
||||
respond_to :html, :js
|
||||
|
||||
def index
|
||||
@debates = Debate.search(params)
|
||||
@debates = Debate.includes(:tags).search(params)
|
||||
set_debate_votes(@debates)
|
||||
end
|
||||
|
||||
def show
|
||||
set_debate_votes(@debate)
|
||||
@comments = @debate.root_comments.with_hidden.recent
|
||||
end
|
||||
|
||||
def new
|
||||
@@ -23,7 +26,9 @@ class DebatesController < ApplicationController
|
||||
def create
|
||||
@debate = Debate.new(debate_params)
|
||||
@debate.author = current_user
|
||||
|
||||
if @debate.save_with_captcha
|
||||
ahoy.track :debate_created, debate_id: @debate.id
|
||||
redirect_to @debate, notice: t('flash.actions.create.notice', resource_name: 'Debate')
|
||||
else
|
||||
load_featured_tags
|
||||
@@ -46,7 +51,6 @@ class DebatesController < ApplicationController
|
||||
set_debate_votes(@debate)
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
|
||||
def debate_params
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
class Moderation::BaseController < ApplicationController
|
||||
layout 'admin'
|
||||
|
||||
before_action :authenticate_user!
|
||||
|
||||
skip_authorization_check
|
||||
|
||||
8
app/controllers/moderation/comments_controller.rb
Normal file
8
app/controllers/moderation/comments_controller.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
class Moderation::CommentsController < Moderation::BaseController
|
||||
|
||||
def hide
|
||||
@comment = Comment.find(params[:id])
|
||||
@comment.hide
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,5 +1,4 @@
|
||||
class Moderation::DashboardController < Moderation::BaseController
|
||||
layout 'admin'
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
7
app/controllers/moderation/debates_controller.rb
Normal file
7
app/controllers/moderation/debates_controller.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class Moderation::DebatesController < Moderation::BaseController
|
||||
|
||||
def hide
|
||||
@debate = Debate.find(params[:id])
|
||||
@debate.hide
|
||||
end
|
||||
end
|
||||
26
app/controllers/organizations/registrations_controller.rb
Normal file
26
app/controllers/organizations/registrations_controller.rb
Normal file
@@ -0,0 +1,26 @@
|
||||
class Organizations::RegistrationsController < Devise::RegistrationsController
|
||||
def new
|
||||
super do |user|
|
||||
user.build_organization
|
||||
end
|
||||
end
|
||||
|
||||
def create
|
||||
build_resource(sign_up_params)
|
||||
if resource.valid_with_captcha?
|
||||
super do |user|
|
||||
# Removes unuseful "organization is invalid" error message
|
||||
user.errors.messages.delete(:organization)
|
||||
end
|
||||
else
|
||||
render :new
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def sign_up_params
|
||||
params.require(:user).permit(:email, :password, :phone_number, :password_confirmation, :captcha, :captcha_key, organization_attributes: [:name])
|
||||
end
|
||||
|
||||
end
|
||||
14
app/controllers/stats_controller.rb
Normal file
14
app/controllers/stats_controller.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
class StatsController < ApplicationController
|
||||
skip_authorization_check
|
||||
before_action :verify_administrator
|
||||
|
||||
def show
|
||||
@event_types = Ahoy::Event.select(:name).uniq.pluck(:name)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def verify_administrator
|
||||
raise CanCan::AccessDenied unless current_user.try(:administrator?)
|
||||
end
|
||||
end
|
||||
@@ -1,4 +1,4 @@
|
||||
class RegistrationsController < Devise::RegistrationsController
|
||||
class Users::RegistrationsController < Devise::RegistrationsController
|
||||
|
||||
def create
|
||||
build_resource(sign_up_params)
|
||||
@@ -9,11 +9,10 @@ class RegistrationsController < Devise::RegistrationsController
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
|
||||
def sign_up_params
|
||||
params.require(:user).permit(:first_name, :last_name, :email, :password, :password_confirmation, :use_nickname, :nickname, :captcha, :captcha_key)
|
||||
params.require(:user).permit(:first_name, :last_name, :email, :phone_number, :password, :password_confirmation, :use_nickname, :nickname, :captcha, :captcha_key)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -2,7 +2,7 @@ class WelcomeController < ApplicationController
|
||||
skip_authorization_check
|
||||
|
||||
def index
|
||||
@featured_debates = Debate.limit(9)
|
||||
@featured_debates = Debate.includes(:tags).limit(9)
|
||||
set_debate_votes(@featured_debates)
|
||||
end
|
||||
|
||||
|
||||
7
app/helpers/abilities_helper.rb
Normal file
7
app/helpers/abilities_helper.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
module AbilitiesHelper
|
||||
|
||||
def moderator?
|
||||
current_user.try(:moderator?)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -4,6 +4,14 @@ module AdminHelper
|
||||
render "/#{namespace}/menu"
|
||||
end
|
||||
|
||||
def official_level_options
|
||||
options = []
|
||||
(0..5).each do |i|
|
||||
options << [[t("admin.officials.level_#{i}"), Setting.value_for("official_level_#{i}_name")].compact.join(': '), i]
|
||||
end
|
||||
options
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def namespace
|
||||
|
||||
16
app/helpers/stats_helper.rb
Normal file
16
app/helpers/stats_helper.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
module StatsHelper
|
||||
def events_chart_tag(events, opt={})
|
||||
events = events.join(',') if events.is_a? Array
|
||||
opt[:data] ||= {}
|
||||
opt[:data][:graph] = api_stats_path(events: events)
|
||||
content_tag :div, "", opt
|
||||
end
|
||||
|
||||
def visits_chart_tag(opt={})
|
||||
events = events.join(',') if events.is_a? Array
|
||||
opt[:data] ||= {}
|
||||
opt[:data][:graph] = api_stats_path(visits: true)
|
||||
content_tag :div, "", opt
|
||||
end
|
||||
|
||||
end
|
||||
@@ -8,17 +8,31 @@ class Ability
|
||||
if user # logged-in users
|
||||
can [:read, :update], User, id: user.id
|
||||
|
||||
can [:read, :create, :vote], Debate
|
||||
can :read, Debate
|
||||
can :update, Debate do |debate|
|
||||
debate.editable_by?(user)
|
||||
end
|
||||
|
||||
can [:create, :vote], Comment
|
||||
can :create, Comment
|
||||
can :create, Debate
|
||||
|
||||
if user.moderator? or user.administrator?
|
||||
unless user.organization?
|
||||
can :vote, Debate
|
||||
can :vote, Comment
|
||||
end
|
||||
|
||||
elsif user.administrator?
|
||||
if user.moderator? || user.administrator?
|
||||
can :read, Organization
|
||||
can(:verify, Organization){ |o| !o.verified? }
|
||||
can(:reject, Organization){ |o| !o.rejected? }
|
||||
|
||||
can :hide, Comment
|
||||
can :hide, Debate
|
||||
end
|
||||
|
||||
if user.administrator?
|
||||
can :restore, Comment
|
||||
can :restore, Debate
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
49
app/models/ahoy/data_source.rb
Normal file
49
app/models/ahoy/data_source.rb
Normal file
@@ -0,0 +1,49 @@
|
||||
# This class combines multiple collections with shared keys into a
|
||||
# hash of collections compatible with C3.js charts
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
module Ahoy
|
||||
class DataSource
|
||||
|
||||
# Adds a collection with the datasource
|
||||
# Name is the name of the collection and will be showed in the
|
||||
# chart
|
||||
def add(name, collection)
|
||||
collections.push data: collection, name: name
|
||||
collection.each{ |k,v| add_key k }
|
||||
end
|
||||
|
||||
def build
|
||||
data = { x: [] }
|
||||
keys.each do |k|
|
||||
# Add the key with a valid date format
|
||||
data[:x].push k.strftime("%Y-%m-%d")
|
||||
|
||||
# Add the value for each column, or 0 if not present
|
||||
collections.each do |col|
|
||||
data[col[:name]] ||= []
|
||||
count = col[:data][k] || 0
|
||||
data[col[:name]].push count
|
||||
end
|
||||
end
|
||||
|
||||
return data
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def collections
|
||||
@collections ||= []
|
||||
end
|
||||
|
||||
def keys
|
||||
@keys ||= []
|
||||
end
|
||||
|
||||
def add_key(key)
|
||||
keys.push(key) unless keys.include? key
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
8
app/models/ahoy/event.rb
Normal file
8
app/models/ahoy/event.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
module Ahoy
|
||||
class Event < ActiveRecord::Base
|
||||
self.table_name = "ahoy_events"
|
||||
|
||||
belongs_to :visit
|
||||
belongs_to :user
|
||||
end
|
||||
end
|
||||
@@ -1,5 +1,8 @@
|
||||
class Comment < ActiveRecord::Base
|
||||
include ActsAsParanoidAliases
|
||||
acts_as_nested_set scope: [:commentable_id, :commentable_type], counter_cache: :children_count
|
||||
|
||||
acts_as_paranoid column: :hidden_at
|
||||
acts_as_votable
|
||||
|
||||
validates :body, presence: true
|
||||
@@ -8,6 +11,7 @@ class Comment < ActiveRecord::Base
|
||||
belongs_to :commentable, polymorphic: true
|
||||
belongs_to :user
|
||||
|
||||
default_scope { includes(:user) }
|
||||
scope :recent, -> { order(id: :desc) }
|
||||
|
||||
def self.build(commentable, user, body)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
require 'numeric'
|
||||
class Debate < ActiveRecord::Base
|
||||
include ActsAsParanoidAliases
|
||||
default_scope { order('created_at DESC') }
|
||||
|
||||
apply_simple_captcha
|
||||
@@ -8,6 +9,7 @@ class Debate < ActiveRecord::Base
|
||||
acts_as_votable
|
||||
acts_as_commentable
|
||||
acts_as_taggable
|
||||
acts_as_paranoid column: :hidden_at
|
||||
|
||||
belongs_to :author, class_name: 'User', foreign_key: 'author_id'
|
||||
|
||||
@@ -20,6 +22,9 @@ class Debate < ActiveRecord::Base
|
||||
before_validation :sanitize_description
|
||||
before_validation :sanitize_tag_list
|
||||
|
||||
# Ahoy setup
|
||||
visitable # Ahoy will automatically assign visit_id on create
|
||||
|
||||
def self.search(params)
|
||||
if params[:tag]
|
||||
tagged_with(params[:tag])
|
||||
|
||||
31
app/models/organization.rb
Normal file
31
app/models/organization.rb
Normal file
@@ -0,0 +1,31 @@
|
||||
class Organization < ActiveRecord::Base
|
||||
|
||||
belongs_to :user
|
||||
|
||||
validates :name, presence: true
|
||||
|
||||
delegate :email, :phone_number, to: :user
|
||||
|
||||
scope :pending, -> { where(verified_at: nil, rejected_at: nil) }
|
||||
scope :verified, -> { where("verified_at is not null and (rejected_at is null or rejected_at < verified_at)") }
|
||||
scope :rejected, -> { where("rejected_at is not null and (verified_at is null or verified_at < rejected_at)") }
|
||||
|
||||
def verify
|
||||
update(verified_at: Time.now)
|
||||
end
|
||||
|
||||
def reject
|
||||
update(rejected_at: Time.now)
|
||||
end
|
||||
|
||||
def verified?
|
||||
verified_at.present? &&
|
||||
(rejected_at.blank? || rejected_at < verified_at)
|
||||
end
|
||||
|
||||
def rejected?
|
||||
rejected_at.present? &&
|
||||
(verified_at.blank? || verified_at < rejected_at)
|
||||
end
|
||||
|
||||
end
|
||||
7
app/models/setting.rb
Normal file
7
app/models/setting.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class Setting < ActiveRecord::Base
|
||||
default_scope { order(key: :desc) }
|
||||
|
||||
def self.value_for(key)
|
||||
where(key: key).pluck(:value).first
|
||||
end
|
||||
end
|
||||
@@ -5,12 +5,29 @@ class User < ActiveRecord::Base
|
||||
|
||||
acts_as_voter
|
||||
|
||||
validates :first_name, presence: true, unless: :use_nickname?
|
||||
validates :last_name, presence: true, unless: :use_nickname?
|
||||
has_one :administrator
|
||||
has_one :moderator
|
||||
has_one :organization
|
||||
|
||||
validates :first_name, presence: true, if: :use_first_name?
|
||||
validates :last_name, presence: true, if: :use_last_name?
|
||||
validates :nickname, presence: true, if: :use_nickname?
|
||||
validates :official_level, inclusion: {in: 0..5}
|
||||
|
||||
validates_associated :organization, message: false
|
||||
|
||||
accepts_nested_attributes_for :organization
|
||||
|
||||
default_scope { includes(:organization) }
|
||||
scope :administrators, -> { joins(:administrators) }
|
||||
scope :moderators, -> { joins(:moderator) }
|
||||
scope :organizations, -> { joins(:organization) }
|
||||
scope :officials, -> { where("official_level > 0") }
|
||||
|
||||
def name
|
||||
use_nickname? ? nickname : "#{first_name} #{last_name}"
|
||||
return nickname if use_nickname?
|
||||
return organization.name if organization?
|
||||
"#{first_name} #{last_name}"
|
||||
end
|
||||
|
||||
def debate_votes(debates)
|
||||
@@ -19,10 +36,40 @@ class User < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def administrator?
|
||||
@is_administrator ||= Administrator.where(user_id: id).exists?
|
||||
administrator.present?
|
||||
end
|
||||
|
||||
def moderator?
|
||||
@is_moderator ||= Moderator.where(user_id: id).exists?
|
||||
moderator.present?
|
||||
end
|
||||
|
||||
def organization?
|
||||
organization.present?
|
||||
end
|
||||
|
||||
def official?
|
||||
official_level && official_level > 0
|
||||
end
|
||||
|
||||
def add_official_position!(position, level)
|
||||
return if position.blank? || level.blank?
|
||||
update official_position: position, official_level: level.to_i
|
||||
end
|
||||
|
||||
def remove_official_position!
|
||||
update official_position: nil, official_level: 0
|
||||
end
|
||||
|
||||
def self.with_email(e)
|
||||
e.present? ? where(email: e) : none
|
||||
end
|
||||
|
||||
private
|
||||
def use_first_name?
|
||||
!organization? && !use_nickname?
|
||||
end
|
||||
|
||||
def use_last_name?
|
||||
use_first_name?
|
||||
end
|
||||
end
|
||||
|
||||
4
app/models/visit.rb
Normal file
4
app/models/visit.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
class Visit < ActiveRecord::Base
|
||||
has_many :ahoy_events, class_name: "Ahoy::Event"
|
||||
belongs_to :user
|
||||
end
|
||||
@@ -11,12 +11,24 @@
|
||||
<div class="small-12 medium-6 column">
|
||||
<h2><%= t("account.show.personal")%></h2>
|
||||
|
||||
<% if @account.organization? %>
|
||||
|
||||
<%= f.fields_for :organization do |fo| %>
|
||||
<%= fo.text_field :name, autofocus: true, placeholder: t("account.show.organization_name_label") %>
|
||||
<% end %>
|
||||
|
||||
<% else %>
|
||||
|
||||
<%= f.text_field :first_name, placeholder: t("account.show.first_name_label") %>
|
||||
<%= f.text_field :last_name, placeholder: t("account.show.last_name_label") %>
|
||||
<%= f.text_field :nickname, placeholder: t("account.show.nickname_label") %>
|
||||
|
||||
<%= f.check_box :use_nickname, label: false %>
|
||||
<span class="checkbox"><%= t("account.show.use_nickname_label") %></span>
|
||||
|
||||
<% end %>
|
||||
|
||||
<%= f.text_field :phone_number, placeholder: t("account.show.phone_number_label") %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-6 column">
|
||||
@@ -41,5 +53,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,3 +1,56 @@
|
||||
<div id="admin_menu">
|
||||
<%= link_to t('admin.tags.index.title'), admin_tags_path %>
|
||||
</div>
|
||||
<nav class="admin-sidebar">
|
||||
<ul id="admin_menu">
|
||||
<li>
|
||||
<%= t("admin.dashboard.index.title") %>
|
||||
</li>
|
||||
|
||||
<li <%= 'class=active' if controller_name == 'tags' %>>
|
||||
<%= link_to admin_tags_path do %>
|
||||
<i class="icon-comment-quotes"></i>
|
||||
<%= t('admin.menu.debate_topics') %>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<li <%= 'class=active' if controller_name == 'debates' %>>
|
||||
<%= link_to admin_debates_path do %>
|
||||
<i class="icon-eye"></i>
|
||||
<%= t('admin.menu.hidden_debates') %>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<li <%= 'class=active' if controller_name == 'comments' %>>
|
||||
<%= link_to admin_comments_path do %>
|
||||
<i class="icon-chat-bubble-two"></i>
|
||||
<%= t('admin.menu.hidden_comments') %>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<li <%= 'class=active' if controller_name == 'organizations' %>>
|
||||
<%= link_to admin_organizations_path do %>
|
||||
<i class="icon-comment-quotes"></i>
|
||||
<%= t('admin.menu.organizations') %>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<li <%= 'class=active' if controller_name == 'officials' %>>
|
||||
<%= link_to admin_officials_path do %>
|
||||
<i class="icon-user"></i>
|
||||
<%= t('admin.menu.officials') %>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<li <%= 'class=active' if controller_name == 'settings' %>>
|
||||
<%= link_to admin_settings_path do %>
|
||||
<i class="icon-settings"></i>
|
||||
<%= t('admin.menu.settings') %>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<li <%= 'class=active' if controller_name == 'stats' %>>
|
||||
<%= link_to stats_path do %>
|
||||
<i class="icon-stats"></i>
|
||||
<%= t('admin.menu.stats') %>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
18
app/views/admin/comments/index.html.erb
Normal file
18
app/views/admin/comments/index.html.erb
Normal file
@@ -0,0 +1,18 @@
|
||||
<h2><%= t("admin.comments.index.title") %></h2>
|
||||
|
||||
<ul class="admin-list">
|
||||
<% @comments.each do |comment| %>
|
||||
<li id="<%= dom_id(comment) %>">
|
||||
<div class="row">
|
||||
<div class="small-12 medium-10 column">
|
||||
<%= comment.body %>
|
||||
</div>
|
||||
<div class="small-12 medium-2 column">
|
||||
<%= link_to t("admin.actions.restore"), restore_admin_comment_path(comment),
|
||||
method: :put, data: { confirm: t("admin.actions.confirm") },
|
||||
class: "button radius small success right" %>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
@@ -1 +1,5 @@
|
||||
<h1><%= t("admin.dashboard.index.title") %></h1>
|
||||
<h2><%= t("admin.dashboard.index.title") %></h2>
|
||||
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p>
|
||||
|
||||
<p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.</p>
|
||||
|
||||
13
app/views/admin/debates/index.html.erb
Normal file
13
app/views/admin/debates/index.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<h2><%= t("admin.debates.index.title") %></h2>
|
||||
|
||||
<ul class="admin-list">
|
||||
<% @debates.each do |debate| %>
|
||||
<li id="<%= dom_id(debate) %>">
|
||||
<%= link_to debate.title, admin_debate_path(debate) %>
|
||||
|
||||
<%= link_to t("admin.actions.restore"), restore_admin_debate_path(debate),
|
||||
method: :put, data: { confirm: t("admin.actions.confirm") },
|
||||
class: "button radius tiny success right" %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
12
app/views/admin/debates/show.html.erb
Normal file
12
app/views/admin/debates/show.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<h2><%= t("admin.debates.index.title") %></h2>
|
||||
|
||||
<h3><%= @debate.title %></h3>
|
||||
|
||||
<div><%= @debate.description %></div>
|
||||
|
||||
<%= link_to t("admin.debates.show.back"), admin_debates_path,
|
||||
class: "button radius small secondary" %>
|
||||
|
||||
<%= link_to t("admin.actions.restore"), restore_admin_debate_path(@debate),
|
||||
method: :put, data: { confirm: t("admin.actions.confirm") },
|
||||
class: "button radius small success" %>
|
||||
15
app/views/admin/officials/edit.html.erb
Normal file
15
app/views/admin/officials/edit.html.erb
Normal file
@@ -0,0 +1,15 @@
|
||||
<h2>
|
||||
<%= t("admin.officials.edit.title") %>
|
||||
<span class="official right"><strong><%= @user.name %></strong> (<%= @user.email %>)</span>
|
||||
</h2>
|
||||
|
||||
<%= form_for @user, url: admin_official_path(@user) do |f| %>
|
||||
<%= f.text_field :official_position %>
|
||||
<%= f.select :official_level, official_level_options %>
|
||||
<%= link_to t("admin.officials.edit.back"), admin_officials_path, class: "button radius small secondary" %>
|
||||
<%= f.submit %>
|
||||
|
||||
<% if @user.official? %>
|
||||
<%= link_to t("admin.officials.edit.destroy"), admin_official_path(@user), method: :delete, class: 'delete' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
32
app/views/admin/officials/index.html.erb
Normal file
32
app/views/admin/officials/index.html.erb
Normal file
@@ -0,0 +1,32 @@
|
||||
<h2><%= t("admin.officials.index.title") %></h2>
|
||||
|
||||
<%= form_for(User.new, url: search_admin_officials_path, as: :user, method: :get) do |f| %>
|
||||
<div class="row">
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= text_field_tag :email, "", placeholder: t("admin.officials.index.search_email_placeholder") %>
|
||||
</div>
|
||||
<div class="form-inline small-12 medium-6 column">
|
||||
<%= f.submit t("admin.officials.index.search"), class: "button radius success" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<h3><%= page_entries_info @officials %></h3>
|
||||
|
||||
<ul class="admin-list">
|
||||
<% @officials.each do |official| %>
|
||||
<li>
|
||||
<%= link_to official.name, edit_admin_official_path(official) %>
|
||||
<span class="bullet"> • </span>
|
||||
<span class="level"><%= t("admin.officials.level_#{official.official_level}") %></span>
|
||||
<span class="bullet"> • </span>
|
||||
<span class="label round level-<%= official.official_level %>">
|
||||
<%= official.official_position %>
|
||||
</span>
|
||||
|
||||
<%= link_to official.official? ? t("admin.officials.search.edit_official") : t("admin.officials.search.make_official"), edit_admin_official_path(official), class: "button radius tiny right" %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<%= paginate @officials %>
|
||||
30
app/views/admin/officials/search.html.erb
Normal file
30
app/views/admin/officials/search.html.erb
Normal file
@@ -0,0 +1,30 @@
|
||||
<h2><%= t("admin.officials.search.title") %></h2>
|
||||
|
||||
<%= form_for(User.new, url: search_admin_officials_path, as: :user, method: :get) do |f| %>
|
||||
<div class="row">
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= text_field_tag :email, "", placeholder: t("admin.officials.index.search_email_placeholder") %>
|
||||
</div>
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.submit t("admin.officials.search.search"), class: "button radius success" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<h3><%= page_entries_info @users %></h3>
|
||||
|
||||
<ul class="admin-list">
|
||||
<% @users.each do |user| %>
|
||||
<li>
|
||||
<%= link_to user.name, edit_admin_official_path(user) %>
|
||||
<span class="bullet"> • </span>
|
||||
<span class="label round level-<%= user.official_level %>">
|
||||
<%= user.official_position %>
|
||||
</span>
|
||||
<span class="bullet"> • </span>
|
||||
<span class="level"><%= t("admin.officials.level_#{user.official_level}") %></span>
|
||||
|
||||
<%= link_to user.official? ? t("admin.officials.search.edit_official") : t("admin.officials.search.make_official"), edit_admin_official_path(user), class: "button radius tiny right" %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
48
app/views/admin/organizations/index.html.erb
Normal file
48
app/views/admin/organizations/index.html.erb
Normal file
@@ -0,0 +1,48 @@
|
||||
<div class="left">
|
||||
|
||||
<h1><%= t('admin.organizations.index.title') %></h1>
|
||||
|
||||
<p>
|
||||
<%= t('admin.organizations.index.filter') %>:
|
||||
|
||||
<% @valid_filters.each do |filter| %>
|
||||
<% if @filter == filter %>
|
||||
<%= t("admin.organizations.index.filters.#{filter}") %>
|
||||
<% else %>
|
||||
<%= link_to t("admin.organizations.index.filters.#{filter}"),
|
||||
admin_organizations_path(filter: filter) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<table>
|
||||
<% @organizations.each do |organization| %>
|
||||
<tr>
|
||||
<td><%= organization.name %></td>
|
||||
<td><%= organization.email %></td>
|
||||
<td><%= organization.phone_number %></td>
|
||||
<% if organization.verified? %>
|
||||
<td><%= t('admin.organizations.index.verified') %></td>
|
||||
<% end %>
|
||||
<% if can? :verify, organization %>
|
||||
<td><%= link_to t('admin.organizations.index.verify'),
|
||||
verify_admin_organization_path(organization, filter: @filter),
|
||||
method: :put
|
||||
%>
|
||||
</td>
|
||||
<% end %>
|
||||
<% if organization.rejected? %>
|
||||
<td><%= t('admin.organizations.index.rejected') %></td>
|
||||
<% end %>
|
||||
<% if can? :reject, organization %>
|
||||
<td><%= link_to t('admin.organizations.index.reject'),
|
||||
reject_admin_organization_path(organization, filter: @filter),
|
||||
method: :put
|
||||
%>
|
||||
</td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
14
app/views/admin/settings/index.html.erb
Normal file
14
app/views/admin/settings/index.html.erb
Normal file
@@ -0,0 +1,14 @@
|
||||
<h2><%= t("admin.settings.index.title") %></h2>
|
||||
|
||||
<ul class="admin-list">
|
||||
<% @settings.each do |setting| %>
|
||||
<li>
|
||||
<strong><%= setting.key.classify %></strong>
|
||||
|
||||
<%= form_for(setting, url: admin_setting_path(setting), html: { id: "edit_#{dom_id(setting)}"}) do |f| %>
|
||||
<%= f.text_field :value, label: false, id: dom_id(setting) %>
|
||||
<%= f.submit(class: "button radius tiny success") %>
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
@@ -1,29 +1,46 @@
|
||||
<div class="left">
|
||||
<h1><%= t("admin.tags.index.add_tag") %></h1>
|
||||
<h2><%= t("admin.tags.index.add_tag") %></h2>
|
||||
|
||||
<%= form_for(@tag, url: admin_tags_path, as: :tag) do |f| %>
|
||||
<%= f.text_field :name, placeholder: t("admin.tags.name.placeholder") %>
|
||||
<%= form_for(@tag, url: admin_tags_path, as: :tag) do |f| %>
|
||||
|
||||
<div class="row">
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.label :name, t("admin.tags.name.placeholder") %>
|
||||
<%= f.text_field :name, placeholder: t("admin.tags.name.placeholder"), label: false %>
|
||||
</div>
|
||||
|
||||
<div class="is-featured small-12 medium-6 column">
|
||||
<%= f.label :featured do %>
|
||||
<%= f.check_box :featured, label: false %>
|
||||
<%= t("admin.tags.mark_as_featured") %>
|
||||
<%= f.submit(class: "button radius small") %>
|
||||
<span class="checkbox"><%= t("admin.tags.mark_as_featured") %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= f.submit(class: "button radius success") %>
|
||||
|
||||
<h1><%= t("admin.tags.index.title") %></h1>
|
||||
<% end %>
|
||||
|
||||
<ul>
|
||||
<h3><%= t("admin.tags.index.title") %></h3>
|
||||
|
||||
<ul class="admin-list">
|
||||
<% @tags.each do |tag| %>
|
||||
<li>
|
||||
<strong><%= tag.name %></strong>
|
||||
<span class="tag"><%= tag.name %></span>
|
||||
|
||||
<%= form_for(tag, url: admin_tag_path(tag), as: :tag, html: { id: "edit_tag_#{tag.id}"}) do |f| %>
|
||||
<%= f.check_box :featured, label: false, id: "tag_featured_#{tag.id}" %>
|
||||
<%= t("admin.tags.mark_as_featured") %>
|
||||
<%= f.submit(class: "button radius tiny") %>
|
||||
<%= link_to t("admin.tags.destroy"), admin_tag_path(tag), method: :delete, class: 'button tiny alert' %>
|
||||
<%= form_for(tag,
|
||||
url: admin_tag_path(tag),
|
||||
as: :tag,
|
||||
html: { id: "edit_tag_#{tag.id}", class: "text-right"}) do |f| %>
|
||||
|
||||
<%= f.label "featured_#{tag.id}" do %>
|
||||
<%= f.check_box :featured, label: false, id: "tag_featured_#{tag.id}", class: "left" %>
|
||||
<span class="checkbox left"><%= t("admin.tags.mark_as_featured") %></span>
|
||||
<% end %>
|
||||
|
||||
<%= f.submit(class: "button radius tiny success") %>
|
||||
|
||||
<%= link_to t("admin.tags.destroy"), admin_tag_path(tag), method: :delete, class: "delete" %>
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</ul>
|
||||
|
||||
5
app/views/comments/_actions.html.erb
Normal file
5
app/views/comments/_actions.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<span id="moderator-comment-actions">
|
||||
|
|
||||
<%= link_to t("admin.actions.hide").capitalize, hide_moderation_comment_path(comment),
|
||||
method: :put, remote: true, data: { confirm: t('admin.actions.confirm') } %>
|
||||
</span>
|
||||
@@ -1,5 +1,9 @@
|
||||
<div class="row">
|
||||
<div id="comment-<%= comment.id %>" class="comment small-12 column">
|
||||
<div id="<%= dom_id(comment) %>" class="comment small-12 column">
|
||||
|
||||
<% if comment.hidden? %>
|
||||
<%= t("debates.comment.deleted") %>
|
||||
<% else %>
|
||||
|
||||
<%= avatar_image(comment.user, size: 32, class: 'left') %>
|
||||
|
||||
@@ -15,15 +19,25 @@
|
||||
|
||||
<p class="reply">
|
||||
<%= t("debates.comment.responses", count: comment.children_count) %>
|
||||
|
||||
<% if user_signed_in? %>
|
||||
|
|
||||
<%= link_to(comment_link_text(comment), "",
|
||||
class: "js-add-comment-link", data: {'id': dom_id(comment)}) %>
|
||||
|
||||
<% if moderator? %>
|
||||
<%= render 'comments/actions', comment: comment %>
|
||||
<% end %>
|
||||
|
||||
<%= render 'comments/form', {parent: comment, toggeable: true} %>
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
<div class="comment-children">
|
||||
<%= render comment.children.reorder('id DESC, lft') %>
|
||||
<%= render comment.children.with_deleted.reorder('id DESC, lft') %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
<%= link_to(comment_link_text(parent), "", class: "js-add-comment-link", data: {'id': dom_id(parent)}) if toggeable %>
|
||||
|
||||
<div id="js-comment-form-<%= dom_id(parent) %>" <%= "style='display:none'".html_safe if toggeable %>>
|
||||
<%= form_for [@debate, Comment.new], remote: true do |f| %>
|
||||
<%= f.text_area :body %>
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
var parent_id = '<%= dom_id(@parent) %>';
|
||||
var parent_id = "<%= dom_id(@parent) %>";
|
||||
var comment_html = "<%= j(render @comment) %>"
|
||||
|
||||
<% if @parent.is_a?(Debate) -%>
|
||||
App.Comments.reset_form(parent_id);
|
||||
App.Comments.add_comment(parent_id, comment_html);
|
||||
<% else -%>
|
||||
App.Comments.reset_and_hide_form(parent_id);
|
||||
App.Comments.add_reply(parent_id, comment_html);
|
||||
<% end -%>
|
||||
|
||||
App.Comments.add_response(parent_id, "<%= j(render @comment) %>");
|
||||
|
||||
2
app/views/debates/_actions.html.erb
Normal file
2
app/views/debates/_actions.html.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
<%= link_to t("admin.actions.hide").capitalize, hide_moderation_debate_path(debate),
|
||||
method: :put, remote: true, data: { confirm: t('admin.actions.confirm') } %>
|
||||
@@ -1,6 +1,79 @@
|
||||
<section role="main">
|
||||
|
||||
<!-- Filters -->
|
||||
<div class="filters row">
|
||||
<div class="small-12 column">
|
||||
<h2><%= t("debates.index.showing") %></h2>
|
||||
|
||||
<select class="inline-block">
|
||||
<option value="filter_debates">
|
||||
<%= t("debates.index.filter_debates") %>
|
||||
</option>
|
||||
<option value="filter_initiatives">
|
||||
<%= t("debates.index.filter_initiatives") %>
|
||||
</option>
|
||||
<option value="filter_debates_and_initiatives">
|
||||
<%= t("debates.index.filter_debates_and_initiatives") %>
|
||||
</option>
|
||||
</select>
|
||||
|
||||
<select class="inline-block">
|
||||
<option value="filter_news">
|
||||
<%= t("debates.index.filter_news") %>
|
||||
</option>
|
||||
<option value="filter_votes">
|
||||
<%= t("debates.index.filter_votes") %>
|
||||
</option>
|
||||
<option value="filter_rated">
|
||||
<%= t("debates.index.filter_rated") %>
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /. Filters -->
|
||||
|
||||
<!-- Filter topic results -->
|
||||
<div class="filters row">
|
||||
<div class="small-12 column">
|
||||
<h2><%= t("debates.index.showing") %></h2>
|
||||
|
||||
<select class="inline-block">
|
||||
<option value="filter_debates">
|
||||
<%= t("debates.index.filter_debates") %>
|
||||
</option>
|
||||
<option value="filter_initiatives">
|
||||
<%= t("debates.index.filter_initiatives") %>
|
||||
</option>
|
||||
<option value="filter_debates_and_initiatives">
|
||||
<%= t("debates.index.filter_debates_and_initiatives") %>
|
||||
</option>
|
||||
</select>
|
||||
|
||||
<select class="inline-block">
|
||||
<option value="filter_news">
|
||||
<%= t("debates.index.filter_news") %>
|
||||
</option>
|
||||
<option value="filter_votes">
|
||||
<%= t("debates.index.filter_votes") %>
|
||||
</option>
|
||||
<option value="filter_rated">
|
||||
<%= t("debates.index.filter_rated") %>
|
||||
</option>
|
||||
</select>
|
||||
|
||||
<h2><%= t("debates.index.tag") %></h2>
|
||||
|
||||
<select class="inline-block">
|
||||
<option value="">Lista de temas</option>
|
||||
</select>
|
||||
|
||||
<h2>(43)</h2>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /. Filter topic results -->
|
||||
|
||||
<div class="row">
|
||||
<div id="debates" class="small-12 medium-9 column debates-list">
|
||||
<div id="debates" class="debates-list small-12 medium-9 column">
|
||||
<%= render @debates %>
|
||||
</div>
|
||||
<div class="small-12 medium-3 column">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<section class="debate-show">
|
||||
<div id="debate-<%= @debate.id %>" class="row">
|
||||
<div id="<%= dom_id(@debate) %>" class="row">
|
||||
<div class="small-12 medium-9 column">
|
||||
<i class="icon-angle-left left"></i> <%= link_to t("debates.show.back_link"), debates_path, class: 'left back' %>
|
||||
|
||||
@@ -21,12 +21,19 @@
|
||||
<span class="bullet"> • </span>
|
||||
<%= l @debate.created_at.to_date %>
|
||||
<span class="bullet"> • </span>
|
||||
<i class="icon-chat-bubble-two"></i> <%= link_to t("debates.show.comments", count: @debate.comment_threads.count), "#comments" %>
|
||||
<i class="icon-chat-bubble-two"></i>
|
||||
<%= link_to t("debates.show.comments", count: @debate.comment_threads.count), "#comments" %>
|
||||
</div>
|
||||
|
||||
<%= @debate.description %>
|
||||
|
||||
<%= render 'shared/tags', debate: @debate %>
|
||||
|
||||
<% if moderator? %>
|
||||
<div id='moderator-debate-actions'>
|
||||
<%= render 'actions', debate: @debate %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<aside class="small-12 medium-3 column">
|
||||
@@ -40,6 +47,7 @@
|
||||
<div class="sidebar-divider"></div>
|
||||
<h3><%= t("debates.show.share") %></h3>
|
||||
<%= social_share_button_tag(@debate.title) %>
|
||||
|
||||
<% if user_signed_in? %>
|
||||
<%= link_to t("debates.show.leave_comment"), "#comments", class: "leave-comment" %>
|
||||
<% else %>
|
||||
@@ -63,7 +71,8 @@
|
||||
<%= render 'comments/form', {parent: @debate, toggeable: false} %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= render @debate.root_comments.recent %>
|
||||
|
||||
<%= render @comments %>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
<div class="auth row">
|
||||
<div class="small-12 medium-8 large-5 column small-centered">
|
||||
<div class="panel">
|
||||
<i class="icon-angle-left left"></i> <%= link_to t("devise_views.registrations.edit.back_link"), :back, class: "left back" %>
|
||||
|
||||
<h2><%= t("devise_views.registrations.edit.edit") %> <%= resource_name.to_s.humanize %></h2>
|
||||
|
||||
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
|
||||
<%= render 'shared/errors', resource: resource %>
|
||||
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<%= f.email_field :email, autofocus: true, placeholder: t("devise_views.registrations.edit.email_label") %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
|
||||
<div><%= t("devise_views.registrations.edit.waiting_for") %> <%= resource.unconfirmed_email %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.label :password, t("devise_views.registrations.edit.password_label") %>
|
||||
<span class="note"><%= t("devise_views.registrations.edit.leave_blank") %></span>
|
||||
<%= f.password_field :password, autocomplete: "off",
|
||||
label: false,
|
||||
placeholder: t("devise_views.registrations.edit.password_label") %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.password_field :password_confirmation, autocomplete: "off", placeholder: t("devise_views.registrations.edit.password_confirmation_label") %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.label :current_password, t("devise_views.registrations.edit.current_password_label") %>
|
||||
<span class="note"><%= t("devise_views.registrations.edit.need_current") %></span>
|
||||
<%= f.password_field :current_password, autocomplete: "off",
|
||||
label: false,
|
||||
placeholder: t("devise_views.registrations.edit.current_password_label") %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.submit t("devise_views.registrations.edit.update_submit"), class: "button radius" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -3,8 +3,14 @@
|
||||
<%= link_to t("devise_views.shared.links.login"), new_session_path(resource_name) %><br>
|
||||
<% end -%>
|
||||
|
||||
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
|
||||
<%= link_to t("devise_views.shared.links.signup"), new_registration_path(resource_name) %><br>
|
||||
<%- if devise_mapping.registerable? &&
|
||||
controller_name != 'registrations' ||
|
||||
controller_path != 'users/registrations' %>
|
||||
<%= link_to t("devise_views.shared.links.signup"), new_user_registration_path %><br>
|
||||
<% end -%>
|
||||
|
||||
<%- if devise_mapping.registerable? && controller_name == 'registrations' && controller_path != 'organizations/registrations' %>
|
||||
<%= link_to t("devise_views.shared.links.organization_signup"), new_organization_registration_path %><br>
|
||||
<% end -%>
|
||||
|
||||
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
|
||||
@@ -24,4 +30,5 @@
|
||||
<%= link_to t("devise_views.shared.links.signin_with_provider", provider: provider.to_s.titleize), omniauth_authorize_path(resource_name, provider) %><br>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
|
||||
</div>
|
||||
44
app/views/layouts/_admin_header.html.erb
Normal file
44
app/views/layouts/_admin_header.html.erb
Normal file
@@ -0,0 +1,44 @@
|
||||
<header class="<%= header_css %>">
|
||||
<section class="top-links">
|
||||
<div class="row">
|
||||
<div class="language">
|
||||
<span id="locale-switcher">
|
||||
<%= t("layouts.header.language") %>
|
||||
[
|
||||
<% available_locales_to_switch.each do |locale| %>
|
||||
<%= link_to(locale, params.merge(locale: locale), id: "locale-link-#{locale}") %>
|
||||
<% end %>
|
||||
]
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="contain-to-grid clear">
|
||||
<nav class="top-bar" data-topbar role="navigation">
|
||||
<ul class="title-area">
|
||||
<li class="name">
|
||||
<%= link_to root_path do %>
|
||||
<%= image_tag('header_logo_madrid.png', class: 'left', size: '96x96') %>
|
||||
<%= t("layouts.header.open_gov", open: "<strong>#{t('layouts.header.open')}</strong>").html_safe %> | <span><%= t("admin.dashboard.index.title") %></span>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="toggle-topbar menu-icon"><a href="#"><span><%= t("layouts.header.menu") %></span></a></li>
|
||||
</ul>
|
||||
|
||||
<section class="top-bar-section">
|
||||
<%= render 'devise/menu/login_items' %>
|
||||
<%= render 'shared/admin_login_items' %>
|
||||
</section>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<% if home_page? %>
|
||||
<div class="row home-page">
|
||||
<div class="small-12 column text-center">
|
||||
<h1><%= t("layouts.header.open_city") %></h1>
|
||||
<h2><%= t("layouts.header.open_city_slogan") %></h2>
|
||||
<%= link_to t("layouts.header.see_all_debates"), debates_path, class: 'button radius' %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</header>
|
||||
@@ -35,6 +35,21 @@
|
||||
<%= render 'devise/menu/login_items' %>
|
||||
<%= render 'shared/admin_login_items' %>
|
||||
</section>
|
||||
|
||||
<section class="subnavigation row text-center">
|
||||
<div class="small-12 medium-3 column end">
|
||||
<%= link_to t("layouts.header.welcome"), root_path, class: ("active" if current_page?(root_path)) %>
|
||||
</div>
|
||||
<div class="small-12 medium-3 column end">
|
||||
<%= link_to t("layouts.header.news"), "#" %>
|
||||
</div>
|
||||
<div class="small-12 medium-3 column end">
|
||||
<%= link_to t("layouts.header.debates"), debates_path, class: ("active" if current_page?(controller: 'debates')) %>
|
||||
</div>
|
||||
<div class="small-12 medium-3 column end">
|
||||
<%= link_to t("layouts.header.initiatives"), "#" %>
|
||||
</div>
|
||||
</section>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -12,22 +12,26 @@
|
||||
<%= csrf_meta_tags %>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<%= render 'layouts/header' %>
|
||||
<body class="admin">
|
||||
<%= render 'layouts/admin_header' %>
|
||||
|
||||
<% if notice %>
|
||||
<p class="alert-box success"><%= notice %></p>
|
||||
<% end %>
|
||||
<div class="row">
|
||||
|
||||
<% if alert %>
|
||||
<p class="alert-box"><%= alert %></p>
|
||||
<% end %>
|
||||
|
||||
<div class="left" style="padding:50px;">
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= side_menu %>
|
||||
</div>
|
||||
|
||||
<%= yield %>
|
||||
</body>
|
||||
<div class="admin-content small-12 medium-9 column">
|
||||
<% if notice %>
|
||||
<div class="alert-box radius success"><%= notice %></div>
|
||||
<% end %>
|
||||
|
||||
<% if alert %>
|
||||
<div class="alert-box radius alert"><%= alert %></div>
|
||||
<% end %>
|
||||
|
||||
<%= yield %>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
3
app/views/moderation/comments/hide.js.erb
Normal file
3
app/views/moderation/comments/hide.js.erb
Normal file
@@ -0,0 +1,3 @@
|
||||
var comment_id = '<%= dom_id(@comment) %>';
|
||||
App.ModeratorComments.add_class_faded(comment_id);
|
||||
App.ModeratorComments.hide_moderator_actions(comment_id);
|
||||
3
app/views/moderation/debates/hide.js.erb
Normal file
3
app/views/moderation/debates/hide.js.erb
Normal file
@@ -0,0 +1,3 @@
|
||||
var debate_id = '<%= dom_id(@debate) %>';
|
||||
App.ModeratorDebates.add_class_faded(debate_id);
|
||||
App.ModeratorDebates.hide_moderator_actions(debate_id);
|
||||
36
app/views/organizations/registrations/new.html.erb
Normal file
36
app/views/organizations/registrations/new.html.erb
Normal file
@@ -0,0 +1,36 @@
|
||||
<div class="auth row">
|
||||
<div class="small-12 medium-8 large-5 column small-centered">
|
||||
<div class="panel">
|
||||
<h2><%= t("devise_views.organizations.registrations.new.title") %></h2>
|
||||
|
||||
<%= form_for(resource, as: :user, url: organization_registration_path) do |f| %>
|
||||
<%= render 'shared/errors', resource: resource %>
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
|
||||
<%= f.fields_for :organization do |fo| %>
|
||||
<%= fo.text_field :name, autofocus: true, placeholder: t("devise_views.organizations.registrations.new.organization_name_label") %>
|
||||
<% end %>
|
||||
|
||||
<%= f.email_field :email, placeholder: t("devise_views.organizations.registrations.new.email_label") %>
|
||||
|
||||
<%= f.text_field :phone_number, placeholder: t("devise_views.organizations.registrations.new.phone_number_label") %>
|
||||
|
||||
<%= f.password_field :password, autocomplete: "off",
|
||||
placeholder: t("devise_views.organizations.registrations.new.password_label") %>
|
||||
|
||||
<%= f.password_field :password_confirmation, autocomplete: "off",
|
||||
label: t("devise_views.organizations.registrations.new.password_confirmation_label"),
|
||||
placeholder: t("devise_views.organizations.registrations.new.password_confirmation_label") %>
|
||||
|
||||
<%= f.simple_captcha input_html: {required: false} %>
|
||||
|
||||
<%= f.submit t("devise_views.organizations.registrations.new.submit"), class: "button radius expand" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= render "devise/shared/links" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
24
app/views/stats/show.html.erb
Normal file
24
app/views/stats/show.html.erb
Normal file
@@ -0,0 +1,24 @@
|
||||
<div class="stats row-full">
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<h2>Stats</h2>
|
||||
|
||||
<div class="small-12 medium-6 column">
|
||||
<h3>Visits</h3>
|
||||
<%= visits_chart_tag id: "visits" %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-6 column">
|
||||
<h3>Combined</h3>
|
||||
<%= events_chart_tag @event_types, id: 'combined' %>
|
||||
</div>
|
||||
|
||||
<div class="small-12">
|
||||
<% @event_types.each do |event_type| %>
|
||||
<h3><%= event_type.titleize %></h3>
|
||||
<%= events_chart_tag event_type %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
45
app/views/users/registrations/edit.html.erb
Normal file
45
app/views/users/registrations/edit.html.erb
Normal file
@@ -0,0 +1,45 @@
|
||||
<div class="row">
|
||||
<div class="account small-12 medium-9 column small-centered">
|
||||
|
||||
<i class="icon-angle-left left"></i> <%= link_to t("devise_views.users.registrations.edit.back_link"), :back, class: "left back" %>
|
||||
|
||||
<h1><%= t("devise_views.users.registrations.edit.edit") %> <%= resource_name.to_s.humanize %></h1>
|
||||
|
||||
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
|
||||
<%= devise_error_messages! %>
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<%= f.label :email, t("devise_views.users.registrations.edit.email_label") %>
|
||||
<%= f.email_field :email, autofocus: true, placeholder: t("devise_views.users.registrations.edit.email_label") %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
|
||||
<div><%= t("devise_views.users.registrations.edit.waiting_for") %> <%= resource.unconfirmed_email %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.label :password, t("devise_views.users.registrations.edit.password_label") %>
|
||||
<span class="note"><%= t("devise_views.users.registrations.edit.leave_blank") %></span>
|
||||
<%= f.password_field :password, autocomplete: "off", placeholder: t("devise_views.users.registrations.edit.password_label") %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.label :password_confirmation, t("devise_views.users.registrations.edit.password_confirmation_label") %>
|
||||
<%= f.password_field :password_confirmation, autocomplete: "off", placeholder: t("devise_views.users.registrations.edit.password_confirmation_label") %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.label :current_password, t("devise_views.users.registrations.edit.current_password_label") %>
|
||||
<span class="note"><%= t("devise_views.users.registrations.edit.need_current") %></span>
|
||||
<%= f.password_field :current_password, autocomplete: "off", placeholder: t("devise_views.users.registrations.edit.current_password_label") %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.submit t("devise_views.users.registrations.edit.update_submit"), class: "button radius" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,31 +1,31 @@
|
||||
<div class="auth row">
|
||||
<div class="small-12 medium-8 large-5 column small-centered">
|
||||
<div class="panel">
|
||||
<h2><%= t("devise_views.registrations.new.title") %></h2>
|
||||
|
||||
<h2><%= t("devise_views.users.registrations.new.title") %></h2>
|
||||
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
|
||||
<%= render 'shared/errors', resource: resource %>
|
||||
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<%= f.text_field :first_name, autofocus: true,
|
||||
placeholder: t("devise_views.registrations.new.first_name_label") %>
|
||||
<%= f.text_field :last_name, placeholder: t("devise_views.registrations.new.last_name_label") %>
|
||||
<%= f.email_field :email, placeholder: t("devise_views.registrations.new.email_label") %>
|
||||
<%= f.text_field :nickname, placeholder: t("devise_views.registrations.new.nickname_label") %>
|
||||
placeholder: t("devise_views.users.registrations.new.first_name_label") %>
|
||||
<%= f.text_field :last_name, placeholder: t("devise_views.users.registrations.new.last_name_label") %>
|
||||
<%= f.email_field :email, placeholder: t("devise_views.users.registrations.new.email_label") %>
|
||||
<%= f.text_field :nickname, placeholder: t("devise_views.users.registrations.new.nickname_label") %>
|
||||
|
||||
<%= f.check_box :use_nickname, label: t("devise_views.registrations.new.use_nickname_label") %>
|
||||
<%= f.check_box :use_nickname, label: t("devise_views.users.registrations.new.use_nickname_label") %>
|
||||
|
||||
<%= f.text_field :phone_number, placeholder: t("devise_views.users.registrations.new.phone_number_label") %>
|
||||
|
||||
<%= f.password_field :password, autocomplete: "off",
|
||||
placeholder: t("devise_views.registrations.new.password_label") %>
|
||||
placeholder: t("devise_views.users.registrations.new.password_label") %>
|
||||
|
||||
<%= f.password_field :password_confirmation, autocomplete: "off",
|
||||
label: t("devise_views.registrations.new.password_confirmation_label"),
|
||||
placeholder: t("devise_views.registrations.new.password_confirmation_label") %>
|
||||
label: t("devise_views.users.registrations.new.password_confirmation_label"),
|
||||
placeholder: t("devise_views.users.registrations.new.password_confirmation_label") %>
|
||||
|
||||
<%= f.simple_captcha input_html: {required: false} %>
|
||||
|
||||
<%= f.submit t("devise_views.registrations.new.submit"), class: "button radius expand" %>
|
||||
<%= f.submit t("devise_views.users.registrations.new.submit"), class: "button radius expand" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -1,5 +1,10 @@
|
||||
<section role="main">
|
||||
<div id="featured-debates" class="featured-debates row">
|
||||
<div class="filters row">
|
||||
<div class="small-12 column">
|
||||
<h2><%= t("welcome.featured_debates") %></h2>
|
||||
</div>
|
||||
</div>
|
||||
<div id="featured-debates" class="row">
|
||||
<%= render partial: "featured_debate", collection: @featured_debates %>
|
||||
</div>
|
||||
</section>
|
||||
@@ -94,13 +94,14 @@ ignore_missing:
|
||||
## Consider these keys used:
|
||||
ignore_unused:
|
||||
- 'activerecord.*'
|
||||
- 'admin.organizations.index.filter.*'
|
||||
- 'unauthorized.*'
|
||||
- 'simple_captcha.*'
|
||||
- 'admin.officials.level_*'
|
||||
# - '{devise,kaminari,will_paginate}.*'
|
||||
# - 'simple_form.{yes,no}'
|
||||
# - 'simple_form.{placeholders,hints,labels}.*'
|
||||
# - 'simple_form.{error_notification,required}.:'
|
||||
ignore_unused:
|
||||
- 'unauthorized.*'
|
||||
- 'simple_captcha.*'
|
||||
|
||||
## Exclude these keys from the `i18n-tasks eq-base' report:
|
||||
# ignore_eq_base:
|
||||
|
||||
9
config/initializers/ahoy.rb
Normal file
9
config/initializers/ahoy.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
class Ahoy::Store < Ahoy::Stores::ActiveRecordStore
|
||||
|
||||
# Track user IP
|
||||
def track_event(name, properties, options)
|
||||
super do |event|
|
||||
event.ip = request.ip
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -211,7 +211,7 @@ Devise.setup do |config|
|
||||
# Turn scoped views on. Before rendering "sessions/new", it will first check for
|
||||
# "users/sessions/new". It's turned off by default because it's slower if you
|
||||
# are using only default views.
|
||||
# config.scoped_views = false
|
||||
config.scoped_views = true
|
||||
|
||||
# Configure the default scope given to Warden. By default it's the first
|
||||
# devise role declared in your routes (usually :user).
|
||||
|
||||
10
config/initializers/kaminari_config.rb
Normal file
10
config/initializers/kaminari_config.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
Kaminari.configure do |config|
|
||||
# config.default_per_page = 25
|
||||
# config.max_per_page = nil
|
||||
# config.window = 4
|
||||
# config.outer_window = 0
|
||||
# config.left = 0
|
||||
# config.right = 0
|
||||
# config.page_method_name = :page
|
||||
# config.param_name = :page
|
||||
end
|
||||
@@ -6,6 +6,7 @@ en:
|
||||
tag: Topic
|
||||
user: User
|
||||
vote: Vote
|
||||
organization: Organization
|
||||
attributes:
|
||||
comment:
|
||||
body: Comment
|
||||
@@ -21,3 +22,8 @@ en:
|
||||
last_name: "Last name"
|
||||
nickname: Nickname
|
||||
password: Password
|
||||
phone_number: Phone number
|
||||
official_position: Official position
|
||||
official_level: Official level
|
||||
organization:
|
||||
name: Organization name
|
||||
|
||||
@@ -6,6 +6,7 @@ es:
|
||||
tag: Tema
|
||||
user: Usuario
|
||||
vote: Voto
|
||||
organization: Organización
|
||||
attributes:
|
||||
comment:
|
||||
body: Comentario
|
||||
@@ -21,3 +22,8 @@ es:
|
||||
last_name: Apellidos
|
||||
nickname: Pseudónimo
|
||||
password: Contraseña
|
||||
phone_number: Teléfono
|
||||
official_position: Cargo público
|
||||
official_level: Nivel del cargo
|
||||
organization:
|
||||
name: Nombre de organización
|
||||
|
||||
@@ -1,8 +1,38 @@
|
||||
en:
|
||||
admin:
|
||||
settings:
|
||||
index:
|
||||
title: Global settings
|
||||
flash:
|
||||
updated: 'Setting updated!'
|
||||
dashboard:
|
||||
index:
|
||||
title: Administration
|
||||
menu:
|
||||
settings: Global settings
|
||||
debate_topics: Debate topics
|
||||
hidden_debates: Hidden debates
|
||||
hidden_comments: Hidden comments
|
||||
organizations: Organizations
|
||||
officials: Officials
|
||||
stats: Statistics
|
||||
organizations:
|
||||
index:
|
||||
title: Organizations
|
||||
verify: Verify
|
||||
reject: Reject
|
||||
verified: Verified
|
||||
rejected: Rejected
|
||||
filter: Filter
|
||||
filters:
|
||||
all: All
|
||||
pending: Pending
|
||||
verified: Verified
|
||||
rejected: Rejected
|
||||
actions:
|
||||
hide: Hide
|
||||
restore: Restore
|
||||
confirm: 'Are you sure?'
|
||||
tags:
|
||||
index:
|
||||
title: 'Debate topics'
|
||||
@@ -11,3 +41,38 @@ en:
|
||||
name:
|
||||
placeholder: 'Write a topic'
|
||||
destroy: Delete Tag
|
||||
comments:
|
||||
index:
|
||||
title: Hidden comments
|
||||
restore:
|
||||
success: The comment has been restored
|
||||
debates:
|
||||
index:
|
||||
title: Hidden debates
|
||||
show:
|
||||
back: Back
|
||||
restore:
|
||||
success: The debate has been restored
|
||||
officials:
|
||||
level_0: Level 0
|
||||
level_1: Level 1
|
||||
level_2: Level 2
|
||||
level_3: Level 3
|
||||
level_4: Level 4
|
||||
level_5: Level 5
|
||||
index:
|
||||
title: Officials
|
||||
search_email_placeholder: 'Search user by email'
|
||||
search: Search
|
||||
search:
|
||||
title: 'Officials: Search users'
|
||||
edit_official: Edit official
|
||||
make_official: Make this user an official
|
||||
search: Search
|
||||
edit:
|
||||
title: 'Officials: edit user'
|
||||
destroy: "Remove 'Official' condition"
|
||||
back: Back
|
||||
flash:
|
||||
official_updated: 'Official position saved!'
|
||||
official_destroyed: 'User is not an official anymore'
|
||||
|
||||
@@ -1,8 +1,38 @@
|
||||
es:
|
||||
admin:
|
||||
settings:
|
||||
index:
|
||||
title: Configuración global
|
||||
flash:
|
||||
updated: 'Valor actualizado'
|
||||
dashboard:
|
||||
index:
|
||||
title: Administración
|
||||
menu:
|
||||
settings: Configuración global
|
||||
debate_topics: Temas de debate
|
||||
hidden_debates: Debates ocultos
|
||||
hidden_comments: Comentarios ocultos
|
||||
organizations: Organizaciones
|
||||
officials: Cargos públicos
|
||||
stats: Estadísticas
|
||||
organizations:
|
||||
index:
|
||||
title: Organizaciones
|
||||
verify: Verificar
|
||||
reject: Rechazar
|
||||
verified: Verificada
|
||||
rejected: Rechazada
|
||||
filter: Filtro
|
||||
filters:
|
||||
all: Todas
|
||||
pending: Pendientes
|
||||
verified: Verificadas
|
||||
rejected: Rechazadas
|
||||
actions:
|
||||
hide: Ocultar
|
||||
restore: Permitir
|
||||
confirm: '¿Estás seguro?'
|
||||
tags:
|
||||
index:
|
||||
title: 'Temas de debate'
|
||||
@@ -11,3 +41,38 @@ es:
|
||||
name:
|
||||
placeholder: 'Escribe el nombre del tema'
|
||||
destroy: Elimina la etiqueta
|
||||
comments:
|
||||
index:
|
||||
title: Comentarios ocultos
|
||||
restore:
|
||||
success: El comentario ha sido permitido
|
||||
debates:
|
||||
index:
|
||||
title: Debates ocultos
|
||||
show:
|
||||
back: Volver
|
||||
restore:
|
||||
success: El debate ha sido permitido
|
||||
officials:
|
||||
level_0: Nivel 0
|
||||
level_1: Nivel 1
|
||||
level_2: Nivel 2
|
||||
level_3: Nivel 3
|
||||
level_4: Nivel 4
|
||||
level_5: Nivel 5
|
||||
index:
|
||||
title: Cargos Públicos
|
||||
search_email_placeholder: 'Buscar usuario por email'
|
||||
search: Buscar
|
||||
search:
|
||||
title: 'Cargos Públicos: Búsqueda de usuarios'
|
||||
edit_official: Editar cargo público
|
||||
make_official: Convertir en cargo público
|
||||
search: Buscar
|
||||
edit:
|
||||
title: 'Cargos Públicos: Editar usuario'
|
||||
destroy: "Eliminar condición de 'Cargo Público'"
|
||||
back: Volver
|
||||
flash:
|
||||
official_updated: 'Datos del cargo público guardados'
|
||||
official_destroyed: 'Datos guardados: el usuario ya no es cargo público'
|
||||
|
||||
@@ -35,6 +35,7 @@ en:
|
||||
title: "Forgot your password?"
|
||||
email_label: "Email"
|
||||
send_submit: "Send me reset password instructions"
|
||||
users:
|
||||
registrations:
|
||||
edit:
|
||||
edit: "Edit"
|
||||
@@ -54,9 +55,20 @@ en:
|
||||
nickname_label: "Nickname"
|
||||
use_nickname_label: "Use nickname"
|
||||
email_label: "Email"
|
||||
phone_number_label: "Phone number"
|
||||
password_label: "Password"
|
||||
password_confirmation_label: "Confirm password"
|
||||
submit: "Sign up"
|
||||
organizations:
|
||||
registrations:
|
||||
new:
|
||||
title: "Sign up as organization"
|
||||
organization_name_label: "Organization name"
|
||||
email_label: "Email"
|
||||
password_label: "Password"
|
||||
phone_number_label: "Phone number"
|
||||
password_confirmation_label: "Confirm password"
|
||||
submit: "Sign up"
|
||||
sessions:
|
||||
new:
|
||||
title: "Log in"
|
||||
@@ -74,6 +86,7 @@ en:
|
||||
login: "Log in"
|
||||
signup: "Sign up"
|
||||
signin_with_provider: "Sign in with %{provider}"
|
||||
organization_signup: "Sign up as an organization"
|
||||
new_password: "Forgot your password?"
|
||||
new_confirmation: "Didn't receive confirmation instructions?"
|
||||
new_unlock: "Didn't receive unlock instructions?"
|
||||
|
||||
@@ -8,7 +8,7 @@ es:
|
||||
confirmation_instructions:
|
||||
welcome: "Bienvenido"
|
||||
text: "Puedes confirmar tu cuenta de correo electrónico en el siguiente enlace:"
|
||||
confirm_link: "Confirmar my cuenta"
|
||||
confirm_link: "Confirmar mi cuenta"
|
||||
reset_password_instructions:
|
||||
hello: "Hola"
|
||||
text: "Se ha solicitado un enlace para cambiar tu contraseña, puedes hacerlo en el siguiente enlace:"
|
||||
@@ -35,6 +35,7 @@ es:
|
||||
title: "¿Has olvidado tu contraseña?"
|
||||
email_label: "Email"
|
||||
send_submit: "Recibir instrucciones para recuperar mi contraseña"
|
||||
users:
|
||||
registrations:
|
||||
edit:
|
||||
edit: "Editar"
|
||||
@@ -54,9 +55,20 @@ es:
|
||||
nickname_label: "Pseudónimo"
|
||||
use_nickname_label: "Usar pseudónimo"
|
||||
email_label: "Email"
|
||||
phone_number_label: "Teléfono"
|
||||
password_label: "Contraseña"
|
||||
password_confirmation_label: "Confirmar contraseña"
|
||||
submit: "Registrarse"
|
||||
organizations:
|
||||
registrations:
|
||||
new:
|
||||
title: "Registrarse como organización"
|
||||
organization_name_label: "Nombre de la organización"
|
||||
email_label: "Email"
|
||||
password_label: "Contraseña"
|
||||
phone_number_label: "Teléfono"
|
||||
password_confirmation_label: "Confirmar contraseña"
|
||||
submit: "Registrarse"
|
||||
sessions:
|
||||
new:
|
||||
title: "Entrar"
|
||||
@@ -73,6 +85,7 @@ es:
|
||||
links:
|
||||
login: "Entrar"
|
||||
signup: "Registrarse"
|
||||
organization_signup: "Registro para organizaciones"
|
||||
signin_with_provider: "Entrar con %{provider}"
|
||||
new_password: "¿Olvidaste tu contraseña?"
|
||||
new_confirmation: "¿No has recibido instrucciones para confirmar tu cuenta?"
|
||||
|
||||
@@ -15,6 +15,10 @@ en:
|
||||
language: Site language
|
||||
administration: Administration
|
||||
moderation: Moderation
|
||||
welcome: Welcome
|
||||
news: News
|
||||
debates: Debates
|
||||
initiatives: Initiatives
|
||||
footer:
|
||||
copyright: "Ayuntamiento de Madrid, 2015. All rights reserved"
|
||||
form:
|
||||
@@ -27,6 +31,14 @@ en:
|
||||
debates:
|
||||
index:
|
||||
create_debate: Create a debate
|
||||
showing: You are seeing
|
||||
tag: with the topic
|
||||
filter_debates: debates
|
||||
filter_initiatives: initiatives
|
||||
filter_debates_and_initiatives: debates and initiatives
|
||||
filter_news: the newest
|
||||
filter_votes: the most voted
|
||||
filter_rated: the best rated
|
||||
debate:
|
||||
debate: Debate
|
||||
comments:
|
||||
@@ -38,6 +50,7 @@ en:
|
||||
one: 1 vote
|
||||
other: "%{count} votes"
|
||||
comment:
|
||||
deleted: This comment has been deleted
|
||||
responses:
|
||||
zero: No Responses
|
||||
one: 1 Response
|
||||
@@ -102,6 +115,8 @@ en:
|
||||
personal: "Personal data"
|
||||
first_name_label: "First Name"
|
||||
last_name_label: "Last Name"
|
||||
phone_number_label: "Phone number"
|
||||
organization_name_label: "Organization name"
|
||||
use_nickname_label: "Use nickname"
|
||||
nickname_label: "Nickname"
|
||||
notifications: Notifications
|
||||
@@ -124,3 +139,5 @@ en:
|
||||
default: "You are not authorized to access this page."
|
||||
manage:
|
||||
all: "You are not authorized to %{action} %{subject}."
|
||||
welcome:
|
||||
featured_debates: Features debates
|
||||
|
||||
@@ -13,8 +13,12 @@ es:
|
||||
see_all_debates: Ver todos los debates
|
||||
my_account_link: Mi cuenta
|
||||
language: Idioma de la página
|
||||
administration: Administar
|
||||
administration: Administrar
|
||||
moderation: Moderar
|
||||
welcome: Portada
|
||||
news: Novedades
|
||||
debates: Debates
|
||||
initiatives: Iniciativas
|
||||
footer:
|
||||
copyright: "Ayuntamiento de Madrid, %{year}. Todos los derechos reservados"
|
||||
form:
|
||||
@@ -27,6 +31,14 @@ es:
|
||||
debates:
|
||||
index:
|
||||
create_debate: Crea un debate
|
||||
showing: "Estás viendo"
|
||||
tag: "con el tema"
|
||||
filter_debates: debates
|
||||
filter_initiatives: iniciativas
|
||||
filter_debates_and_initiatives: debates e iniciativas
|
||||
filter_news: "más nuevos"
|
||||
filter_votes: "más votados"
|
||||
filter_rated: mejor valorados
|
||||
debate:
|
||||
debate: Debate
|
||||
comments:
|
||||
@@ -38,6 +50,7 @@ es:
|
||||
one: 1 voto
|
||||
other: "%{count} votos"
|
||||
comment:
|
||||
deleted: Este comentario ha sido eliminado
|
||||
responses:
|
||||
zero: Sin respuestas
|
||||
one: 1 Respuesta
|
||||
@@ -102,6 +115,8 @@ es:
|
||||
personal: "Datos personales"
|
||||
first_name_label: "Nombre"
|
||||
last_name_label: "Apellidos"
|
||||
phone_number_label: "Teléfono"
|
||||
organization_name_label: "Nombre de la organización"
|
||||
use_nickname_label: "Usar pseudónimo"
|
||||
nickname_label: "Pseudónimo"
|
||||
notifications: Notificaciones
|
||||
@@ -122,17 +137,7 @@ es:
|
||||
subject: Alguien ha respondido a tu comentario
|
||||
unauthorized:
|
||||
default: "No tienes permiso para acceder a esta página."
|
||||
index:
|
||||
all: "No tienes permiso para listar %{subject}"
|
||||
show:
|
||||
all: "No tienes permiso para ver %{subject}"
|
||||
edit:
|
||||
all: "No tienes permiso para editar %{subject}"
|
||||
update:
|
||||
all: "No tienes permiso para modificar %{subject}"
|
||||
create:
|
||||
all: "No tienes permiso para crear %{subject}"
|
||||
delete:
|
||||
all: "No tienes permiso para borrar %{subject}"
|
||||
manage:
|
||||
all: "No tienes permiso para realizar la acción '%{action}' sobre %{subject}."
|
||||
welcome:
|
||||
featured_debates: Debates destacados
|
||||
|
||||
17
config/locales/kaminari.en.yml
Normal file
17
config/locales/kaminari.en.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
en:
|
||||
views:
|
||||
pagination:
|
||||
first: "« First"
|
||||
last: "Last »"
|
||||
previous: "‹ Prev"
|
||||
next: "Next ›"
|
||||
truncate: "…"
|
||||
helpers:
|
||||
page_entries_info:
|
||||
one_page:
|
||||
display_entries:
|
||||
zero: "No %{entry_name} found"
|
||||
one: "Displaying <b>1</b> %{entry_name}"
|
||||
other: "Displaying <b>all %{count}</b> %{entry_name}"
|
||||
more_pages:
|
||||
display_entries: "Displaying %{entry_name} <b>%{first} - %{last}</b> of <b>%{total}</b> in total"
|
||||
17
config/locales/kaminari.es.yml
Normal file
17
config/locales/kaminari.es.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
es:
|
||||
views:
|
||||
pagination:
|
||||
first: "« Primera"
|
||||
last: "Última »"
|
||||
previous: "‹ Anterior"
|
||||
next: "Siguiente ›"
|
||||
truncate: "…"
|
||||
helpers:
|
||||
page_entries_info:
|
||||
one_page:
|
||||
display_entries:
|
||||
zero: "No se han encontrado %{entry_name}"
|
||||
one: "Encontrado <b>1</b> %{entry_name}"
|
||||
other: "Encontrados <b> %{count}</b> %{entry_name}"
|
||||
more_pages:
|
||||
display_entries: "Se muestran <b> del %{first} al %{last}</b> de un total de <b>%{total}</b> %{entry_name}"
|
||||
@@ -3,3 +3,4 @@ en:
|
||||
dashboard:
|
||||
index:
|
||||
title: Moderation
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user