pageflow-internal-links 0.2.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +33 -10
  3. data/Gemfile +0 -6
  4. data/README.md +7 -5
  5. data/app/assets/javascripts/pageflow/internal_links/editor/config.js +0 -10
  6. data/app/assets/javascripts/pageflow/internal_links/editor/models/page_link.js +18 -1
  7. data/app/assets/javascripts/pageflow/internal_links/editor/models/page_link_file_selection_handler.js +17 -0
  8. data/app/assets/javascripts/pageflow/internal_links/editor/views/edit_page_link_view.js +18 -1
  9. data/app/assets/javascripts/pageflow/internal_links/editor/views/grid_configuration_editor_view.js +1 -1
  10. data/app/assets/javascripts/pageflow/internal_links/editor/views/list_configuration_editor_view.js +1 -1
  11. data/app/assets/javascripts/pageflow/internal_links/editor/views/list_item_embedded_view.js +13 -4
  12. data/app/assets/javascripts/pageflow/internal_links/grid_page_type.js +2 -8
  13. data/app/assets/javascripts/pageflow/internal_links/list_page_type.js +24 -6
  14. data/app/assets/stylesheets/pageflow/{internal_links.css.scss → internal_links.scss} +0 -0
  15. data/app/assets/stylesheets/pageflow/internal_links/{editor.css.scss → editor.scss} +0 -0
  16. data/app/assets/stylesheets/pageflow/internal_links/editor/{embedded_grid_item.css.scss → embedded_grid_item.scss} +0 -0
  17. data/app/assets/stylesheets/pageflow/internal_links/grid.scss +1 -0
  18. data/app/assets/stylesheets/pageflow/internal_links/themes/default/list_as_multiple_choice.scss +64 -11
  19. data/app/helpers/pageflow/internal_links/page_links.rb +22 -3
  20. data/app/views/pageflow/internal_links/grid/page.html.erb +1 -1
  21. data/app/views/pageflow/internal_links/list/_page_link.html.erb +2 -3
  22. data/app/views/pageflow/internal_links/list/page.html.erb +1 -1
  23. data/config/locales/de.yml +12 -0
  24. data/config/locales/en.yml +12 -12
  25. data/lib/pageflow/internal_links/plugin.rb +1 -0
  26. data/lib/pageflow/internal_links/version.rb +1 -1
  27. data/pageflow-internal-links.gemspec +7 -3
  28. metadata +41 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0845761ea65ab16498a70c7d3364b69cc1c3aff6
4
- data.tar.gz: 3676084ee081f6d236146aece24c1c92db12cb33
3
+ metadata.gz: 52df1b9dcf29bb39776058164da43e087bafd77e
4
+ data.tar.gz: 4a91b9d5b35789efdc5ae81bcd800995296f16b3
5
5
  SHA512:
6
- metadata.gz: ac0533baa66a611b2ca887a04261b8e9ea5903ebca758853152b72a6b2db907cf111f2b00e960b60339bf8dda4981578e05986d50400a5718c5d7322fe2ad89f
7
- data.tar.gz: c11bcc37e3da97991256825f8de1355f6954970b8122922b5ee68326773c6cc74f26a712049c8e30a35b984dab689cf9fb481ba7e71d5ff1b62c4e6743a6ff4c
6
+ metadata.gz: 8d50464ef1da30024124078851c0ad933e54f1f079f0999e6aa3f115325afc3e0a2ca8fdc9af08109c90d8bd7394a250a56f07306f4c7edc81bb9e0e882148cd
7
+ data.tar.gz: 0e42e90a826ef4f7e0d24d16df6463223024bb80b71a9de36b22ce420d8239fc92a38c0ea6dd12ba53b8c608d44421eb3231e6eb5f94c2d4eaeff09c334f04c0
@@ -1,18 +1,41 @@
1
1
  # CHANGELOG
2
2
 
3
- ### Version 0.2.0
3
+ ### Version 1.0.0
4
4
 
5
- 2016-06-09
5
+ 2017-08-11
6
6
 
