add an events tab

This commit is contained in:
Sven Fuchs 2012-10-16 02:00:24 +02:00
parent 257a26d1d0
commit f91622e7e8
14 changed files with 40 additions and 6 deletions

View File

@ -43,7 +43,7 @@ GIT
GIT
remote: git://github.com/travis-ci/travis-api.git
revision: 602bd4d30db7b41520615947556d5e77d6fae0a4
revision: 6b02ffabacd4476e1a0b4d7f150d0733cfbb57d9
specs:
travis-api (0.0.1)
backports (~> 2.5)

View File

@ -42,6 +42,10 @@ Travis.RepoController = Travis.Controller.extend
@connectTab('branches')
@_bind('builds', 'repo.branches')
viewEvents: ->
@connectTab('events')
@_bind('events', 'repo.events')
viewBuild: ->
@connectTab('build')

View File

@ -4,6 +4,7 @@ require 'models/artifact'
require 'models/branch'
require 'models/build'
require 'models/commit'
require 'models/event'
require 'models/hook'
require 'models/job'
require 'models/repo'

View File

@ -21,8 +21,6 @@ require 'travis/model'
@notifyPropertyChange 'started_at'
@notifyPropertyChange 'finished_at'
@Travis.Branch.reopenClass
byRepoId: (id) ->
@find repository_id: id

View File

@ -37,6 +37,10 @@ require 'travis/model'
Travis.Branch.byRepoId @get('id')
).property()
events: (->
Travis.Event.byRepoId @get('id')
).property()
owner: (->
(@get('slug') || '').split('/')[0]
).property('slug')

View File

@ -124,6 +124,7 @@ Travis.Router = Ember.Router.extend
showBuild: Ember.Route.transitionTo('root.home.repo.builds.show')
showPullRequests: Ember.Route.transitionTo('root.home.repo.pullRequests')
showBranches: Ember.Route.transitionTo('root.home.repo.branches')
showEvents: Ember.Route.transitionTo('root.home.repo.events')
showJob: Ember.Route.transitionTo('root.home.repo.job')
showProfile: Ember.Route.transitionTo('root.profile')
@ -390,6 +391,11 @@ Travis.Router = Ember.Router.extend
connectOutlets: (router, repo) ->
router.get('repoController').activate 'branches'
events: Ember.Route.extend
route: '/events'
connectOutlets: (router, repo) ->
router.get('repoController').activate 'events'
job: Ember.Route.extend
route: '/jobs/:job_id'
connectOutlets: (router, job) ->

View File

@ -35,6 +35,15 @@
{{/if}}
</h5>
</li>
<li id="tab_events" {{bindAttr class="view.classEvents"}}>
<h5>
{{#if view.repo.slug}}
<a {{action showEvents view.repo href=true}}>
Events
</a>
{{/if}}
</h5>
</li>
<li id="tab_build" {{bindAttr class="view.classBuild"}}>
<h5>
{{#if view.build.id}}

View File

@ -20,6 +20,7 @@ require 'ext/ember/namespace'
require 'views/accounts'
require 'views/application'
require 'views/build'
require 'views/events'
require 'views/flash'
require 'views/job'
require 'views/repo'

View File

@ -53,6 +53,10 @@
'active' if @get('tab') == 'branches'
).property('tab')
classEvents: (->
'active' if @get('tab') == 'events'
).property('tab')
classBuild: (->
tab = @get('tab')
classes = []

View File

@ -43,3 +43,6 @@ table.list
td:last-child
@include border-right-radius(4px)
tr.message, td.message
width: 100%

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -3620,6 +3620,10 @@ table.list td:last-child {
-webkit-border-bottom-right-radius: 4px;
border-bottom-right-radius: 4px;
}
/* line 47, /Users/sven/Development/projects/travis/travis-web/assets/styles/main/list.sass */
table.list tr.message, table.list td.message {
width: 100%;
}
/* line 3, /Users/sven/Development/projects/travis/travis-web/assets/styles/_mixins/ansi.sass */
.ansi .bold {
font-weight: bold;

View File

@ -1 +1 @@
ef63edf5
6250e20b