Sha256: 9740929c796b62bf47d6d62ce25b6ecf4dbffa8e0ee0c8437bec83adf6f089c5

Contents?: true

Size: 1.48 KB

Versions: 64

Compression:

Stored size: 1.48 KB

Contents

pageflow.PageItemView = Backbone.Marionette.ItemView.extend({
  tagName: 'li',
  template: 'templates/page_item',

  ui: {
    title: '.title',
    pictogram: '.type_pictogram',
    pageThumbnail: '.page_thumbnail'
  },

  modelEvents: {
    'change:title': 'update',
    'change:active': 'update'
  },

  onRender: function() {
    this.subview(new pageflow.PageThumbnailView({
      el: this.ui.pageThumbnail,
      model: this.model
    }));

    this.update();
  },

  update: function() {
    this.$el.attr('data-id', this.model.id);
    this.$el.attr('data-perma-id', this.model.get('perma_id'));

    this.$el.toggleClass('active', this.model.get('active'));
    this.$el.toggleClass('disabled',
                         !!(this.options.isDisabled && this.options.isDisabled(this.model)));
    this.$el.toggleClass('display_in_navigation', !!this.model.configuration.get('display_in_navigation'));
    this.$el
      .removeClass(pageflow.editor.pageTypes.pluck('name').join(' '))
      .addClass(this.model.get('template'));

    this.ui.pictogram.attr('title', this._getPictogramTitle());
    this.ui.title.text(this.model.title() || I18n.t('pageflow.editor.views.page_item_view.unnamed'));
  },

  _getPictogramTitle: function() {
    var result = I18n.t(this.model.pageType().translationKey());
    result += ' Seite';

    if (this.options.displayInNavigationHint && !this.model.configuration.get('display_in_navigation')) {
      result += ' (nicht in Navigationsleiste)';
    }

    return result;
  }
});

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
pageflow-13.0.0.beta4 app/assets/javascripts/pageflow/editor/views/page_item_view.js
pageflow-13.0.0.beta3 app/assets/javascripts/pageflow/editor/views/page_item_view.js
pageflow-13.0.0.beta2 app/assets/javascripts/pageflow/editor/views/page_item_view.js
pageflow-13.0.0.beta1 app/assets/javascripts/pageflow/editor/views/page_item_view.js
pageflow-12.2.0 app/assets/javascripts/pageflow/editor/views/page_item_view.js
pageflow-12.1.0 app/assets/javascripts/pageflow/editor/views/page_item_view.js
pageflow-12.0.4 app/assets/javascripts/pageflow/editor/views/page_item_view.js
pageflow-12.0.3 app/assets/javascripts/pageflow/editor/views/page_item_view.js
pageflow-12.0.2 app/assets/javascripts/pageflow/editor/views/page_item_view.js
pageflow-12.0.1 app/assets/javascripts/pageflow/editor/views/page_item_view.js
pageflow-12.0.0 app/assets/javascripts/pageflow/editor/views/page_item_view.js
pageflow-12.0.0.rc7 app/assets/javascripts/pageflow/editor/views/page_item_view.js
pageflow-12.0.0.rc6 app/assets/javascripts/pageflow/editor/views/page_item_view.js
pageflow-0.11.4 app/assets/javascripts/pageflow/editor/views/page_item_view.js
pageflow-12.0.0.rc5 app/assets/javascripts/pageflow/editor/views/page_item_view.js
pageflow-12.0.0.rc4 app/assets/javascripts/pageflow/editor/views/page_item_view.js
pageflow-12.0.0.rc3 app/assets/javascripts/pageflow/editor/views/page_item_view.js
pageflow-12.0.0.rc2 app/assets/javascripts/pageflow/editor/views/page_item_view.js
pageflow-12.0.0.rc1 app/assets/javascripts/pageflow/editor/views/page_item_view.js
pageflow-0.11.3 app/assets/javascripts/pageflow/editor/views/page_item_view.js