diff --git a/assets/scripts/app/controllers.coffee b/assets/scripts/app/controllers.coffee index d44c02a0..a8c9be07 100644 --- a/assets/scripts/app/controllers.coffee +++ b/assets/scripts/app/controllers.coffee @@ -61,7 +61,7 @@ require 'controllers/job' require 'controllers/profile' require 'controllers/repos' require 'controllers/repo' -require 'controllers/repo_settings' +require 'controllers/settings' require 'controllers/stats' require 'controllers/current_user' require 'controllers/request' diff --git a/assets/scripts/app/controllers/repo_settings.coffee b/assets/scripts/app/controllers/settings.coffee similarity index 67% rename from assets/scripts/app/controllers/repo_settings.coffee rename to assets/scripts/app/controllers/settings.coffee index 3cf63526..e4e0e0bb 100644 --- a/assets/scripts/app/controllers/repo_settings.coffee +++ b/assets/scripts/app/controllers/settings.coffee @@ -1,17 +1,4 @@ -Travis.RepoSettingsController = Em.ObjectController.extend - tabs: - index: "General Settings" - env_vars: "Environment Variables" - ssh_key: "SSH Key" - - init: -> - @_super.apply this, arguments - - tabs = [] - @set('_tabs', tabs) - for own id, name of @get('tabs') - tabs.pushObject Travis.Tab.create(id: id, name: name) - +Travis.SettingsIndexController = Em.ObjectController.extend settings: Ember.computed.alias('model.settings') settingsChanged: (-> diff --git a/assets/scripts/app/helpers/handlebars.coffee b/assets/scripts/app/helpers/handlebars.coffee index c08285b2..bc555d96 100644 --- a/assets/scripts/app/helpers/handlebars.coffee +++ b/assets/scripts/app/helpers/handlebars.coffee @@ -103,9 +103,14 @@ Travis.ErrorsView = Ember.View.extend template: Ember.Handlebars.compile("{{#each view.errors}}{{message}}{{/each}}") classNames: ['error'] classNameBindings: ['codes'] + attributeBindings: ['style'] + style: (-> + 'display: none' unless @get('show') + ).property('show') codes: (-> @get('errors').mapBy('code') ).property('@errors') + show: Ember.computed.notEmpty('errors.[]') Ember.Handlebars.helper('travis-errors', (name, options) -> errors = @get('errors').for(name) diff --git a/assets/scripts/app/templates/repo/settings.hbs b/assets/scripts/app/templates/repo/settings.hbs deleted file mode 100644 index 005597a9..00000000 --- a/assets/scripts/app/templates/repo/settings.hbs +++ /dev/null @@ -1,33 +0,0 @@ -
- Build only if .travis.yml is present - {{travis-switch action="save" active=settings.builds_only_with_travis_yml}} -
- -- Build pushes - {{travis-switch action="save" active=settings.build_pushes}} -
- -- Build pull requests - {{travis-switch action="save" active=settings.build_pull_requests}} -
- --
- {{input value=settings.maximum_number_of_builds size="4" pattern='/^[0-9]+$/'}} -
- - - {{/settings-form}} - {{/travis-tab}} - {{/travis-tabs}} -