Travis mostly works with new router

I haven't touched almost all of the things related to profile. I'm not
also sure what's the state of authentication at this point.

Conflicts:

	Gemfile
	Gemfile.lock
	Procfile
	assets/javascripts/app/app.coffee
	assets/javascripts/app/controllers.coffee
	assets/javascripts/app/controllers/auth.coffee
	assets/javascripts/app/controllers/profile.coffee
	assets/javascripts/app/routes.coffee
	assets/javascripts/app/templates/builds/list.hbs
	assets/javascripts/app/templates/builds/show.hbs
	assets/javascripts/app/templates/jobs/list.hbs
	assets/javascripts/app/templates/layouts/top.hbs
	assets/javascripts/app/templates/repos/list.hbs
	assets/javascripts/app/templates/repos/show/tabs.hbs
	assets/javascripts/app/templates/workers/list.hbs
	assets/javascripts/app/views.coffee
	assets/javascripts/app/views/repo/show.coffee
	assets/javascripts/travis.coffee
	public/index.html
	public/javascripts/application.js
	public/stylesheets/application.css
This commit is contained in:
Piotr Sarnacki 2012-09-14 15:34:35 +02:00
parent b31515fa57
commit 1134028996
27 changed files with 1767 additions and 1729 deletions

View File

@ -26,8 +26,7 @@ Travis.reopen
authStateBinding: 'auth.state' authStateBinding: 'auth.state'
init: -> init: ->
@_super() @_super.apply this, arguments
@connect()
@store = Travis.Store.create() @store = Travis.Store.create()
@store.loadMany(Travis.Sponsor, Travis.SPONSORS) @store.loadMany(Travis.Sponsor, Travis.SPONSORS)
@ -35,7 +34,7 @@ Travis.reopen
@set('auth', Travis.Auth.create(store: @store, endpoint: Travis.config.api_endpoint)) @set('auth', Travis.Auth.create(store: @store, endpoint: Travis.config.api_endpoint))
@slider = new Travis.Slider() @slider = new Travis.Slider()
@routes = new Travis.Routes()
@pusher = new Travis.Pusher() @pusher = new Travis.Pusher()
@tailing = new Travis.Tailing() @tailing = new Travis.Tailing()
@ -54,18 +53,13 @@ Travis.reopen
receive: -> receive: ->
@store.receive.apply(@store, arguments) @store.receive.apply(@store, arguments)
connectLayout: (name) -> toggleSidebar: ->
unless @get('layout.name') == name $('body').toggleClass('maximized')
name = $.camelize(name) # TODO gotta force redraws here :/
viewClass = Travis["#{name}Layout"] element = $('<span></span>')
@layout = Travis["#{name}Controller"].create(parent: @controller) $('#top .profile').append(element)
@controller.connectOutlet(outletName: 'layout', controller: @layout, viewClass: viewClass) Em.run.later (-> element.remove()), 10
@layout element = $('<span></span>')
$('#repository').append(element)
connect: -> Em.run.later (-> element.remove()), 10
@controller = Em.Controller.create()
view = Em.View.create
template: Em.Handlebars.compile('{{outlet layout}}')
controller: @controller
view.appendTo(@get('rootElement') || 'body')

View File

@ -3,16 +3,6 @@ require 'travis/ticker'
Travis.reopen Travis.reopen
Controller: Em.Controller.extend Controller: Em.Controller.extend
init: ->
for name in Array.prototype.slice.apply(arguments)
name = "#{$.camelize(name, false)}Controller"
klass = Travis[$.camelize(name)] || Em.Controller
this[name] = klass.create(parent: this, namespace: Travis, controllers: this)
connectTop: ->
@connectOutlet(outletName: 'top', controller: @topController, viewClass: Travis.TopView)
@topController.set('tab', @get('name'))
connectOutlet: -> connectOutlet: ->
view = @_super.apply(this, arguments) view = @_super.apply(this, arguments)
@ -28,6 +18,7 @@ Travis.reopen
TopController: Em.Controller.extend TopController: Em.Controller.extend
userBinding: 'Travis.app.currentUser' userBinding: 'Travis.app.currentUser'
ApplicationController: Em.Controller.extend()
require 'controllers/accounts' require 'controllers/accounts'
require 'controllers/builds' require 'controllers/builds'

View File

