diff --git a/app/components/org-item.coffee b/app/components/org-item.coffee new file mode 100644 index 00000000..64233d3e --- /dev/null +++ b/app/components/org-item.coffee @@ -0,0 +1,28 @@ +`import Ember from 'ember'` + +OrgItemComponent = Ember.Component.extend + + classNames: ['media', 'account'] + tagName: 'li' + classNameBindings: ['type', 'selected'] + typeBinding: 'account.type' + selectedBinding: 'account.selected' + tokenIsVisible: false + + name: (-> + @get('account.name') || @get('account.login') + ).property('account') + + avatarUrl: (-> + @get('account.avatarUrl') || false + ).property('account') + + isUser: (-> + @get('account.type') == 'user' + ).property('account') + + actions: + tokenVisibility: () -> + @toggleProperty('tokenIsVisible') + +`export default OrgItemComponent` diff --git a/app/components/repo-show-tabs.coffee b/app/components/repo-show-tabs.coffee index 8bbf8e46..f6a9a446 100644 --- a/app/components/repo-show-tabs.coffee +++ b/app/components/repo-show-tabs.coffee @@ -23,10 +23,6 @@ RepoShowTabsComponent = Ember.Component.extend 'active' if @get('tab') == 'branches' ).property('tab') - classEvents: (-> - 'active' if @get('tab') == 'events' - ).property('tab') - classBuild: (-> tab = @get('tab') classes = [] diff --git a/app/components/subscribe-button.coffee b/app/components/subscribe-button.coffee new file mode 100644 index 00000000..cc808ff4 --- /dev/null +++ b/app/components/subscribe-button.coffee @@ -0,0 +1,8 @@ +`import Ember from 'ember'` +`import config from 'travis/config/environment'` + +SubscribeButtonComponent = Ember.Component.extend + + classNames: ['cta-btn'] + +`export default SubscribeButtonComponent` diff --git a/app/controllers/account.coffee b/app/controllers/account.coffee index 27aea603..c6195a19 100644 --- a/app/controllers/account.coffee +++ b/app/controllers/account.coffee @@ -50,9 +50,17 @@ Controller = Ember.Controller.extend @config.show_repos_hint == 'public' ).property() - billingUrl: (-> + billingUrl: ( -> id = if @get('model.type') == 'user' then 'user' else @get('model.login') "#{@config.billingEndpoint}/subscriptions/#{id}" + ).property('model.name', 'model.login') + + subscribeButtonInfo: (-> + { + billingUrl: @get('billingUrl') + subscribed: @get('model.subscribed') + education: @get('model.education') + } ).property('model.login', 'model.type') `export default Controller` diff --git a/app/controllers/accounts.coffee b/app/controllers/accounts.coffee index 90b871bd..7286d5b4 100644 --- a/app/controllers/accounts.coffee +++ b/app/controllers/accounts.coffee @@ -1,16 +1,5 @@ `import Ember from 'ember'` -Controller = Ember.ArrayController.extend - tab: 'accounts' - - userName: (-> - @get('user.name') || @get('user.login') - ).property('user.login', 'user.name') - - - actions: - tokenVisibility: () -> - @toggleProperty('isVisible') - return false +Controller = Ember.ArrayController.extend() `export default Controller` diff --git a/app/controllers/build.coffee b/app/controllers/build.coffee index b01148ff..433dd49d 100644 --- a/app/controllers/build.coffee +++ b/app/controllers/build.coffee @@ -14,7 +14,7 @@ Controller = Ember.Controller.extend GithubUrlPropertievs, jobsLoaded: (-> if jobs = @get('build.jobs') - jobs.everyBy('config') + jobs.isEvery('config') ).property('build.jobs.@each.config') loading: (-> diff --git a/app/controllers/job.coffee b/app/controllers/job.coffee index 496a2247..42196a8a 100644 --- a/app/controllers/job.coffee +++ b/app/controllers/job.coffee @@ -6,7 +6,6 @@ Controller = Ember.Controller.extend repoBinding: 'repoController.repo' commitBinding: 'job.commit' - annotationsBinding: 'job.annotations' currentUserBinding: 'auth.currentUser' tabBinding: 'repoController.tab' diff --git a/app/controllers/profile.coffee b/app/controllers/profile.coffee index 867f4c7c..bf9443f7 100644 --- a/app/controllers/profile.coffee +++ b/app/controllers/profile.coffee @@ -21,9 +21,4 @@ Controller = Ember.Controller.extend connectTab: (tab) -> @set('tab', tab) - billingUrl: (-> - id = if @get('account.type') == 'user' then 'user' else @get('account.login') - "#{@get('config').billingEndpoint}/subscriptions/#{id}" - ).property('account.login', 'account.type') - `export default Controller` diff --git a/app/controllers/top.coffee b/app/controllers/top.coffee index e532a19c..9c8f4584 100644 --- a/app/controllers/top.coffee +++ b/app/controllers/top.coffee @@ -13,7 +13,8 @@ Controller = Ember.Controller.extend ).property('user.login', 'user.name') gravatarUrl: (-> - "#{location.protocol}//www.gravatar.com/avatar/#{@get('user.gravatarId')}?s=48&d=mm" + if @get('user.gravatarId') + "#{location.protocol}//www.gravatar.com/avatar/#{@get('user.gravatarId')}?s=36&d=mm" ).property('user.gravatarId') defineTowerColor: (broadcastArray) -> diff --git a/app/helpers/label.coffee b/app/helpers/label.coffee deleted file mode 100644 index 31c989dc..00000000 --- a/app/helpers/label.coffee +++ /dev/null @@ -1,33 +0,0 @@ -`import Ember from 'ember'` - -LabelView = Ember.View.extend( - tagName: 'label' - - attributeBindings: ['for', 'accesskey', 'form'] - classNameBindings: ['class'] -) - -label = (params, hash, options, env) -> - view = LabelView - - controller = env.data.view.get('controller') - name = hash.for - if name - labels = controller.get('_labels') - unless labels - labels = Ember.Object.create() - controller.set('_labels', labels) - - # for now I support only label + input in their own context - id = labels.get(name) - unless id - id = "#{name}-#{Math.round(Math.random() * 1000000)}" - labels.set(name, id) - - hash.for = id - if hash.content - view = view.extend(templateName: 'helpers/label') - - env.helpers.view.helperFunction.call(this, [view], hash, options, env) - -`export default label` diff --git a/app/routes/accounts.coffee b/app/routes/accounts.coffee index 7753daba..dba38215 100644 --- a/app/routes/accounts.coffee +++ b/app/routes/accounts.coffee @@ -18,4 +18,11 @@ Route = TravisRoute.extend @render 'profile_accounts', outlet: 'left', into: 'profile' + organizations: -> + model.filterBy('type', 'organization') + + user: -> + model.filterBy('type', 'user')[0] + + `export default Route` diff --git a/app/routes/env-vars.coffee b/app/routes/env-vars.coffee deleted file mode 100644 index c5bf7c62..00000000 --- a/app/routes/env-vars.coffee +++ /dev/null @@ -1,10 +0,0 @@ -`import TravisRoute from 'travis/routes/basic'` - -Route = TravisRoute.extend - titleToken: 'Environment variables' - - model: (params) -> - repo = @modelFor('repo') - repo.get('envVars.promise') - -`export default Route` diff --git a/app/styles/app.scss b/app/styles/app.scss index d4e03f6b..68e88824 100644 --- a/app/styles/app.scss +++ b/app/styles/app.scss @@ -12,7 +12,6 @@ @import "app/forms"; @import "app/github"; -@import "app/main/annotations"; @import "app/userlike"; @import "app/main/log"; @@ -43,6 +42,7 @@ @import "app/modules/forms"; @import "app/modules/notice"; @import "app/modules/build-header"; +@import "app/modules/avatar"; @import "app/layout"; @import "app/layouts/dashboard"; diff --git a/app/styles/app/layouts/profile.sass b/app/styles/app/layouts/profile.sass index 5185780f..e3e84e36 100644 --- a/app/styles/app/layouts/profile.sass +++ b/app/styles/app/layouts/profile.sass @@ -25,7 +25,7 @@ color: $grey-light text-decoration: underline @media #{$medium-up} - .profile-header, .sync-button, .ember-view + .profile-header, .sync-button display: inline-block vertical-align: middle .sync-button @@ -128,9 +128,7 @@ p.profile-user-last .profile-orglist @media #{$large-up} - padding-right: 10em - aside - padding: 0 + padding: 0 3em 0 0 .profile-hooklist @include resetul @@ -138,7 +136,6 @@ p.profile-user-last li clear: both margin-bottom: .8em - // overflow: auto .profile-hooks width: grid-calc(10, 24) display: inline-block diff --git a/app/styles/app/main/annotations.sass b/app/styles/app/main/annotations.sass deleted file mode 100644 index 35fe3b3c..00000000 --- a/app/styles/app/main/annotations.sass +++ /dev/null @@ -1,17 +0,0 @@ - -#annotations - @include clearfix - margin: 8px 0 25px 12px - padding: 12px 0 0 0 - - a - text-decoration: underline - - img - border: none - - .annotation - float: left - min-height: 25px - margin: 0 - diff --git a/app/styles/app/modules/avatar.sass b/app/styles/app/modules/avatar.sass new file mode 100644 index 00000000..bf2af64d --- /dev/null +++ b/app/styles/app/modules/avatar.sass @@ -0,0 +1,43 @@ +%avatar + position: relative + background-color: #a0a0a0 + border-radius: 50% + overflow: hidden + &:before + content: "" + display: block + width: 40% + height: 40% + border-radius: 50% + background: $cream-light + position: absolute + top: 20% + margin: auto + left: 0 + right: 0 + + &:after + content: "" + display: block + width: 66% + height: 70% + border-radius: 50% + background: $cream-light + position: absolute + top: 55% + margin: auto + left: 0 + right: 0 + +.default-avatar--profile + @extend %avatar + width: 2.6rem + height: 2.6rem + +.default-avatar--topbar + @extend %avatar + width: 2.7rem + height: 2.7rem + display: inline-block + vertical-align: middle + margin-left: 0.3em diff --git a/app/templates/account.hbs b/app/templates/account.hbs index 409c46d9..558189bc 100644 --- a/app/templates/account.hbs +++ b/app/templates/account.hbs @@ -126,5 +126,3 @@ {{else}} {{loading-indicator}} {{/if}} - - diff --git a/app/templates/accounts-list/empty.hbs b/app/templates/accounts-list/empty.hbs deleted file mode 100644 index 18503769..00000000 --- a/app/templates/accounts-list/empty.hbs +++ /dev/null @@ -1 +0,0 @@ -{{loading-indicator}} \ No newline at end of file diff --git a/app/templates/annotations/list.hbs b/app/templates/annotations/list.hbs deleted file mode 100644 index 663f6303..00000000 --- a/app/templates/annotations/list.hbs +++ /dev/null @@ -1,12 +0,0 @@ -{{#if view.annotations}} -