From 341372d8745b1b7dd6fb5ed88a11fee1e488f392 Mon Sep 17 00:00:00 2001 From: pixeldesu <git@pixelde.su> Date: Mon, 8 Jun 2015 21:51:46 +0200 Subject: [PATCH] finalize --- app/views/layouts/_header.html.haml | 8 ++++---- app/views/layouts/_notifications.html.haml | 2 +- app/views/layouts/_profile.html.haml | 10 +++++----- app/views/layouts/application.html.haml | 1 + app/views/shared/_sidebar.html.haml | 4 ---- app/views/static/about.html.haml | 10 +++++----- config/initializers/assets.rb | 1 + config/locales/en.yml | 12 ++++-------- 8 files changed, 21 insertions(+), 27 deletions(-) diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index ee9b1d40..6296893c 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -20,9 +20,9 @@ #j2-main-navbar-collapse.collapse.navbar-collapse - if user_signed_in? %ul.nav.navbar-nav - = nav_entry "Timeline", root_path - = nav_entry "Inbox", "/inbox", badge: inbox_count - = nav_entry "Discover", discover_path + = nav_entry t('views.navigation.timeline'), root_path + = nav_entry t('views.navigation.inbox'), "/inbox", badge: inbox_count + = nav_entry t('views.navigation.discover'), discover_path %ul.nav.navbar-nav.navbar-right - unless @user.nil? - unless @user == current_user @@ -38,7 +38,7 @@ - else %ul.nav.navbar-nav.navbar-right = nav_entry t('views.sessions.create'), new_user_session_path - = nav_entry t('views.actions.new'), new_user_registration_path + = nav_entry t('views.sessions.new'), new_user_registration_path - if user_signed_in? = render 'shared/modal_ask_followers' diff --git a/app/views/layouts/_notifications.html.haml b/app/views/layouts/_notifications.html.haml index 6aceca73..93a442c4 100644 --- a/app/views/layouts/_notifications.html.haml +++ b/app/views/layouts/_notifications.html.haml @@ -1,4 +1,4 @@ -= nav_entry "Notifications", notifications_path, badge: notification_count, class: 'visible-xs' += nav_entry t('views.navigation.notifications'), notifications_path, badge: notification_count, class: 'visible-xs' - notifications = Notification.for(current_user).limit(4) %li.dropdown.hidden-xs %a.dropdown-toggle{href: "#", "data-toggle" => "dropdown"} diff --git a/app/views/layouts/_profile.html.haml b/app/views/layouts/_profile.html.haml index 1c4f4eb4..24ca3437 100644 --- a/app/views/layouts/_profile.html.haml +++ b/app/views/layouts/_profile.html.haml @@ -9,26 +9,26 @@ %li %a{href: show_user_profile_path(current_user.screen_name)} %i.fa.fa-fw.fa-user - = t 'views.user.profile.view' + = t('views.navigation.show') %li %a{href: edit_user_registration_path} %i.fa.fa-fw.fa-cog - = t 'views.user.profile.settings' + = t('views.navigation.settings') %li.divider - if current_user.admin? %li %a{href: rails_admin_path} %i.fa.fa-fw.fa-cogs - Kontrollzentrum + = t('views.navigation.admin') %li %a{href: sidekiq_web_path} %i.fa.fa-fw.fa-bar-chart - Sidekiq + = t('views.navigation.sidekiq') - if current_user.mod? %li %a{href: moderation_path} %i.fa.fa-fw.fa-gavel - Moderation Panel + = t('views.navigation.moderation') %li.divider %li %a{href: destroy_user_session_path, data: {method: :delete} } diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 291159f8..d381ce8f 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -13,6 +13,7 @@ %link{rel: 'icon', href: '/icon-152.png', sizes: '152x152'} %link{rel: 'icon', href: '/images/favicon/favicon-32.png', sizes: '32x32'} %title= yield(:title) + = javascript_include_tag 'i18n', 'data-turbolinks-track' => true = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true = javascript_include_tag 'application', 'data-turbolinks-track' => true - if user_signed_in? diff --git a/app/views/shared/_sidebar.html.haml b/app/views/shared/_sidebar.html.haml index afa71294..b8375a6a 100644 --- a/app/views/shared/_sidebar.html.haml +++ b/app/views/shared/_sidebar.html.haml @@ -1,9 +1,5 @@ .panel.panel-default.hidden-xs %img.profile--avatar{src: current_user.profile_picture.url(:large)} - - unless inbox_count.nil? - .profile--panel-badge.panel-badge-info - %i.fa.fa-envelope - = pluralize(inbox_count, 'new question') .panel-body - if current_user.display_name.blank? .profile--displayname diff --git a/app/views/static/about.html.haml b/app/views/static/about.html.haml index 92273da6..9eb7760f 100644 --- a/app/views/static/about.html.haml +++ b/app/views/static/about.html.haml @@ -88,16 +88,16 @@ %p= t('views.about.statistics.desc', app_title: APP_CONFIG['site_name']) .col-md-3.col-sm-6.col-xs-6.statistics %h2.entry-text#asked-count= Question.count - %h4.entry-subtext Questions + %h4.entry-subtext= t('views.general.question').pluralize(Question.count) %h2.entry-text#answered-count= Answer.count - %h4.entry-subtext Answers + %h4.entry-subtext= t('views.general.answer').pluralize(Answer.count) .col-md-3.col-sm-6.col-xs-6.statistics %h2.entry-text#asked-count= Comment.count - %h4.entry-subtext Comments + %h4.entry-subtext= t('views.general.comment').pluralize(Comment.count) %h2.entry-text#answered-count= Smile.count + CommentSmile.count - %h4.entry-subtext Smiles + %h4.entry-subtext= t('views.general.smile').pluralize(Smile.count) .col-md-3.col-sm-12.col-xs-12.users .entry-text#follower-count= User.count - %h6.entry-subtext Users + %h6.entry-subtext= t('views.general.user').pluralize(User.count) = render "shared/links" diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index 1f4fa74b..0c0205fe 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -6,3 +6,4 @@ Rails.application.config.assets.version = '1.0' # Precompile additional assets. # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. Rails.application.config.assets.precompile += %w( moderation.js ) +Rails.application.config.assets.precompile += %w( i18n.js ) diff --git a/config/locales/en.yml b/config/locales/en.yml index eeafecb7..3f38a62d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -359,15 +359,15 @@ en: title: "Popular Content" desc: "Answers with most smiles and most answered questions" tab: - answers: "Answers" - questions: "Questions" - comments: "Most Comments" + answers: "Most Liked" + questions: "Most Answers" + comments: "Most Controversial" people: title: "People" desc: "Newcomers and people who asked the most questions" tab: new: "New Users" - questions: "Most Asked Questions" + questions: "Active Askers" answers: "Most Answers" userbox: new: "registered %{time} ago" @@ -470,7 +470,3 @@ en: contributor: "Contributor" blogger: "Blogger" banned: "Banned" - profile: - view: "View profile" - settings: "Settings" - hello: "Hello world"