@ -1,13 +1,5 @@
Travis.HomeController = Travis.Controller.extend Travis.HomeController = Travis.Controller.extend
name: 'home' name: 'home'
init: ->
@_super('top', 'repositories', 'repository', 'sidebar')
@connectTop()
@connectOutlet outletName: 'left', controller: @repositoriesController, viewClass: Travis.RepositoriesView
@connectOutlet outletName: 'main', controller: @repositoryController, viewClass: Travis.RepositoryView
@connectOutlet outletName: 'right', controller: @sidebarController, viewClass: Travis.SidebarView
activate: (action, params) -> activate: (action, params) ->
@repositoryController.activate(action, params) @repositoryController.activate(action, params)

View File

@ -3,11 +3,12 @@ Travis.ProfileController = Travis.Controller.extend
userBinding: 'Travis.app.currentUser' userBinding: 'Travis.app.currentUser'
init: -> init: ->
@_super('top', 'accounts') @_super()
@connectTop() # @_super('top', 'accounts')
@connectOutlet outletName: 'left', controller: @accountsController, viewClass: Travis.AccountsView # @connectTop()
@connectOutlet(outletName: 'main', controller: this, viewClass: Travis.ProfileView) # @connectOutlet outletName: 'left', controller: @accountsController, viewClass: Travis.AccountsView
@accounts = @accountsController.get('content') # @connectOutlet(outletName: 'main', controller: this, viewClass: Travis.ProfileView)
# @accounts = @accountsController.get('content')
account: (-> account: (->
login = @get('params.login') || Travis.app.get('currentUser.login') login = @get('params.login') || Travis.app.get('currentUser.login')

View File

@ -3,7 +3,7 @@ Travis.RepositoryController = Travis.Controller.extend
params: {} params: {}
init: -> init: ->
@_super('builds', 'build', 'job') @_super.apply this, arguments
Ember.run.later(@updateTimes.bind(this), Travis.INTERVALS.updateTimes) Ember.run.later(@updateTimes.bind(this), Travis.INTERVALS.updateTimes)
updateTimes: -> updateTimes: ->

View File

@ -3,8 +3,7 @@ Travis.StatsController = Travis.Controller.extend
init: -> init: ->
@_super('top') @_super('top')
@connectTop() #@connectOutlet(outletName: 'main', controller: this, viewClass: Travis.StatsView)
@connectOutlet(outletName: 'main', controller: this, viewClass: Travis.StatsView)
activate: (action, params) -> activate: (action, params) ->
# noop # noop

View File

@ -18,10 +18,6 @@ require 'travis/model'
@get('state') == 'working' @get('state') == 'working'
).property('state') ).property('state')
urlJob: (->
"/#{@get('repository')}/jobs/#{@get('job_id')}" if @get('state') == 'working'
).property('repository', 'job_id', 'state')
repository: (-> repository: (->
@get('payload.repository.slug') @get('payload.repository.slug')
).property('payload.repository.slug') ).property('payload.repository.slug')
@ -29,3 +25,7 @@ require 'travis/model'
job_id: (-> job_id: (->
@get('payload.job.id') @get('payload.job.id')
).property('payload.job.id') ).property('payload.job.id')
job: (->
Travis.Job.find @get('job_id')
).property('job_id')

View File

