diff --git a/CUSTOMIZE_ES.md b/CUSTOMIZE_ES.md new file mode 100644 index 000000000..71c3701e4 --- /dev/null +++ b/CUSTOMIZE_ES.md @@ -0,0 +1,214 @@ +# Personalización + +Puedes modificar consul y ponerle tu propia imagen, para esto debes primero hacer un fork de https://github.com/consul/consul creando un repositorio nuevo en Github. Puedes usar otro servicio como Gitlab, pero no te olvides de poner el enlace en el footer a tu repositorio en cumplimiento con la licencia de este proyecto (GPL Affero 3). + +Hemos creado una estructura específica donde puedes sobreescribir y personalizar la aplicación para que puedas actualizar sin que tengas problemas al hacer merge y se sobreescriban por error tus cambios. Intentamos que Consul sea una aplicación Ruby on Rails lo más plain vanilla posible para facilitar el acceso de nuevas desarrolladoras. + +## Ficheros y directorios especiales + +Para adaptarlo puedes hacerlo a través de los directorios que están en custom dentro de: + +* config/locales/custom/ +* app/assets/images/custom/ +* app/views/custom/ +* app/controllers/custom/ +* app/models/custom/ + +Aparte de estos directorios también cuentas con ciertos ficheros para: + +* app/assets/stylesheets/custom.css +* app/assets/javascripts/custom.js +* Gemfile_custom +* config/application.custom.rb + +### Internacionalización + +Si quieres modificar algún texto de la web deberías encontrarlos en los ficheros formato YML disponibles en *config/locales/*. Puedes leer la [guía de internacionalización](http://guides.rubyonrails.org/i18n.html) de Ruby on Rails sobre como funciona este sistema. + +Las adaptaciones los debes poner en el directorio *config/locales/custom/*, recomendamos poner solo los textos que quieras personalizar. Por ejemplo si quieres personalizar el texto de "Ayuntamiento de Madrid, 2016" que se encuentra en el footer en todas las páginas, primero debemos ubicar en que plantilla se encuentra (app/views/layouts/_footer.html.erb), vemos que en el código pone lo siguiente: +``` +<%= t("layouts.footer.copyright", year: Time.now.year) %> +``` + +Y que en el fichero config/locales/es.yml sigue esta estructura (solo ponemos lo relevante para este caso): + +``` +es: + layouts: + footer: + copyright: Ayuntamiento de Madrid, %{year} + +``` + +Si creamos el fichero config/locales/custom/es.yml y modificamos "Ayuntamiento de Madrid" por el nombre de la organización que se este haciendo la modificación. Recomendamos directamente copiar los ficheros config/locales/ e ir revisando y corrigiendo las que querramos, borrando las líneas que no querramos traducir. + +### Imágenes + +Si quieres sobreescribir alguna imagen debes primero fijarte el nombre que tiene, por defecto se encuentran en *app/assets/images*. Por ejemplo si quieres modificar *app/assets/images/logo_header.png* debes poner otra con ese mismo nombre en el directorio app/assets/images/custom. Los iconos que seguramente quieras modificar son: + +* apple-touch-icon-200.png +* icon_home.png +* logo_email.png +* logo_header.png +* map.jpg +* social-media-icon.png + +### Vistas (HTML) + +Si quieres modificar el HTML de alguna página puedes hacerlo copiando el HTML de *app/views* y poniendolo en *app/views/custom* respetando los subdirectorios que encuentres ahí. Por ejemplo si quieres modificar *app/views/pages/conditions.html* debes copiarlo y modificarla en app/views/custom/pages/conditions.html.erb + +### CSS + +Si quieres cambiar algun selector CSS (de las hojas de estilo) puedes hacerlo en el fichero *app/assets/stylesheets/custom.scss*. Por ejemplo si quieres cambiar el color del header (.top-links) puedes hacerlo agregando: + +``` +.top-links { + background: red; +} +``` + +Usamos un preprocesador de CSS, [SASS, con la sintaxis SCSS](http://sass-lang.com/guide). + +### Javascript + +Si quieres agregar código Javascript puedes hacerlo en el fichero *app/assets/javascripts/custom.js". Por ejemplo si quieres que salga una alerta puedes poner lo siguiente: + +``` +$(function(){ + alert('foobar'); +}); +``` + +### Modelos + +Si quieres agregar modelos nuevos, o modificar o agregar métodos a uno ya existente puedes hacerlo en *app/models/custom*. En el caso de los modelos antiguos debes primero hacer un require de la dependencia. + +Por ejemplo en el caso del Ayuntamiento de Madrid se requiere comprobar que el código postal durante la verificación sigue un cierto formato (empieza con 280). Esto se realiza creando este fichero en *app/models/custom/verification/residence.rb*: + +``` +require_dependency Rails.root.join('app', 'models', 'verification', 'residence').to_s + +class Verification::Residence + + validate :postal_code_in_madrid + validate :residence_in_madrid + + def postal_code_in_madrid + errors.add(:postal_code, I18n.t('verification.residence.new.error_not_allowed_postal_code')) unless valid_postal_code? + end + + def residence_in_madrid + return if errors.any? + + unless residency_valid? + errors.add(:residence_in_madrid, false) + store_failed_attempt + Lock.increase_tries(user) + end + end + + private + + def valid_postal_code? + postal_code =~ /^280/ + end + +end +``` + +No olvides poner los tests relevantes en *spec/models/custom*, siguiendo con el ejemplo pondriamos lo siguiente en *spec/models/custom/residence_spec.rb*: + + +``` +require 'rails_helper' + +describe Verification::Residence do + + let(:residence) { build(:verification_residence, document_number: "12345678Z") } + + describe "verification" do + + describe "postal code" do + it "should be valid with postal codes starting with 280" do + residence.postal_code = "28012" + residence.valid? + expect(residence.errors[:postal_code].size).to eq(0) + + residence.postal_code = "28023" + residence.valid? + expect(residence.errors[:postal_code].size).to eq(0) + end + + it "should not be valid with postal codes not starting with 280" do + residence.postal_code = "12345" + residence.valid? + expect(residence.errors[:postal_code].size).to eq(1) + + residence.postal_code = "13280" + residence.valid? + expect(residence.errors[:postal_code].size).to eq(1) + expect(residence.errors[:postal_code]).to include("In order to be verified, you must be registered in the municipality of Madrid.") + end + end + + end + +end +``` + +### Controladores + +TODO + +### Gemfile + +Para agregar librerías (gems) nuevas puedes hacerlo en el fichero *Gemfile_custom*. Por ejemplo si quieres agregar la gema [rails-footnotes](https://github.com/josevalim/rails-footnotes) debes hacerlo agregandole + +``` +gem 'rails-footnotes', '~> 4.0' +``` + +Y siguiendo el flujo clásico en Ruby on Rails (bundle install y seguir con los pasos específicos de la gema en la documentación) + +### application.rb + +Cuando necesites extender o modificar el *config/application.rb* puedes hacerlo a través del fichero *config/application_custom.rb*. Por ejemplo si quieres modificar el idioma por defecto al inglés pondrías lo siguiente: + + +``` +module Consul + class Application < Rails::Application + config.i18n.default_locale = :en + config.i18n.available_locales = [:en, :es] + end +end +``` + +Recuerda que para ver reflejado estos cambios debes reiniciar el servidor de desarrollo. + +### lib/ + +TODO + +### public/ + +TODO + +### Seeds + +TODO + +## Actualizar + +Te recomendamos que agregues el remote de consul para facilitar este proceso de merge: + +``` +$ git remote add consul https://github.com/consul/consul +``` + +Con esto puedes actualizarte con + +``` +git checkout -b consul_update +git pull consul master +``` diff --git a/Gemfile b/Gemfile index 2ea2eb5c4..1819992d3 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '4.2.7' +gem 'rails', '4.2.7.1' # Use PostgreSQL gem 'pg' # Use SCSS for stylesheets @@ -19,6 +19,9 @@ gem 'jquery-ui-rails' # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks gem 'turbolinks' +# Fix sprockets on the +gem 'sprockets', '~> 3.6.3' + gem 'devise', '~> 3.5.7' # Use ActiveModel has_secure_password # gem 'bcrypt', '~> 3.1.7' @@ -94,3 +97,5 @@ group :development do # Access an IRB console on exception pages or by using <%= console %> in views gem 'web-console', '3.3.0' end + +eval_gemfile './Gemfile_custom' diff --git a/Gemfile.lock b/Gemfile.lock index ad24ae9ec..121d7b86e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,36 +1,36 @@ GEM remote: https://rubygems.org/ specs: - actionmailer (4.2.7) - actionpack (= 4.2.7) - actionview (= 4.2.7) - activejob (= 4.2.7) + actionmailer (4.2.7.1) + actionpack (= 4.2.7.1) + actionview (= 4.2.7.1) + activejob (= 4.2.7.1) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (4.2.7) - actionview (= 4.2.7) - activesupport (= 4.2.7) + actionpack (4.2.7.1) + actionview (= 4.2.7.1) + activesupport (= 4.2.7.1) rack (~> 1.6) rack-test (~> 0.6.2) rails-dom-testing (~> 1.0, >= 1.0.5) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (4.2.7) - activesupport (= 4.2.7) + actionview (4.2.7.1) + activesupport (= 4.2.7.1) builder (~> 3.1) erubis (~> 2.7.0) rails-dom-testing (~> 1.0, >= 1.0.5) rails-html-sanitizer (~> 1.0, >= 1.0.2) - activejob (4.2.7) - activesupport (= 4.2.7) + activejob (4.2.7.1) + activesupport (= 4.2.7.1) globalid (>= 0.3.0) - activemodel (4.2.7) - activesupport (= 4.2.7) + activemodel (4.2.7.1) + activesupport (= 4.2.7.1) builder (~> 3.1) - activerecord (4.2.7) - activemodel (= 4.2.7) - activesupport (= 4.2.7) + activerecord (4.2.7.1) + activemodel (= 4.2.7.1) + activesupport (= 4.2.7.1) arel (~> 6.0) - activesupport (4.2.7) + activesupport (4.2.7.1) i18n (~> 0.7) json (~> 1.7, >= 1.7.7) minitest (~> 5.1) @@ -67,7 +67,7 @@ GEM bcrypt (3.1.11) browser (2.2.0) builder (3.2.2) - bullet (5.1.1) + bullet (5.2.0) activesupport (>= 3.0.0) uniform_notifier (~> 1.10.0) byebug (9.0.5) @@ -114,12 +114,12 @@ GEM execjs coffee-script-source (1.10.0) concurrent-ruby (1.0.2) - coveralls (0.8.14) + coveralls (0.8.15) json (>= 1.8, < 3) simplecov (~> 0.12.0) term-ansicolor (~> 1.3) thor (~> 0.19.1) - tins (~> 1.6.0) + tins (>= 1.6.0, < 2) daemons (1.2.3) dalli (2.7.6) database_cleaner (1.5.3) @@ -156,7 +156,7 @@ GEM factory_girl_rails (4.7.0) factory_girl (~> 4.7.0) railties (>= 3.0.0) - faker (1.6.5) + faker (1.6.6) i18n (~> 0.5) faraday (0.9.2) multipart-post (>= 1.2, < 3) @@ -174,7 +174,7 @@ GEM rspec (~> 3.0) ruby-progressbar (~> 1.4) geocoder (1.3.7) - globalid (0.3.6) + globalid (0.3.7) activesupport (>= 4.1.0) groupdate (3.0.1) activesupport (>= 3) @@ -290,16 +290,16 @@ GEM rack rack-test (0.6.3) rack (>= 1.0) - rails (4.2.7) - actionmailer (= 4.2.7) - actionpack (= 4.2.7) - actionview (= 4.2.7) - activejob (= 4.2.7) - activemodel (= 4.2.7) - activerecord (= 4.2.7) - activesupport (= 4.2.7) + rails (4.2.7.1) + actionmailer (= 4.2.7.1) + actionpack (= 4.2.7.1) + actionview (= 4.2.7.1) + activejob (= 4.2.7.1) + activemodel (= 4.2.7.1) + activerecord (= 4.2.7.1) + activesupport (= 4.2.7.1) bundler (>= 1.3.0, < 2.0) - railties (= 4.2.7) + railties (= 4.2.7.1) sprockets-rails rails-deprecated_sanitizer (1.0.3) activesupport (>= 4.2.0.alpha) @@ -309,9 +309,9 @@ GEM rails-deprecated_sanitizer (>= 1.0.1) rails-html-sanitizer (1.0.3) loofah (~> 2.0) - railties (4.2.7) - actionpack (= 4.2.7) - activesupport (= 4.2.7) + railties (4.2.7.1) + actionpack (= 4.2.7.1) + activesupport (= 4.2.7.1) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) raindrops (0.16.0) @@ -350,7 +350,7 @@ GEM safely_block (0.1.1) errbase sass (3.4.22) - sass-rails (5.0.5) + sass-rails (5.0.6) railties (>= 4.0.0, < 6) sass (~> 3.1) sprockets (>= 2.8, < 4.0) @@ -396,7 +396,7 @@ GEM thread (0.2.2) thread_safe (0.3.5) tilt (2.0.5) - tins (1.6.0) + tins (1.11.0) tolk (1.9.3) rails (>= 4.0, < 4.3) safe_yaml (>= 0.8.6) @@ -408,7 +408,7 @@ GEM tilt (>= 1.4, < 3) tzinfo (1.2.2) thread_safe (~> 0.1) - uglifier (3.0.0) + uglifier (3.0.1) execjs (>= 0.3.0, < 3) unicorn (5.1.0) kgio (~> 2.6) @@ -485,7 +485,7 @@ DEPENDENCIES pg_search poltergeist quiet_assets - rails (= 4.2.7) + rails (= 4.2.7.1) redcarpet responders rinku @@ -496,6 +496,7 @@ DEPENDENCIES social-share-button spring spring-commands-rspec + sprockets (~> 3.6.3) tolk turbolinks turnout diff --git a/Gemfile_custom b/Gemfile_custom new file mode 100644 index 000000000..9d91e0680 --- /dev/null +++ b/Gemfile_custom @@ -0,0 +1,5 @@ +# Overrides and adds customized gems in this file +# Read more on documentation: +# * English: https://github.com/consul/consul/blob/master/CUSTOMIZE_EN.md#gemfile +# * Spanish: https://github.com/consul/consul/blob/master/CUSTOMIZE_ES.md#gemfile +# diff --git a/README.md b/README.md index 7a92401f3..27162bfd7 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,10 @@ But for some actions like voting, you will need a verified user, the seeds file **user:** verified@consul.dev **pass:** 12345678 +### Customization + +See [CUSTOMIZE_ES.md](CUSTOMIZE_ES.md) + ### OAuth To test authentication services with external OAuth suppliers - right now Twitter, Facebook and Google - you'll need to create an "application" in each of the supported platforms and set the *key* and *secret* provided in your *secrets.yml* diff --git a/README_ES.md b/README_ES.md index 489412299..d8c394680 100644 --- a/README_ES.md +++ b/README_ES.md @@ -61,6 +61,9 @@ Pero para ciertas acciones, como apoyar, necesitarás un usuario verificado, el **user:** verified@consul.dev **pass:** 12345678 +### Customización + +Ver fichero [CUSTOMIZE_ES.md](CUSTOMIZE_ES.md) ### OAuth diff --git a/app/assets/images/custom/.keep b/app/assets/images/custom/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index a1b8dd70a..7fb92b5e3 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -16,7 +16,7 @@ //= require jquery-ui/datepicker-es //= require foundation //= require turbolinks -//= require ckeditor/init +//= require ckeditor/loader //= require_directory ./ckeditor //= require social-share-button //= require initial @@ -45,6 +45,7 @@ //= require valuation_spending_proposal_form //= require embed_video //= require banners +//= require custom var initialize_modules = function() { App.Comments.initialize(); diff --git a/app/assets/javascripts/ckeditor/loader.js.erb b/app/assets/javascripts/ckeditor/loader.js.erb new file mode 100644 index 000000000..66e1d8347 --- /dev/null +++ b/app/assets/javascripts/ckeditor/loader.js.erb @@ -0,0 +1,3 @@ +//= require ckeditor/init + +CKEDITOR.config.customConfig = '<%= javascript_path 'ckeditor/config.js' %>'; diff --git a/app/assets/javascripts/custom.js b/app/assets/javascripts/custom.js new file mode 100644 index 000000000..6c880b3a9 --- /dev/null +++ b/app/assets/javascripts/custom.js @@ -0,0 +1,7 @@ +// Overrides and adds customized javascripts in this file +// Read more on documentation: +// * English: https://github.com/consul/consul/blob/master/CUSTOMIZE_EN.md#javascript +// * Spanish: https://github.com/consul/consul/blob/master/CUSTOMIZE_ES.md#javascript +// +// + diff --git a/app/assets/stylesheets/custom.scss b/app/assets/stylesheets/custom.scss index c764f4ad2..090eb0342 100644 --- a/app/assets/stylesheets/custom.scss +++ b/app/assets/stylesheets/custom.scss @@ -1,2 +1,5 @@ // Overrides and adds customized styles in this file -// \ No newline at end of file +// Read more on documentation: +// * English: https://github.com/consul/consul/blob/master/CUSTOMIZE_EN.md#css +// * Spanish: https://github.com/consul/consul/blob/master/CUSTOMIZE_ES.md#css +// diff --git a/app/mailers/mailer.rb b/app/mailers/mailer.rb index ad87359af..25c019857 100644 --- a/app/mailers/mailer.rb +++ b/app/mailers/mailer.rb @@ -60,8 +60,8 @@ class Mailer < ApplicationMailer end end - def proposal_notification_digest(user) - @notifications = user.notifications.where(notifiable_type: "ProposalNotification") + def proposal_notification_digest(user, notifications) + @notifications = notifications with_user(user) do mail(to: user.email, subject: t('mailers.proposal_notification_digest.title', org_name: Setting['org_name'])) diff --git a/app/models/custom/.keep b/app/models/custom/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/app/models/custom/verification/residence.rb b/app/models/custom/verification/residence.rb new file mode 100644 index 000000000..1cbc6f7ab --- /dev/null +++ b/app/models/custom/verification/residence.rb @@ -0,0 +1,29 @@ + +require_dependency Rails.root.join('app', 'models', 'verification', 'residence').to_s + +class Verification::Residence + + validate :postal_code_in_madrid + validate :residence_in_madrid + + def postal_code_in_madrid + errors.add(:postal_code, I18n.t('verification.residence.new.error_not_allowed_postal_code')) unless valid_postal_code? + end + + def residence_in_madrid + return if errors.any? + + unless residency_valid? + errors.add(:residence_in_madrid, false) + store_failed_attempt + Lock.increase_tries(user) + end + end + + private + + def valid_postal_code? + postal_code =~ /^280/ + end + +end diff --git a/app/models/notification.rb b/app/models/notification.rb index 9695c1b01..c6c32eb8d 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -2,9 +2,11 @@ class Notification < ActiveRecord::Base belongs_to :user, counter_cache: true belongs_to :notifiable, polymorphic: true - scope :unread, -> { all } - scope :recent, -> { order(id: :desc) } - scope :for_render, -> { includes(:notifiable) } + scope :unread, -> { all } + scope :recent, -> { order(id: :desc) } + scope :not_emailed, -> { where(emailed_at: nil) } + scope :for_render, -> { includes(:notifiable) } + def timestamp notifiable.created_at diff --git a/app/models/proposal.rb b/app/models/proposal.rb index b6a8ddb26..7ccf8995f 100644 --- a/app/models/proposal.rb +++ b/app/models/proposal.rb @@ -95,7 +95,7 @@ class Proposal < ActiveRecord::Base end def voters - votes_for.voters + User.active.where(id: votes_for.voters) end def editable? diff --git a/app/models/user.rb b/app/models/user.rb index 4bb09c4a0..60bc2364a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -53,6 +53,7 @@ class User < ActiveRecord::Base scope :for_render, -> { includes(:organization) } scope :by_document, -> (document_type, document_number) { where(document_type: document_type, document_number: document_number) } scope :email_digest, -> { where(email_digest: true) } + scope :active, -> { where(erased_at: nil) } before_validation :clean_document_number diff --git a/app/models/verification/residence.rb b/app/models/verification/residence.rb index 5756af2b3..cc24bb7c8 100644 --- a/app/models/verification/residence.rb +++ b/app/models/verification/residence.rb @@ -16,8 +16,6 @@ class Verification::Residence validate :allowed_age validate :document_number_uniqueness - validate :postal_code_in_madrid - validate :residence_in_madrid def initialize(attrs={}) self.date_of_birth = parse_date('date_of_birth', attrs) @@ -45,20 +43,6 @@ class Verification::Residence errors.add(:document_number, I18n.t('errors.messages.taken')) if User.where(document_number: document_number).any? end - def postal_code_in_madrid - errors.add(:postal_code, I18n.t('verification.residence.new.error_not_allowed_postal_code')) unless valid_postal_code? - end - - def residence_in_madrid - return if errors.any? - - unless residency_valid? - errors.add(:residence_in_madrid, false) - store_failed_attempt - Lock.increase_tries(user) - end - end - def store_failed_attempt FailedCensusCall.create({ user: user, @@ -97,8 +81,4 @@ class Verification::Residence self.document_number = self.document_number.gsub(/[^a-z0-9]+/i, "").upcase unless self.document_number.blank? end - def valid_postal_code? - postal_code =~ /^280/ - end - end diff --git a/app/views/comments/_comment.html.erb b/app/views/comments/_comment.html.erb index 7b5ff4b7d..bf8bfb50d 100644 --- a/app/views/comments/_comment.html.erb +++ b/app/views/comments/_comment.html.erb @@ -74,6 +74,7 @@ <% if comment.children.size > 0 %> <%= link_to "", class: "js-toggle-children relative", data: {'id': "#{dom_id(comment)}"} do %> + <%= t("shared.show") %> <%= t("comments.comment.responses", count: comment.children.size) %> <% end %> <% else %> diff --git a/app/views/comments/_votes.html.erb b/app/views/comments/_votes.html.erb index 20fc2d1cf..8ee315e35 100644 --- a/app/views/comments/_votes.html.erb +++ b/app/views/comments/_votes.html.erb @@ -7,7 +7,9 @@ <% if can?(:vote, comment) %> <%= link_to vote_comment_path(comment, value: 'yes'), method: "post", remote: true do %> - + + <%= t('votes.agree') %> + <% end %> <% else %> @@ -19,7 +21,9 @@ <% if can?(:vote, comment) %> <%= link_to vote_comment_path(comment, value: 'no'), method: "post", remote: true do %> - + + <%= t('votes.disagree') %> + <% end %> <% else %> diff --git a/app/views/custom/.keep b/app/views/custom/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/app/views/debates/_votes.html.erb b/app/views/debates/_votes.html.erb index 9ac6638d6..4c5f5a9b7 100644 --- a/app/views/debates/_votes.html.erb +++ b/app/views/debates/_votes.html.erb @@ -3,7 +3,9 @@
<%= link_to vote_debate_path(debate, value: 'yes'), class: "like #{voted_classes[:in_favor]}", title: t('votes.agree'), method: "post", remote: true do %> - + + <%= t('votes.agree') %> + <%= votes_percentage('likes', debate) %> <% end %>
@@ -12,7 +14,9 @@
<%= link_to vote_debate_path(debate, value: 'no'), class: "unlike #{voted_classes[:against]}", title: t('votes.disagree'), method: "post", remote: true do %> - + + <%= t('votes.disagree') %> + <%= votes_percentage('dislikes', debate) %> <% end %>
diff --git a/app/views/devise/menu/_login_items.html.erb b/app/views/devise/menu/_login_items.html.erb index 55665708a..0ab28e2ee 100644 --- a/app/views/devise/menu/_login_items.html.erb +++ b/app/views/devise/menu/_login_items.html.erb @@ -1,6 +1,7 @@ <% if user_signed_in? %>
  • <%= link_to notifications_path, class: "notifications", accesskey: "n" do %> + <%= t("layouts.header.notifications") %> <% if current_user.notifications_count > 0 %>