Skip to content
This repository was archived by the owner on Mar 20, 2019. It is now read-only.

Commit 485c67a

Browse files
committed
Merge pull request coderwall#158 from seuros/menu
Style top menu
2 parents 4d1cf1b + b9ba642 commit 485c67a

File tree

7 files changed

+49
-80
lines changed

7 files changed

+49
-80
lines changed

app/assets/stylesheets/application.css.scss

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@import "base";
2-
@import "compass/css3/";
2+
@import "compass/css3";
33
@import "fonts";
44
@import "normailze";
55
@import "tipTip";
@@ -103,31 +103,23 @@ h4 {
103103
#nav {
104104
float: right;
105105
li {
106-
float: left;
106+
display: inline-block;
107107
line-height: 100px;
108108
margin-left: 30px;
109109
&:first-child {
110110
margin: 0px;
111111
}
112112
}
113-
.new {
114-
a:before {
115-
content: "New";
116-
padding: 3px 6px 2px 6px;
117-
@include border-radius(4px);
118-
background: $light-blue;
119-
color: #fff;
120-
margin-right: 10px;
121-
font-size: 0.7em;
122-
vertical-align: middle;
123-
text-transform: uppercase;
124-
}
113+
i {
114+
font-size: 1.4em;
115+
color: $level2;
116+
margin-right: 2px;
125117
}
126118
a {
127119
font-size: 1.4em;
128120
color: #fff;
129121
@include ts-top-black;
130-
display: block;
122+
display: inline;
131123
&:hover {
132124
color: $light-blue;
133125
}
@@ -137,6 +129,9 @@ h4 {
137129
&:hover {
138130
color: $light-grey;
139131
}
132+
i {
133+
color: $level1;
134+
}
140135
}
141136
}
142137

app/helpers/application_helper.rb

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -124,26 +124,6 @@ def connections_nav_class
124124
end
125125
end
126126

127-
def team_nav_class
128-
if params[:controller] == "teams" && params[:action] != 'index'
129-
if signed_in? && current_user.team_document_id == params[:id] || params[:id].blank?
130-
'active'
131-
else
132-
nil
133-
end
134-
else
135-
nil
136-
end
137-
end
138-
139-
def teams_nav_class
140-
if params[:controller] == "teams" && params[:action] == 'index'
141-
'active'
142-
else
143-
nil
144-
end
145-
end
146-
147127
def jobs_nav_class
148128
if params[:controller] == "opportunities" && params[:action] == 'index'
149129
'active'
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
header#masthead
2+
.inside-masthead.cf
3+
.mobile-panel.cf
4+
= link_to root_path, class: 'logo'
5+
span coderwall
6+
a.menu-btn
7+
8+
nav#nav
9+
ul
10+
li
11+
i.fa.fa-graduation-cap
12+
= link_to(t('protips'), root_path)
13+
-if signed_in?
14+
li
15+
i.fa.fa-user
16+
= link_to('Profile', badge_path(username: current_user.username), class: mywall_nav_class)
17+
18+
li
19+
i.fa.fa-money
20+
= link_to('Jobs', jobs_path, class: jobs_nav_class)
21+
-if signed_in?
22+
li
23+
i.fa.fa-cogs
24+
= link_to('Settings', settings_path, class: settings_nav_class)
25+
li
26+
i.fa.fa-sign-out
27+
= link_to('Sign out', sign_out_path)
28+
-else
29+
30+
li
31+
i.fa.fa-sign-in
32+
= link_to('Sign In', signin_path, class: signin_nav_class)
33+
li
34+
i.fa.fa-plus-square
35+
= link_to('Sign Up', signin_path, class: signup_nav_class)
36+

app/views/layouts/_navigation.html.haml

Lines changed: 0 additions & 23 deletions
This file was deleted.

app/views/layouts/application.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
= yield :head
1919

2020
%body{ id: yield(:body_id) }
21-
= render partial: 'layouts/navigation'
21+
= render partial: 'navigation'
2222
#main-content
2323
- if main_content_wrapper(yield(:content_wrapper))
2424
- if flash[:notice] || flash[:error]

app/views/layouts/protip.html.haml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,8 @@
1010
= yield :head
1111
= csrf_meta_tag
1212
%body.protip-single
13-
= render partial: 'layouts/navigation'
13+
= render partial: 'navigation'
1414

15-
.mobile-top
16-
%a.new-logo{href: '/'}
17-
%a.mobile-nav-btn#x-mobile-toggle
18-
19-
%nav.mobile-nav#x-mobile-menu
20-
%ul
21-
%li= link_to('Discover', root_path)
22-
-if signed_in?
23-
%li= link_to('Admin', admin_root_path) if is_admin?
24-
%li= link_to('Profile', badge_path(username: current_user.username), class: mywall_nav_class)
25-
26-
%li= link_to('Teams', teams_path, class: teams_nav_class)
27-
%li= link_to('Jobs', jobs_path, class: jobs_nav_class)
28-
-if signed_in?
29-
%li= link_to('Settings', settings_path, class: settings_nav_class)
30-
%li= link_to('Sign out', sign_out_path)
31-
-else
32-
%li= link_to('Sign In', signin_path, class: signin_nav_class)
33-
%li= link_to('Sign Up', signin_path, class: signup_nav_class)
3415
%canvas.blur{src: image_path(users_background_image)}
3516
=yield
3617

config/locales/en.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
33

44
en:
5-
hello: "Hello world"
5+
protips: "Protips"

0 commit comments

Comments
 (0)