spina 0.7.3 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of spina might be problematic. Click here for more details.

Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -0
  3. data/app/assets/javascripts/spina/admin/spina.trix.js.coffee +0 -2
  4. data/app/controllers/spina/inquiries_controller.rb +1 -1
  5. data/app/helpers/spina/application_helper.rb +1 -1
  6. data/app/models/spina/ability.rb +2 -2
  7. data/app/uploaders/spina/default_store_uploader.rb +2 -2
  8. data/app/views/spina/admin/attachments/_select.html.haml +2 -2
  9. data/app/views/spina/admin/attachments/_select_collection.html.haml +2 -2
  10. data/app/views/spina/admin/attachments/index.html.haml +2 -2
  11. data/app/views/spina/admin/page_partables/_attachment_collection_form.html.haml +8 -6
  12. data/app/views/spina/admin/page_partables/_attachment_form.html.haml +8 -6
  13. data/app/views/spina/admin/sessions/new.html.haml +1 -1
  14. data/config/routes.rb +6 -2
  15. data/db/seeds.rb +0 -19
  16. data/lib/generators/spina/install_generator.rb +51 -14
  17. data/lib/generators/spina/templates/app/assets/stylesheets/default/application.css.sass +0 -66
  18. data/lib/generators/spina/templates/app/assets/stylesheets/demo/application.css.sass +66 -0
  19. data/lib/generators/spina/templates/app/views/{default → demo}/pages/demo.html.haml +0 -0
  20. data/lib/generators/spina/templates/app/views/demo/pages/homepage.html.haml +2 -0
  21. data/lib/generators/spina/templates/app/views/demo/pages/show.html.haml +3 -0
  22. data/lib/generators/spina/templates/app/views/{default → demo}/shared/_navigation.html.haml +0 -0
  23. data/lib/generators/spina/templates/app/views/layouts/demo/application.html.haml +11 -0
  24. data/lib/generators/spina/templates/config/initializers/spina.rb +12 -9
  25. data/lib/generators/spina/templates/config/initializers/themes/default.rb +2 -51
  26. data/lib/generators/spina/templates/config/initializers/themes/demo.rb +103 -0
  27. data/lib/spina.rb +49 -2
  28. data/lib/spina/engine.rb +12 -52
  29. data/lib/spina/version.rb +1 -1
  30. data/test/dummy/app/assets/stylesheets/default/application.css.sass +0 -66
  31. data/test/dummy/app/assets/stylesheets/demo/application.css.sass +66 -0
  32. data/test/dummy/app/views/{default → demo}/pages/demo.html.haml +5 -16
  33. data/test/dummy/app/views/demo/pages/homepage.html.haml +2 -0
  34. data/test/dummy/app/views/demo/pages/show.html.haml +3 -0
  35. data/test/dummy/app/views/demo/shared/_navigation.html.haml +5 -0
  36. data/test/dummy/app/views/layouts/demo/application.html.haml +11 -0
  37. data/test/dummy/config/initializers/spina.rb +11 -8
  38. data/test/dummy/config/initializers/themes/default.rb +2 -51
  39. data/test/dummy/config/initializers/themes/demo.rb +103 -0
  40. data/test/dummy/db/schema.rb +1 -1
  41. data/test/dummy/tmp/restart.txt +0 -0
  42. metadata +21 -9
@@ -0,0 +1,66 @@
1
+ // require normalize.css
2
+
3
+ // $color-primary: #6865b4
4
+ $color-link: #0275d8
5
+
6
+ html
7
+ font-size: 16px
8
+
9
+ body
10
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif
11
+ font-size: 1rem
12
+ line-height: 1.5
13
+
14
+ h1, h2, h3, h4, h5, h6
15
+ margin-top: 0
16
+ margin-bottom: 0.5rem
17
+
18
+ h1
19
+ font-size: 2.5rem
20
+ h2
21
+ font-size: 2rem
22
+ h3
23
+ font-size: 1.75rem
24
+ h4
25
+ font-size: 1.5rem
26
+ h5
27
+ font-size: 1.25rem
28
+ h6
29
+ font-size: 1rem
30
+
31
+ p
32
+ margin-top: 0
33
+ margin-bottom: 1rem
34
+
35
+ ul, ol
36
+ margin-top: 0
37
+ margin-bottom: 1rem
38
+
39
+ img
40
+ vertical-align: middle
41
+
42
+ a
43
+ color: $color-link
44
+ text-decoration: none
45
+
46
+ &:hover, &:focus
47
+ color: darken($color-link, 15%)
48
+ text-decoration: underline
49
+
50
+ .container
51
+ width: 960px
52
+ margin: 0 auto
53
+
54
+ .nav
55
+ padding-left: 0
56
+ margin-bottom: 2rem
57
+ list-style: none
58
+
59
+ .nav-item
60
+ display: inline-block
61
+
62
+ .nav-item + .nav-item
63
+ margin-left: 20px
64
+
65
+ .nav-item.active > a
66
+ text-decoration: underline
@@ -4,27 +4,19 @@
4
4
  %h5 Line
