diff --git a/Gemfile b/Gemfile index 5430c9c41..bf657d345 100644 --- a/Gemfile +++ b/Gemfile @@ -53,6 +53,7 @@ gem 'pg_search' gem 'ahoy_matey', '~> 1.2.1' gem 'groupdate' # group temporary data +gem 'tolk' # Web interface for translations gem 'browser' gem 'turnout' diff --git a/Gemfile.lock b/Gemfile.lock index 4756e3aed..fafb13808 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -344,6 +344,7 @@ GEM rspec-support (~> 3.4.0) rspec-support (3.4.1) ruby-progressbar (1.7.5) + safe_yaml (1.0.4) sass (3.4.21) sass-rails (5.0.4) railties (>= 4.0.0, < 5.0) @@ -397,6 +398,9 @@ GEM thread_safe (0.3.5) tilt (2.0.2) tins (1.6.0) + tolk (1.9.3) + rails (>= 4.0, < 4.3) + safe_yaml (>= 0.8.6) turbolinks (2.5.3) coffee-rails turnout (2.2.1) @@ -496,6 +500,7 @@ DEPENDENCIES social-share-button! spring spring-commands-rspec + tolk turbolinks turnout uglifier (>= 1.3.0) diff --git a/app/assets/fonts/icons.eot b/app/assets/fonts/icons.eot index ced98a9b4..7323d578f 100644 Binary files a/app/assets/fonts/icons.eot and b/app/assets/fonts/icons.eot differ diff --git a/app/assets/fonts/icons.svg b/app/assets/fonts/icons.svg index d92b9a44a..e272b9550 100644 --- a/app/assets/fonts/icons.svg +++ b/app/assets/fonts/icons.svg @@ -42,8 +42,10 @@ - - + + + + diff --git a/app/assets/fonts/icons.ttf b/app/assets/fonts/icons.ttf index f3486cf96..4db54078d 100644 Binary files a/app/assets/fonts/icons.ttf and b/app/assets/fonts/icons.ttf differ diff --git a/app/assets/fonts/icons.woff b/app/assets/fonts/icons.woff index 9045aa563..33d2d4dee 100644 Binary files a/app/assets/fonts/icons.woff and b/app/assets/fonts/icons.woff differ diff --git a/app/assets/images/featured_debates.jpg b/app/assets/images/featured_debates.jpg deleted file mode 100644 index f1daa4c6e..000000000 Binary files a/app/assets/images/featured_debates.jpg and /dev/null differ diff --git a/app/assets/images/featured_proposals.jpg b/app/assets/images/featured_proposals.jpg deleted file mode 100644 index 303c21747..000000000 Binary files a/app/assets/images/featured_proposals.jpg and /dev/null differ diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index 5d3418748..470885665 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -70,10 +70,6 @@ body.admin { .admin-content { margin-top: rem-calc(24); - .filters h2 { - margin-top: 0; - } - .proposal-new, .proposal-edit { padding-top: 0; } diff --git a/app/assets/stylesheets/icons.scss b/app/assets/stylesheets/icons.scss index 46e24e4cf..b13b09f46 100644 --- a/app/assets/stylesheets/icons.scss +++ b/app/assets/stylesheets/icons.scss @@ -142,15 +142,21 @@ .icon-letter:before { content: "\4c"; } -.icon-no-notification:before { - content: "\78"; -} -.icon-notification:before { - content: "\6e"; -} .icon-circle:before { content: "\43"; } .icon-circle-o:before { content: "\4d"; } +.icon-help:before { + content: "\4e"; +} +.icon-budget:before { + content: "\53"; +} +.icon-notification:before { + content: "\6e"; +} +.icon-no-notification:before { + content: "\78"; +} diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index 8c279ff78..d7cf4d4d1 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -8,7 +8,7 @@ // 06. Forms // 07. Alerts // 08. User account -// 09. Filters & search +// 09. Search // 10. Official levels // 11. Pagination // 12. Tables @@ -639,11 +639,7 @@ footer { background-repeat: no-repeat; background-size: cover; - @media (min-width: $small-breakpoint) { - padding-top: $line-height*2; - } - - h1 { + h1:not(.logo) { @include logo; a { @@ -661,25 +657,18 @@ footer { } .auth { - min-height: $line-height*20; .back, .icon-angle-left { @include back; } - p, a { - font-family: $font-sans; + p, a, .checkbox { font-size: $small-font-size; } .panel { background: white; border: 0; - - h1 { - font-size: rem-calc(30); - font-weight: bolder; - } } } @@ -1028,60 +1017,9 @@ img.avatar, img.admin-avatar, img.moderator-avatar, img.initialjs-avatar { } } -// 09. Filters & search +// 09. Search // - - - - - - - - - - - - - - - - - - - - - - - - - -.filters, .search-results { - - h2 { - display: inline-block; - font-size: rem-calc(24); - margin: $line-height/2 0; - - @media (min-width: $small-breakpoint) { - margin: $line-height 0; - } - } - - select { - background-color: #DEE0E2; - height: auto; - margin-bottom: $line-height; - min-width: $line-height*7.5; - outline: 0; - padding: $line-height/2; - width: auto; - - @media (min-width: $small-breakpoint) { - margin: 0 0 $line-height $line-height/2; - } - - optgroup { - font-size: $small-font-size; - } - - option { - - &:after { - content: "a"; - font-family: "icons"; - } - } - } - - .debates-order { - text-align: left; - - @media (min-width: $small-breakpoint) { - text-align: right; - } - - select { - margin-left: 0; - } - } -} - .search-form { h3 { diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss index cfad21920..87aed579d 100644 --- a/app/assets/stylesheets/participation.scss +++ b/app/assets/stylesheets/participation.scss @@ -272,7 +272,9 @@ // 02. New participation // - - - - - - - - - - - - - - - - - - - - - - - - - -.debate-new, .debate-edit, .proposal-new, .proposal-edit, { +.debate-new, .debate-edit, +.proposal-new, .proposal-edit, +.spending-proposal-new, .spending-proposal-edit { padding-top: $line-height; .back { @@ -293,6 +295,13 @@ opacity: .5; } + .icon-budget { + color: $budget; + font-size: rem-calc(50); + line-height: $line-height; + opacity: .5; + } + .recommendations { list-style-type: none; margin-left: 0; @@ -789,8 +798,12 @@ // 05. Featured // - - - - - - - - - - - - - - - - - - - - - - - - - -.featured-debates-container { - background: $votes-bg; +.featured-debates, .featured-proposals { + padding: $line-height/2 0; + + @media (min-width: $small-breakpoint) { + margin-top: $line-height !important; + } @media (min-width: $medium-breakpoint) { margin-left: 0 !important; @@ -798,134 +811,40 @@ } h2 { - color: white; - } - - .debates-list { - margin-bottom: 0; - } -} - -.featured-proposals-container { - background: #FED900; - - @media (min-width: $medium-breakpoint) { - margin-left: 0 !important; - margin-right: rem-calc(-15) !important; - } - - h2 { - color: $text; - - @media (min-width: $medium-breakpoint) { - margin-bottom: rem-calc(27); - } - } -} - -.featured-debates-container, .featured-proposals-container { - margin: $line-height 0 !important; - - h2 { - font-size: rem-calc(24); - margin: rem-calc(12) 0 0; - position: relative; + font-size: $small-font-size; + line-height: $line-height; text-transform: uppercase; + } - .icon-proposals { - font-size: rem-calc(20); - position: absolute; - right: -26px; - top: -5px; + h3 { + margin-bottom: 0; + + a { + color: $text; + font-size: $h3-font-size; } } - .debates-list { - - @media (min-width: $medium-breakpoint) { - border-left: 1px solid $votes-border; - } - - &:after { - - @media (min-width: $medium-breakpoint) { - content: none; - } - } + a, .info { + color: lighten($text, 15%); + font-size: $small-font-size; } - .proposals-list { - - @media (min-width: $medium-breakpoint) { - border-left: 1px solid #D2B400; - } - - &:after { - border-color: #C9AF00 transparent transparent transparent; - - @media (min-width: $medium-breakpoint) { - content: " "; - } - } - } - - .debates-list, .proposals-list { - margin: rem-calc(6) 0; - - &:after { - content: none; - position: absolute; - display: block; - border-style: solid; - bottom: rem-calc(-20); - border-left-width: 0; - border-right-color: transparent; - right: rem-calc(1); - border-width: rem-calc(14) rem-calc(14) 0 0; - } - } } -.debate-featured, .proposal-featured { - margin-bottom: 0; - margin-top: 0; - padding-left: 0; +.featured-debates { + background: $highlight; +} - .panel { - background: none; - border: 0; - margin-bottom: 0; - padding: 0 rem-calc(12); - - h3 { - font-weight: bold; - margin: rem-calc(8) 0 0 0; - min-height: auto; - - a { - clear: both; - display: block; - font-size: rem-calc(14); - line-height: $line-height; - } - } - } - - .progress { - display: none !important; - } - - .content { - overflow: hidden; - } +.featured-proposals { + background: $featured; .supports { @include supports; background: none; border: 0; - padding: 0; - padding-left: rem-calc(13); - margin-right: rem-calc(-26); + padding-bottom: 0; + padding-top: 0; &:after { content: none; @@ -935,8 +854,12 @@ display: none; } + .button-support { + margin-top: 0; + } + .not-logged, .organizations-votes { - background: #FED900; + background: $featured; color: $warning-color; font-size: $small-font-size; line-height: rem-calc(24); @@ -949,14 +872,12 @@ } .anonymous-votes { - background: #FED900; - padding: 0; - padding-top: rem-calc(6); + background: $featured; p { - font-size: rem-calc(12); - line-height: rem-calc(20); - margin: 0; + color: $text; + font-size: $small-font-size; + line-height: $line-height; } } @@ -967,10 +888,6 @@ text-align: center; } - .button-support { - margin-top: rem-calc(4); - } - .supported { margin-top: 0; } @@ -981,60 +898,12 @@ .social-share-button-facebook, .social-share-button-google_plus { height: rem-calc(33); - } - .social-share-button-twitter:before, - .social-share-button-facebook:before, - .social-share-button-google_plus:before { - font-size: rem-calc(18); - line-height: rem-calc(33); + &:before { + font-size: rem-calc(18); + line-height: rem-calc(33); + } } } } } - -.debate-featured { - background: $votes-bg; - margin-bottom: rem-calc(12) !important; - - .panel h3 a { - color: #0D3F54; - font-size: $h3-font-size; - margin: 0; - } - - .info, .info a { - color: white !important; - font-family: $font-sans; - font-size: $small-font-size; - } - - .content { - height: auto; - } -} - -.proposal-featured { - background: #FED900; - - .panel h3 a { - color: $text; - font-size: $base-font-size; - } - - .info { - color: #806C00 !important; - font-size: $small-font-size; - } - - .content { - height: rem-calc(60); - } -} -.advanced-search-title{ - cursor:pointer; cursor: hand -} - -.blue{ - color: $brand; -} diff --git a/app/assets/stylesheets/variables.scss b/app/assets/stylesheets/variables.scss index 6a61ec72c..eeae89a61 100644 --- a/app/assets/stylesheets/variables.scss +++ b/app/assets/stylesheets/variables.scss @@ -73,7 +73,10 @@ $check: #46DB91; $proposals: #FFA42D; $proposals-border: #CC8425; +$budget: #454372; + $highlight: #E7F2FC; +$featured: #FED900; $footer-bg: #DEE0E2; $footer-color: #171819; diff --git a/app/controllers/concerns/commentable_actions.rb b/app/controllers/concerns/commentable_actions.rb index b4b3c06df..cb023cdf4 100644 --- a/app/controllers/concerns/commentable_actions.rb +++ b/app/controllers/concerns/commentable_actions.rb @@ -66,7 +66,7 @@ module CommentableActions end def tag_cloud - resource_model.tag_counts.order("#{resource_name.pluralize}_count": :desc, name: :asc).limit(20) + resource_model.last_week.tag_counts.order("#{resource_name.pluralize}_count": :desc, name: :asc).limit(5) end def load_featured_tags diff --git a/app/models/debate.rb b/app/models/debate.rb index db11e4b7c..d65779b7a 100644 --- a/app/models/debate.rb +++ b/app/models/debate.rb @@ -35,7 +35,7 @@ class Debate < ActiveRecord::Base scope :sort_by_random, -> { reorder("RANDOM()") } scope :sort_by_relevance, -> { all } scope :sort_by_flags, -> { order(flags_count: :desc, updated_at: :desc) } - + scope :last_week, -> { where("created_at >= ?", 7.days.ago)} # Ahoy setup visitable # Ahoy will automatically assign visit_id on create diff --git a/app/models/proposal.rb b/app/models/proposal.rb index 5c28d9bd4..c7b406be9 100644 --- a/app/models/proposal.rb +++ b/app/models/proposal.rb @@ -41,7 +41,8 @@ class Proposal < ActiveRecord::Base scope :sort_by_random, -> { reorder("RANDOM()") } scope :sort_by_relevance , -> { all } scope :sort_by_flags, -> { order(flags_count: :desc, updated_at: :desc) } - + scope :last_week, -> { where("created_at >= ?", 7.days.ago)} + pg_search_scope :pg_search, { against: { title: 'A', diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb index b27a8a73b..b075755da 100644 --- a/app/views/admin/_menu.html.erb +++ b/app/views/admin/_menu.html.erb @@ -34,7 +34,7 @@
  • > <%= link_to admin_spending_proposals_path do %> - + <%= t("admin.menu.spending_proposals") %> <% end %>
  • diff --git a/app/views/debates/_featured_debates_static.html.erb b/app/views/debates/_featured_debates_static.html.erb index 8fc48a7bc..8f7d0b68d 100644 --- a/app/views/debates/_featured_debates_static.html.erb +++ b/app/views/debates/_featured_debates_static.html.erb @@ -1,41 +1,17 @@ -