collapse left navbar sections

This commit is contained in:
fla 2016-02-28 19:57:40 +01:00 committed by Flaburgan
parent 70140259ba
commit a10601f9a9
5 changed files with 59 additions and 20 deletions

View file

@ -4,11 +4,16 @@ app.views.Sidebar = app.views.Base.extend({
el: ".info-bar", el: ".info-bar",
events: { events: {
"click input#invite_code": "selectInputText" "click input#invite_code": "selectInputText",
"click .section .title": "toggleSection"
}, },
selectInputText: function(event) { selectInputText: function(event) {
event.target.select(); event.target.select();
},
toggleSection: function(e) {
$(e.target).closest(".section").toggleClass("collapsed");
} }
}); });
// @license-end // @license-end

View file

@ -29,7 +29,7 @@ code {
} }
body { body {
background-color: $sidebars-background; background-color: $main-background;
padding: 0; padding: 0;
} }

View file

@ -101,19 +101,35 @@
} }
.info-bar { .info-bar {
border-top: 1px solid $border-grey;
padding: 0 20px; padding: 0 20px;
.section { .section {
margin-top: 20px; margin-top: 10px;
&:last-child {
margin-bottom: 10px;
}
&:not(.collapsed) .entypo-triangle-right,
&.collapsed .entypo-triangle-down,
&.collapsed .content {
display: none;
}
&.collapsed .title h5 {
font-weight: normal;
}
} }
.title { .title {
border-bottom: 1px solid $border-grey; cursor: pointer;
padding-bottom: 5px; padding-bottom: 5px;
h5 { h5 {
color: $text-dark-grey; color: $text-dark-grey;
font-size: $font-size-base; font-size: $font-size-base;
font-weight: bold;
margin: 0; margin: 0;
} }
} }

View file

@ -24,7 +24,12 @@ h1.tag {
} }
.page-tags { .page-tags {
#tags_show { #tags_show {
.col-md-3 { .sidebar {
h3 {
font-size: 13px;
line-height: 1.1;
}
.side_stream #people_stream { .side_stream #people_stream {
.name { display: block; } .name { display: block; }
.name, .diaspora_handle { .name, .diaspora_handle {

View file

@ -9,14 +9,14 @@
- if current_user.getting_started? - if current_user.getting_started?
#welcome-to-diaspora #welcome-to-diaspora
.container .container-fluid
.row .row
.col-md-8.offset1 .col-md-9
%h1 %h1
= t('aspects.index.welcome_to_diaspora', name: current_user.first_name) = t('aspects.index.welcome_to_diaspora', name: current_user.first_name)
%h3 %h3
= t('aspects.index.introduce_yourself') = t('aspects.index.introduce_yourself')
.col-md-2 .col-md-3
.pull-right .pull-right
= link_to '×'.html_safe, getting_started_completed_path, id: "gs-skip-x", class: "close" = link_to '×'.html_safe, getting_started_completed_path, id: "gs-skip-x", class: "close"
@ -40,16 +40,20 @@
.info-bar.hidden-xs .info-bar.hidden-xs
- if AppConfig.settings.invitations.open? - if AppConfig.settings.invitations.open?
.section .section.collapsed
.title .title
%h5.title-header %h5.title-header
.entypo-triangle-right
.entypo-triangle-down
= t("shared.invitations.invite_your_friends") = t("shared.invitations.invite_your_friends")
.content .content
= render "shared/invitations" = render "shared/invitations"
.section .section.collapsed
.title .title
%h5.title-header %h5.title-header
.entypo-triangle-right
.entypo-triangle-down
= t("aspects.index.new_here.title") = t("aspects.index.new_here.title")
.content .content
!= t("aspects.index.new_here.follow", != t("aspects.index.new_here.follow",
@ -59,9 +63,11 @@
= link_to(t("aspects.index.new_here.learn_more"), = link_to(t("aspects.index.new_here.learn_more"),
"http://wiki.diasporafoundation.org/Welcoming_Committee") "http://wiki.diasporafoundation.org/Welcoming_Committee")
.section .section.collapsed
.title .title
%h5.title-header %h5.title-header
.entypo-triangle-right
.entypo-triangle-down
= t("aspects.index.help.need_help") = t("aspects.index.help.need_help")
.content .content
%p %p
@ -91,9 +97,11 @@
target: "_blank") target: "_blank")
- unless AppConfig.configured_services.blank? || all_services_connected? - unless AppConfig.configured_services.blank? || all_services_connected?
.section .section.collapsed
.title .title
%h5.title-header %h5.title-header
.entypo-triangle-right
.entypo-triangle-down
= t("aspects.index.services.heading") = t("aspects.index.services.heading")
.content .content
%div %div
@ -107,17 +115,21 @@
class: "social-media-logos-#{service.to_s.downcase}-24x24", class: "social-media-logos-#{service.to_s.downcase}-24x24",
title: service.to_s.titleize), "/auth/#{service}") title: service.to_s.titleize), "/auth/#{service}")
.section .section.collapsed
.title .title
%h5.title-header %h5.title-header
.entypo-triangle-right
.entypo-triangle-down
= t("bookmarklet.heading") = t("bookmarklet.heading")
.content .content
!= t("bookmarklet.explanation", link: link_to(t("bookmarklet.post_something"), bookmarklet_code)) != t("bookmarklet.explanation", link: link_to(t("bookmarklet.post_something"), bookmarklet_code))
- if AppConfig.settings.paypal_donations.enable? || AppConfig.bitcoin_donation_address - if AppConfig.settings.paypal_donations.enable? || AppConfig.bitcoin_donation_address
.section .section.collapsed
.title .title
%h5.title-header %h5.title-header
.entypo-triangle-right
.entypo-triangle-down
= t("aspects.index.donate") = t("aspects.index.donate")
.content .content
%p %p
@ -125,9 +137,11 @@
= render "shared/donatepod" = render "shared/donatepod"
- if AppConfig.admins.podmin_email.present? - if AppConfig.admins.podmin_email.present?
.section .section.collapsed
.title .title
%h5.title-header %h5.title-header
.entypo-triangle-right
.entypo-triangle-down
= t("aspects.index.help.any_problem") = t("aspects.index.help.any_problem")
.content .content
%p %p
@ -135,8 +149,7 @@
%p %p
= link_to t("aspects.index.help.mail_podmin"), "mailto:#{AppConfig.admins.podmin_email}" = link_to t("aspects.index.help.mail_podmin"), "mailto:#{AppConfig.admins.podmin_email}"
.section .info-bar
.title
.content .content
%ul %ul
= render "shared/links" = render "shared/links"