From 99c7aa8f86afb0bd961a93367f38b6c4a23bffd7 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Fri, 30 Jan 2015 22:46:44 +0100 Subject: [PATCH] add mobile navigation for lists and timelines --- app/views/group/index.html.haml | 1 + app/views/public/index.html.haml | 1 + app/views/shared/_sidebar.html.haml | 2 +- app/views/static/_mobile-nav.html.haml | 14 ++++++++++++++ app/views/static/index.html.haml | 1 + 5 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 app/views/static/_mobile-nav.html.haml diff --git a/app/views/group/index.html.haml b/app/views/group/index.html.haml index d9f363bf..a4d167ff 100644 --- a/app/views/group/index.html.haml +++ b/app/views/group/index.html.haml @@ -1,3 +1,4 @@ += render 'static/mobile-nav' .container.j2-page .col-md-3.col-sm-3 = render 'shared/sidebar' diff --git a/app/views/public/index.html.haml b/app/views/public/index.html.haml index d9f363bf..a4d167ff 100644 --- a/app/views/public/index.html.haml +++ b/app/views/public/index.html.haml @@ -1,3 +1,4 @@ += render 'static/mobile-nav' .container.j2-page .col-md-3.col-sm-3 = render 'shared/sidebar' diff --git a/app/views/shared/_sidebar.html.haml b/app/views/shared/_sidebar.html.haml index 1fc18c9b..93f7ab4c 100644 --- a/app/views/shared/_sidebar.html.haml +++ b/app/views/shared/_sidebar.html.haml @@ -32,7 +32,7 @@ .col-md-6.col-sm-6.col-xs-6 %h4.entry-text#answered-count= current_user.smiled_count %h6.entry-subtext Smiles -.panel.panel-default +.panel.panel-default.hidden-xs .panel-body %ul.nav.nav-pills.nav-stacked = nav_entry "Timeline", root_path diff --git a/app/views/static/_mobile-nav.html.haml b/app/views/static/_mobile-nav.html.haml new file mode 100644 index 00000000..cedf46c2 --- /dev/null +++ b/app/views/static/_mobile-nav.html.haml @@ -0,0 +1,14 @@ +%nav.navbar.navbar-default.navbar-fixed-top.visible-xs{role: "navigation"} + .container + .navbar-header + %button.navbar-toggle{"data-target" => "#j2-tl-navbar-collapse", "data-toggle" => "collapse", type: "button"} + %span.sr-only Toggle navigation + %span.icon-bar + %span.icon-bar + %span.icon-bar + %a.navbar-brand{href: "/"} Timelines & Lists + #j2-tl-navbar-collapse.collapse.navbar-collapse + %ul.nav.navbar-nav + = nav_entry "Public", public_timeline_path + - current_user.groups.each do |group| + = nav_entry group.display_name, group_timeline_path(group.name) diff --git a/app/views/static/index.html.haml b/app/views/static/index.html.haml index 14d88172..1102acdd 100644 --- a/app/views/static/index.html.haml +++ b/app/views/static/index.html.haml @@ -1,4 +1,5 @@ - if user_signed_in? + = render 'static/mobile-nav' .container.j2-page .col-md-3.col-sm-3 = render 'shared/sidebar'