7
- [Compare changes](https://github.com/codevise/pageflow-internal-links/compare/v0.1.0...v0.2.0)
7
+ [Compare changes](https://github.com/codevise/pageflow-internal-links/compare/0-x-stable...v1.0.0)
8
8
 
9
- - Use common page link attribute inline help texts
10
- ([#5](https://github.com/codevise/pageflow-internal-links/pull/5))
11
- - Add themeable page type pictograms
12
- ([#4](https://github.com/codevise/pageflow-internal-links/pull/4))
9
+ ##### Breaking Changes
13
10
 
14
- ### Version 0.1.0
11
+ [Compare changes](https://github.com/codevise/pageflow-internal-links/compare/0-2-stable...master)
15
12
 
16
- 2015-10-23
13
+ - Grid page type registration is performed by plugin call now.
14
+ ([#11](https://github.com/codevise/pageflow-internal-links/pull/11))
17
15
 
18
- Initial release.
16
+ Ensure you register the plugin in your Pageflow initializer:
17
+
18
+ config.plugin(Pageflow::InternalLinks.plugin)
19
+
20
+ Remove manual registration of page type:
21
+
22
+ # Delete the following line
23
+ config.page_types.register(Pageflow::InternalLinks.grid_page_type)
24
+
25
+ - Require Pageflow 12
26
+ ([#10](https://github.com/codevise/pageflow-internal-links/pull/10))
27
+
28
+ ##### Minor Changes
29
+
30
+ - Allow custom images in list page link items
31
+ ([#9](https://github.com/codevise/pageflow-internal-links/pull/9))
32
+ - Allow to use background video
33
+ ([#8](https://github.com/codevise/pageflow-internal-links/pull/8))
34
+ - Rename .css.scss files to just .scss
35
+ ([#7](https://github.com/codevise/pageflow-internal-links/pull/7))
36
+ - Add no repeat to thumbails background
37
+ ([#6](https://github.com/codevise/pageflow-internal-links/pull/6))
38
+
39
+ See
40
+ [0-2-stable branch](https://github.com/codevise/pageflow-internal-links/blob/0-2-stable/CHANGELOG.md)
41
+ for previous changes.
data/Gemfile CHANGED
@@ -2,9 +2,3 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in chart.gemspec
4
4
  gemspec
5
-
6
- # Rails 4 compat
7
- gem 'activeadmin', :git => 'https://github.com/codevise/active_admin.git', :branch => 'rails4'
8
- gem 'ransack'
9
- gem 'inherited_resources', '1.4.1'
10
- gem 'formtastic', '2.3.0.rc2'
data/README.md CHANGED
@@ -15,7 +15,7 @@ Register the page types:
15
15
 
16
16
  # config/initializers/pageflow.rb
17
17
  Pageflow.configure do |config|
18
- config.page_types.register(Pageflow::InternalLinks.grid_page_type)
18
+ config.plugin(Pageflow::InternalLinks.plugin)
19
19
  end
20
20
 
21
21
  Include javascripts and stylesheets:
@@ -26,15 +26,15 @@ Include javascripts and stylesheets:
26
26
  # app/assets/javascripts/pageflow/editor.js
27
27
  //= require pageflow/internal_links/editor
28
28
 
29
- # app/assets/stylesheets/pageflow/application.css.scss
29
+ # app/assets/stylesheets/pageflow/application.scss
30
30
  @import "pageflow/internal_links";
31
31
 
32
- # app/assets/stylesheets/pageflow/editor.css.scss
32
+ # app/assets/stylesheets/pageflow/editor.scss
33
33
  @import "pageflow/internal_links/editor";
34
34
 
35
35
  Import the default theme additions:
36
36
 
37
- # app/assets/stylesheets/pageflow/themes/default.css.scss
37
+ # app/assets/stylesheets/pageflow/themes/default.scss
38
38
 
39
39
  @import "pageflow/internal_links/themes/default";
40
40
  @import "pageflow/internal_links/themes/default/list_as_multiple_choice";
@@ -51,7 +51,9 @@ Migrate the database:
51
51
 
52
52
  bundle exec rake db:migrate
53
53
 
54
- Restart the application server.
54
+ Restart the application server. The grid page type is available by
55
+ default. For the list page type enable the corresponding feature in
56
+ the tab *features*.
55
57
 
56
58
  ## Troubleshooting
57
59
 
@@ -5,11 +5,6 @@ pageflow.editor.pageTypes.register('internal_links_grid', {
5
5
  'nav li': {
6
6
  view: pageflow.internalLinks.GridItemEmbeddedView,
7
7
  options: {propertyName: 'linked_page_ids'}
8
- },
9
-
10
- '.background_image': {
11
- view: pageflow.BackgroundImageEmbeddedView,
12
- options: {propertyName: 'background_image_id'}
13
8
  }
14
9
  },
15
10
 
@@ -24,11 +19,6 @@ pageflow.editor.pageTypes.register('internal_links_list', {
24
19
  embeddedViews: {
25
20
  'nav': {
26
21
  view: pageflow.internalLinks.ListEmbeddedView
27
- },
28
-
29
- '.background_image': {
30
- view: pageflow.BackgroundImageEmbeddedView,
31
- options: {propertyName: 'background_image_id'}
32
22
  }
33
23
  },
34
24
 
@@ -1,6 +1,8 @@
1
1
  pageflow.internalLinks.PageLink = Backbone.Model.extend({
2
2
  i18nKey: 'pageflow/internal_links/page_link',
3
3
 
4
+ mixins: [pageflow.transientReferences],
5
+
4
6
  targetPage: function() {
5
7
  return pageflow.pages.getByPermaId(this.get('target_page_id'));
6
8
  },
@@ -9,6 +11,21 @@ pageflow.internalLinks.PageLink = Backbone.Model.extend({
9
11
  return this.get('label');
10
12
  },
11
13
 
14
+ thumbnailFile: function() {
15
+ var thumbnailFile = this.getReference('thumbnail_image_id',
16
+ pageflow.imageFiles);
17
+
18
+ if (thumbnailFile) {
19
+ return thumbnailFile;
20
+ }
21
+ else if (this.targetPage()) {
22
+ return this.targetPage().thumbnailFile();
23
+ }
24
+ else {
25
+ return null
26
+ }
27
+ },
28
+
12
29
  editPath: function() {
13
30
  return '/internal_links_pages/' + this.getRoutableId() + '/page_links/' + this.id;
14
31
  },
@@ -32,4 +49,4 @@ pageflow.internalLinks.PageLink = Backbone.Model.extend({
32
49
  remove: function() {
33
50
  this.collection.remove(this);
34
51
  }
35
- });
52
+ });
@@ -0,0 +1,17 @@
1
+ pageflow.internalLinks.PageLinkFileSelectionHandler = function(options) {
2
+ var page = pageflow.pages.get(options.id);
3
+ var pageLink = page.pageLinks().get(options.pageLinkId);
4
+
5
+ this.call = function(file) {
6
+ pageLink.setReference(options.attributeName, file);
7
+ };
8
+
9
+ this.getReferer = function() {
10
+ return '/internal_links_pages/' + options.id + '/page_links/' + options.pageLinkId;
11
+ };
12
+ };
13
+
14
+ pageflow.editor.registerFileSelectionHandler(
15
+ 'internalLinks.pageLink',
16
+ pageflow.internalLinks.PageLinkFileSelectionHandler
17
+ );
@@ -43,6 +43,9 @@ pageflow.internalLinks.EditPageLinkView = Backbone.Marionette.Layout.extend({
43
43
  },
44
44
 
45
45
  configure: function(configurationEditor) {
46
+ var pageLink = this.model;
47
+ var page = pageLink.collection.page;
48
+
46
49
  configurationEditor.tab('general', function() {
47
50
  this.input('label', pageflow.TextInputView);
48
51
  this.input('target_page_id', pageflow.PageLinkInputView);
@@ -52,6 +55,20 @@ pageflow.internalLinks.EditPageLinkView = Backbone.Marionette.Layout.extend({
52
55
  blankTranslationKey: 'pageflow.internal_links.editor.views.edit_page_link_view.default_page_transition',
53
56
  values: pageflow.pageTransitions.names()
54
57
  });
58
+ this.input('thumbnail_image_id', pageflow.FileInputView, {
59
+ collection: pageflow.imageFiles,
60
+ positioning: false,
61
+
62
+ fileSelectionHandler: 'internalLinks.pageLink',
63
+ fileSelectionHandlerOptions: {
64
+ pageLinkId: pageLink.id,
65
+ },
66
+
67
+ visibleBinding: 'id',
68
+ visible: function() {
69
+ return page.get('template') === 'internal_links_list';
70
+ }
71
+ });
55
72
  this.input('description', pageflow.TextAreaInputView, {
56
73
  size: 'short'
57
74
  });
@@ -68,4 +85,4 @@ pageflow.internalLinks.EditPageLinkView = Backbone.Marionette.Layout.extend({
68
85
  goBack: function() {
69
86
  pageflow.editor.navigate('/pages/' + this.options.page.id + '/links', {trigger: true});
70
87
  }
71
- });
88
+ });
@@ -5,7 +5,7 @@ pageflow.internalLinks.GridConfigurationEditorView = pageflow.ConfigurationEdito
5
5
  });
6
6
 
7
7
  this.tab('files', function() {
8
- this.input('background_image_id', pageflow.FileInputView, {collection: pageflow.imageFiles});
8
+ this.group('background');
9
9
  this.input('thumbnail_image_id', pageflow.FileInputView, {
10
10
  collection: pageflow.imageFiles,
11
11
  positioning: false
@@ -5,7 +5,7 @@ pageflow.internalLinks.ListConfigurationEditorView = pageflow.ConfigurationEdito
5
5
  });
6
6
 
7
7
  this.tab('files', function() {
8
- this.input('background_image_id', pageflow.FileInputView, {collection: pageflow.imageFiles});
8
+ this.group('background');
9
9
  this.input('thumbnail_image_id', pageflow.FileInputView, {
10
10
  collection: pageflow.imageFiles,
11
11
  positioning: false
@@ -36,12 +36,17 @@ pageflow.internalLinks.ListItemEmbeddedView = Backbone.Marionette.ItemView.exten
36
36
  update: function() {
37
37
  var targetPage = this.targetPage();
38
38
 
39
- if (!('currentTargetPage' in this) || this.currentTargetPage !== targetPage) {
39
+ if (!('currentTargetPage' in this) ||
40
+ this.currentTargetPage !== targetPage ||
41
+ !('currentThumbnailImageId' in this) ||
42
+ this.currentThumbnailImageId != this.model.get('thumbnail_image_id')) {
43
+
40
44
  if (this.currentTargetPage) {
41
45
  this.stopListening(this.currentTargetPage.configuration, 'change:description');
42
46
  }
43
47
 
44
48
  this.currentTargetPage = targetPage;
49
+ this.currentThumbnailImageId = this.model.get('thumbnail_image_id');
45
50
 
46
51
  this.ui.link.attr('data-page', targetPage ? targetPage.get('perma_id') : null);
47
52
 
@@ -68,7 +73,7 @@ pageflow.internalLinks.ListItemEmbeddedView = Backbone.Marionette.ItemView.exten
68
73
  this.ui.description.html(this.model.get('description'));
69
74
  }
70
75
  else {
71
- this.ui.description.html(targetPage ? targetPage.configuration.get('description') : '');
76
+ this.ui.description.html(targetPage ? (targetPage.configuration.get('description') || '') : '');
72
77
  }
73
78
  },
74
79
 
@@ -80,7 +85,7 @@ pageflow.internalLinks.ListItemEmbeddedView = Backbone.Marionette.ItemView.exten
80
85
  }
81
86
 
82
87
  this.thumbnailView = this.subview(new pageflow.PageThumbnailView({
83
- model: targetPage,
88
+ model: this.model,
84
89
  imageUrlPropertyName: 'link_thumbnail_url'
85
90
  }));
86
91
 
@@ -95,9 +100,13 @@ pageflow.internalLinks.ListItemEmbeddedView = Backbone.Marionette.ItemView.exten
95
100
  this.$el.toggleClass('empty', !targetPage && !editable);
96
101
  this.$el.toggleClass('unassigned', !targetPage);
97
102
  this.$el.toggleClass('highlighted', !!this.model.get('highlighted'));
103
+ this.ui.link.toggleClass('custom_thumbnail', !!this.model.getReference('thumbnail_image_id', pageflow.imageFiles));
104
+ this.ui.link.toggleClass('no_custom_thumbnail', !this.model.getReference('thumbnail_image_id', pageflow.imageFiles));
105
+ this.ui.link.toggleClass('own_description', !!this.model.get('description'));
106
+ this.ui.link.toggleClass('no_own_description', !this.model.get('description'));
98
107
  },
99
108
 
100
109
  targetPage: function() {
101
110
  return this.model.targetPage();
102
111
  }
103
- });
112
+ });
@@ -1,4 +1,4 @@
1
- pageflow.pageType.register('internal_links_grid', _.extend({
1
+ pageflow.react.registerPageTypeWithDefaultBackground('internal_links_grid', {
2
2
  prepareNextPageTimeout: 0,
3
3
 
4
4
  enhance: function(pageElement, configuration) {
@@ -10,22 +10,16 @@ pageflow.pageType.register('internal_links_grid', _.extend({
10
10
  });
11
11
  },
12
12
 
13
- preload: function(pageElement, configuration) {
14
- return pageflow.preload.backgroundImage(pageElement.find('.background_image'));
15
- },
16
-
17
13
  update: function(pageElement, configuration) {
18
14
  pageElement.find('h2 .tagline').text(configuration.get('tagline') || '');
19
15
  pageElement.find('h2 .title').text(configuration.get('title') || '');
20
16
  pageElement.find('h2 .subtitle').text(configuration.get('subtitle') || '');
21
17
  pageElement.find('p').html(configuration.get('text') || '');
22
18
 
23
- this.updateCommonPageCssClasses(pageElement, configuration);
24
-
25
19
  pageElement.find('.shadow').css({
26
20
  opacity: configuration.get('gradient_opacity') / 100
27
21
  });
28
22
 
29
23
  pageElement.find('nav').attr('data-layout', configuration.get('linked_pages_layout'));
30
24
  }
31
- }, pageflow.commonPageCssClasses));
25
+ });
@@ -1,4 +1,4 @@
1
- pageflow.pageType.register('internal_links_list', _.extend({
1
+ pageflow.react.registerPageTypeWithDefaultBackground('internal_links_list', {
2
2
  prepareNextPageTimeout: 0,
3
3
 
4
4
  enhance: function(pageElement, configuration) {
@@ -10,8 +10,12 @@ pageflow.pageType.register('internal_links_list', _.extend({
10
10
  });
11
11
  },
12
12
 
13
- preload: function(pageElement, configuration) {
14
- return pageflow.preload.backgroundImage(pageElement.find('.background_image'));
13
+ activated: function(pageElement) {
14
+ this._updateThumbnailHeights(pageElement);
15
+ },
16
+
17
+ resize: function(pageElement) {
18
+ this._updateThumbnailHeights(pageElement);
15
19
  },
16
20
 
17
21
  update: function(pageElement, configuration) {
@@ -20,10 +24,24 @@ pageflow.pageType.register('internal_links_list', _.extend({
20
24
  pageElement.find('h2 .subtitle').text(configuration.get('subtitle') || '');
21
25
  pageElement.find('.contentText p').html(configuration.get('text') || '');
22
26
 
23
- this.updateCommonPageCssClasses(pageElement, configuration);
24
-
25
27
  pageElement.find('.shadow').css({
26
28
  opacity: configuration.get('gradient_opacity') / 100
27
29
  });
30
+
31
+ this._updateThumbnailHeights(pageElement);
32
+ },
33
+
34
+ _updateThumbnailHeights: function(pageElement) {
35
+ pageElement.find('.page_link.custom_thumbnail').each(function() {
36
+ var thumbnail = $('.page_thumbnail', this);
37
+ var details = $('.details', this);
38
+
39
+ if ($(this).hasClass('own_description')) {
40
+ thumbnail.css('bottom', details.outerHeight() + 'px');
41
+ }
42
+ else {
43
+ thumbnail.css('bottom', '0');
44
+ }
45
+ });
28
46
  }
29
- }, pageflow.commonPageCssClasses));
47
+ });
@@ -124,6 +124,7 @@
124
124
  background-position: center;
125
125
  background-size: cover;
126
126
  position: relative;
127
+ background-repeat: no-repeat;
127
128
 
128
129
  div {
129
130
  position: absolute;
@@ -2,6 +2,14 @@
2
2
  $internal-links-list-main-color: $main-color-dark !default;
3
3
  $internal-links-list-item-background-color: rgba(48, 48, 48, 0.8) !default;
4
4
 
5
+ .contentText {
6
+ margin-bottom: 250px;
7
+
8
+ @include mobile {
9
+ margin-bottom: 0;
10
+ }
11
+ }
12
+
5
13
  nav {
6
14
  position: absolute;
7
15
  bottom: 6.666%;
@@ -46,21 +54,66 @@
46
54
  -ms-interpolation-mode: nearest-neighbor;
47
55
 
48
56
  .details {
49
- position: absolute;
50
- top: 50%;
51
- margin: 0;
52
- padding: 10%;
53
- width: 100%;
54
- box-sizing: border-box;
55
- @include transform(translate(0,-50%));
56
-
57
57
  p:last-of-type {
58
58
  margin: 0;
59
59
  }
60
60
  }
61
61
 
62
- .page_thumbnail {
63
- display: none;
62
+ &.no_custom_thumbnail {
63
+ .details {
64
+ position: absolute;
65
+ top: 50%;
66
+ margin: 0;
67
+ padding: 10%;
68
+ width: 100%;
69
+ box-sizing: border-box;
70
+ @include transform(translate(0,-50%));
71
+
72
+ p:last-of-type {
73
+ margin: 0;
74
+ }
75
+ }
76
+
77
+ .page_thumbnail {
78
+ display: none;
79
+ }
80
+ }
81
+
82
+ &.custom_thumbnail {
83
+ .details {
84
+ position: absolute;
85
+ bottom: 0;
86
+ left: 0;
87
+ right: 0;
88
+ padding: 7px 10px;
89
+ margin: 0;
90
+ font-size: 15px;
91
+
92
+ @media (max-width: 500px) {
93
+ font-size: 12px;
94
+ }
95
+ }
96
+
97
+ &.no_own_description {
98
+ .details {
99
+ display: none;
100
+ }
101
+ }
102
+
103
+ .page_thumbnail {
104
+ display: block;
105
+ position: absolute;
106
+ top: 0;
107
+ left: 0;
108
+ right: 0;
109
+ bottom: 35px;
110
+ padding: 0;
111
+ }
112
+
113
+ .page_thumbnail,
114
+ .page_thumbnail div {
115
+ background-position: 50% 50%;
116
+ }
64
117
  }
65
118
  }
66
119
  li:hover {
@@ -117,4 +170,4 @@
117
170
  }
118
171
  }
119
172
  }
120
- }
173
+ }
@@ -32,13 +32,14 @@ module Pageflow
32
32
  PageLink.new(attributes['target_page_id'],
33
33
  attributes['position'].to_i,
34
34
  attributes['page_transition'],
35
- attributes['description'])
35
+ attributes['description'],
36
+ attributes['thumbnail_image_id'])
36
37
  end.sort_by(&:position)
37
38
  end
38
39
 
39
40
  def parse_legacy_hash(hash)
40
41
  hash.map do |position, target_page_id|
41
- PageLink.new(target_page_id, (position.to_i - 1), nil, nil)
42
+ PageLink.new(target_page_id, (position.to_i - 1), nil, nil, nil)
42
43
  end
43
44
  end
44
45
  end
@@ -46,7 +47,8 @@ module Pageflow
46
47
  class PageLink < Struct.new(:target_page_id,
47
48
  :position,
48
49
  :page_transition,
49
- :optional_description)
50
+ :optional_description,
51
+ :custom_thumbnail_image_id)
50
52
 
51
53
  attr_accessor :target_page
52
54
 
@@ -58,6 +60,19 @@ module Pageflow
58
60
  optional_description.presence || target_page_description
59
61
  end
60
62
 
63
+ def thumbnail_file
64
+ custom_thumbnail_file ||
65
+ (target_page && target_page.thumbnail_file)
66
+ end
67
+
68
+ def css_class
69
+ [
70
+ 'page_link',
71
+ custom_thumbnail_file ? 'custom_thumbnail' : 'no_custom_thumbnail',
72
+ optional_description.present? ? 'own_description' : 'no_own_description'
73
+ ].compact.join(' ')
74
+ end
75
+
61
76
  def data_attributes
62
77
  {}.tap do |result|
63
78
  result[:page] = target_page.perma_id if target_page
@@ -71,6 +86,10 @@ module Pageflow
71
86
 
72
87
  private
73
88
 
89
+ def custom_thumbnail_file
90
+ @custom_thumbnail_file = ImageFile.find_by_id(custom_thumbnail_image_id)
91
+ end
92
+
74
93
  def target_page_description
75
94
  target_page ? target_page.configuration['description'] : ''
76
95
  end
@@ -1,7 +1,7 @@
1
1
  <div class="blackLayer"></div>
2
2
  <div class="content_and_background internal_links_page">
3
3
  <div class="backgroundArea">
4
- <%= background_image_div(configuration, 'background_image') %>
4
+ <%= page_background_asset(configuration) %>
5
5
  <%= shadow_div :opacity => configuration['gradient_opacity'] %>
6
6
  </div>
7
7
  <div class="content scroller">
@@ -1,10 +1,9 @@
1
1
  <li>
2
- <%= link_to("#", class: 'page_link', data: page_link.data_attributes) do %>
2
+ <%= link_to("#", class: page_link.css_class, data: page_link.data_attributes) do %>
3
3
  <%= content_tag(:div,
4
4
  '',
5
5
  class: ['page_thumbnail',
6
- page_link.target_page ? page_thumbnail_image_class(page_link.target_page, false) : nil].compact * ' ') %>
7
-
6
+ file_thumbnail_css_class(page_link.thumbnail_file, :link_thumbnail_large)].compact * ' ') %>
8
7
  <div class="details">
9
8
  <p class="page_description">
10
9
  <%= raw(strip_links(page_link.description)) %>
@@ -1,7 +1,7 @@
1
1
  <div class="blackLayer"></div>
2
2
  <div class="content_and_background internal_links_list_page">
3
3
  <div class="backgroundArea">
4
- <%= background_image_div(configuration, 'background_image') %>
4
+ <%= page_background_asset(configuration) %>
5
5
  <%= shadow_div :opacity => configuration['gradient_opacity'] %>
6
6
  </div>
7
7
  <div class="content scroller">
@@ -1,4 +1,8 @@
1
1
  de:
2
+ activerecord:
3
+ attributes:
4
+ pageflow/internal_links/page_link:
5
+ thumbnail_image_id: Bild
2
6
  pageflow:
3
7
  internal_links:
4
8
  editor:
@@ -25,6 +29,8 @@ de:
25
29
  Im Gegensatz zur externen Verweis-Seite, werden hier interne Seiten innerhalb des
26
30
  Pageflows verlinkt. Dies bietet sich an, um den User gezielt durch den Pageflow zu leiten.
27
31
 
32
+ Für den Hintergrund kann ein Bild oder Video verwendet werden.
33
+
28
34
  Typische Anwendungsbeispiele: Willkommens-Seite, Kapitel-Startseite
29
35
  page_attributes:
30
36
  linked_pages_layout:
@@ -46,6 +52,8 @@ de:
46
52
 
47
53
  Links auf andere Seiten des Pageflows dargestellt als horizontal angeordnete Boxen mit einem kurzen Text.
48
54
 
55
+ Für den Hintergrund kann ein Bild oder Video verwendet werden.
56
+
49
57
  Typische Anwendungsbeispiele: Frage/Antwort-Seite, interaktives Interview, Quiz
50
58
  page_type_category_name: Verweise
51
59
  page_type_description: Verweise auf andere Seiten als Reihe von Antworten
@@ -56,3 +64,7 @@ de:
56
64
  label: Beschreibung
57
65
  internal_links_list:
58
66
  page_type_feature_name: Multiple Choice Seitentyp
67
+ ui:
68
+ inline_help:
69
+ pageflow/internal_links/page_link:
70
+ thumbnail_image_id: Ein Bild in der Verweis-Box anzeigen.
@@ -1,4 +1,8 @@
1
1
  en:
2
+ activerecord:
3
+ attributes:
4
+ pageflow/internal_links/page_link:
5
+ thumbnail_image_id: Image
2
6
  pageflow:
3
7
  internal_links:
4
8
  editor:
@@ -18,16 +22,7 @@ en:
18
22
  help_entries:
19
23
  page_type:
20
24
  menu_item: Internal Links Grid
21
- text: |-
22
- # Internal Links Grid
23
-
24
- References to other pages inside a Pageflow
25
-
26
- In contrast to external link, you can link to pages inside
27
- your Pageflow. This page type helps you guide your users
28
- through your Pageflow.
29
-
30
- Examples of application: Welcome page, chapter homepage
25
+ text: "# Internal Links Grid\n\nReferences to other pages inside a Pageflow\n\nIn contrast to external link, you can link to pages inside\nyour Pageflow. This page type helps you guide your users\nthrough your Pageflow. \n\nYou can use an image or video for the background.\n\nExamples of application: Welcome page, chapter homepage"
31
26
  page_attributes:
32
27
  linked_pages_layout:
33
28
  inline_help: Emphasize one of the thumbnails.
@@ -43,13 +38,14 @@ en:
43
38
  help_entries:
44
39
  page_type:
45
40
  menu_item: Multiple Choice
46
- text: |+
41
+ text: |-
47
42
  # Multiple Choice
48
43
 
49
44
  A collection of links to other pages of the Pageflow displayed as a row of boxes with some text.
50
45
 
51
- Examples of application: Question/answer page, interactive interview, quiz
46
+ You can use an image or video for the background.
52
47
 
48
+ Examples of application: Question/answer page, interactive interview, quiz
53
49
  page_type_category_name: Links
54
50
  page_type_description: Links to other pages as collection of answers
55
51
  page_type_name: Multiple Choice
@@ -59,3 +55,7 @@ en:
59
55
  label: Description
60
56
  internal_links_list:
61
57
  page_type_feature_name: Multiple Choice Page Type
58
+ ui:
59
+ inline_help:
60
+ pageflow/internal_links/page_link:
61
+ thumbnail_image_id: Display image inside of page link box.
@@ -2,6 +2,7 @@ module Pageflow
2
2
  module InternalLinks
3
3
  class Plugin < Pageflow::Plugin
4
4
  def configure(config)
5
+ config.page_types.register(InternalLinks.grid_page_type)
5
6
  config.features.register(PageTypeFeature.new(InternalLinks.list_page_type))
6
7
  end
7
8
  end
@@ -1,5 +1,5 @@
1
1
  module Pageflow
2
2
  module InternalLinks
3
- VERSION = '0.2.0'.freeze
3
+ VERSION = '1.0.0'.freeze
4
4
  end
5
5
  end
@@ -13,12 +13,16 @@ Gem::Specification.new do |spec|
13
13
  spec.license = 'MIT'
14
14
 
15
15
  spec.files = `git ls-files`.split($/)
16
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
16
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
17
  spec.require_paths = ['lib']
19
18
 
20
- spec.add_runtime_dependency('pageflow', '~> 0.10')
19
+ spec.required_ruby_version = '~> 2.1'
20
+
21
+ spec.add_runtime_dependency('pageflow', '~> 12.x')
22
+
23
+ spec.add_development_dependency 'bundler', '~> 1.0'
24
+ spec.add_development_dependency 'rake', '~> 12.0'
21
25
 
22
26
  # Semantic versioning rake tasks
23
- spec.add_development_dependency 'semmy', '~> 0.2'
27
+ spec.add_development_dependency 'semmy', '~> 1.0'
24
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pageflow-internal-links
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Codevise Solutions
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-09 00:00:00.000000000 Z
11
+ date: 2017-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pageflow
@@ -16,28 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.10'
19
+ version: 12.x
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.10'
26
+ version: 12.x
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '12.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '12.0'
27
55
  - !ruby/object:Gem::Dependency
28
56
  name: semmy
29
57
  requirement: !ruby/object:Gem::Requirement
30
58
  requirements:
31
59
  - - "~>"
32
60
  - !ruby/object:Gem::Version
33
- version: '0.2'
61
+ version: '1.0'
34
62
  type: :development
35
63
  prerelease: false
36
64
  version_requirements: !ruby/object:Gem::Requirement
37
65
  requirements:
38
66
  - - "~>"
39
67
  - !ruby/object:Gem::Version
40
- version: '0.2'
68
+ version: '1.0'
41
69
  description:
42
70
  email:
43
71
  - info@codevise.de
@@ -71,6 +99,7 @@ files:
71
99
  - app/assets/javascripts/pageflow/internal_links/editor/controllers/side_bar_controller.js
72
100
  - app/assets/javascripts/pageflow/internal_links/editor/models/page_configuration_mixin.js
73
101
  - app/assets/javascripts/pageflow/internal_links/editor/models/page_link.js
102
+ - app/assets/javascripts/pageflow/internal_links/editor/models/page_link_file_selection_handler.js
74
103
  - app/assets/javascripts/pageflow/internal_links/editor/routers/side_bar_router.js
75
104
  - app/assets/javascripts/pageflow/internal_links/editor/templates/edit_page_link.jst.ejs
76
105
  - app/assets/javascripts/pageflow/internal_links/editor/templates/grid_item_embedded.jst.ejs
@@ -85,9 +114,9 @@ files:
85
114
  - app/assets/javascripts/pageflow/internal_links/editor/views/page_link_embedded_view.js
86
115
  - app/assets/javascripts/pageflow/internal_links/grid_page_type.js
87
116
  - app/assets/javascripts/pageflow/internal_links/list_page_type.js
88
- - app/assets/stylesheets/pageflow/internal_links.css.scss
89
- - app/assets/stylesheets/pageflow/internal_links/editor.css.scss
90
- - app/assets/stylesheets/pageflow/internal_links/editor/embedded_grid_item.css.scss
117
+ - app/assets/stylesheets/pageflow/internal_links.scss
118
+ - app/assets/stylesheets/pageflow/internal_links/editor.scss
119
+ - app/assets/stylesheets/pageflow/internal_links/editor/embedded_grid_item.scss
91
120
  - app/assets/stylesheets/pageflow/internal_links/editor/embedded_list_item.scss
92
121
  - app/assets/stylesheets/pageflow/internal_links/grid.scss
93
122
  - app/assets/stylesheets/pageflow/internal_links/list.scss
@@ -121,9 +150,9 @@ require_paths:
121
150
  - lib
122
151
  required_ruby_version: !ruby/object:Gem::Requirement
123
152
  requirements:
124
- - - ">="
153
+ - - "~>"
125
154
  - !ruby/object:Gem::Version
126
- version: '0'
155
+ version: '2.1'
127
156
  required_rubygems_version: !ruby/object:Gem::Requirement
128
157
  requirements:
129
158
  - - ">="
@@ -131,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
160
  version: '0'
132
161
  requirements: []
133
162
  rubyforge_project:
134
- rubygems_version: 2.2.5
163
+ rubygems_version: 2.6.8
135
164
  signing_key:
136
165
  specification_version: 4
137
166
  summary: Pageflow page types for linking to other pages.