5
5
  %p
6
6
  = @page.content(:line)
7
-
8
- %hr
9
-
10
7
  %h5 Content
11
8
  = @page.content(:text).try(:html_safe)
12
9
 
13
- %hr
14
-
15
10
  %h5 Photo
16
11
  %p
17
12
  = image_tag @page.content(:photo).try(:file_url)
18
13
 
19
- %hr
20
-
21
14
  %h5 Photo collection
22
- %p
23
- - @page.content(:photo_collection).photos.each do |photo|
24
- %span
25
- = image_tag photo.file_url
26
-
27
- %hr
15
+ - if @page.content(:photo_collection).try(:photos)
16
+ %ul
17
+ - @page.content(:photo_collection).photos.each do |photo|
18
+ %li
19
+ = image_tag photo.file_url
28
20
 
29
21
  %h5 Structure
30
22
  - if @page.content(:structure).try(:structure_items)
@@ -36,6 +28,3 @@
36
28
  = item.content(:title)
37
29
  %h6 Description
38
30
  = item.content(:description).try(:html_safe)
39
-
40
- %h5 Color
41
- = @page.content(:color)
@@ -0,0 +1,2 @@
1
+ %h1= @page.title
2
+ = @page.content(:content).try(:html_safe)
@@ -0,0 +1,3 @@
1
+ %h1= @page.title
2
+ = @page.content(:content).try(:html_safe)
3
+
@@ -0,0 +1,5 @@
1
+ - pages = current_user.present? ? Spina::Page.active : Spina::Page.live
2
+ - menu = Spina::Pages::MenuPresenter.new(pages.in_menu.arrange(order: :position), self, @page)
3
+ - menu.list_class = 'nav'
4
+ - menu.list_item_css = 'nav-item'
5
+ = menu.to_html
@@ -0,0 +1,11 @@
1
+ !!!
2
+ %html
3
+ %head
4
+ %title= current_account.name
5
+ = stylesheet_link_tag 'demo/application', media: 'all', 'data-turbolinks-track' => true
6
+ = javascript_include_tag 'application', 'data-turbolinks-track' => true
7
+ = csrf_meta_tags
8
+ %body
9
+ .container
10
+ = render 'demo/shared/navigation'
11
+ = yield
@@ -1,23 +1,26 @@
1
- Spina::Engine.configure do
1
+ Spina.configure do |config|
2
2
  config.NEGATIVE_CAPTCHA_SECRET = '445e0c9c0cee31f783754bc174661052d1236850da8f5f5ba5e11cbfa56cbaa8bce9260df75feaa56da91949ee4204fefac41c35b3e4f5e0d3e395b00c87781a'
3
3
 
4
4
  # Important Note
5
5
  # ==============
6
- #
6
+
7
7
  # You MUST restart your server before changes to this file
8
8
  # will take effect.
9
- #
9
+
10
+ # Specify a backend path. Defaults to /admin.
11
+ # config.backend_path = 'admin'
12
+
10
13
  # Storage Options
11
14
  # ===============
12
- #
15
+
13
16
  # Please specify how you want to store photos, your logo, and
14
17
  # other files. We use CarrierWave for storage. See
15
18
  # https://github.com/denkGroot/Spina/tree/master/app/uploaders/spina
16
- #
17
- config.storage = :file
18
- #
19
+
20
+ # config.storage = :file
21
+
19
22
  # If you want to use s3 to store uploads (recommended)
20
- #
23
+
21
24
  # config.storage = :s3
22
25
  # config.aws_region = "eu-west-1"
23
26
  # config.aws_access_key_id = "abc123"
@@ -7,52 +7,14 @@ module Spina
7
7
  self.title = 'Default theme'
8
8
 
9
9
  self.page_parts = [{
10
- name: 'line',
11
- title: 'Line',
12
- page_partable_type: 'Spina::Line'
13
- }, {
14
10
  name: 'text',
15
11
  title: 'Text',
16
12
  page_partable_type: 'Spina::Text'
17
- }, {
18
- name: 'photo',
19
- title: 'Photo',
20
- page_partable_type: 'Spina::Photo'
21
- }, {
22
- name: 'photo_collection',
23
- title: 'Photo collection',
24
- page_partable_type: 'Spina::PhotoCollection'
25
- }, {
26
- name: 'structure',
27
- title: 'Structure',
28
- page_partable_type: 'Spina::Structure'
29
- }, {
30
- name: 'color',
31
- title: 'Color',
32
- page_partable_type: 'Spina::Color'
33
13
  }]
