From 7056487f3d23cb7a4442ec26fce11427d17257cb Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 30 Nov 2016 18:46:35 +0100 Subject: [PATCH] improves styles for admin menu --- app/assets/stylesheets/admin.scss | 60 ++++++- app/assets/stylesheets/icons.scss | 12 ++ app/helpers/admin_helper.rb | 24 +++ app/views/admin/_menu.html.erb | 204 +++++++++++----------- app/views/admin/dashboard/index.html.erb | 10 +- app/views/admin/moderators/index.html.erb | 4 +- app/views/admin/stats/show.html.erb | 3 +- app/views/layouts/_admin_header.html.erb | 2 + app/views/layouts/admin.html.erb | 4 +- config/locales/admin.en.yml | 16 +- config/locales/admin.es.yml | 16 +- 11 files changed, 225 insertions(+), 130 deletions(-) diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index 59c1271b4..c349a1c9c 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -20,6 +20,11 @@ body.admin { .top-links { background: darken($admin-color, 15%); } + + .back-web { + padding-top: $line-height/4; + text-decoration: underline; + } } .top-bar { @@ -150,7 +155,7 @@ body.admin { border-right: 1px solid $border; @include breakpoint(medium) { - padding-bottom: $line-height*3; + min-height: rem-calc(1100); } ul { @@ -160,10 +165,12 @@ body.admin { padding: 0; [class^="icon-"] { + color: $admin-color; display: inline-block; font-size: rem-calc(24); - padding-right: rem-calc(12); - padding-top: rem-calc(4); + line-height: $line-height; + padding: $line-height/2 $line-height/4; + padding-left: 0; vertical-align: middle; } @@ -172,19 +179,26 @@ body.admin { margin: 0; outline: 0; + ul { + margin-left: $line-height/1.5; + border-left: 1px solid $border; + padding-left: $line-height/2; + } + + &.section-title { + border-bottom: 1px solid $border; + } + &.active a { background: #f3f6f7; + border-radius: rem-calc(6); + -moz-border-radius: rem-calc(6); + -webkit-border-radius: rem-calc(6); color: $admin-color; font-weight: bold; } } - li.section { - border-bottom: 1px dotted #d5d5d5; - border-top: 1px dotted #d5d5d5; - height: $line-height/2; - } - li a { color: $text; display: block; @@ -194,10 +208,38 @@ body.admin { &:hover { background: #f3f6f7; + border-radius: rem-calc(6); + -moz-border-radius: rem-calc(6); + -webkit-border-radius: rem-calc(6); + color: $admin-color; text-decoration: none; } } } + + .is-accordion-submenu-parent { + + & > a::after { + border-color: $admin-color transparent transparent; + } + } + + .submenu { + border-bottom: 0; + margin-left: $line-height; + + li:first-child { + padding-top: $line-height/2; + } + + li:last-child { + padding-bottom: $line-height/2; + } + + a { + font-weight: normal; + } + } } // 03. List elements diff --git a/app/assets/stylesheets/icons.scss b/app/assets/stylesheets/icons.scss index a4b0da4f7..c2faa006c 100644 --- a/app/assets/stylesheets/icons.scss +++ b/app/assets/stylesheets/icons.scss @@ -163,6 +163,12 @@ .icon-whatsapp:before { content: "\50"; } +.icon-zip:before { + content: "\4f"; +} +.icon-banner:before { + content: "\51"; +} .icon-arrow-down:before { content: "\52"; } @@ -172,6 +178,12 @@ .icon-arrow-right:before { content: "\55"; } +.icon-check-circle:before { + content: "\56"; +} +.icon-arrow-top:before { + content: "\57"; +} .icon-checkmark-circle:before { content: "\59"; } diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb index f14269fb3..6c6bfbe25 100644 --- a/app/helpers/admin_helper.rb +++ b/app/helpers/admin_helper.rb @@ -4,6 +4,30 @@ module AdminHelper render "/#{namespace}/menu" end + def menu_tags + ["tags"].include? controller_name + end + + def menu_moderated_content + ["proposals", "debates", "comments", "users"].include? controller_name + end + + def menu_budget + ["spending_proposals"].include? controller_name + end + + def menu_polls + ["polls", "questions", "officers", "booths"].include? controller_name + end + + def menu_profiles + ["organizations", "officials", "moderators", "valuators", "managers"].include? controller_name + end + + def menu_banners + ["banners"].include? controller_name + end + def official_level_options options = [["",0]] (1..5).each do |i| diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb index 31d3911a0..4b657939a 100644 --- a/app/views/admin/_menu.html.erb +++ b/app/views/admin/_menu.html.erb @@ -1,130 +1,122 @@ -