Completely remove left sidebar for not logged in users

This commit is contained in:
Piotr Sarnacki 2015-03-30 13:22:38 +02:00
parent ecc635bde5
commit 6695a8e19a
8 changed files with 20 additions and 32 deletions

View File

@ -65,9 +65,6 @@ Controller = Ember.ArrayController.extend
@set('tab', tab)
this["view_#{tab}".camelize()](params)
viewRecent: ->
@set('content', @get('recentRepos'))
viewOwned: ->
@set('content', @get('userRepos'))

View File

@ -14,8 +14,7 @@ Route = TravisRoute.extend
setupController: (controller)->
# TODO: this is redundant with repositories and recent routes
toActivate = if @signedIn() then 'owned' else 'recent'
@container.lookup('controller:repos').activate(toActivate)
@container.lookup('controller:repos').activate('owned')
activate: ->
# subscribe to pusher only if we're at a main route

View File

@ -2,7 +2,9 @@
Route = TravisRoute.extend
redirect: ->
target = if @signedIn() then 'repositories' else 'recent'
@transitionTo("main.#{target}")
if @signedIn()
@transitionTo('main.repositories')
else
@transitionTo('home')
`export default Route`

View File

@ -1,15 +1,7 @@
`import TravisRoute from 'travis/routes/basic'`
`import MainTabRoute from 'travis/routes/main-tab'`
`import Ember from 'ember'`
Route = MainTabRoute.extend
reposTabName: 'recent'
activate: ->
@_super.apply(this, arguments)
@store.set('isRecentTabOpen', true)
deactivate: ->
@_super.apply(this, arguments)
@store.set('isRecentTabOpen', false)
Route = Ember.Route.extend
redirect: ->
@transitionTo('main')
`export default Route`

View File

@ -3,8 +3,7 @@
Route = TravisRoute.extend
setupController: ->
$('body').attr('id', 'simple')
toActivate = if @signedIn() then 'owned' else 'recent'
@container.lookup('controller:repos').activate(toActivate)
@container.lookup('controller:repos').activate('owned')
@_super.apply(this, arguments)
renderTemplate: ->

View File

@ -63,30 +63,35 @@
margin-left: -100%
max-width: 325px
.wrapper-main
.wrapper-main.non-centered
width: grid-calc(18, 24)
float: left
margin-left: grid-calc(6, 24)
overflow: visible
.wrapper-main.centered
max-width: 1024px
margin-left: auto
margin-right: auto
@media #{$xlarge-up}
#left
width: grid-calc(7, 36)
.wrapper-main
.wrapper-main.non-centered
width: grid-calc(29, 36)
margin-left: grid-calc(7, 36)
@media #{$xxlarge-up}
#left
width: grid-calc(6, 36)
.wrapper-main
.wrapper-main.non-centered
width: grid-calc(30, 36)
margin-left: grid-calc(6, 36)
@media screen and (min-width: 2200px)
#left
width: grid-calc(5, 36)
.wrapper-main
.wrapper-main.non-centered
width: grid-calc(31, 36)
margin-left: grid-calc(5, 36)

View File

@ -6,7 +6,7 @@
{{render "flash"}}
<div class="wrapper-main">
<div {{bind-attr class=":wrapper-main auth.signedIn:non-centered:centered"}}>
<div id="main" role="main">
{{yield}}
</div>

View File

@ -4,12 +4,6 @@
<a href="#" {{action "showMyRepositories"}}>My Repositories</a>
</li>
{{#unless config.pro}}
<li id="tab_recent" {{bind-attr class="view.classRecent"}}>
{{#link-to "main.recent"}}Recent{{/link-to}}
</li>
{{/unless}}
{{#if config.pro}}
<li id="tab_running" {{bind-attr class="view.classRunning"}}>
<a href="#" {{action "showRunningJobs"}}>Running ({{startedJobsCount}}/{{allJobsCount}})</a>