~benji/juju-gui/no-foot-shooting

« back to all changes in this revision

Viewing changes to app/views/service.js

  • Committer: Benji York
  • Date: 2013-01-17 16:01:27 UTC
  • Revision ID: benji.york@canonical.com-20130117160127-5yly9ihicp1athma
fix lint

Show diffs side-by-side

added added

removed removed

Lines of Context:
375
375
          '#service-relations .btn': {click: 'confirmRemoved'}
376
376
        },
377
377
 
 
378
        /**
 
379
         * Gather up all of the data required for the template.
 
380
         *
 
381
         * Aside from a nice seperation of concerns, this method also
 
382
         * facilitates testing.
 
383
         *
 
384
         * @method gatherRenderData
 
385
         * @return {Object} The data the template will render.
 
386
         */
378
387
        gatherRenderData: function() {
379
388
          var container = this.get('container'),
380
389
              service = this.get('model'),
555
564
          }
556
565
        },
557
566
 
 
567
        /**
 
568
         * Gather up all of the data required for the template.
 
569
         *
 
570
         * Aside from a nice seperation of concerns, this method also
 
571
         * facilitates testing.
 
572
         *
 
573
         * @method gatherRenderData
 
574
         * @return {Object} The data the template will render.
 
575
         */
558
576
        gatherRenderData: function() {
559
577
          var service = this.get('model'),
560
578
              constraints = service.get('constraints'),
617
635
          '#save-service-config': {click: 'saveConfig'}
618
636
        },
619
637
 
 
638
        /**
 
639
         * Gather up all of the data required for the template.
 
640
         *
 
641
         * Aside from a nice seperation of concerns, this method also
 
642
         * facilitates testing.
 
643
         *
 
644
         * @method gatherRenderData
 
645
         * @return {Object} The data the template will render.
 
646
         */
620
647
        gatherRenderData: function() {
621
648
          var container = this.get('container');
622
649
          var db = this.get('db');
731
758
          container.one('#save-service-config').set('disabled', 'disabled');
732
759
 
733
760
          var new_values = utils.getElementsValuesMapping(
734
 
                                            container, '.config-field'),
735
 
              errors = utils.validate(new_values, schema);
 
761
              container, '.config-field');
 
762
          var errors = utils.validate(new_values, schema);
736
763
 
737
764
          if (Y.Object.isEmpty(errors)) {
738
765
            env.set_config(
807
834
 
808
835
        template: Templates.service,
809
836
 
 
837
        /**
 
838
         * Gather up all of the data required for the template.
 
839
         *
 
840
         * Aside from a nice seperation of concerns, this method also
 
841
         * facilitates testing.
 
842
         *
 
843
         * @method gatherRenderData
 
844
         * @return {Object} The data the template will render.
 
845
         */
810
846
        gatherRenderData: function() {
811
847
          var db = this.get('db');
812
848
          var service = this.get('model');
816
852
          var charm = db.charms.getById(charm_id);
817
853
          var charm_attrs = charm ? charm.getAttrs() : undefined;
818
854
          var state_data = [{
819
 
                title: 'All',
820
 
                link: '.',
821
 
                active: !filter_state,
822
 
                count: this.filterUnits(null, units).length
823
 
              }];
 
855
            title: 'All',
 
856
            link: '.',
 
857
            active: !filter_state,
 
858
            count: this.filterUnits(null, units).length
 
859
          }];
824
860
          Y.each(['Running', 'Pending', 'Error'], function(title) {
825
861
            var lower = title.toLowerCase();
826
862
            state_data.push({
839
875
            state: filter_state,
840
876
            units: this.filterUnits(filter_state, units),
841
877
            states: state_data
842
 
          }
 
878
          };
843
879
        },
844
880
 
845
881
        render: function() {