@ -1,42 +1,171 @@
Travis.Routes = -> Travis.Router = Ember.Router.extend
unless Travis.Routes.initialized location: 'hash'
Ember.run.next => enableLogging: true
Em.routes.set('usesHistory', true) initialState: 'loading'
Em.routes.set('wantsHistory', true)
Em.routes.set('baseURI', @base_uri)
@add(route, target[0], target[1]) for route, target of Travis.ROUTES goToRoot: Ember.Route.transitionTo('root.home.show')
Travis.Routes.initialized = true goToStats: Ember.Route.transitionTo('root.home.stats')
showRepository: Ember.Route.transitionTo('root.home.repository.show')
$.extend Travis.Routes.prototype, showBuilds: Ember.Route.transitionTo('root.home.repository.builds.index')
base_uri: "#{document.location.protocol}//#{document.location.host}" showBuild: Ember.Route.transitionTo('root.home.repository.builds.show')
showPullRequests: Ember.Route.transitionTo('root.home.repository.pullRequests')
add: (route, layout, action) -> showBranches: Ember.Route.transitionTo('root.home.repository.branches')
Em.routes.add route, (params) => showJob: Ember.Route.transitionTo('root.home.repository.job')
@action(layout, action, params)
route: (location) ->
location = $(event.target).closest('a')[0].href.replace("#{@base_uri}/", '') if typeof location != 'string'
Em.routes.set('location', location)
action: (name, action, params) ->
# this needs to be a global reference because Em.routes is global
Travis.app.render(name, action, params) if @before(name, action, params)
before: (name, action, params) ->
if @requiresAuth(name, action, params)
@requireAuth(name, action, params)
else
true
signedIn: -> signedIn: ->
!!Travis.app.get('currentUser') !!Travis.app.get('currentUser')
requiresAuth: (name, action, params) -> requiresAuth: (path) ->
name == 'profile' and not @signedIn() # TODO: not sure what the path is at the moment
path == '/profile' && !@signedIn()
requireAuth: (name, action, params) -> loading: Ember.Route.extend
Travis.app.set('returnTo', [name, action, params]) routePath: (router, path) ->
# Travis.app.render('auth', 'show') router.set('lastAttemptedPath', path)
@route('') if router.requiresAuth(path)
false router.send 'switchToUnauthenticated'
else
router.send 'switchToAuthenticated'
switchToUnauthenticated: Ember.State.transitionTo('unauthenticated.index')
switchToAuthenticated: Ember.State.transitionTo('authenticated.index')
unauthenticated: Ember.Route.extend
index: Ember.Route.extend
route: '/'
connectOutlets: (router) ->
router.transitionTo('login')
login: Ember.Route.extend
route: '/login'
connectOutlets: (router) ->
router.get('applicationController').connectOutlet('login')
authenticated: Ember.Route.extend
index: Ember.Route.extend
connectOutlets: (router) ->
router.transitionTo('root')
path = router.get('lastAttemptedPath')
if path && path != '/'
router.route(path)
root: Ember.Route.extend
initialState: 'home'
loading: Ember.State.extend()
home: Ember.Route.extend
initialState: 'show'
route: '/'
connectOutlets: (router) ->
router.get('applicationController').connectOutlet 'left', 'repositories'
router.get('applicationController').connectOutlet 'right', 'sidebar'
router.get('applicationController').connectOutlet 'top', 'top'
router.get('applicationController').connectOutlet 'main', 'repository'
show: Ember.Route.extend
route: '/'
connectOutlets: (router) ->
router.get('repositoryController').activate('index')
stats: Ember.Route.extend
route: '/stats'
connectOutlets: (router) ->
router.get('applicationController').connectOutlet 'main', 'stats'
repository: Ember.Route.extend
initialState: 'show'
route: '/:owner/:name'
connectOutlets: (router, repository) ->
params = { owner: repository.get('owner'), name: repository.get('name') }
# TODO: we can just pass objects instead of params now, I'm leaving this
# to not have to rewrite too much, but it would be nice to fix this
# later
router.get('repositoryController').setParams(params)
deserialize: (router, params) ->
slug = "#{params.owner}/#{params.name}"
repos = Travis.Repository.bySlug(slug)
deferred = $.Deferred()
observer = ->
if repos.get 'isLoaded'
repos.removeObserver 'isLoaded', observer
deferred.resolve repos.objectAt(0)
repos.addObserver 'isLoaded', observer
deferred.promise()
serialize: (router, repository) ->
if repository
{ owner: repository.get('owner'), name: repository.get('name') }
else
{}
show: Ember.Route.extend
route: '/'
connectOutlets: (router) ->
router.get('repositoryController').activate('current')
builds: Ember.Route.extend
route: '/builds'
initialState: 'index'
index: Ember.Route.extend
route: '/'
connectOutlets: (router, repository) ->
router.get('repositoryController').activate 'builds'
show: Ember.Route.extend
route: '/:build_id'
connectOutlets: (router, build) ->
router.get('repositoryController').activate 'build', id: build.get('id')
deserialize: (router, params) ->
# Something is wrong here. If I don't use deferred, id is not
# initialized and url ends up being /jobs/null
# This should not be needed, as id should be immediately set on the
# record.
# TODO: find out why it happens
build = Travis.Build.find params.build_id
deferred = $.Deferred()
observer = ->
if build.get 'id'
build.removeObserver 'id', observer
deferred.resolve build
build.addObserver 'id', observer
deferred.promise()
pullRequests: Ember.Route.extend
route: '/pull_requests'
connectOutlets: (router, repository) ->
router.get('repositoryController').activate 'pull_requests'
branches: Ember.Route.extend
route: '/branches'
connectOutlets: (router, repository) ->
router.get('repositoryController').activate 'branches'
job: Ember.Route.extend
route: '/jobs/:job_id'
connectOutlets: (router, job) ->
router.get('repositoryController').activate 'job', id: job.get('id')
deserialize: (router, params) ->
job = Travis.Job.find params.job_id
deferred = $.Deferred()
observer = ->
if job.get 'id'
job.removeObserver 'id', observer
deferred.resolve job
job.addObserver 'id', observer
deferred.promise()

