pageflow-parent-page-box 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ed88f5cb153907c5949ecca188f1701a1e84a619
4
+ data.tar.gz: c085a7d052b7b6dfb76ec2c6ea94bc6d7238eefc
5
+ SHA512:
6
+ metadata.gz: dddf179fb48c4af5b8a3b026a7e1757ffd7d73fc6b0dbacdf8f2272a217c2def3d7999b677ef43d314ed761a0094ae0c21f5722f6a9b5627167ec50b19df2988
7
+ data.tar.gz: 2e434ab3e003e2c0a87a67137b3ea9aa22ecda6a9cdd2c75b90803d695878f785d1fe4e76a8b9a02ca3447276a30b2b773b889f9bab94205095129fd05859d7b
data/.gitignore ADDED
@@ -0,0 +1,22 @@
1
+ *.gem
2
+ *.rbc
3
+ *.sqlite3
4
+ .bundle
5
+ .config
6
+ .yardoc
7
+ .idea
8
+ InstalledFiles
9
+ _yardoc
10
+ coverage
11
+ doc/
12
+ lib/bundler/man
13
+ pkg
14
+ rdoc
15
+ spec/reports
16
+ test/tmp
17
+ test/version_tmp
18
+ tmp
19
+ log
20
+ Gemfile.lock
21
+
22
+ .localeapp
data/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # CHANGELOG
2
+
3
+ ### Version 0.1.0
4
+
5
+ 2016-06-09
6
+
7
+ - Initial release.
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in chart.gemspec
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 ADDED
@@ -0,0 +1,45 @@
1
+ # Pageflow Parent Page Box
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/pageflow-parent-page-box.svg)](http://badge.fury.io/rb/pageflow-parent-page-box)
4
+
5
+ A navigation widget to exit the current storyline and return to the
6
+ parent page.
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's `Gemfile`:
11
+
12
+ gem 'pageflow-parent-page-box'
13
+
14
+ Register the plugin inside the configure block in `config/initializers/pageflow.rb`
15
+
16
+ Pageflow.configure do |config|
17
+ config.plugin(Pageflow::ParentPageBox.plugin)
18
+ end
19
+
20
+ Include javascripts and stylesheets:
21
+
22
+ # app/assets/javascripts/components.js
23
+ //= require pageflow/parent_page_box/components
24
+
25
+ # app/assets/javascripts/pageflow/application.js
26
+ //= require pageflow/parent_page_box
27
+
28
+ # app/assets/stylesheets/pageflow/themes/default.scss
29
+ @import "pageflow/parent_page_box/themes/default";
30
+
31
+ Execute `bundle install` Restart the application server.
32
+
33
+ ## Troubleshooting
34
+
35
+ If you run into problems while installing the page type, please also refer to the
36
+ [Troubleshooting](https://github.com/codevise/pageflow/wiki/Troubleshooting) wiki
37
+ page in the [Pageflow repository](https://github.com/codevise/pageflow). If that
38
+ doesn't help, consider
39
+ [filing an issue](https://github.com/codevise/pageflow-parent-page-box/issues).
40
+
41
+ ## Contributing Locales
42
+
43
+ This project uses locales from the
44
+ [pageflow-public-i18n](http://www.localeapp.com/projects/public?search=tf/pageflow-public-i18n)
45
+ locale project.
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ Bundler::GemHelper.install_tasks
8
+
9
+ require 'semmy'
10
+ Semmy::Tasks.install
@@ -0,0 +1,4 @@
1
+ //= require_self
2
+ //= require ./widget
3
+
4
+ pageflow.parentPageBox = pageflow.parentPageBox || {};
@@ -0,0 +1,70 @@
1
+ const {createContainer, createWidget, resolve, classNames} = pageflow.react;
2
+ const {PageThumbnail} = pageflow.react.components;
3
+
4
+ function ParentPageBox(props) {
5
+ return (
6
+ <div className="parent_page_box">
7
+ <a className={classNames('parent_page_box-link',
8
+ props.parentPage && 'is_visible')}
9
+ href={`#${props.parentPage ? props.parentPage.permaId : ''}`}
10
+ tabIndex="2"
11
+ onClick={handleClick} />
12
+
13
+ {renderOverlay(props.parentPage, props.i18n)}
14
+ </div>
15
+ )
16
+ }
17
+
18
+ function renderOverlay(page, i18n) {
19
+ if (page) {
20
+ return (
21
+ <div className="parent_page_box-overlay">
22
+ {renderBackTo(page.chapter, i18n)}
23
+ <span className="parent_page_box-page_title">
24
+ {page.title}
25
+ </span>
26
+ <PageThumbnail className="parent_page_box-thumbnail" page={page} />
27
+ </div>
28
+ );
29
+ }
30
+ else {
31
+ return null;
32
+ }
33
+ }
34
+
35
+ function renderBackTo(chapter, i18n) {
36
+ if (chapter.title) {
37
+ return (
38
+ <div>
39
+ {i18n.t('pageflow.public.back_to_chapter')}
40
+ <div className="parent_page_box-chapter_title">
41
+ {chapter.title}
42
+ </div>
43
+ <hr className="parent_page_box-separator" />
44
+ </div>
45
+ );
46
+ }
47
+ else {
48
+ return (
49
+ <div className="parent_page_box-standalong_back_label">
50
+ {i18n.t('pageflow.public.back_to_chapter')}
51
+ </div>
52
+ );
53
+ }
54
+ }
55
+
56
+ function handleClick(event) {
57
+ pageflow.slides.goToParentPage();
58
+ event.preventDefault();
59
+ }
60
+
61
+ pageflow.parentPageBox.Widget = createWidget(createContainer(ParentPageBox, {
62
+ fragments: {
63
+ i18n: resolve('i18n'),
64
+ parentPage: resolve('currentParentPage', {
65
+ fragments: {
66
+ chapter: resolve('chapter')
67
+ }
68
+ })
69
+ }
70
+ }));
@@ -0,0 +1,2 @@
1
+ pageflow.widgetTypes.register('parent_page_box',
2
+ pageflow.react.createWidgetType(pageflow.parentPageBox.Widget));
@@ -0,0 +1,9 @@
1
+ //= require react
2
+ //= require pageflow/react
3
+
4
+ //= require_self
5
+
6
+ //= require ./parent_page_box/components
7
+ //= require ./parent_page_box/widget_type
8
+
9
+ pageflow.parentPageBox = pageflow.parentPageBox || {};
@@ -0,0 +1,108 @@
1
+ @import "pageflow/extendables";
2
+
3
+ .parent_page_box {
4
+ $basic-text-color: #fff !default;
5
+
6
+ $parent-page-box-background-color: $basic-background-color-transparent !default;
7
+ $parent-page-box-text-color: $basic-text-color !default;
8
+ $parent-page-box-border: solid 2px #aaa !default;
9
+ $parent-page-box-indicator-icon-color: fade-out($parent-page-box-text-color, 0.2);
10
+ $parent-page-box-indicator-icon-hover-color: $parent-page-box-text-color;
11
+ $parent-page-box-separator-color: fade-out($parent-page-box-text-color, 0.2);
12
+
13
+ $background-color: $parent-page-box-background-color;
14
+ $text-color: $parent-page-box-text-color;
15
+ $border: $parent-page-box-border;
16
+
17
+ $indicator-width: 40px;
18
+ $indicator-height: 50px;
19
+ $indicator-margin: 5px;
20
+
21
+ @extend %pageflow_widget;
22
+
23
+ position: absolute;
24
+ top: 75%;
25
+ left: 0;
26
+ z-index: 100;
27
+
28
+ .parent_page_box-link {
29
+ @include background-icon-center($color: $parent-page-box-indicator-icon-color, $left: 48%, $font-size: 30px);
30
+ @include fa-angle-left-icon;
31
+
32
+ position: absolute;
33
+ bottom: 0;
34
+ display: block;
35
+ height: $indicator-height;
36
+ width: $indicator-width;
37
+
38
+ background-color: $background-color;
39
+ text-decoration: none;
40
+
41
+ @include transition(transform 0.3s ease, visibility 0.3s ease);
42
+ @include transition-delay(0);
43
+ @include transform(translate3d(-100%, 0, 0));
44
+ visibility: hidden;
45
+
46
+ &::before {
47
+ font-weight: bold;
48
+ }
49
+
50
+ &.is_visible {
51
+ @include transform(translate3d(0, 0, 0));
52
+ @include transition-delay(1s);
53
+ visibility: visible;
54
+ }
55
+ }
56
+
57
+ .parent_page_box-overlay {
58
+ position: absolute;
59
+ bottom: 0;
60
+ left: $indicator-width + $indicator-margin;
61
+ padding: 15px;
62
+ display: none;
63
+ pointer-events: none;
64
+
65
+ background-color: $background-color;
66
+ color: $text-color;
67
+ }
68
+
69
+ &:hover {
70
+ .parent_page_box-link {
71
+ @include background-icon-color($parent-page-box-indicator-icon-hover-color);
72
+ }
73
+
74
+ .parent_page_box-overlay {
75
+ display: block;
76
+ }
77
+ }
78
+
79
+ .parent_page_box-thumbnail {
80
+ @extend %pageflow_page_type_thumbnail;
81
+
82
+ width: 170px;
83
+ height: 95px;
84
+ margin: 12px 0 5px 0;
85
+ }
86
+
87
+ .parent_page_box-separator {
88
+ border: none;
89
+ border-bottom: solid 1px $parent-page-box-separator-color;
90
+ }
91
+
92
+ .parent_page_box-standalong_back_label,
93
+ .parent_page_box-chapter_title {
94
+ font-weight: bold;
95
+ }
96
+ }
97
+
98
+ @include phone {
99
+ .parent_page_box {
100
+ display: none;
101
+ }
102
+ }
103
+
104
+ @include pad_portrait {
105
+ .parent_page_box {
106
+ display: none;
107
+ }
108
+ }
@@ -0,0 +1,8 @@
1
+ de:
2
+ pageflow:
3
+ parent_page_box:
4
+ widget_type_name: "Box am linken Seitenrand"
5
+ widgets:
6
+ roles:
7
+ parent_page_box:
8
+ "Übergeordnete Seite Hinweis"
@@ -0,0 +1,8 @@
1
+ en:
2
+ pageflow:
3
+ parent_page_box:
4
+ widget_type_name: "Box at left page margin"
5
+ widgets:
6
+ roles:
7
+ parent_page_box:
8
+ "Parent Page Box"
@@ -0,0 +1,10 @@
1
+ module Pageflow
2
+ module ParentPageBox
3
+ class Engine < Rails::Engine
4
+ isolate_namespace Pageflow::ParentPageBox
5
+
6
+ config.autoload_paths << File.join(config.root, 'lib')
7
+ config.i18n.load_path += Dir[config.root.join('config', 'locales', '**', '*.yml').to_s]
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,9 @@
1
+ module Pageflow
2
+ module ParentPageBox
3
+ class Plugin < Pageflow::Plugin
4
+ def configure(config)
5
+ config.widget_types.register(ParentPageBox.widget_type, default: true)
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ module Pageflow
2
+ module ParentPageBox
3
+ VERSION = '0.1.0'.freeze
4
+ end
5
+ end
@@ -0,0 +1,15 @@
1
+ require 'pageflow/parent_page_box/engine'
2
+
3
+ module Pageflow
4
+ module ParentPageBox
5
+ def self.plugin
6
+ ParentPageBox::Plugin.new
7
+ end
8
+
9
+ def self.widget_type
10
+ Pageflow::React.create_widget_type('parent_page_box',
11
+ 'parent_page_box',
12
+ 'pageflow.parentPageBox.Widget')
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'pageflow/parent_page_box/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'pageflow-parent-page-box'
8
+ spec.version = Pageflow::ParentPageBox::VERSION
9
+ spec.authors = ['Codevise Solutions Ltd.']
10
+ spec.email = ['info@codevise.de']
11
+ spec.summary = 'Pageflow navigation widget to leave current storyline.'
12
+ spec.homepage = 'https://github.com/codevise/pageflow-parent-page-box'
13
+ spec.license = 'MIT'
14
+
15
+ spec.files = `git ls-files`.split($/)
16
+ spec.test_files = spec.files.grep(%r{^spec/})
17
+ spec.require_paths = ['lib']
18
+
19
+ spec.add_runtime_dependency 'pageflow', '~> 0.10'
20
+ spec.add_runtime_dependency 'pageflow-public-i18n', '~> 1.1'
21
+ spec.add_runtime_dependency 'pageflow-react'
22
+
23
+ spec.add_development_dependency 'bundler'
24
+ spec.add_development_dependency 'rake'
25
+
26
+ # Semantic versioning rake tasks
27
+ spec.add_development_dependency 'semmy', '~> 0.2'
28
+ end
metadata ADDED
@@ -0,0 +1,145 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pageflow-parent-page-box
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Codevise Solutions Ltd.
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-06-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: pageflow
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.10'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: pageflow-public-i18n
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: pageflow-react
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: semmy
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '0.2'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '0.2'
97
+ description:
98
+ email:
99
+ - info@codevise.de
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - ".gitignore"
105
+ - CHANGELOG.md
106
+ - Gemfile
107
+ - README.md
108
+ - Rakefile
109
+ - app/assets/javascript/pageflow/parent_page_box.js
110
+ - app/assets/javascript/pageflow/parent_page_box/components.js
111
+ - app/assets/javascript/pageflow/parent_page_box/widget.jsx
112
+ - app/assets/javascript/pageflow/parent_page_box/widget_type.js
113
+ - app/assets/stylesheets/pageflow/parent_page_box/themes/default.scss
114
+ - config/locales/de.yml
115
+ - config/locales/en.yml
116
+ - lib/pageflow-parent-page-box.rb
117
+ - lib/pageflow/parent_page_box/engine.rb
118
+ - lib/pageflow/parent_page_box/plugin.rb
119
+ - lib/pageflow/parent_page_box/version.rb
120
+ - pageflow-parent-page-box.gemspec
121
+ homepage: https://github.com/codevise/pageflow-parent-page-box
122
+ licenses:
123
+ - MIT
124
+ metadata: {}
125
+ post_install_message:
126
+ rdoc_options: []
127
+ require_paths:
128
+ - lib
129
+ required_ruby_version: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ required_rubygems_version: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ requirements: []
140
+ rubyforge_project:
141
+ rubygems_version: 2.2.5
142
+ signing_key:
143
+ specification_version: 4
144
+ summary: Pageflow navigation widget to leave current storyline.
145
+ test_files: []