34
14
 
35
- self.structures = {
36
- 'structure' => [{
37
- name: 'title',
38
- title: 'Title',
39
- structure_partable_type: 'Spina::Line'
40
- }, {
41
- name: 'description',
42
- title: 'Description',
43
- structure_partable_type: 'Spina::Text'
44
- }]
45
- }
15
+ self.structures = {}
46
16
 
47
- self.layout_parts = [{
48
- name: 'line',
49
- title: 'Line',
50
- layout_partable_type: 'Spina::Line'
51
- }, {
52
- name: 'color',
53
- title: 'Color',
54
- layout_partable_type: 'Spina::Color'
55
- }]
17
+ self.layout_parts = []
56
18
 
57
19
  self.view_templates = {
58
20
  'homepage' => {
@@ -64,12 +26,6 @@ module Spina
64
26
  description: 'A simple page',
65
27
  usage: 'Use for your content',
66
28
  page_parts: ['text']
67
- },
68
- 'demo' => {
69
- title: 'Demo',
70
- description: 'Example page',
71
- usage: 'Shows the usage of several page parts',
72
- page_parts: ['line', 'text', 'photo', 'photo_collection', 'structure', 'color']
73
29
  }
74
30
  }
75
31
 
@@ -78,11 +34,6 @@ module Spina
78
34
  title: 'Homepage',
79
35
  deletable: false,
80
36
  view_template: 'homepage'
81
- }, {
82
- name: 'demo',
83
- title: 'Demo',
84
- deletable: true,
85
- view_template: 'demo'
86
37
  }]
87
38
 
88
39
  self.plugins = []
@@ -0,0 +1,103 @@
1
+ module Spina
2
+ module DemoTheme
3
+ include ::ActiveSupport::Configurable
4
+
5
+ config_accessor :title, :page_parts, :view_templates, :layout_parts, :custom_pages, :plugins, :structures
6
+
7
+ self.title = 'Demo theme'
8
+
9
+ self.page_parts = [{
10
+ name: 'line',
11
+ title: 'Line',
12
+ page_partable_type: 'Spina::Line'
13
+ }, {
14
+ name: 'text',
15
+ title: 'Text',
16
+ page_partable_type: 'Spina::Text'
17
+ }, {
18
+ name: 'photo',
19
+ title: 'Photo',
20
+ page_partable_type: 'Spina::Photo'
21
+ }, {
22
+ name: 'photo_collection',
23
+ title: 'Photo collection',
24
+ page_partable_type: 'Spina::PhotoCollection'
25
+ }, {
26
+ name: 'attachment',
27
+ title: 'Attachment',
28
+ page_partable_type: 'Spina::Attachment'
29
+ }, {
30
+ name: 'attachment_collection',
31
+ title: 'Attachment collection',
32
+ page_partable_type: 'Spina::AttachmentCollection'
33
+ }, {
34
+ name: 'structure',
35
+ title: 'Structure',
36
+ page_partable_type: 'Spina::Structure'
37
+ }, {
38
+ name: 'color',
39
+ title: 'Color',
40
+ page_partable_type: 'Spina::Color'
41
+ }]
42
+
43
+ self.structures = {
44
+ 'structure' => [{
45
+ name: 'title',
46
+ title: 'Title',
47
+ structure_partable_type: 'Spina::Line'
48
+ }, {
49
+ name: 'description',
50
+ title: 'Description',
51
+ structure_partable_type: 'Spina::Text'
52
+ }]
53
+ }
54
+
55
+ self.layout_parts = [{
56
+ name: 'line',
57
+ title: 'Line',
58
+ layout_partable_type: 'Spina::Line'
59
+ }, {
60
+ name: 'color',
61
+ title: 'Color',
62
+ layout_partable_type: 'Spina::Color'
63
+ }]
64
+
65
+ self.view_templates = {
66
+ 'homepage' => {
67
+ title: 'Homepage',
68
+ page_parts: ['text']
69
+ },
70
+ 'show' => {
71
+ title: 'Default',
72
+ description: 'A simple page',
73
+ usage: 'Use for your content',
74
+ page_parts: ['text']
75
+ },
76
+ 'demo' => {
77
+ title: 'Demo',
78
+ description: 'Contains examples of every page part',
79
+ page_parts: ['line', 'text', 'photo', 'photo_collection', 'attachment', 'attachment_collection', 'structure', 'color']
80
+ }
81
+ }
82
+
83
+ self.custom_pages = [{
84
+ name: 'homepage',
85
+ title: 'Homepage',
86
+ deletable: false,
87
+ view_template: 'homepage'
88
+ }, {
89
+ name: 'demo',
90
+ title: 'Demo',
91
+ deletable: true,
92
+ view_template: 'demo'
93
+ }]
94
+
95
+ self.plugins = []
96
+
97
+ end
98
+ end
99
+
100
+ theme = Spina::Theme.new
101
+ theme.name = 'demo'
102
+ theme.config = Spina::DemoTheme.config
103
+ Spina.register_theme(theme)
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(version: 20160108105712) do
14
+ ActiveRecord::Schema.define(version: 20160114085213) do
15
15
 
