-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 3457e1b
Showing
21 changed files
with
294 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
*.gem | ||
*.rbc | ||
*.sqlite3 | ||
.bundle | ||
.config | ||
.yardoc | ||
.idea | ||
InstalledFiles | ||
_yardoc | ||
coverage | ||
doc/ | ||
lib/bundler/man | ||
pkg | ||
rdoc | ||
spec/reports | ||
test/tmp | ||
test/version_tmp | ||
tmp | ||
log | ||
Gemfile.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
vendor/assets/javascripts/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"browser": true, | ||
"undef": true, | ||
"immed": true, | ||
"trailing": true, | ||
"globals": { | ||
"jQuery": true, | ||
"$": true, | ||
"Backbone": true, | ||
"Cocktail": true, | ||
"_": true, | ||
"vjs": true, | ||
"Audio5js": true, | ||
"I18n": true, | ||
|
||
"pageflow": true, | ||
"editor": true, | ||
|
||
"confirm": true, | ||
"alert": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
source 'https://rubygems.org' | ||
|
||
# Specify your gem's dependencies in chart.gemspec | ||
gemspec | ||
|
||
# Rails 4 compat | ||
gem 'activeadmin', :git => 'https://github.com/codevise/active_admin.git', :branch => 'rails4' | ||
gem 'ransack' | ||
gem 'inherited_resources', '1.4.1' | ||
gem 'formtastic', '2.3.0.rc2' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Pageflow Text Page | ||
|
||
Page type to display large texts on a page. | ||
|
||
## Installation | ||
|
||
Add this line to your application's `Gemfile`: | ||
|
||
gem 'pageflow-text-page' | ||
|
||
Register the page type inside the configure block in `config/initializers/pageflow.rb` | ||
|
||
Pageflow.configure do |config| | ||
config.register_page_type(Pageflow::TextPage::PageType.new) | ||
end | ||
|
||
Include javascripts and stylesheets: | ||
|
||
# app/assets/javascripts/pageflow/application.js | ||
//= require pageflow/text_page | ||
|
||
# app/assets/javascripts/pageflow/editor.js | ||
//= require pageflow/text_page/editor | ||
|
||
# app/assets/stylesheets/pageflow/application.css.scss | ||
@import "pageflow/text_page"; | ||
|
||
Mount the routes in `config/routes.rb`: | ||
|
||
authenticated do | ||
mount Pageflow::TextPage::Engine, :at => '/text_page' | ||
end | ||
|
||
Install dependencies: | ||
|
||
bundle install | ||
|
||
Migrate the database: | ||
|
||
bundle exec rake db:migrate | ||
|
||
Restart the application server. | ||
|
||
## Troubleshooting | ||
|
||
If you run into problems while installing the page type, please also refer to the | ||
[Troubleshooting](https://github.com/codevise/pageflow/wiki/Troubleshooting) wiki | ||
page in the [Pageflow repository](https://github.com/codevise/pageflow). If that | ||
doesn't help, consider | ||
[filing an issue](https://github.com/codevise/pageflow-text-page/issues). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
begin | ||
require 'bundler/setup' | ||
rescue LoadError | ||
puts 'You must `gem install bundler` and `bundle install` to run rake tasks' | ||
end | ||
|
||
Bundler::GemHelper.install_tasks |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
//= require_self | ||
//= require ./text_page/page_type | ||
|
||
pageflow.textPage = pageflow.textPage || {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//= require_self | ||
|
||
//= require_tree ./editor/models | ||
//= require_tree ./editor/collections | ||
//= require_tree ./editor/routers | ||
//= require_tree ./editor/controllers | ||
//= require_tree ./editor/templates | ||
//= require_tree ./editor/views | ||
|
||
//= require ./editor/config | ||
|
||
pageflow.textPage = pageflow.textPage || {}; |
14 changes: 14 additions & 0 deletions
14
app/assets/javascript/pageflow/text_page/editor/text_page_embedded_view.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
pageflow.textPage.TextPageEmbeddedView = Backbone.Marionette.View.extend({ | ||
modelEvents: { | ||
'change': 'update' | ||
}, | ||
|
||
render: function() { | ||
|
||
this.update(); | ||
return this; | ||
}, | ||
|
||
update: function() { | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/*global IScroll*/ | ||
|
||
pageflow.pageType.register('text_page', _.extend({ | ||
prepareNextPageTimeout: 0, | ||
|
||
enhance: function(pageElement, configuration) {}, | ||
|
||
resize: function(pageElement, configuration) {}, | ||
|
||
prepare: function(pageElement, configuration) {}, | ||
|
||
preload: function(pageElement, configuration) { | ||
return pageflow.preload.backgroundImage(pageElement.find('.background_image')); | ||
}, | ||
|
||
activating: function(pageElement, configuration) {}, | ||
|
||
activated: function(pageElement, configuration) {}, | ||
|
||
deactivating: function(pageElement, configuration) {}, | ||
|
||
deactivated: function(pageElement, configuration) {}, | ||
|
||
update: function(pageElement, configuration) { | ||
pageElement.find('h2 .tagline').text(configuration.get('tagline') || ''); | ||
pageElement.find('h2 .title').text(configuration.get('title') || ''); | ||
pageElement.find('h2 .subtitle').text(configuration.get('subtitle') || ''); | ||
pageElement.find('.contentText p').html(configuration.get('text') || ''); | ||
|
||
this.updateCommonPageCssClasses(pageElement, configuration); | ||
|
||
pageElement.find('.shadow').css({ | ||
opacity: configuration.get('gradient_opacity') / 100 | ||
}); | ||
}, | ||
|
||
embeddedEditorViews: function() { | ||
return { | ||
'.background_image': { | ||
view: pageflow.BackgroundImageEmbeddedView, | ||
options: {propertyName: 'background_image_id'} | ||
}, | ||
|
||
'.text-page': { | ||
view: pageflow.textPage.ListEmbeddedView, | ||
options: {propertyName: 'linked_text_page_perma_ids'} | ||
} | ||
}; | ||
} | ||
}, pageflow.commonPageCssClasses)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@include pageflow-page-type(text_page); | ||
|
||
.text-page { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<div class="blackLayer"></div> | ||
<div class="content_and_background textPage"> | ||
|
||
<div class="content"> | ||
<div class="scroller"> | ||
<div> | ||
<div class="contentWrapper"> | ||
<div class="page_header"> | ||
<h2> | ||
<span class="tagline"><%= configuration['tagline'] %></span> | ||
<span class="title"><%= configuration['title'] %></span> | ||
<span class="subtitle"><%= configuration['subtitle'] %></span> | ||
</h2> | ||
<%= background_image_tag(configuration['background_image_id'], {:class => "print_image"}) %> | ||
</div> | ||
<div class="contentText"> | ||
<p><%= raw configuration['text'] %></p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
de: | ||
pageflow: | ||
text_page: | ||
page_type_name: "Text Seite" | ||
activerecord: | ||
attributes: | ||
"pageflow/page": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Pageflow::TextPage::Engine.routes.draw do | ||
resources :entries, only: [], shallow: true do | ||
resources :sites | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require 'pageflow/text_page/engine' | ||
|
||
module Pageflow | ||
module TextPage | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module Pageflow | ||
module TextPage | ||
class Engine < Rails::Engine | ||
isolate_namespace Pageflow::TextPage | ||
|
||
config.autoload_paths << File.join(config.root, 'lib') | ||
|
||
config.generators do |g| | ||
g.test_framework :rspec,:fixture => false | ||
g.fixture_replacement :factory_girl, :dir => 'spec/factories' | ||
g.assets false | ||
g.helper false | ||
end | ||
end | ||
end | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module Pageflow | ||
module TextPage | ||
class PageType < Pageflow::PageType | ||
name 'text_page' | ||
|
||
def revision_components | ||
[Site] | ||
end | ||
|
||
def view_helpers | ||
[SitesHelper] | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# coding: utf-8 | ||
|
||
Gem::Specification.new do |spec| | ||
spec.name = "pageflow-text-page" | ||
spec.version = "0.0.1" | ||
spec.authors = ["Tim Fischbach"] | ||
spec.email = ["[email protected]"] | ||
spec.summary = "Pageflow Page Type text pages" | ||
spec.homepage = "" | ||
spec.license = "MIT" | ||
|
||
spec.files = `git ls-files`.split($/) | ||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } | ||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) | ||
spec.require_paths = ["lib"] | ||
|
||
spec.add_runtime_dependency "pageflow" | ||
|
||
# Using translations from rails locales in javascript code. | ||
spec.add_runtime_dependency 'i18n-js' | ||
|
||
spec.add_development_dependency "bundler" | ||
spec.add_development_dependency "rake" | ||
spec.add_development_dependency "rspec-rails", "~> 2.0" | ||
spec.add_development_dependency 'factory_girl_rails' | ||
spec.add_development_dependency "sqlite3" | ||
end |