Skip to content

Commit

Permalink
move the profile link out of the login buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Rayman committed Nov 7, 2014
1 parent f288615 commit 23a5edb
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 38 deletions.
53 changes: 27 additions & 26 deletions client/components/header/header.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
<template name="header">
<div class="navbar navbar-default" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{pathFor 'home'}}">Fusic <small>Realtime Social Music Collaboration</small></a>
</div>

<div class="navbar-right container-fluid">
<ul id="login" class="nav navbar-nav">
{{> loginButtons }}
</ul>
</div>
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{pathFor 'home'}}">Fusic <small>Realtime Social Music Collaboration</small></a>
</div>

{{#if currentUser}}
<div class="collapse navbar-collapse">
<div class="navbar-right container-fluid">
{{#with user}}
<ul class="nav navbar-nav">
<li class="{{ isActivePath regex='profile' }}">
<a href="{{pathFor 'userProfile'}}">
<span class="glyphicon glyphicon-user"></span> Profile
</a>
</li>
</ul>
{{/with}}
<ul id="login" class="nav navbar-nav">
{{> loginButtons }}
</ul>
</div>

{{#if currentUser}}
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="{{ isActivePath regex='playlists' }}"><a href="{{pathFor 'playlists'}}">Playlists</a></li>
<li class="{{ isActivePath regex='loved' }}"><a href="{{pathFor 'loved'}}">Loved songs</a></li>
Expand All @@ -28,16 +37,8 @@
</a>
</li>
</ul>
</div><!--/.nav-collapse -->
{{/if}}
</div><!--/.nav-collapse -->
{{/if}}

</div>
</template>

<template name="_loginButtonsAdditionalLoggedInDropdownActions">
{{#with user}}
<a href="{{pathFor 'userProfile'}}" class="btn btn-default btn-block" role="button">
<span class="glyphicon glyphicon-pencil"></span> Edit profile
</a>
{{/with}}
</template>
13 changes: 1 addition & 12 deletions client/components/header/header.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
Template.header.rendered = function() {
//apparantly still the easiest way to make slight adjustments to accounts-ui package
setTimeout(function(){
var html = '<span class="glyphicon glyphicon-user"></span>';
var current = $("#login a.dropdown-toggle").html();
html = html + current;
$("#login a.dropdown-toggle").html(html);
}, 3000);

}

Template._loginButtonsAdditionalLoggedInDropdownActions.user = function(){
Template.header.user = function (){
return Meteor.user();
}

0 comments on commit 23a5edb

Please sign in to comment.