From 3b2bfc46cf8cf872d44ea8981a1b258d1ebccbd3 Mon Sep 17 00:00:00 2001 From: MaiteHdezRivas Date: Thu, 19 May 2016 12:47:50 +0200 Subject: [PATCH 01/21] Admin option to add banners and show banners --- app/assets/images/banners/banner1.png | Bin 0 -> 7918 bytes app/assets/images/banners/banner2.png | Bin 0 -> 10257 bytes app/assets/images/banners/banner3.png | Bin 0 -> 10350 bytes app/assets/images/banners/banner4.png | Bin 0 -> 10258 bytes .../javascripts/advanced_search.js.coffee | 2 + app/assets/javascripts/application.js | 2 + app/assets/javascripts/banners.js.coffee | 25 +++++ app/assets/stylesheets/admin.scss | 1 + app/assets/stylesheets/application.scss | 1 + app/assets/stylesheets/banners.scss | 69 ++++++++++++ .../stylesheets/datepicker_overrides.scss | 2 +- app/assets/stylesheets/variables.scss | 1 + app/controllers/admin/banners_controller.rb | 56 ++++++++++ app/controllers/admin/settings_controller.rb | 8 +- .../concerns/commentable_actions.rb | 2 + app/helpers/banners_helper.rb | 5 + app/models/abilities/administrator.rb | 1 + app/models/abilities/banner.rb | 20 ++++ app/models/banner.rb | 20 ++++ app/models/setting.rb | 22 ++++ app/views/admin/_menu.html.erb | 7 ++ app/views/admin/banners/_errors.html.erb | 15 +++ app/views/admin/banners/_form.html.erb | 69 ++++++++++++ app/views/admin/banners/edit.html.erb | 13 +++ app/views/admin/banners/index.html.erb | 45 ++++++++ app/views/admin/banners/new.html.erb | 13 +++ app/views/admin/settings/index.html.erb | 34 ++++++ app/views/debates/index.html.erb | 4 + app/views/proposals/index.html.erb | 4 + app/views/shared/_banner.html.erb | 9 ++ config/i18n-tasks.yml | 1 + config/locales/admin.en.yml | 36 ++++++ config/locales/admin.es.yml | 34 ++++++ config/routes.rb | 4 + db/dev_seeds.rb | 18 +++ db/migrate/20160518141543_create_banners.rb | 18 +++ db/schema.rb | 55 ++++++++- db/seeds.rb | 11 ++ spec/factories.rb | 10 ++ spec/features/admin/banners_spec.rb | 105 ++++++++++++++++++ spec/models/setting_spec.rb | 24 ++++ 41 files changed, 760 insertions(+), 6 deletions(-) create mode 100644 app/assets/images/banners/banner1.png create mode 100644 app/assets/images/banners/banner2.png create mode 100644 app/assets/images/banners/banner3.png create mode 100644 app/assets/images/banners/banner4.png create mode 100644 app/assets/javascripts/banners.js.coffee create mode 100644 app/assets/stylesheets/banners.scss create mode 100644 app/controllers/admin/banners_controller.rb create mode 100644 app/helpers/banners_helper.rb create mode 100644 app/models/abilities/banner.rb create mode 100644 app/models/banner.rb create mode 100644 app/views/admin/banners/_errors.html.erb create mode 100644 app/views/admin/banners/_form.html.erb create mode 100644 app/views/admin/banners/edit.html.erb create mode 100644 app/views/admin/banners/index.html.erb create mode 100644 app/views/admin/banners/new.html.erb create mode 100644 app/views/shared/_banner.html.erb create mode 100644 db/migrate/20160518141543_create_banners.rb create mode 100644 spec/features/admin/banners_spec.rb diff --git a/app/assets/images/banners/banner1.png b/app/assets/images/banners/banner1.png new file mode 100644 index 0000000000000000000000000000000000000000..eff1cb9d78cca22e091b1e1b282994fb0ae28ce4 GIT binary patch literal 7918 zcmaKRcQ{<%+VZIIuc4SWC1UHpm5o1ZX1AcacB?Ul(^I6zPHp@$W>c001O@o>n$k8xvzC zSG2FV%U>DsU|+v0GytHY9_;7h>W#z#?;_njQL22~^-X+0PlPJp9a$3z6F+UFho}C1 z4ASzxsg>(}Z&yVGpSl`QC0OZ7fiDv40u1)`K?NuUtMdIzuhLcj?=YAT_%9Kxw<_Pi zN!gf~1GUi@Bv4jd4&*8!Cl8cY6ql5hmzR;h4V03Qlm$yjgQX=vQqoE?5=t^s!2cY4 zSJp5HHzg=U_dm9-?o|0auvkAOFgPeENIXbd9F1`YODZZVf+eKDQc|ER2~a=?3hNRK zLIv>uqXB{paK(7~VLj0(;9rd{chP}ZRlX~x|DJ-cpNYx;C`JYR$5B@<0|&eKfhENy zz`nkJ=k+h?04x;we`)+z=>V$`KO`863_u5BT(9Ec#{Uoa%6I>NLw^OY*eID{Jg{lsxVeI4H;sub#!!C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MJ=DI&}`K%3vZhJX}lAAd0#7SVZ=QH@{7(J>j#ez=Yh;6NdqfFIim+@egmTO|Lqn z%`{|{bxyVZR>`fqA$075OE;|5neazETX;7H{RBxXmW)QQfDOv+pGH2W^e$%rvZva& zN!twilIQlZo_x9E;Xgv`M4CD~Si;KujhDY#%H$gJ2d@(xPfmdjSL#F3!5>CGYwzxn z^S|N@pMXREd?H`ID`N7t${l(GM(fsjNhJaBGxqBRZT9K>{R3^FV+yI%a*p~x_ujU( literal 0 HcmV?d00001 diff --git a/app/assets/images/banners/banner2.png b/app/assets/images/banners/banner2.png new file mode 100644 index 0000000000000000000000000000000000000000..5b31f5a3a80b60701f7f070fff8a6b3d8d2c6bc2 GIT binary patch literal 10257 zcmeHtXHZjH+jb}lNbiCm2_Op6JE13(fb=2=hz1A{N+_Wh0SQf7Kt!Y?J@h7mbZLSD zQUvKuP>?P?z=!8N?|aTS^StlO^W*#R&73{6vv<~g-PgL;wXXZen%Pl$I_i|ySg!#9 z07?y*ioxY``SP|Qy?XhZyqa!&`3UzjGW9TkdjnnFU2Ks~2%v|rD*}k{LD~WUK9k0A zQ)Hb=q^cKXR`<3g6#5=?5D&K}xAt*U$Z+^I^eU&cu48nez1i>I4^xn9YoFgIwIJmb zG1y9t_9r)9d>FcYEqS5nRB!7X9vPNVzA5>$GPHld5cb+Odh*$s8tTL7YOc4-N%DIR zjd^}Uy7&F9004y%^0FdRZ7s01i?bly#>EOD=;Q2qStrCtp|jRWMqVdMTJB~1uhW+XkU~E+(!U~=K4+XCx;3G zZS9V9^+39yfWJB6RxX|%@|>KPao~T|=j^Jj{onK`^uJWN)I-Pz?kXfAC@kdcEcEvb zw1)xWuY&$<2HNOyV}%S5Xctd+Ys4j->+b}Y0{!n3{vG_=9seHvJMu?;e}{V@ZT|=O z@5o>9%Nn$`!Mg6q%dLewskm5sIwMdX8Y=Rfmk~i5qzzb9R9I3>SXf*@QdH7bKwMZt zL_k{H)>=SZQdkCou$HiqvXTB{=0BvC`3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Lkcw$`P? znrG`58>yS~<)Ln5Y@%_A+%*HBc{*K#lEKX24{}>lo80q$=T_yEjVxD+80%Ohhl;XL zSkf!XsIb8wMpN!(C&fb+?Oa{=1FY#o*viSFh@ds)8m25Q0j5| z?f6|T%Jr|O&$s*ybg;SnFG)Pg+4yUdU-@EE&PKk@%bqqYE0k$*&f0j6ohX^luy`GCH1n;I3`$HxMBK*{HMgnTz3mnLtwr14y%$^E4o+H15ilkSSS z{3?1MoXe`KJ>9ED?PE7B(T`K6>u?%X6O(_{oj(?fJ83$Yi*@C}ZS0pG@g%b_|>? z6v?G@o+ zpZB=GGJBik>E!_n?Swi|V`RN~vYd0DLxu;?DC>8k=e2M7e7quzS->=wg{X1s8IF>1 z(8y=jH@$(F+EoV^mG{BW>o>@sk3 z>UQxX%ec;!qMGD9992R2ipq|JWldhn;PA|dp&Zl#Q+0XTB+R-=pKA3_S<0PrY zYkzSrUx0Si^&-09sN$6p6IZJTZFWTaSN(sN2lqhgud(EL`J39r1OL94ZP6VImWS+f^&&GYjJ z(>oQyaoOcc3rbmgI6nrouHnwkxmm4epmBdK#u<_$GBp$e6)jr;C_vPSY74=K6lkIk zBc})V0s822k@en{7mWcGKrG?OHFrXV_$cWKst$Qh8XVIlRNUDQFJW3)!y zAbBGvPpOH1rsW}(jBP@!OA}!LRja96VG%Q|{0eSXYfE#u?WOSb%?Q@u6Q_SaFn68d zT?_kcu5WV>Y0P@;<Z*?EAi4sP?i>SfS4Yi`t7IbXcja@RUS#qa!vkwK#~gqEaSpAef29<0FZlle575Sk literal 0 HcmV?d00001 diff --git a/app/assets/javascripts/advanced_search.js.coffee b/app/assets/javascripts/advanced_search.js.coffee index a5e657633..b38efb874 100644 --- a/app/assets/javascripts/advanced_search.js.coffee +++ b/app/assets/javascripts/advanced_search.js.coffee @@ -23,6 +23,8 @@ App.AdvancedSearch = $('.js-calendar').datepicker regional: locale maxDate: "+0d" + $('.js-calendar-full').datepicker + regional: locale initialize: -> App.AdvancedSearch.init_calendar() diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index e24d144bb..a1b8dd70a 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -44,6 +44,7 @@ //= require tracks //= require valuation_spending_proposal_form //= require embed_video +//= require banners var initialize_modules = function() { App.Comments.initialize(); @@ -63,6 +64,7 @@ var initialize_modules = function() { App.Tracks.initialize(); App.ValuationSpendingProposalForm.initialize(); App.EmbedVideo.initialize(); + App.Banners.initialize(); }; $(function(){ diff --git a/app/assets/javascripts/banners.js.coffee b/app/assets/javascripts/banners.js.coffee new file mode 100644 index 000000000..ec00abe95 --- /dev/null +++ b/app/assets/javascripts/banners.js.coffee @@ -0,0 +1,25 @@ +App.Banners = + + update_banner: (selector, text) -> + $(selector).html(text) + + update_style: (selector, style) -> + $(selector).removeClass($(selector).attr("class"), true) + .addClass(style, true) + + initialize: -> + $('[data-js-banner-title]').on + change: -> + App.Banners.update_banner("#js-banner-title", $(this).val()) + + $('[data-js-banner-description]').on + change: -> + App.Banners.update_banner("#js-banner-description", $(this).val()) + + $("#banner_style").on + change: -> + App.Banners.update_style("#js-banner-style", $(this).val()) + + $("#banner_image").on + change: -> + App.Banners.update_style("#js-banner-image", $(this).val()) diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index 48642841d..0def1c8a5 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -106,6 +106,7 @@ body.admin { a { color: white\9 !important; + color: red\9 !important; } ul { diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 71e74c251..92ae33b74 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -13,3 +13,4 @@ @import "annotator_overrides"; @import "jquery-ui/datepicker"; @import "datepicker_overrides"; +@import "banners"; diff --git a/app/assets/stylesheets/banners.scss b/app/assets/stylesheets/banners.scss new file mode 100644 index 000000000..a14ce6257 --- /dev/null +++ b/app/assets/stylesheets/banners.scss @@ -0,0 +1,69 @@ +// Place all the styles related to the banner controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ + +// 01. Banners +// - - - - - - - - - - - - - - - - - - - - - - - - - + +.banner-style-one { + background-color: $brand; +} + +.banner-style-two { + background-color: $budget; +} + +.banner-style-three { + background-color: #33DADF; +} + +@media (min-width: $medium-breakpoint) { + + .banner-img-one { + background-image: image-url('banners/banner1.png'); + } + + .banner-img-two { + background-image: image-url('banners/banner2.png'); + } + + .banner-img-three { + background-image: image-url('banners/banner3.png'); + } +} + +.banner-img-one, .banner-img-two, .banner-img-three { + background-position: bottom right; + background-repeat: no-repeat; +} + +.banner-style-one, .banner-style-two, .banner-style-three { + margin: 0; + margin-bottom: $line-height; + + h2, h3, a { + color: #eaeaf2; + } + + h2 { + padding: $line-height/2; + padding-bottom: 0; + } + + h3 { + padding: $line-height/2; + padding-top: 0; + } + + a:hover h2, a:hover h3 { + color: #eaeaf2 !important; + text-decoration: none; + } + + @media (min-width: $medium-breakpoint) { + + h3 { + width: 80%; + } + } +} \ No newline at end of file diff --git a/app/assets/stylesheets/datepicker_overrides.scss b/app/assets/stylesheets/datepicker_overrides.scss index abab720e0..9e6419243 100644 --- a/app/assets/stylesheets/datepicker_overrides.scss +++ b/app/assets/stylesheets/datepicker_overrides.scss @@ -51,7 +51,7 @@ border-right: 1px solid $dark; tr th { - color: white; + color: $dark; } } diff --git a/app/assets/stylesheets/variables.scss b/app/assets/stylesheets/variables.scss index 5d59ebf8f..9c621fbd2 100644 --- a/app/assets/stylesheets/variables.scss +++ b/app/assets/stylesheets/variables.scss @@ -77,6 +77,7 @@ $budget: #454372; $budget-hover: #7571BF; $highlight: #E7F2FC; +$highlight-dark: #33DADF; $featured: #FED900; $footer-bg: #DEE0E2; diff --git a/app/controllers/admin/banners_controller.rb b/app/controllers/admin/banners_controller.rb new file mode 100644 index 000000000..dbf683b9a --- /dev/null +++ b/app/controllers/admin/banners_controller.rb @@ -0,0 +1,56 @@ +class Admin::BannersController < Admin::BaseController + + has_filters %w{all with_active with_inactive}, only: :index + + before_action :find_banner, only: [:edit, :update, :destroy] + before_action :banner_styles, only: [:edit, :new, :create, :update] + before_action :banner_imgs, only: [:edit, :new, :create, :update] + + respond_to :html, :js + + load_and_authorize_resource + + def index + @banners = Banner.send(@current_filter).page(params[:page]) + end + + def create + @banner = Banner.new(banner_params) + if @banner.save + redirect_to admin_banners_path + else + render :new + end + end + + def update + @banner.assign_attributes(banner_params) + if @banner.update(banner_params) + redirect_to admin_banners_path + else + render :edit + end + end + + def destroy + @banner.destroy + redirect_to admin_banners_path + end + + private + def banner_params + params.require(:banner).permit(:title, :description, :target_url, :style, :image, :post_started_at, :post_ended_at) + end + + def find_banner + @banner = Banner.find(params[:id]) + end + + def banner_styles + @banner_styles = Setting.all.banner_style.map { |banner_style| [banner_style.value, banner_style.key.split('.')[1]] } + end + + def banner_imgs + @banner_imgs = Setting.all.banner_img.map { |banner_img| [banner_img.value, banner_img.key.split('.')[1]] } + end +end \ No newline at end of file diff --git a/app/controllers/admin/settings_controller.rb b/app/controllers/admin/settings_controller.rb index 387f38177..17bd364f3 100644 --- a/app/controllers/admin/settings_controller.rb +++ b/app/controllers/admin/settings_controller.rb @@ -1,9 +1,11 @@ class Admin::SettingsController < Admin::BaseController def index - all_settings = (Setting.all).group_by { |s| s.feature_flag? } - @settings = all_settings[false] - @feature_flags = all_settings[true] + all_settings = (Setting.all).group_by { |s| s.type } + @settings = all_settings['common'] + @feature_flags = all_settings['feature'] + @banner_styles = all_settings['banner-style'] + @banner_imgs = all_settings['banner-img'] end def update diff --git a/app/controllers/concerns/commentable_actions.rb b/app/controllers/concerns/commentable_actions.rb index de2a2276a..3a79238ea 100644 --- a/app/controllers/concerns/commentable_actions.rb +++ b/app/controllers/concerns/commentable_actions.rb @@ -11,6 +11,8 @@ module CommentableActions index_customization if index_customization.present? @tag_cloud = tag_cloud + @banners = Banner.with_active + set_resource_votes(@resources) set_resources_instance end diff --git a/app/helpers/banners_helper.rb b/app/helpers/banners_helper.rb new file mode 100644 index 000000000..548513c7d --- /dev/null +++ b/app/helpers/banners_helper.rb @@ -0,0 +1,5 @@ +module BannersHelper + def has_banners + @banners.count > 0 + end +end \ No newline at end of file diff --git a/app/models/abilities/administrator.rb b/app/models/abilities/administrator.rb index 6b77c130d..0dfce6d3e 100644 --- a/app/models/abilities/administrator.rb +++ b/app/models/abilities/administrator.rb @@ -42,6 +42,7 @@ module Abilities can :manage, Annotation can [:read, :update, :destroy, :summary], SpendingProposal + can [:search, :edit, :update, :create, :index, :destroy], Banner end end end diff --git a/app/models/abilities/banner.rb b/app/models/abilities/banner.rb new file mode 100644 index 000000000..db8f10635 --- /dev/null +++ b/app/models/abilities/banner.rb @@ -0,0 +1,20 @@ +class Banner < ActiveRecord::Base + + acts_as_paranoid column: :hidden_at + include ActsAsParanoidAliases + + validates :title, presence: true, + length: { minimum: 2 } + validates :description, presence: true + validates :target_url, presence: true + validates :style, presence: true + validates :image, presence: true + validates :post_started_at, presence: true + validates :post_ended_at, presence: true + + scope :with_active, -> {where("post_started_at <= ?", Time.now). + where("post_ended_at >= ?", Time.now) } + + scope :with_inactive,-> {where("post_started_at > ? or post_ended_at < ?", Time.now, Time.now) } + +end \ No newline at end of file diff --git a/app/models/banner.rb b/app/models/banner.rb new file mode 100644 index 000000000..db8f10635 --- /dev/null +++ b/app/models/banner.rb @@ -0,0 +1,20 @@ +class Banner < ActiveRecord::Base + + acts_as_paranoid column: :hidden_at + include ActsAsParanoidAliases + + validates :title, presence: true, + length: { minimum: 2 } + validates :description, presence: true + validates :target_url, presence: true + validates :style, presence: true + validates :image, presence: true + validates :post_started_at, presence: true + validates :post_ended_at, presence: true + + scope :with_active, -> {where("post_started_at <= ?", Time.now). + where("post_ended_at >= ?", Time.now) } + + scope :with_inactive,-> {where("post_started_at > ? or post_ended_at < ?", Time.now, Time.now) } + +end \ No newline at end of file diff --git a/app/models/setting.rb b/app/models/setting.rb index 40659ed74..9010abba5 100644 --- a/app/models/setting.rb +++ b/app/models/setting.rb @@ -2,6 +2,20 @@ class Setting < ActiveRecord::Base validates :key, presence: true, uniqueness: true default_scope { order(id: :asc) } + scope :banner_style, -> { where("key ilike ?", "banner-style.%")} + scope :banner_img, -> { where("key ilike ?", "banner-img.%")} + + def type + if feature_flag? + 'feature' + elsif banner_style? + 'banner-style' + elsif banner_img? + 'banner-img' + else + 'common' + end + end def feature_flag? key.start_with?('feature.') @@ -11,6 +25,14 @@ class Setting < ActiveRecord::Base feature_flag? && value.present? end + def banner_style? + key.start_with?('banner-style.') + end + + def banner_img? + key.start_with?('banner-img.') + end + class << self def [](key) where(key: key).pluck(:value).first.presence diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb index bf0382dbd..f8437906f 100644 --- a/app/views/admin/_menu.html.erb +++ b/app/views/admin/_menu.html.erb @@ -43,6 +43,13 @@ <% end %> +
  • > + <%= link_to admin_banners_path do %> + + <%= t("admin.menu.banner") %> + <% end %> +
  • +
  • > <%= link_to admin_users_path do %> diff --git a/app/views/admin/banners/_errors.html.erb b/app/views/admin/banners/_errors.html.erb new file mode 100644 index 000000000..e50720971 --- /dev/null +++ b/app/views/admin/banners/_errors.html.erb @@ -0,0 +1,15 @@ + +<% if @banner.errors.any? %> + +
    + + + + <%= @banner.errors.count %> + <%= t("admin.banners.errors.form.error", count: @banner.errors.count) %> + +
    + +<% end %> \ No newline at end of file diff --git a/app/views/admin/banners/_form.html.erb b/app/views/admin/banners/_form.html.erb new file mode 100644 index 000000000..dce669777 --- /dev/null +++ b/app/views/admin/banners/_form.html.erb @@ -0,0 +1,69 @@ +<%= form_for [:admin, @banner] do |f| %> + + <%= render 'errors' %> + +
    +
    + <%= f.label :style, t("admin.banners.banner.style") %> + <%= f.select :style, options_for_select(@banner_styles, @banner.style),:include_blank => '-', + label: false,placeholder: t("admin.banners.banner.style") %> +
    +
    + <%= f.label :image, t("admin.banners.banner.image") %> + <%= f.select :image, options_for_select(@banner_imgs, @banner.image),:include_blank => '-', + label: false, placeholder: t("admin.banners.banner.image") %> +
    +
    + <%= f.label :title, t("admin.banners.banner.title") %> + <%= f.text_field :title, placeholder: t("admin.banners.banner.title"), label: false, + data: {js_banner_title: "js_banner_title"} %> +
    + +
    + <%= f.label :description, t("admin.banners.banner.description") %> + <%= f.text_field :description, + label: false, + data: {js_banner_description: "js_banner_description"}, + placeholder: t("admin.banners.banner.description") %> +
    + +
    + <%= f.label :target_url, t("admin.banners.banner.target_url") %> + <%= f.text_field :target_url, + label: false, + placeholder: t("admin.banners.banner.target_url") %> +
    + <% date_started_at = @banner.post_started_at.present? ? I18n.localize(@banner.post_started_at) : "" %> +
    + <%= f.label :post_started_at, t("admin.banners.banner.post_started_at") %> + <%= f.text_field :post_started_at, + label: false, + placeholder: t("admin.banners.banner.post_started_at"), + value: date_started_at, + class: "js-calendar-full", + id: "post_started_at" %> +
    + <% date_ended_at = @banner.post_ended_at.present? ? I18n.localize(@banner.post_ended_at) : ""%> +
    + <%= f.label :post_ended_at, t("admin.banners.banner.post_ended_at") %> + <%= f.text_field :post_ended_at, + label: false, + placeholder: t("admin.banners.banner.post_ended_at"), + value: date_ended_at, + class: "js-calendar-full", + id: "post_ended_at" %> +
    + +
    + <%= f.submit(class: "button", value: t("admin.banners.edit.form.submit_button")) %> +
    +
    +
    +
    + <%= link_to @banner.target_url do %> +

    <%= @banner.title %>

    +

    <%= @banner.description %>

    + <% end %> +
    +
    +<% end %> \ No newline at end of file diff --git a/app/views/admin/banners/edit.html.erb b/app/views/admin/banners/edit.html.erb new file mode 100644 index 000000000..9f2ad0ac0 --- /dev/null +++ b/app/views/admin/banners/edit.html.erb @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/app/views/admin/banners/index.html.erb b/app/views/admin/banners/index.html.erb new file mode 100644 index 000000000..84395f644 --- /dev/null +++ b/app/views/admin/banners/index.html.erb @@ -0,0 +1,45 @@ +<%= link_to t("admin.banners.index.create"), + new_admin_banner_path, class: "button large success float-right" %> + +

    <%= t("admin.banners.index.title") %>

    + +<%= render 'shared/filter_subnav', i18n_namespace: "admin.banners.index" %> + +

    <%= page_entries_info @banners %>

    + + + <% @banners.each do |banner| %> + + + + + + <% end %> +
    +
    +
    + <%= link_to banner.target_url do %> +

    <%= banner.title %>

    +

    <%= banner.description %>

    + <% end %> +
    +
    + + <%= t("admin.banners.banner.post_started_at")%> <%= banner.post_started_at %> +  |  + <%= t("admin.banners.banner.post_ended_at")%> <%= banner.post_ended_at%> +
    + <%= link_to edit_admin_banner_path(banner), + class: 'edit-banner button' do %> + + <%= t("admin.banners.index.edit") %> + <% end %> + + <%= link_to admin_banner_path(banner), method: :delete, + class: 'delete' do %> + + <%= t("admin.banners.index.delete") %> + <% end %> +
    + +<%= paginate @banners %> \ No newline at end of file diff --git a/app/views/admin/banners/new.html.erb b/app/views/admin/banners/new.html.erb new file mode 100644 index 000000000..41a48084d --- /dev/null +++ b/app/views/admin/banners/new.html.erb @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/app/views/admin/settings/index.html.erb b/app/views/admin/settings/index.html.erb index b18a1eb39..44aa09026 100644 --- a/app/views/admin/settings/index.html.erb +++ b/app/views/admin/settings/index.html.erb @@ -32,3 +32,37 @@
  • <% end %> + +<% if @banner_styles.present? %> +

    <%= t("admin.settings.index.banners") %>

    + +
      + <% @banner_styles.each do |setting| %> +
    • + <%= t("settings.#{setting.key}") %> + + <%= form_for(setting, url: admin_setting_path(setting), html: { id: "edit_#{dom_id(setting)}"}) do |f| %> + <%= f.text_area :value, label: false, id: dom_id(setting), lines: 1 %> + <%= f.submit(t('admin.settings.index.update_setting'), class: "button small success") %> + <% end %> +
    • + <% end %> +
    +<% end %> + +<% if @banner_imgs.present?%> +

    <%= t("admin.settings.index.banner_imgs") %>

    + +
      + <% @banner_imgs.each do |setting| %> +
    • + <%= t("settings.#{setting.key}") %> + + <%= form_for(setting, url: admin_setting_path(setting), html: { id: "edit_#{dom_id(setting)}"}) do |f| %> + <%= f.text_area :value, label: false, id: dom_id(setting), lines: 1 %> + <%= f.submit(t('admin.settings.index.update_setting'), class: "button small success") %> + <% end %> +
    • + <% end %> +
    +<% end %> diff --git a/app/views/debates/index.html.erb b/app/views/debates/index.html.erb index ab0a137c7..6809782b1 100644 --- a/app/views/debates/index.html.erb +++ b/app/views/debates/index.html.erb @@ -25,6 +25,10 @@ <% end %> + <% if has_banners %> + <%= render "shared/banner" %> + <% end %> + <% unless @tag_filter || @search_terms || !has_featured? %> <%= render "featured_debates" %> <% end %> diff --git a/app/views/proposals/index.html.erb b/app/views/proposals/index.html.erb index 67ee98f67..6f6516890 100644 --- a/app/views/proposals/index.html.erb +++ b/app/views/proposals/index.html.erb @@ -27,6 +27,10 @@ <% end %> + <% if has_banners %> + <%= render "shared/banner" %> + <% end %> + <% if @featured_proposals.present? %> + +
    + +

    <%= page_entries_info @managers %>

    + + + <% @managers.each do |manager| %> + + + + + + <% end %> +
    + <%= manager.name %> + + <%= manager.email %> + + <% if manager.persisted? %> + <%= link_to t('admin.managers.manager.delete'), + admin_manager_path(manager), + method: :delete, + class: "button hollow alert" + %> + <% else %> + <%= link_to t('admin.managers.manager.add'),{ controller: "admin/managers", action: :create, user_id: manager.user_id }, + method: :post, class: "button success" %> + <% end %> +
    <%= paginate @managers %> diff --git a/app/views/admin/managers/search.js.erb b/app/views/admin/managers/search.js.erb index 0f0fd09cd..e54b84293 100644 --- a/app/views/admin/managers/search.js.erb +++ b/app/views/admin/managers/search.js.erb @@ -1 +1 @@ -$("#search-result").html("
    <%= j render 'manager', manager: @manager %>
    "); +$("#search-result").html("<%= j render 'manager', manager: @manager %>"); diff --git a/app/views/admin/managers/user_not_found.js.erb b/app/views/admin/managers/user_not_found.js.erb index 0116de21d..53e9d7e20 100644 --- a/app/views/admin/managers/user_not_found.js.erb +++ b/app/views/admin/managers/user_not_found.js.erb @@ -1 +1 @@ -$("#search-result").html("
    <%= j t('admin.managers.search.user_not_found') %>
    "); +$("#search-result").html("
    <%= j t('admin.managers.search.user_not_found') %>
    "); diff --git a/app/views/admin/moderators/_moderator.html.erb b/app/views/admin/moderators/_moderator.html.erb index 0f01b47b9..57a29d2e8 100644 --- a/app/views/admin/moderators/_moderator.html.erb +++ b/app/views/admin/moderators/_moderator.html.erb @@ -1,13 +1,26 @@ -<%= moderator.name %> - •  -<%= moderator.email %> -<% if moderator.persisted? %> - <%= link_to t('admin.moderators.moderator.delete'), - admin_moderator_path(moderator), - method: :delete, - class: "button small alert float-right" - %> -<% else %> - <%= link_to t('admin.moderators.moderator.add'),{ controller: "admin/moderators", action: :create, user_id: moderator.user_id }, - method: :post, class: "button small success float-right" %> -<% end %> +
    + + + + + + + + +
    + <%= moderator.name %> + + <%= moderator.email %> + + <% if moderator.persisted? %> + <%= link_to t('admin.moderators.moderator.delete'), + admin_moderator_path(moderator), + method: :delete, + class: "button hollow alert" %> + <% else %> + <%= link_to t('admin.moderators.moderator.add'),{ controller: "admin/moderators", action: :create, user_id: moderator.user_id }, + method: :post, + class: "button success" %> + <% end %> +
    +
    diff --git a/app/views/admin/moderators/index.html.erb b/app/views/admin/moderators/index.html.erb index 7c39f3234..d2a5d45e0 100644 --- a/app/views/admin/moderators/index.html.erb +++ b/app/views/admin/moderators/index.html.erb @@ -1,24 +1,46 @@

    <%= t("admin.moderators.index.title") %>

    +
    -
    - <%= form_tag search_admin_moderators_path, method: :get, remote: true do %> -
    - <%= text_field_tag :email, '', placeholder: t('admin.moderators.search.email_placeholder') %> -
    -
    - <%= submit_tag t('admin.moderators.search.search'), class: 'button' %> -
    - <% end %> -
    -
    -
    -

    <%= page_entries_info @moderators %>

    -
      - <% @moderators.each do |moderator| %> -
    • - <%= render 'moderator', moderator: moderator %> -
    • + <%= form_tag search_admin_moderators_path, method: :get, remote: true do %> +
      + <%= text_field_tag :email, '', placeholder: t('admin.moderators.search.email_placeholder') %> +
      +
      + <%= submit_tag t('admin.moderators.search.search'), class: 'button' %> +
      <% end %> -
    + + +
    + +

    <%= page_entries_info @moderators %>

    + + + <% @moderators.each do |moderator| %> + + + + + + <% end %> +
    + <%= moderator.name %> + + <%= moderator.email %> + + <% if moderator.persisted? %> + <%= link_to t('admin.moderators.moderator.delete'), + admin_moderator_path(moderator), + method: :delete, + class: "button hollow alert" + %> + <% else %> + <%= link_to t('admin.moderators.moderator.add'), + { controller: "admin/moderators", action: :create, + user_id: moderator.user_id }, + method: :post, + class: "button success" %> + <% end %> +
    <%= paginate @moderators %> diff --git a/app/views/admin/moderators/search.js.erb b/app/views/admin/moderators/search.js.erb index a6ac48206..887d8aa3a 100644 --- a/app/views/admin/moderators/search.js.erb +++ b/app/views/admin/moderators/search.js.erb @@ -1 +1 @@ -$("#search-result").html("
    <%= j render 'moderator', moderator: @moderator %>
    "); +$("#search-result").html("<%= j render 'moderator', moderator: @moderator %>"); diff --git a/app/views/admin/moderators/user_not_found.js.erb b/app/views/admin/moderators/user_not_found.js.erb index a3f86936c..a8573236c 100644 --- a/app/views/admin/moderators/user_not_found.js.erb +++ b/app/views/admin/moderators/user_not_found.js.erb @@ -1 +1 @@ -$("#search-result").html("
    <%= j t('admin.moderators.search.user_not_found') %>
    "); +$("#search-result").html("
    <%= j t('admin.moderators.search.user_not_found') %>
    "); diff --git a/app/views/admin/officials/edit.html.erb b/app/views/admin/officials/edit.html.erb index defbaa483..10ec9b23f 100644 --- a/app/views/admin/officials/edit.html.erb +++ b/app/views/admin/officials/edit.html.erb @@ -1,15 +1,20 @@ -

    - <%= t("admin.officials.edit.title") %> - <%= @user.name %> (<%= @user.email %>) -

    +<%= render 'shared/back_link' %> -<%= 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 small secondary" %> - <%= f.submit %> +
    - <% if @user.official? %> - <%= link_to t("admin.officials.edit.destroy"), admin_official_path(@user), method: :delete, class: 'delete' %> +
    <%= @user.name %> (<%= @user.email %>)
    + +

    <%= t("admin.officials.edit.title") %>

    + +
    +
    + <%= form_for @user, url: admin_official_path(@user) do |f| %> + <%= f.text_field :official_position %> + <%= f.select :official_level, official_level_options %> + <% if @user.official? %> + <%= link_to t("admin.officials.edit.destroy"), admin_official_path(@user), method: :delete, class: 'button hollow alert' %> + <% end %> + <%= f.submit class: "button hollow" %> <% end %> -<% end %> +
    +
    diff --git a/app/views/admin/officials/index.html.erb b/app/views/admin/officials/index.html.erb index ea0e8dccf..078d5bbbc 100644 --- a/app/views/admin/officials/index.html.erb +++ b/app/views/admin/officials/index.html.erb @@ -4,20 +4,24 @@

    <%= page_entries_info @officials %>

    -
      -<% @officials.each do |official| %> -
    • - <%= link_to official.name, edit_admin_official_path(official) %> -  •  - <%= t("admin.officials.level_#{official.official_level}") %> -  •  - - <%= official.official_position %> - - - <%= link_to official.official? ? t("admin.officials.search.edit_official") : t("admin.officials.search.make_official"), edit_admin_official_path(official), class: "button small float-right" %> -
    • -<% end %> -
    + + <% @officials.each do |official| %> + + + + + + <% end %> +
    + <%= link_to official.name, edit_admin_official_path(official) %> + + + <%= official.official_position %> + + (<%= t("admin.officials.level_#{official.official_level}") %>) + + <%= link_to official.official? ? t("admin.officials.search.edit_official") : t("admin.officials.search.make_official"), + edit_admin_official_path(official), class: "button hollow" %> +
    <%= paginate @officials %> diff --git a/app/views/admin/officials/search.html.erb b/app/views/admin/officials/search.html.erb index c7a7dc2a6..f2d90c143 100644 --- a/app/views/admin/officials/search.html.erb +++ b/app/views/admin/officials/search.html.erb @@ -4,18 +4,22 @@

    <%= page_entries_info @users %>

    -
      + <% @users.each do |user| %> -
    • - <%= link_to user.name, edit_admin_official_path(user) %> -  •  - - <%= user.official_position %> - -  •  - <%= t("admin.officials.level_#{user.official_level}") %> - - <%= link_to user.official? ? t("admin.officials.search.edit_official") : t("admin.officials.search.make_official"), edit_admin_official_path(user), class: "button small float-right" %> -
    • + + + + + <% end %> - +
      + <%= link_to user.name, edit_admin_official_path(user) %> + + + <%= user.official_position %> + + (<%= t("admin.officials.level_#{user.official_level}") %>) + + <%= link_to user.official? ? t("admin.officials.search.edit_official") : t("admin.officials.search.make_official"), + edit_admin_official_path(user), class: "button hollow" %> +
      diff --git a/app/views/admin/organizations/index.html.erb b/app/views/admin/organizations/index.html.erb index ec834eebf..0ddee4247 100644 --- a/app/views/admin/organizations/index.html.erb +++ b/app/views/admin/organizations/index.html.erb @@ -22,12 +22,12 @@ <% @organizations.each do |organization| %> <% hidden += 1 and next if organization.user.nil? || organization.user.hidden? %> - <%= organization.name %> - <%= organization.email %> - <%= organization.phone_number %> - <%= organization.responsible_name %> +

      <%= organization.name %>

      +

      <%= organization.email %>

      +

      <%= organization.phone_number %>

      +

      <%= organization.responsible_name %>

      <% if organization.verified? %> - + <%= t("admin.organizations.index.verified") %> @@ -36,27 +36,32 @@ <%= link_to t("admin.organizations.index.verify"), verify_admin_organization_path(organization, request.query_parameters), - method: :put, class: "button small success" + method: :put, class: "button success expanded" %> <% end %> <% if organization.rejected? %> - + <%= t("admin.organizations.index.rejected") %> <% end %> <% if can? :reject, organization %> - <%= link_to t("admin.organizations.index.reject"), + + <%= link_to t("admin.organizations.index.reject"), reject_admin_organization_path(organization, request.query_parameters), - method: :put, class: "button small alert" - %> + method: :put, class: "button hollow alert expanded" + %> <% end %> <% end %> -<%= t("admin.organizations.index.hidden_count", count: hidden) if hidden > 0 %> +<% if hidden > 0 %> +
      + <%= t("admin.organizations.index.hidden_count_html", count: hidden) %> +
      +<% end %> <%= paginate @organizations %> diff --git a/app/views/admin/organizations/search.html.erb b/app/views/admin/organizations/search.html.erb index 9e90975ab..5b5071c5b 100644 --- a/app/views/admin/organizations/search.html.erb +++ b/app/views/admin/organizations/search.html.erb @@ -18,12 +18,12 @@ <% @organizations.each do |organization| %> - - - - + + + + <% if organization.verified? %> - @@ -32,12 +32,12 @@ <% end %> <% if organization.rejected? %> - @@ -45,7 +45,7 @@ <% if can? :reject, organization %> <% end %> diff --git a/app/views/admin/proposals/index.html.erb b/app/views/admin/proposals/index.html.erb index 8df15af87..cbe1e6d74 100644 --- a/app/views/admin/proposals/index.html.erb +++ b/app/views/admin/proposals/index.html.erb @@ -22,19 +22,17 @@

      <%= proposal.question %>

      - - diff --git a/app/views/admin/settings/index.html.erb b/app/views/admin/settings/index.html.erb index 44aa09026..14c89b776 100644 --- a/app/views/admin/settings/index.html.erb +++ b/app/views/admin/settings/index.html.erb @@ -1,68 +1,97 @@

      <%= t("admin.settings.index.title") %>

      -
        - <% @settings.each do |setting| %> -
      • - <%= t("settings.#{setting.key}") %> - - <%= form_for(setting, url: admin_setting_path(setting), html: { id: "edit_#{dom_id(setting)}"}) do |f| %> - <%= f.text_area :value, label: false, id: dom_id(setting), lines: 1 %> - <%= f.submit(t('admin.settings.index.update_setting'), class: "button small success") %> - <% end %> -
      • - <% end %> -
      +
      <%= organization.name %><%= organization.email %><%= organization.phone_number %><%= organization.responsible_name %>

      <%= organization.name %>

      <%= organization.email %>

      <%= organization.phone_number %>

      <%= organization.responsible_name %>

      + <%= t("admin.organizations.index.verified") %> <%= link_to t("admin.organizations.index.verify"), verify_admin_organization_path(organization, request.query_parameters), - method: :put, class: "button small success" + method: :put, class: "button success expanded" %> + <%= t("admin.organizations.index.rejected") %> <%= link_to t("admin.organizations.index.reject"), reject_admin_organization_path(organization, request.query_parameters), - method: :put, class: "button small alert" + method: :put, class: "button hollow alert expanded" %> + <%= link_to t("admin.actions.restore"), restore_admin_proposal_path(proposal, request.query_parameters), method: :put, data: { confirm: t("admin.actions.confirm") }, - class: "button small success no-margin" %> - + class: "button hollow on-hover" %> <% unless proposal.confirmed_hide? %> <%= link_to t("admin.actions.confirm_hide"), confirm_hide_admin_proposal_path(proposal, request.query_parameters), method: :put, - class: "button small warning float-right" %> + class: "button hollow warning on-hover" %> <% end %>
      + + <% @settings.each do |setting| %> + + + + + <% end %> + +
      + <%= t("settings.#{setting.key}") %> + + <%= form_for(setting, url: admin_setting_path(setting), html: { id: "edit_#{dom_id(setting)}"}) do |f| %> +
      + <%= f.text_area :value, label: false, id: dom_id(setting), lines: 1 %> +
      +
      + <%= f.submit(t('admin.settings.index.update_setting'), class: "button hollow expanded") %> +
      + <% end %> +

      <%= t("admin.settings.index.feature_flags") %>

      -
        - <% @feature_flags.each do |feature_flag| %> -
      • - <%= t("settings.#{feature_flag.key}") %> + + + <% @feature_flags.each do |feature_flag| %> + + -
        - <%= feature_flag.enabled? ? t("admin.settings.index.features.enabled") : t("admin.settings.index.features.disabled") %> -
        +
        - <%= form_for(feature_flag, url: admin_setting_path(feature_flag), html: { id: "edit_#{dom_id(feature_flag)}"}) do |f| %> + + + <% end %> + +
        + <%= t("settings.#{feature_flag.key}") %> + + <%= feature_flag.enabled? ? t("admin.settings.index.features.enabled") : t("admin.settings.index.features.disabled") %> + + <%= form_for(feature_flag, url: admin_setting_path(feature_flag), html: { id: "edit_#{dom_id(feature_flag)}"}) do |f| %> - <%= f.hidden_field :value, id: dom_id(feature_flag), value: (feature_flag.enabled? ? "" : "active") %> - <%= f.submit(t("admin.settings.index.features.#{feature_flag.enabled? ? 'disable' : 'enable'}"), class: "button small #{feature_flag.enabled? ? 'warning' : 'success'}", data: {confirm: t("admin.actions.confirm")}) %> - <% end %> - - <% end %> - + <%= f.hidden_field :value, id: dom_id(feature_flag), value: (feature_flag.enabled? ? "" : "active") %> + <%= f.submit(t("admin.settings.index.features.#{feature_flag.enabled? ? 'disable' : 'enable'}"), + class: "button expanded #{feature_flag.enabled? ? 'hollow alert' : 'success'}", + data: {confirm: t("admin.actions.confirm")}) %> + <% end %> +
        <% if @banner_styles.present? %>

        <%= t("admin.settings.index.banners") %>

        -
          + + <% @banner_styles.each do |setting| %> -
        • - <%= t("settings.#{setting.key}") %> +
        • + - <%= form_for(setting, url: admin_setting_path(setting), html: { id: "edit_#{dom_id(setting)}"}) do |f| %> - <%= f.text_area :value, label: false, id: dom_id(setting), lines: 1 %> - <%= f.submit(t('admin.settings.index.update_setting'), class: "button small success") %> - <% end %> - + + <% end %> - -<% end %> + +
          + <%= t("settings.#{setting.key}") %> + + <%= form_for(setting, url: admin_setting_path(setting), html: { id: "edit_#{dom_id(setting)}"}) do |f| %> + <%= f.text_area :value, label: false, id: dom_id(setting), lines: 1 %> + <%= f.submit(t('admin.settings.index.update_setting'), class: "button hollow") %> + <% end %> +
          +<% end %> <% if @banner_imgs.present?%>

          <%= t("admin.settings.index.banner_imgs") %>

          -
            - <% @banner_imgs.each do |setting| %> -
          • - <%= t("settings.#{setting.key}") %> + + + <% @banner_imgs.each do |setting| %> + + - <%= form_for(setting, url: admin_setting_path(setting), html: { id: "edit_#{dom_id(setting)}"}) do |f| %> - <%= f.text_area :value, label: false, id: dom_id(setting), lines: 1 %> - <%= f.submit(t('admin.settings.index.update_setting'), class: "button small success") %> - <% end %> - + + <% end %> - + +
            + <%= t("settings.#{setting.key}") %> + + <%= form_for(setting, url: admin_setting_path(setting), html: { id: "edit_#{dom_id(setting)}"}) do |f| %> + <%= f.text_area :value, label: false, id: dom_id(setting), lines: 1 %> + <%= f.submit(t('admin.settings.index.update_setting'), class: "button small success") %> + <% end %> +
            <% end %> diff --git a/app/views/admin/tags/index.html.erb b/app/views/admin/tags/index.html.erb index 5e5ca5c99..c1eda4b30 100644 --- a/app/views/admin/tags/index.html.erb +++ b/app/views/admin/tags/index.html.erb @@ -22,29 +22,29 @@

            <%= t("admin.tags.index.title") %>: <%= page_entries_info @tags %>

            -
              + <% @tags.each do |tag| %> -
            • - <%= tag.name %> +
            • + + <% end %> - +
              + <%= form_for(tag, + url: admin_tag_path(tag), + as: :tag, + html: { id: "edit_tag_#{tag.id}", class: "text-right"}) do |f| %> - <%= form_for(tag, - url: admin_tag_path(tag), - as: :tag, - html: { id: "edit_tag_#{tag.id}", class: "text-right"}) do |f| %> + + <%= tag.name %> + <%= f.label "featured_#{tag.id}" do %> + <%= f.check_box :featured, title: t('admin.tags.mark_as_featured'), label: false, id: "tag_featured_#{tag.id}", class: "inline-block" %> + <%= t("admin.tags.mark_as_featured") %> + <% end %> + - - <%= f.label "featured_#{tag.id}" do %> - <%= f.check_box :featured, title: t('admin.tags.mark_as_featured'), label: false, id: "tag_featured_#{tag.id}", class: "inline-block" %> - <%= t("admin.tags.mark_as_featured") %> - <% end %> - - - <%= f.submit(t("admin.tags.update"), class: "button small success") %> - - <%= link_to t("admin.tags.destroy"), admin_tag_path(tag), method: :delete, class: "delete" %> - <% end %> - + <%= f.submit(t("admin.tags.update"), class: "button hollow on-hover") %> + <%= link_to t("admin.tags.destroy"), admin_tag_path(tag), method: :delete, class: "button hollow alert on-hover" %> + <% end %> +
              <%= paginate @tags %> diff --git a/app/views/admin/users/index.html.erb b/app/views/admin/users/index.html.erb index a575bdef2..336443055 100644 --- a/app/views/admin/users/index.html.erb +++ b/app/views/admin/users/index.html.erb @@ -4,25 +4,29 @@

              <%= page_entries_info @users %>

              -
                + <% @users.each do |user| %> -
              • - <%= link_to user.name, admin_user_path(user) %> +
              • + - <%= link_to t("admin.actions.restore"), - restore_admin_user_path(user, request.query_parameters), - method: :put, - data: { confirm: t("admin.actions.confirm") }, - class: "button small success float-right" %> - <% unless user.confirmed_hide? %> - <%= link_to t("admin.actions.confirm_hide"), - confirm_hide_admin_user_path(user, request.query_parameters), - method: :put, - class: "button small warning float-right" %> - <% end %> - + + <% end %> - +
                +

                <%= link_to user.name, admin_user_path(user) %>

                +
                + <%= link_to t("admin.actions.restore"), + restore_admin_user_path(user, request.query_parameters), + method: :put, + data: { confirm: t("admin.actions.confirm") }, + class: "button hollow on-hover" %> + <% unless user.confirmed_hide? %> + <%= link_to t("admin.actions.confirm_hide"), + confirm_hide_admin_user_path(user, request.query_parameters), + method: :put, + class: "button hollow warning on-hover" %> + <% end %> +
                <%= paginate @users %> diff --git a/app/views/admin/users/show.html.erb b/app/views/admin/users/show.html.erb index 7fba928b3..1a6ab9795 100644 --- a/app/views/admin/users/show.html.erb +++ b/app/views/admin/users/show.html.erb @@ -1,3 +1,5 @@ +<%= render 'shared/back_link' %> +

                <%= t("admin.users.show.title", user: @user.name) %>

                @@ -5,37 +7,33 @@ <%= t("admin.users.show.registered_at") %> <%= @user.confirmed_at %> | <%= t("admin.users.show.hidden_at") %> <%= @user.hidden_at %>

                -

                - <%= link_to t("admin.users.show.back"), admin_users_path, - class: "button small secondary" %> -

                <% if @debates.present? %>

                <%= page_entries_info @debates %>

                <% end %> -
                  -<% @debates.each do |debate| %> -
                • - <%= link_to debate.title, debate_path(debate) %> -
                • -<% end %> -
                + + <% @debates.each do |debate| %> + + + + <% end %> +
                + <%= link_to debate.title, debate_path(debate) %> +
                <% if @comments.present? %>

                <%= page_entries_info @comments %>

                <% end %> -
                  -<% @comments.each do |comment| %> -
                • -
                  -
                  - <%= text_with_links comment.body %> -
                  -
                  -
                • -<% end %> -
                + + <% @comments.each do |comment| %> + + + + <% end %> +
                + <%= text_with_links comment.body %> +
                <%= paginate [@debates, @comments].sort_by {|x| x.size}.last %> diff --git a/app/views/admin/valuators/_valuator.html.erb b/app/views/admin/valuators/_valuator.html.erb index 0c64fcef0..e5971391b 100644 --- a/app/views/admin/valuators/_valuator.html.erb +++ b/app/views/admin/valuators/_valuator.html.erb @@ -1,12 +1,16 @@ -

                <%= t('admin.valuators.valuator.user_found') %>:

                -
                -
                -

                - <%= valuator.name %> -  •  - <%= valuator.email %> -

                -
                +
                +

                <%= t('admin.valuators.valuator.user_found') %>

                + + + + + + +
                + <%= valuator.name %> + + <%= valuator.email %> +
                <% unless @valuator.persisted? %> <%= form_for @valuator, url: admin_valuators_path do |f| %> @@ -21,4 +25,4 @@
                <% end %> <% end %> -
                \ No newline at end of file + diff --git a/app/views/admin/valuators/index.html.erb b/app/views/admin/valuators/index.html.erb index f3abe5e03..30132e66f 100644 --- a/app/views/admin/valuators/index.html.erb +++ b/app/views/admin/valuators/index.html.erb @@ -1,30 +1,36 @@

                <%= t("admin.valuators.index.title") %>

                +
                -
                - <%= form_tag search_admin_valuators_path, method: :get, remote: true do %> -
                - <%= text_field_tag :email, '', placeholder: t('admin.valuators.search.email_placeholder') %> -
                -
                - <%= submit_tag t('admin.valuators.search.search'), class: 'button radius' %> -
                - <% end %> -
                -
                -
                -

                <%= page_entries_info @valuators %>

                -
                  - <% @valuators.each do |valuator| %> -
                • - <%= valuator.name %> -  •  - <%= valuator.email %> - <% if valuator.description.present? %> -  •  - <%= valuator.description %> - <% end %> -
                • + <%= form_tag search_admin_valuators_path, method: :get, remote: true do %> +
                  + <%= text_field_tag :email, '', placeholder: t('admin.valuators.search.email_placeholder') %> +
                  +
                  + <%= submit_tag t('admin.valuators.search.search'), class: 'button radius' %> +
                  <% end %> -
                + + +
                + +

                <%= page_entries_info @valuators %>

                + + + <% @valuators.each do |valuator| %> + + + + + + <% end %> +
                + <%= valuator.name %> + + <%= valuator.email %> + + <% if valuator.description.present? %> + <%= valuator.description %> + <% end %> +
                <%= paginate @valuators %> diff --git a/app/views/admin/valuators/summary.html.erb b/app/views/admin/valuators/summary.html.erb index 6de304cb1..81cbc54d4 100644 --- a/app/views/admin/valuators/summary.html.erb +++ b/app/views/admin/valuators/summary.html.erb @@ -1,7 +1,4 @@ -<%= link_to admin_spending_proposals_path, class: "back" do %> - - <%= t("shared.back") %> -<% end %> +<%= render 'shared/back_link' %>

                <%= t("admin.valuators.summary.title") %>

                diff --git a/app/views/admin/valuators/user_not_found.js.erb b/app/views/admin/valuators/user_not_found.js.erb index 1425577f4..af3f83a3f 100644 --- a/app/views/admin/valuators/user_not_found.js.erb +++ b/app/views/admin/valuators/user_not_found.js.erb @@ -1 +1 @@ -$("#search-result").html("

                <%= j t('admin.valuators.search.user_not_found') %>

                "); +$("#search-result").html("
                <%= j t('admin.valuators.search.user_not_found') %>
                "); diff --git a/app/views/admin/verifications/index.html.erb b/app/views/admin/verifications/index.html.erb index 429972ba1..97cca3a4e 100644 --- a/app/views/admin/verifications/index.html.erb +++ b/app/views/admin/verifications/index.html.erb @@ -4,13 +4,17 @@

                <%= page_entries_info @users %>

                -
                  -<% @users.each do |user| %> -
                • - <%= link_to user.name, admin_user_path(user) %> - <%= render "pending_step", user: user %> -
                • -<% end %> -
                + + <% @users.each do |user| %> + + + + + <% end %> +
                + <%= link_to user.name, admin_user_path(user) %> + + <%= render "pending_step", user: user %> +
                <%= paginate @users %> \ No newline at end of file diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index dc2de2862..9364e066a 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb @@ -14,20 +14,39 @@ - <%= render 'layouts/admin_header' %> +
                +
                +
                -
                -
                - <%= side_menu %> + + + <%= side_menu %> +
                + +
                + <%= render 'layouts/admin_header' %> + +
                +
                + +
                + +
                + +
                + <%= side_menu %> +
                +
                + +
                + <%= render 'layouts/flash' %> + <%= yield %> +
                +
                +
                - -
                - - <%= render 'layouts/flash' %> - - <%= yield %> -
                - - +
                diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml index 6f39b76bb..ec3542c2c 100755 --- a/config/locales/admin.en.yml +++ b/config/locales/admin.en.yml @@ -50,6 +50,7 @@ en: hide: Hidden restore: Restored by: Moderated by + content: Content filter: Show filters: all: All @@ -93,6 +94,7 @@ en: user_not_found: User not found menu: activity: Moderator activity + admin: Admin menu banner: Manage banners debate_topics: Debate topics hidden_comments: Hidden comments @@ -140,7 +142,6 @@ en: cost: Cost officials: edit: - back: Back destroy: Remove 'Official' status title: 'Officials: Edit user' flash: @@ -166,9 +167,9 @@ en: pending: Pending rejected: Rejected verified: Verified - hidden_count: - one: There is also one organisation with no users or with a hidden user - other: There are %{count} organisations with no users or with a hidden user + hidden_count_html: + one: There is also one organisation with no users or with a hidden user. + other: There are %{count} organisations with no users or with a hidden user. reject: Reject rejected: Rejected search: Search @@ -306,11 +307,10 @@ en: without_confirmed_hide: Pending title: Hidden users show: - back: Back email: 'Email:' hidden_at: 'Hidden at:' registered_at: 'Registered at:' - title: Activity of user %{user} + title: Activity of user (%{user}) verifications: index: phone_not_given: Phone not given diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml index 27369e012..eef5ce10e 100644 --- a/config/locales/admin.es.yml +++ b/config/locales/admin.es.yml @@ -11,7 +11,7 @@ es: unmark_featured: Quitar destacado banners: index: - title: Anuncios + title: Banners create: Crear un banner edit: Editar banner delete: Eliminar banner @@ -48,6 +48,7 @@ es: hide: Ocultado restore: Restaurado by: Moderado por + content: Contenido filter: Mostrar filters: all: Todo @@ -91,6 +92,7 @@ es: user_not_found: Usuario no encontrado menu: activity: Actividad de moderadores + admin: Menú de administración banner: Gestionar banners debate_topics: Temas de debate hidden_comments: Comentarios ocultos @@ -138,7 +140,6 @@ es: cost: Coste total officials: edit: - back: Volver destroy: Eliminar condición de 'Cargo Público' title: 'Cargos Públicos: Editar usuario' flash: @@ -164,9 +165,9 @@ es: pending: Pendientes rejected: Rechazadas verified: Verificadas - hidden_count: - one: Hay además una organización sin usuario o con el usuario bloqueado - other: Hay %{count} organizaciones sin usuario o con el usuario bloqueado + hidden_count_html: + one: Hay además una organización sin usuario o con el usuario bloqueado. + other: Hay %{count} organizaciones sin usuario o con el usuario bloqueado. reject: Rechazar rejected: Rechazada search: Buscar @@ -304,11 +305,10 @@ es: without_confirmed_hide: Pendientes title: Usuarios bloqueados show: - back: Volver email: 'Email:' hidden_at: 'Bloqueado:' registered_at: 'Fecha de alta:' - title: Actividad del usuario %{user} + title: Actividad del usuario (%{user}) verifications: index: phone_not_given: No ha dado su teléfono From ea3d15996c983f9526c1adb0a4eade58889693f8 Mon Sep 17 00:00:00 2001 From: Tom Demeyer Date: Wed, 1 Jun 2016 14:13:15 +0200 Subject: [PATCH 15/21] Tests run fine in under 2.3.0 These two tests fail: rspec ./spec/features/legislation_spec.rb:40 # Legislation Annotations Update rspec ./spec/features/admin/spending_proposals_spec.rb:146 # Admin spending proposals Index Filtering by valuator Seem not to be ruby issues. --- .ruby-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ruby-version b/.ruby-version index 585940699..276cbf9e2 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.2.3 +2.3.0 From b71c61e4059f1786a701bec59a71280a64cf01d7 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 1 Jun 2016 17:30:01 +0200 Subject: [PATCH 16/21] Improves styles for moderation section --- app/views/moderation/comments/index.html.erb | 8 +-- app/views/moderation/dashboard/index.html.erb | 61 +++++++++++-------- app/views/moderation/proposals/index.html.erb | 8 +-- app/views/moderation/users/index.html.erb | 30 +++++---- 4 files changed, 61 insertions(+), 46 deletions(-) diff --git a/app/views/moderation/comments/index.html.erb b/app/views/moderation/comments/index.html.erb index c12b1405d..80c1e31cf 100644 --- a/app/views/moderation/comments/index.html.erb +++ b/app/views/moderation/comments/index.html.erb @@ -13,7 +13,7 @@
                <%= form_tag moderate_moderation_comments_path(request.query_parameters), method: :put do %> -

                +

                <%= t('shared.check') %>: <%= link_to t('shared.check_all'), '#', data: {check_all: "comment_ids[]"} %> | @@ -55,19 +55,19 @@ <%= submit_tag t('moderation.comments.index.block_authors'), name: "block_authors", - class: "button alert", + class: "button hollow alert", data: {confirm: t('moderation.comments.index.confirm')} %>

                <%= submit_tag t('moderation.comments.index.hide_comments'), name: "hide_comments", - class: "button alert", + class: "button hollow alert", data: {confirm: t('moderation.comments.index.confirm')} %> <%= submit_tag t('moderation.comments.index.ignore_flags'), name: "ignore_flags", - class: "button success", + class: "button hollow", data: {confirm: t('moderation.comments.index.confirm')} %>
                diff --git a/app/views/moderation/dashboard/index.html.erb b/app/views/moderation/dashboard/index.html.erb index abb3bb905..aa214c561 100644 --- a/app/views/moderation/dashboard/index.html.erb +++ b/app/views/moderation/dashboard/index.html.erb @@ -1,33 +1,42 @@ -
                -

                <%= t("moderation.dashboard.index.title") %>

                +<%= link_to t("admin.dashboard.index.back") + " " + Setting['org_name'], root_path, class: "button float-right" %> -

                Desde aquí puedes moderar el sistema, a través de las siguientes acciones:

                +

                <%= t("moderation.dashboard.index.title") %>

                -

                Propuestas / Debates / Comentarios

                +

                Desde aquí puedes moderar el sistema, a través de las siguientes acciones:

                -

                Cuando un usuario marca en una Propuesta/Debate/Comentario la opción de "denunciar como inapropiado", aparecerá en esta lista. Respecto a cada uno aparecerá el título, fecha, número de denuncias (cuántos usuarios diferentes han marcado la opción de denuncia) y el texto de la Propuesta/Debate/Comentario.

                +
                +
                  -

                  A la derecha de cada elemento aparece una caja que podemos marcar para seleccionar todos los que queramos de la lista. Una vez seleccionados uno o varios, encontramos al final de la página tres botones para realizar acciones sobre ellos:

                  +
                • + Propuestas / Debates / Comentarios +
                  +

                  Cuando un usuario marca en una Propuesta/Debate/Comentario la opción de "denunciar como inapropiado", aparecerá en esta lista. Respecto a cada uno aparecerá el título, fecha, número de denuncias (cuántos usuarios diferentes han marcado la opción de denuncia) y el texto de la Propuesta/Debate/Comentario.

                  -
                    -
                  • Ocultar: hará que esos elementos dejen de mostrarse en la web.
                  • -
                  • Bloquear autores: hará que el autor de ese elemento deje de poder acceder a la web, y que además todos las Propuestas/Debates/Comentarios de ese usuario dejen de mostrarse en la web.
                  • -
                  • Marcar como revisados cuando consideramos que esos elementos no deben ser moderados, que su contenido es correcto, y que por lo tanto deben dejar de ser mostrados en esta lista de elementos inapropiados.
                  • +

                    A la derecha de cada elemento aparece una caja que podemos marcar para seleccionar todos los que queramos de la lista. Una vez seleccionados uno o varios, encontramos al final de la página tres botones para realizar acciones sobre ellos:

                    + +
                      +
                    • Ocultar: hará que esos elementos dejen de mostrarse en la web.
                    • +
                    • Bloquear autores: hará que el autor de ese elemento deje de poder acceder a la web, y que además todos las Propuestas/Debates/Comentarios de ese usuario dejen de mostrarse en la web.
                    • +
                    • Marcar como revisados cuando consideramos que esos elementos no deben ser moderados, que su contenido es correcto, y que por lo tanto deben dejar de ser mostrados en esta lista de elementos inapropiados.
                    • +
                    + +

                    Para facilitar la gestión, arriba encontramos un filtro con las secciones:

                    + +
                      +
                    • Pendientes: las Propuestas/Debates/Comentarios sobre los que todavía no se ha pulsado "ocultar", "bloquear" o "marcar como revisados", y que por lo tanto deberían ser revisados todavía
                    • +
                    • Todos: mostrando todos las Propuestas/Debates/Comentarios de la web, y no sólo los marcados como inapropiados.
                    • +
                    • Marcados como revisados: los que algún moderador ha marcado como revisados y por lo tanto parecen correctos.
                    • +
                    + +

                    Es recomendable revisar regularmente la sección "pendientes".

                    +
                  +
                • + +
                • + Bloquear usuarios +
                  +

                  Un buscador nos permite encontrar cualquier usuario introduciendo su nombre de usuario o correo electrónico, y bloquearlo una vez encontrado. Al bloquearlo, el usuario no podrá volver a acceder a la web, y todas sus Propuestas/Debates/Comentarios serán ocultados y dejarán de ser visibles en la web.

                  +
                  +
                - -

                Para facilitar la gestión, arriba encontramos un filtro con las secciones:

                - -
                  -
                • Pendientes: las Propuestas/Debates/Comentarios sobre los que todavía no se ha pulsado "ocultar", "bloquear" o "marcar como revisados", y que por lo tanto deberían ser revisados todavía
                • -
                • Todos: mostrando todos las Propuestas/Debates/Comentarios de la web, y no sólo los marcados como inapropiados.
                • -
                • Marcados como revisados: los que algún moderador ha marcado como revisados y por lo tanto parecen correctos.
                • -
                - -

                Es recomendable revisar regularmente la sección "pendientes".

                - -

                Bloquear usuarios

                - -

                Un buscador nos permite encontrar cualquier usuario introduciendo su nombre de usuario o correo electrónico, y bloquearlo una vez encontrado. Al bloquearlo, el usuario no podrá volver a - acceder a la web, y todas sus Propuestas/Debates/Comentarios serán ocultados y dejarán de ser visibles en la web.

                -
                diff --git a/app/views/moderation/proposals/index.html.erb b/app/views/moderation/proposals/index.html.erb index 0b8d64ca1..91149e0b0 100644 --- a/app/views/moderation/proposals/index.html.erb +++ b/app/views/moderation/proposals/index.html.erb @@ -13,7 +13,7 @@
                <%= form_tag moderate_moderation_proposals_path(request.query_parameters), method: :put do %> -

                +

                <%= t('shared.check') %>: <%= link_to t('shared.check_all'), '#', data: {check_all: "proposal_ids[]"} %> | @@ -53,19 +53,19 @@ <%= submit_tag t('moderation.proposals.index.block_authors'), name: "block_authors", - class: "button alert", + class: "button hollow alert", data: {confirm: t('moderation.proposals.index.confirm')} %>

                <%= submit_tag t('moderation.proposals.index.hide_proposals'), name: "hide_proposals", - class: "button alert", + class: "button hollow alert", data: {confirm: t('moderation.proposals.index.confirm')} %> <%= submit_tag t('moderation.proposals.index.ignore_flags'), name: "ignore_flags", - class: "button success", + class: "button hollow", data: {confirm: t('moderation.proposals.index.confirm')} %>
                diff --git a/app/views/moderation/users/index.html.erb b/app/views/moderation/users/index.html.erb index 988419f53..b5dff141a 100644 --- a/app/views/moderation/users/index.html.erb +++ b/app/views/moderation/users/index.html.erb @@ -15,18 +15,24 @@

                <%= page_entries_info @users %>

                <% end %> -
                  - <% @users.each do |user| %> -
                • - <%= user.name %> -  •  - <% if user.hidden? %> - <%= t("moderation.users.index.hidden") %> - <% else %> - <%= link_to t("moderation.users.index.hide"), hide_in_moderation_screen_moderation_user_path(user, request.query_parameters), method: :put, class: "delete" %> + + + <% @users.each do |user| %> + + + <% end %> - - <% end %> - + + <% end %> + +
                  + <%= user.name %> + + <% if user.hidden? %> + <%= t("moderation.users.index.hidden") %> + <% else %> + <%= link_to t("moderation.users.index.hide"), hide_in_moderation_screen_moderation_user_path(user, request.query_parameters), + method: :put, class: "button hollow alert" %> +
                  <%= paginate @users %> From 5bd7bbee4f308b2fff2255e27c86a0734a5e304e Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 1 Jun 2016 18:07:58 +0200 Subject: [PATCH 17/21] Improves styles for management section --- app/assets/stylesheets/print.css | 2 ++ .../admin/shared/_proposal_search.html.erb | 2 +- .../shared/_spending_proposal_search.html.erb | 2 +- app/views/layouts/management.html.erb | 31 +++++++------------ app/views/management/_account_info.html.erb | 2 +- .../document_verifications/index.html.erb | 2 +- .../email_verifications/new.html.erb | 4 +-- app/views/management/proposals/new.html.erb | 8 +++-- .../spending_proposals/new.html.erb | 8 +++-- .../users/_erase_user_account.html.erb | 4 +-- app/views/management/users/new.html.erb | 2 +- 11 files changed, 32 insertions(+), 35 deletions(-) diff --git a/app/assets/stylesheets/print.css b/app/assets/stylesheets/print.css index 29096ae13..de5a56a31 100644 --- a/app/assets/stylesheets/print.css +++ b/app/assets/stylesheets/print.css @@ -12,6 +12,8 @@ #print_link { display: none !important; } +#responsive-menu { display: none !important; } + .admin-sidebar { display: none !important; } img.left { display: none !important; } diff --git a/app/views/admin/shared/_proposal_search.html.erb b/app/views/admin/shared/_proposal_search.html.erb index 8fae3b543..895b6ea55 100644 --- a/app/views/admin/shared/_proposal_search.html.erb +++ b/app/views/admin/shared/_proposal_search.html.erb @@ -4,7 +4,7 @@ <%= text_field_tag :search, "", placeholder: t("admin.shared.proposal_search.placeholder") %>
                  - <%= f.submit t("admin.shared.proposal_search.button"), class: "button success" %> + <%= f.submit t("admin.shared.proposal_search.button"), class: "button" %>
                  <% end %> \ No newline at end of file diff --git a/app/views/admin/shared/_spending_proposal_search.html.erb b/app/views/admin/shared/_spending_proposal_search.html.erb index c3e276ebe..cfb7e45f9 100644 --- a/app/views/admin/shared/_spending_proposal_search.html.erb +++ b/app/views/admin/shared/_spending_proposal_search.html.erb @@ -4,7 +4,7 @@ <%= text_field_tag :search, "", placeholder: t("admin.shared.spending_proposal_search.placeholder") %>
                  - <%= f.submit t("admin.shared.spending_proposal_search.button"), class: "button success expanded" %> + <%= f.submit t("admin.shared.spending_proposal_search.button"), class: "button" %>
                  <% end %> \ No newline at end of file diff --git a/app/views/layouts/management.html.erb b/app/views/layouts/management.html.erb index 735175155..ff7531295 100644 --- a/app/views/layouts/management.html.erb +++ b/app/views/layouts/management.html.erb @@ -16,13 +16,7 @@
                  - - -
                  +
                  <%= link_to Setting['org_name'], management_root_path, class: "logo show-for-small-only" %> @@ -45,21 +39,18 @@
                  -
                  -
                  -
                  - <%= render "/management/menu" %> -
                  +
                  +
                  + <%= render "/management/menu" %> +
                  - <%= render "management/account_info" %> + <%= render "management/account_info" %> -
                  +
                  + <%= render 'layouts/flash' %> + <%= yield %> +
                  +
                  - <%= render 'layouts/flash' %> - - <%= yield %> -
                  - - diff --git a/app/views/management/_account_info.html.erb b/app/views/management/_account_info.html.erb index 20a6bc24d..30af66cb6 100644 --- a/app/views/management/_account_info.html.erb +++ b/app/views/management/_account_info.html.erb @@ -1,5 +1,5 @@ <% if managed_user.document_number.present? %> -
                  +
                  - <%= f.submit t("management.check") %> + <%= f.submit t("management.check"), class: "button" %> <% end %> diff --git a/app/views/management/email_verifications/new.html.erb b/app/views/management/email_verifications/new.html.erb index ca13a3c43..6bbbdc3a5 100644 --- a/app/views/management/email_verifications/new.html.erb +++ b/app/views/management/email_verifications/new.html.erb @@ -15,7 +15,7 @@ <%= f.hidden_field :document_number %> <%= f.text_field :email, label: false, placeholder: t('management.email_verifications.email_placeholder') %> - <%= f.submit t("management.email_verifications.send_email"), class: "button success" %> + <%= f.submit t("management.email_verifications.send_email"), class: "button hollow" %> <% end %>
                • @@ -23,7 +23,7 @@ <%= t("management.email_verifications.if_no_existing_account") %>

                  - <%= link_to t('management.users.create_user'), new_management_user_path(user: params[:email_verification]), class: "button warning" %> + <%= link_to t('management.users.create_user'), new_management_user_path(user: params[:email_verification]), class: "button success" %>

                diff --git a/app/views/management/proposals/new.html.erb b/app/views/management/proposals/new.html.erb index 680552b9a..e3e2087e9 100644 --- a/app/views/management/proposals/new.html.erb +++ b/app/views/management/proposals/new.html.erb @@ -1,8 +1,10 @@ -
                +
                - <%= render '/shared/print' %> +
                + <%= render '/shared/print' %> +
                -
                +

                <%= t("management.proposals.create_proposal") %>

                <%= render "proposals/form", form_url: management_proposals_url %>
                diff --git a/app/views/management/spending_proposals/new.html.erb b/app/views/management/spending_proposals/new.html.erb index c04c81b03..e036a04cb 100644 --- a/app/views/management/spending_proposals/new.html.erb +++ b/app/views/management/spending_proposals/new.html.erb @@ -1,8 +1,10 @@ -
                +
                - <%= render '/shared/print' %> +
                + <%= render '/shared/print' %> +
                -
                +

                <%= t("management.spending_proposals.create") %>

                <%= render "spending_proposals/form", form_url: management_spending_proposals_url %>
                diff --git a/app/views/management/users/_erase_user_account.html.erb b/app/views/management/users/_erase_user_account.html.erb index af2e3b75b..8d5a545a3 100644 --- a/app/views/management/users/_erase_user_account.html.erb +++ b/app/views/management/users/_erase_user_account.html.erb @@ -1,9 +1,9 @@ -<%= link_to t("management.users.erase_account_link"), "#", class: "delete js-toggle-link", data: { "toggle-selector" => "#erase-account-form" } %> +<%= link_to t("management.users.erase_account_link"), "#", class: "button hollow alert js-toggle-link", data: { "toggle-selector" => "#erase-account-form" } %> \ No newline at end of file diff --git a/app/views/management/users/new.html.erb b/app/views/management/users/new.html.erb index 4283a9760..6602e4978 100644 --- a/app/views/management/users/new.html.erb +++ b/app/views/management/users/new.html.erb @@ -5,7 +5,7 @@ permissions: [:debates, :create_proposals, :support_proposals, :vote_proposals] %>
                -
                +
                <%= form_for @user, url: management_users_path do |f| %> <%= f.hidden_field :document_type %> <%= f.hidden_field :document_number %> From 9e31eeefada8289ef917eca119602bfdd04d11d8 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 1 Jun 2016 18:10:14 +0200 Subject: [PATCH 18/21] Cleans admin.scss --- app/assets/stylesheets/admin.scss | 102 ++++++++++++------------------ 1 file changed, 42 insertions(+), 60 deletions(-) diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index f4d73aba2..8a84043b8 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -24,6 +24,7 @@ body.admin { } form { + .button { margin-top: 0; } @@ -38,23 +39,34 @@ body.admin { table { + th { + text-align: left; + } + tr { - background: #f4f4f4; + background: white; + border: 1px solid $border; - &:nth-child(odd) { - background: white; - } - - &:nth-child(even) { - background: #f0f0f0; + &:hover { + background: #f3f6f7; } } - td.small { - font-size: $small-font-size; + input[type="submit"] ~ a, a ~ a { + margin-left: $line-height/2; + margin-right: $line-height/2; } } + hr { + max-width: none; + } + + .menu.simple li.active { + border-bottom: 2px solid $admin-color; + color: $admin-color; + } + #proposals { width: 100% !important; } @@ -95,13 +107,30 @@ body.admin { padding: $line-height !important; } +@include breakpoint(medium) { + + tr { + + .on-hover { + display: none; + } + + &:hover .on-hover { + display: inline; + } + } +} + // 02. Sidebar // ----------- .admin-sidebar { - border-bottom: 1px solid $border; border-right: 1px solid $border; + @include breakpoint(medium) { + padding-bottom: $line-height*3; + } + ul { list-style-type: none; margin-bottom: 0; @@ -154,45 +183,6 @@ body.admin { // 03. List elements // ----------------- -.admin-list { - list-style-type: none; - margin: 0; - margin-bottom: rem-calc(48); - - form { - clear: both; - - .checkbox { - font-size: $small-font-size; - } - } - - 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: $delete; @@ -234,14 +224,9 @@ body.admin { font-style: italic; } -.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); } @@ -257,13 +242,10 @@ body.admin { .moderation-description { max-height: rem-calc(65); overflow: hidden; - max-width: rem-calc(590); + max-width: rem-calc(700); &:hover { - cursor: text; max-height: rem-calc(1000); - outline: 3px solid #ffbf47; - padding: rem-calc(12); transition: max-height 0.9s; -moz-transition: max-height 0.9s; -webkit-transition: max-height 0.9s; @@ -332,8 +314,8 @@ body.admin { border-radius: rem-calc(3); font-size: rem-calc(16); font-weight: normal; - margin-bottom: rem-calc(12); - padding: rem-calc(6) rem-calc(12); + margin: $line-height; + padding: $line-height/2; strong { font-size: rem-calc(18); From 31cb29d8c5a5153f44f51c5f78a46e1bbdb4c591 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 1 Jun 2016 21:46:17 +0200 Subject: [PATCH 19/21] Fixes specs --- app/views/layouts/admin.html.erb | 2 +- app/views/moderation/users/index.html.erb | 2 +- spec/features/admin/activity_spec.rb | 2 +- spec/features/admin/banners_spec.rb | 12 +++++++++--- spec/features/admin/feature_flags_spec.rb | 8 ++++---- spec/features/moderation/users_spec.rb | 4 ++-- 6 files changed, 18 insertions(+), 12 deletions(-) diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index 9364e066a..0cad84197 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb @@ -35,7 +35,7 @@
                -
                +
                <%= side_menu %>
                diff --git a/app/views/moderation/users/index.html.erb b/app/views/moderation/users/index.html.erb index b5dff141a..c7fcf502b 100644 --- a/app/views/moderation/users/index.html.erb +++ b/app/views/moderation/users/index.html.erb @@ -15,7 +15,7 @@

                <%= page_entries_info @users %>

                <% end %> - +
                <% @users.each do |user| %> diff --git a/spec/features/admin/activity_spec.rb b/spec/features/admin/activity_spec.rb index 715c65f55..0bc1d7b6b 100644 --- a/spec/features/admin/activity_spec.rb +++ b/spec/features/admin/activity_spec.rb @@ -220,7 +220,7 @@ feature 'Admin activity' do visit moderation_users_path(name_or_email: user.username) - within(".admin-list") do + within("#moderation_users") do click_link 'Block' end diff --git a/spec/features/admin/banners_spec.rb b/spec/features/admin/banners_spec.rb index 9d329ceff..cad4c9f7a 100644 --- a/spec/features/admin/banners_spec.rb +++ b/spec/features/admin/banners_spec.rb @@ -67,14 +67,17 @@ feature 'Admin banners magement' do scenario 'Banners publication is listed on admin menu' do visit admin_root_path - within('#admin_menu') do + within('#side_menu') do expect(page).to have_link "Manage banners" end end scenario 'Publish a banner' do visit admin_root_path - click_link "Manage banners" + + within('#side_menu') do + click_link "Manage banners" + end click_link "Create banner" @@ -108,7 +111,10 @@ feature 'Admin banners magement' do post_ended_at: (Time.now + 10.days)) visit admin_root_path - click_link "Manage banners" + + within('#side_menu') do + click_link "Manage banners" + end click_link "Edit banner" diff --git a/spec/features/admin/feature_flags_spec.rb b/spec/features/admin/feature_flags_spec.rb index 63c4f1d64..55ea30837 100644 --- a/spec/features/admin/feature_flags_spec.rb +++ b/spec/features/admin/feature_flags_spec.rb @@ -9,7 +9,7 @@ feature 'Admin feature flags' do scenario 'Enabled features are listed on menu' do visit admin_root_path - within('#admin_menu') do + within('#side_menu') do expect(page).to have_link "Spending proposals" expect(page).to have_link "Hidden debates" end @@ -28,7 +28,7 @@ feature 'Admin feature flags' do visit admin_root_path - within('#admin_menu') do + within('#side_menu') do expect(page).not_to have_link "Spending proposals" end @@ -42,7 +42,7 @@ feature 'Admin feature flags' do visit admin_root_path - within('#admin_menu') do + within('#side_menu') do expect(page).not_to have_link "Spending proposals" end @@ -56,7 +56,7 @@ feature 'Admin feature flags' do visit admin_root_path - within('#admin_menu') do + within('#side_menu') do expect(page).to have_link "Spending proposals" end end diff --git a/spec/features/moderation/users_spec.rb b/spec/features/moderation/users_spec.rb index caace7d9c..053d29590 100644 --- a/spec/features/moderation/users_spec.rb +++ b/spec/features/moderation/users_spec.rb @@ -62,13 +62,13 @@ feature 'Moderate users' do fill_in 'name_or_email', with: 'Wanda' click_button 'Search' - within(".admin-list") do + within("#moderation_users") do expect(page).to have_content citizen.name expect(page).not_to have_content "Blocked" click_link 'Block' end - within(".admin-list") do + within("#moderation_users") do expect(page).to have_content citizen.name expect(page).to have_content "Blocked" end From d147cce459baac1e59fcf67c3a77e03000100d61 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Thu, 2 Jun 2016 11:26:40 +0200 Subject: [PATCH 20/21] Fixes localization specs --- app/assets/stylesheets/admin.scss | 4 ++++ app/views/layouts/_admin_header.html.erb | 6 ++++++ app/views/layouts/admin.html.erb | 4 ++-- app/views/layouts/management.html.erb | 10 ++++++++-- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index 8a84043b8..f52045c7b 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -16,6 +16,10 @@ body.admin { header { border: 0; + + .top-links { + background: darken($admin-color, 15%); + } } .top-bar { diff --git a/app/views/layouts/_admin_header.html.erb b/app/views/layouts/_admin_header.html.erb index e66b8b09f..2b15faaaa 100644 --- a/app/views/layouts/_admin_header.html.erb +++ b/app/views/layouts/_admin_header.html.erb @@ -1,4 +1,10 @@
                + +
                diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index 0cad84197..18ec500fe 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb @@ -29,7 +29,7 @@ <%= render 'layouts/admin_header' %>
                -
                +
                @@ -40,7 +40,7 @@
                -
                +
                <%= render 'layouts/flash' %> <%= yield %>
                diff --git a/app/views/layouts/management.html.erb b/app/views/layouts/management.html.erb index ff7531295..2607f1b82 100644 --- a/app/views/layouts/management.html.erb +++ b/app/views/layouts/management.html.erb @@ -16,6 +16,12 @@
                + +
                @@ -40,13 +46,13 @@
                -
                +
                <%= render "/management/menu" %>
                <%= render "management/account_info" %> -
                +
                <%= render 'layouts/flash' %> <%= yield %>
                From 824a969c0e7636c9a396b689cdc359339191bf77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?= Date: Thu, 2 Jun 2016 12:21:13 +0200 Subject: [PATCH 21/21] fixes admin menu spec --- app/views/layouts/admin.html.erb | 4 +++- spec/features/admin/banners_spec.rb | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index 18ec500fe..95bcae3e3 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb @@ -22,7 +22,9 @@ - <%= side_menu %> +
                + <%= side_menu %> +
                diff --git a/spec/features/admin/banners_spec.rb b/spec/features/admin/banners_spec.rb index cad4c9f7a..6d7779aa4 100644 --- a/spec/features/admin/banners_spec.rb +++ b/spec/features/admin/banners_spec.rb @@ -147,7 +147,10 @@ feature 'Admin banners magement' do post_started_at: (Time.now + 4.days), post_ended_at: (Time.now + 10.days)) visit admin_root_path - click_link "Manage banners" + + within("#side_menu") do + click_link "Manage banners" + end expect(page).to have_content 'Ugly banner'