16
16
  # These are extensions that must be enabled in order to support this database
17
17
  enable_extension "plpgsql"
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spina
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bram Jetten
@@ -9,22 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-01-19 00:00:00.000000000 Z
12
+ date: 2016-02-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ">="
18
+ - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '0'
20
+ version: '4.0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ">="
25
+ - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '0'
27
+ version: '4.0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: bcrypt
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -427,13 +427,18 @@ files:
427
427
  - db/seeds.rb
428
428
  - lib/generators/spina/install_generator.rb
429
429
  - lib/generators/spina/templates/app/assets/stylesheets/default/application.css.sass
430
- - lib/generators/spina/templates/app/views/default/pages/demo.html.haml
430
+ - lib/generators/spina/templates/app/assets/stylesheets/demo/application.css.sass
431
431
  - lib/generators/spina/templates/app/views/default/pages/homepage.html.haml
432
432
  - lib/generators/spina/templates/app/views/default/pages/show.html.haml
433
- - lib/generators/spina/templates/app/views/default/shared/_navigation.html.haml
433
+ - lib/generators/spina/templates/app/views/demo/pages/demo.html.haml
434
+ - lib/generators/spina/templates/app/views/demo/pages/homepage.html.haml
435
+ - lib/generators/spina/templates/app/views/demo/pages/show.html.haml
436
+ - lib/generators/spina/templates/app/views/demo/shared/_navigation.html.haml
434
437
  - lib/generators/spina/templates/app/views/layouts/default/application.html.haml
438
+ - lib/generators/spina/templates/app/views/layouts/demo/application.html.haml
435
439
  - lib/generators/spina/templates/config/initializers/spina.rb
436
440
  - lib/generators/spina/templates/config/initializers/themes/default.rb
441
+ - lib/generators/spina/templates/config/initializers/themes/demo.rb
437
442
  - lib/spina.rb
438
443
  - lib/spina/carrierwave.rb
439
444
  - lib/spina/engine.rb
@@ -445,14 +450,19 @@ files:
445
450
  - test/dummy/Rakefile
446
451
  - test/dummy/app/assets/javascripts/application.js
447
452
  - test/dummy/app/assets/stylesheets/default/application.css.sass
453
+ - test/dummy/app/assets/stylesheets/demo/application.css.sass
448
454
  - test/dummy/app/assets/stylesheets/fonts.css.sass
449
455
  - test/dummy/app/controllers/application_controller.rb
450
456
  - test/dummy/app/helpers/application_helper.rb
451
- - test/dummy/app/views/default/pages/demo.html.haml
452
457
  - test/dummy/app/views/default/pages/homepage.html.haml
453
458
  - test/dummy/app/views/default/pages/show.html.haml
454
459
  - test/dummy/app/views/default/shared/_navigation.html.haml
460
+ - test/dummy/app/views/demo/pages/demo.html.haml
461
+ - test/dummy/app/views/demo/pages/homepage.html.haml
462
+ - test/dummy/app/views/demo/pages/show.html.haml
463
+ - test/dummy/app/views/demo/shared/_navigation.html.haml
455
464
  - test/dummy/app/views/layouts/default/application.html.haml
465
+ - test/dummy/app/views/layouts/demo/application.html.haml
456
466
  - test/dummy/config.ru
457
467
  - test/dummy/config/application.rb
458
468
  - test/dummy/config/application.yml
@@ -468,6 +478,7 @@ files:
468
478
  - test/dummy/config/initializers/session_store.rb
469
479
  - test/dummy/config/initializers/spina.rb
470
480
  - test/dummy/config/initializers/themes/default.rb
481
+ - test/dummy/config/initializers/themes/demo.rb
471
482
  - test/dummy/config/initializers/wrap_parameters.rb
472
483
  - test/dummy/config/locales/en.yml
473
484
  - test/dummy/config/locales/nl.yml
@@ -481,6 +492,7 @@ files:
481
492
  - test/dummy/public/500.html
482
493
  - test/dummy/public/favicon.ico
483
494
  - test/dummy/script/rails
495
+ - test/dummy/tmp/restart.txt
484
496
  - test/fixtures/spina/accounts.yml
485
497
  - test/fixtures/spina/pages.yml
486
498
  - test/fixtures/spina/users.yml