View File

@ -0,0 +1 @@
heyho

View File

@ -16,9 +16,11 @@
<tr {{bindAttr class="view.color"}}> <tr {{bindAttr class="view.color"}}>
<td class="number"> <td class="number">
<span class="status"></span> <span class="status"></span>
<a {{bindAttr href="view.urlBuild"}} {{action route}}> {{#if id}}
<a {{action showBuild this href=true}}>
{{number}} {{number}}
</a> </a>
{{/if}}
</td> </td>
<td class="commit"> <td class="commit">
<a {{bindAttr href="view.urlGithubCommit"}}> <a {{bindAttr href="view.urlGithubCommit"}}>
@ -39,7 +41,6 @@
{{/each}} {{/each}}
</tbody> </tbody>
</table> </table>
<p> <p>
<button {{action showMore on="click" target="this" isVisibleBinding="hasMore"}}> <button {{action showMore on="click" target="this" isVisibleBinding="hasMore"}}>
{{t builds.show_more}} {{t builds.show_more}}

View File

@ -6,9 +6,9 @@
<dt>{{t builds.name}}</dt> <dt>{{t builds.name}}</dt>
<dd class="number"> <dd class="number">
<span class="status"></span> <span class="status"></span>
<a {{bindAttr href="urlBuild"}} {{action route}}> {{#if build.id}}
{{build.number}} <a {{action showBuild build href=true}}>{{build.number}}</a>
</a> {{/if}}
</dd> </dd>
<dt class="finished_at_label">{{t builds.finished_at}}</dt> <dt class="finished_at_label">{{t builds.finished_at}}</dt>
<dd class="finished_at timeago" {{bindAttr title="finishedAt"}}>{{formatTime build.finishedAt}}</dd> <dd class="finished_at timeago" {{bindAttr title="finishedAt"}}>{{formatTime build.finishedAt}}</dd>

View File

@ -8,7 +8,7 @@
<table id="allowed_failure_jobs" class="list"> <table id="allowed_failure_jobs" class="list">
<caption> <caption>
{{t jobs.allowed_failures}} {{t jobs.allowed_failures}}
<a title="What's this?" class="help" name="help-allowed_failures" {{action popup}}></a> <a title="What's this?" class="help" name="help-allowed_failures" {{action toggleHelp target="view"}}></a>
</caption> </caption>
{{/if}} {{/if}}
<thead> <thead>
@ -23,9 +23,9 @@
{{#view Travis.JobsItemView contextBinding="job"}} {{#view Travis.JobsItemView contextBinding="job"}}
<td class="number"> <td class="number">
<span class="status"></span> <span class="status"></span>
<a {{bindAttr href="view.urlJob"}} {{action route}}> {{#if job.id}}
{{number}} <a {{action showJob repository job href=true}}>{{number}}</a>
</a> {{/if}}
</td> </td>
<td class="duration" {{bindAttr title="startedAt"}}> <td class="duration" {{bindAttr title="startedAt"}}>
{{formatDuration duration}} {{formatDuration duration}}

View File

@ -4,7 +4,11 @@
<dl id="summary"> <dl id="summary">
<div class="left"> <div class="left">
<dt>Job</dt> <dt>Job</dt>
<dd class="number"><a {{bindAttr href="view.urlJob"}} {{action route}}>{{job.number}}</a></dd> <dd class="number">
{{#if job.id}}
<a {{action showJob repository job href=true}}>{{job.number}}</a>
{{/if}}
</dd>
<dt class="finished_at_label">{{t jobs.finished_at}}</dt> <dt class="finished_at_label">{{t jobs.finished_at}}</dt>
<dd class="finished_at timeago" {{bindAttr title="finishedAt"}}>{{formatTime job.finishedAt}}</dd> <dd class="finished_at timeago" {{bindAttr title="finishedAt"}}>{{formatTime job.finishedAt}}</dd>
<dt>{{t jobs.duration}}</dt> <dt>{{t jobs.duration}}</dt>

View File

@ -1,8 +1,11 @@
<div id="top"> {{! TODO apparently styles assume that there is more divs here...
I should fix that later }}
<div><div>
<div id="top">
{{outlet top}} {{outlet top}}
</div> </div>
<div id="page"> <div id="page">
<div id="left"> <div id="left">
{{outlet left}} {{outlet left}}
</div> </div>
@ -14,4 +17,5 @@
<div id="right"> <div id="right">
{{outlet right}} {{outlet right}}
</div> </div>
</div> </div>
</div></div>

View File

@ -1,13 +1,13 @@
<a href="/" {{action route}}> <a {{action goToRoot href=true}}>
<h1>Travis</h1> <h1>Travis</h1>
</a> </a>
<ul id="navigation"> <ul id="navigation">
<li {{bindAttr class="view.classHome"}}> <li {{bindAttr class="view.classHome"}}>
<a href="/" {{action route}}>Home</a> <a {{action goToRoot href=true}}>Home</a>
</li> </li>
<li {{bindAttr class="view.classStats"}}> <li {{bindAttr class="view.classStats"}}>
<a href="/stats" {{action route}}>Stats</a> <a {{action goToStats href=true}}>Stats</a>
</li> </li>
<li> <li>
<a href="http://about.travis-ci.org/blog">Blog</a> <a href="http://about.travis-ci.org/blog">Blog</a>

View File

@ -11,9 +11,13 @@
{{#with view.repository}} {{#with view.repository}}
<div class="slug-and-status"> <div class="slug-and-status">
<span class="status"></span> <span class="status"></span>
<a {{bindAttr href="view.urlRepository"}} {{action route}} class="slug">{{slug}}</a> {{#if slug}}
<a {{action showRepository this href=true}} class="slug">{{slug}}</a>
{{/if}}
</div> </div>
<a {{bindAttr href="view.urlLastBuild"}} {{action route}} class="last_build">{{lastBuildNumber}}</a> {{#if lastBuild.id}}
<a {{action showBuild this lastBuild href=true}} class="last_build">#{{lastBuildNumber}}</a>
{{/if}}
<p class="summary"> <p class="summary">
<span class="duration_label">{{t repositories.duration}}:</span> <span class="duration_label">{{t repositories.duration}}:</span>

View File

@ -1,12 +1,12 @@
<ul class="tabs"> <ul class="tabs">
<li id="tab_recent" {{bindAttr class="view.classRecent"}}> <li id="tab_recent" {{bindAttr class="view.classRecent"}}>
<h5><a name="recent" {{action activate}}>{{t layouts.application.recent}}</a></h5> <h5><a name="recent" {{action activate target="view"}}>{{t layouts.application.recent}}</a></h5>
</li> </li>
<li id="tab_owned" {{bindAttr class="view.classOwned"}}> <li id="tab_owned" {{bindAttr class="view.classOwned"}}>
<h5><a name="owned" {{action activate}}>{{t layouts.application.my_repositories}}</a></h5> <h5><a name="owned" {{action activate target="view"}}>{{t layouts.application.my_repositories}}</a></h5>
</li> </li>
<li id="tab_search" {{bindAttr class="view.classSearch"}}> <li id="tab_search" {{bindAttr class="view.classSearch"}}>
<h5><a name="search" {{action activate}}>{{t layouts.application.search}}</a></h5> <h5><a name="search" {{action activate target="view"}}>{{t layouts.application.search}}</a></h5>
</li> </li>
</ul> </ul>

View File

@ -1,44 +1,56 @@
<ul class="tabs"> <ul class="tabs">
<li id="tab_current" {{bindAttr class="view.classCurrent"}}> <li id="tab_current" {{bindAttr class="view.classCurrent"}}>
<h5> <h5>
<a {{bindAttr href="view.urlRepository"}} {{action route}}> {{#if view.repository.slug}}
<a {{action showRepository view.repository href=true}}>
{{t repositories.tabs.current}} {{t repositories.tabs.current}}
</a> </a>
{{/if}}
</h5> </h5>
</li> </li>
<li id="tab_builds" {{bindAttr class="view.classBuilds"}}> <li id="tab_builds" {{bindAttr class="view.classBuilds"}}>
<h5> <h5>
<a {{bindAttr href="view.urlBuilds"}} {{action route}}> {{#if view.repository.slug}}
<a {{action showBuilds view.repository href=true}}>
{{t repositories.tabs.build_history}} {{t repositories.tabs.build_history}}
</a> </a>
{{/if}}
</h5> </h5>
</li> </li>
<li id="tab_pull_requests" {{bindAttr class="view.classPullRequests"}}> <li id="tab_pull_requests" {{bindAttr class="view.classPullRequests"}}>
<h5> <h5>
<a {{bindAttr href="view.urlPullRequests"}} {{action route}}> {{#if view.repository.slug}}
<a {{action showPullRequests view.repository href=true}}>
{{t repositories.tabs.pull_requests}} {{t repositories.tabs.pull_requests}}
</a> </a>
{{/if}}
</h5> </h5>
</li> </li>
<li id="tab_branches" {{bindAttr class="view.classBranches"}}> <li id="tab_branches" {{bindAttr class="view.classBranches"}}>
<h5> <h5>
<a {{bindAttr href="view.urlBranches"}} {{action route}}> {{#if view.repository.slug}}
<a {{action showBranches view.repository href=true}}>
{{t repositories.tabs.branches}} {{t repositories.tabs.branches}}
</a> </a>
{{/if}}
</h5> </h5>
</li> </li>
<li id="tab_build" {{bindAttr class="view.classBuild"}}> <li id="tab_build" {{bindAttr class="view.classBuild"}}>
<h5> <h5>
<a {{bindAttr href="view.urlBuild"}} {{action route}}> {{#if view.build.id}}
{{t repositories.tabs.build}} {{view.build.number}} <a {{action showBuild view.build href=true}}>
{{t repositories.tabs.build}} #{{view.build.number}}
</a> </a>
{{/if}}
</h5> </h5>
</li> </li>
<li id="tab_job" {{bindAttr class="view.classJob"}}> <li id="tab_job" {{bindAttr class="view.classJob"}}>
<h5> <h5>
<a {{bindAttr href="view.urlJob"}} {{action route}}> {{#if view.job.id}}
{{t repositories.tabs.job}} {{view.job.number}} <a {{action showBuild view.job href=true}}>
{{t repositories.tabs.job}} #{{view.job.number}}
</a> </a>
{{/if}}
</h5> </h5>
</li> </li>
</ul> </ul>

View File

@ -7,7 +7,7 @@
{{#each group in controller.groups}} {{#each group in controller.groups}}
{{#view Travis.WorkersListView}} {{#view Travis.WorkersListView}}
<li class="group"> <li class="group">
<h5 {{action toggle}}> <h5 {{action toggle target="view"}}>
{{group.firstObject.host}} {{group.firstObject.host}}
</h5> </h5>
<ul> <ul>
@ -16,9 +16,11 @@
<li class="worker"> <li class="worker">
<div class="status"></div> <div class="status"></div>
{{#if worker.isWorking}} {{#if worker.isWorking}}
<a {{bindAttr href="worker.urlJob"}} {{bindAttr title="worker.lastSeenAt"}} {{action route}}> {{#if view.job.id}}
<a {{bindAttr title="worker.lastSeenAt"}} {{action showJob view.job href=true}}>
{{view.display}} {{view.display}}
</a> </a>
{{/if}}
{{else}} {{else}}
{{view.display}} {{view.display}}
{{/if}} {{/if}}

View File

@ -2,9 +2,6 @@ require 'ext/ember/namespace'
@Travis.reopen @Travis.reopen
View: Em.View.extend View: Em.View.extend
route: (event) ->
Travis.app.routes.route(event)
popup: (event) -> popup: (event) ->
$("##{event.target.name}").remove().appendTo('body').toggle() $("##{event.target.name}").remove().appendTo('body').toggle()
@ -12,6 +9,7 @@ require 'ext/ember/namespace'
HomeLayout: Travis.View.extend(templateName: 'layouts/home') HomeLayout: Travis.View.extend(templateName: 'layouts/home')
ProfileLayout: Travis.View.extend(templateName: 'layouts/profile') ProfileLayout: Travis.View.extend(templateName: 'layouts/profile')
StatsLayout: Travis.View.extend(templateName: 'layouts/simple') StatsLayout: Travis.View.extend(templateName: 'layouts/simple')
ApplicationView: Travis.View.extend(templateName: 'layouts/home')
require 'views/build' require 'views/build'
require 'views/job' require 'views/job'

View File

@ -57,30 +57,6 @@
'active display' if @get('tab') == 'job' 'active display' if @get('tab') == 'job'
).property('tab') ).property('tab')
urlRepository: (->
Travis.Urls.repository(@get('repository.slug'))
).property('repository.slug')
urlBuilds: (->
Travis.Urls.builds(@get('repository.slug'))
).property('repository.slug')
urlPullRequests: (->
Travis.Urls.pullRequests(@get('repository.slug'))
).property('repository.slug')
urlBranches: (->
Travis.Urls.branches(@get('repository.slug'))
).property('repository.slug')
urlBuild: (->
Travis.Urls.build(@get('repository.slug'), @get('build.id'))
).property('repository.slug', 'build.id')
urlJob: (->
Travis.Urls.job(@get('repository.slug'), @get('job.id'))
).property('repository.slug', 'job.id')
RepoShowToolsView: Travis.View.extend RepoShowToolsView: Travis.View.extend
templateName: 'repos/show/tools' templateName: 'repos/show/tools'

View File

@ -40,5 +40,14 @@ require 'ext/ember/namespace'
run: (attrs) -> run: (attrs) ->
console.log "Connecting to #{Travis.config.api_endpoint}" console.log "Connecting to #{Travis.config.api_endpoint}"
@app = Travis.App.create(attrs || {}) app = Travis.App.create(attrs || {})
# TODO: router expects the classes for controllers on main namespace, so
# if we want to keep app at Travis.app, we need to copy that, it would
# be ideal to send a patch to ember and get rid of this
$.each Travis, (key, value) ->
app[key] = value if value && value.isClass && key != 'constructor'
@app = app
@store = app.store
app.initialize()

View File

@ -17,6 +17,6 @@
}); });
</script> </script>
</head> </head>
<body></body> <body id="home"></body>
</html> </html>

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -1,79 +0,0 @@
#HTMLReporter { font-size: 11px; font-family: Monaco, "Lucida Console", monospace; line-height: 14px; color: #333333; }
#HTMLReporter a { text-decoration: none; }
#HTMLReporter a:hover { text-decoration: underline; }
#HTMLReporter p, #HTMLReporter h1, #HTMLReporter h2, #HTMLReporter h3, #HTMLReporter h4, #HTMLReporter h5, #HTMLReporter h6 { margin: 0; line-height: 14px; }
#HTMLReporter .banner, #HTMLReporter .symbolSummary, #HTMLReporter .summary, #HTMLReporter .resultMessage, #HTMLReporter .specDetail .description, #HTMLReporter .alert .bar, #HTMLReporter .stackTrace { padding-left: 9px; padding-right: 9px; }
#HTMLReporter #jasmine_content { position: fixed; right: 100%; }
#HTMLReporter .version { color: #aaaaaa; }
#HTMLReporter .banner { margin-top: 14px; }
#HTMLReporter .duration { color: #aaaaaa; float: right; }
#HTMLReporter .symbolSummary { overflow: hidden; *zoom: 1; margin: 14px 0; }
#HTMLReporter .symbolSummary li { display: block; float: left; height: 7px; width: 14px; margin-bottom: 7px; font-size: 16px; }
#HTMLReporter .symbolSummary li.passed { font-size: 14px; }
#HTMLReporter .symbolSummary li.passed:before { color: #5e7d00; content: "\02022"; }
#HTMLReporter .symbolSummary li.failed { line-height: 9px; }
#HTMLReporter .symbolSummary li.failed:before { color: #b03911; content: "x"; font-weight: bold; margin-left: -1px; }
#HTMLReporter .symbolSummary li.skipped { font-size: 14px; }
#HTMLReporter .symbolSummary li.skipped:before { color: #bababa; content: "\02022"; }
#HTMLReporter .symbolSummary li.pending { line-height: 11px; }
#HTMLReporter .symbolSummary li.pending:before { color: #aaaaaa; content: "-"; }
#HTMLReporter .bar { line-height: 28px; font-size: 14px; display: block; color: #eee; }
#HTMLReporter .runningAlert { background-color: #666666; }
#HTMLReporter .skippedAlert { background-color: #aaaaaa; }
#HTMLReporter .skippedAlert:first-child { background-color: #333333; }
#HTMLReporter .skippedAlert:hover { text-decoration: none; color: white; text-decoration: underline; }
#HTMLReporter .passingAlert { background-color: #a6b779; }
#HTMLReporter .passingAlert:first-child { background-color: #5e7d00; }
#HTMLReporter .failingAlert { background-color: #cf867e; }
#HTMLReporter .failingAlert:first-child { background-color: #b03911; }
#HTMLReporter .results { margin-top: 14px; }
#HTMLReporter #details { display: none; }
#HTMLReporter .resultsMenu, #HTMLReporter .resultsMenu a { background-color: #fff; color: #333333; }
#HTMLReporter.showDetails .summaryMenuItem { font-weight: normal; text-decoration: inherit; }
#HTMLReporter.showDetails .summaryMenuItem:hover { text-decoration: underline; }
#HTMLReporter.showDetails .detailsMenuItem { font-weight: bold; text-decoration: underline; }
#HTMLReporter.showDetails .summary { display: none; }
#HTMLReporter.showDetails #details { display: block; }
#HTMLReporter .summaryMenuItem { font-weight: bold; text-decoration: underline; }
#HTMLReporter .summary { margin-top: 14px; }
#HTMLReporter .summary .suite .suite, #HTMLReporter .summary .specSummary { margin-left: 14px; }
#HTMLReporter .summary .specSummary.passed a { color: #5e7d00; }
#HTMLReporter .summary .specSummary.failed a { color: #b03911; }
#HTMLReporter .description + .suite { margin-top: 0; }
#HTMLReporter .suite { margin-top: 14px; }
#HTMLReporter .suite a { color: #333333; }
#HTMLReporter #details .specDetail { margin-bottom: 28px; }
#HTMLReporter #details .specDetail .description { display: block; color: white; background-color: #b03911; }
#HTMLReporter .resultMessage { padding-top: 14px; color: #333333; }
#HTMLReporter .resultMessage span.result { display: block; }
#HTMLReporter .stackTrace { margin: 5px 0 0 0; max-height: 224px; overflow: auto; line-height: 18px; color: #666666; border: 1px solid #ddd; background: white; white-space: pre; }
#TrivialReporter { padding: 8px 13px; clear: both; overflow-y: scroll; background-color: white; font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif; /*.resultMessage {*/ /*white-space: pre;*/ /*}*/ }
#TrivialReporter a:visited, #TrivialReporter a { color: #303; }
#TrivialReporter a:hover, #TrivialReporter a:active { color: blue; }
#TrivialReporter .run_spec { float: right; padding-right: 5px; font-size: .8em; text-decoration: none; }
#TrivialReporter .banner { color: #303; background-color: #fef; padding: 5px; }
#TrivialReporter .logo { float: left; font-size: 1.1em; padding-left: 5px; }
#TrivialReporter .logo .version { font-size: .6em; padding-left: 1em; }
#TrivialReporter .runner.running { background-color: yellow; }
#TrivialReporter .options { text-align: right; font-size: .8em; }
#TrivialReporter .suite { border: 1px outset gray; margin: 5px 0; padding-left: 1em; }
#TrivialReporter .suite .suite { margin: 5px; }
#TrivialReporter .suite.passed { background-color: #dfd; }
#TrivialReporter .suite.failed { background-color: #fdd; }
#TrivialReporter .spec { margin: 5px; padding-left: 1em; clear: both; }
#TrivialReporter .spec.failed, #TrivialReporter .spec.passed, #TrivialReporter .spec.skipped { padding-bottom: 5px; border: 1px solid gray; }
#TrivialReporter .spec.failed { background-color: #fbb; border-color: red; }
#TrivialReporter .spec.passed { background-color: #bfb; border-color: green; }
#TrivialReporter .spec.skipped { background-color: #bbb; }
#TrivialReporter .messages { border-left: 1px dashed gray; padding-left: 1em; padding-right: 1em; }
#TrivialReporter .passed { background-color: #cfc; display: none; }
#TrivialReporter .failed { background-color: #fbb; }
#TrivialReporter .skipped { color: #777; background-color: #eee; display: none; }
#TrivialReporter .resultMessage span.result { display: block; line-height: 2em; color: black; }
#TrivialReporter .resultMessage .mismatch { color: black; }
#TrivialReporter .stackTrace { white-space: pre; font-size: .8em; margin-left: 10px; max-height: 5em; overflow: auto; border: 1px inset red; padding: 1em; background: #eef; }
#TrivialReporter .finished-at { padding-left: 1em; font-size: .6em; }
#TrivialReporter.show-passed .passed, #TrivialReporter.show-skipped .skipped { display: block; }
#TrivialReporter #jasmine_content { position: fixed; right: 100%; }
#TrivialReporter .runner { border: 1px solid gray; display: block; margin: 5px 0; padding: 2px 0 2px 10px; }