Sha256: 724769b1e78a7a8d103928ceb03a2c770fcbac9cb52592d4769db12ada75d55c

Contents?: true

Size: 1.86 KB

Versions: 4

Compression:

Stored size: 1.86 KB

Contents

<script type="text/ng-template" id="promethee/components/slider/edit/inspect">
  <div ui-sortable="{handle: '.handle'}" ng-model="promethee.inspected.children">
    <div
      class="panel panel-default"
      ng-repeat="component in promethee.inspected.children"
    >
      <div class="panel-body">
        <div class="row handle">
          <div class="col-xs-9">
            <span class="label label-default">#{{$index + 1}}</span>
            <span class="label label-info">{{component.type}}</span>
          </div>
          <div class="col-xs-3">
            <ng-include src="'promethee/move/component'"></ng-include>
          </div>
        </div>

        <div class="row">
          <div class="col-xs-12">
            <div class="form-group">
              <label class="label-control">Text</label>
              <summernote config="summernoteConfig" ng-model="promethee.inspected.attributes.contents['content-' + component.id]"></summernote>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>

  <div class="pull-right btn-toolbar" ng-controller="SliderInspectorController">
    <span ng-repeat="definition in itemDefinitions" class="btn btn-default" ng-click="addItem(definition)">Add {{definition.name}}</span>
  </div>
</script>

<script>
  promethee.controller('SliderInspectorController', ['$scope', function($scope) {
    var availableComponents = ['image', 'video'];

    $scope.itemDefinitions = $scope.promethee.definitions.filter(function(definition) {
      return availableComponents.includes(definition.data.type);
    });

    var clone = function(object) {
      return JSON.parse(JSON.stringify(object));
    };

    $scope.addItem = function(definition) {
      var item = JSON.parse(JSON.stringify(definition.data));
      item.id = $scope.generateIdentifier();

      $scope.promethee.inspected.children.push(item);
    }
  }])
</script>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
promethee-1.6.14 app/views/promethee/components/slider/_edit.inspect.html.erb
promethee-1.6.13 app/views/promethee/components/slider/_edit.inspect.html.erb
promethee-1.6.12 app/views/promethee/components/slider/_edit.inspect.html.erb
promethee-1.6.11 app/views/promethee/components/slider/_edit.inspect.html.erb