honey-cms 0.3.13 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/cms/base_controller.rb +5 -1
- data/app/views/layouts/cms.html.haml +3 -1
- data/lib/generators/cms/migration_generator.rb +1 -0
- data/lib/generators/cms/templates/migration.rb +2 -1
- data/lib/generators/cms/templates/type_model.rb +2 -0
- data/lib/generators/cms/templates/views/edit.html.haml +1 -1
- data/lib/generators/cms/templates/views/new.html.haml +1 -1
- data/vendor/assets/javascripts/cms.js.coffee +2 -1
- metadata +25 -3
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'kaminari'
|
2
|
+
|
1
3
|
class CMS::BaseController < ApplicationController
|
2
4
|
before_filter :admin!
|
3
5
|
before_filter :set_active
|
@@ -25,7 +27,9 @@ class CMS::BaseController < ApplicationController
|
|
25
27
|
end
|
26
28
|
|
27
29
|
def create
|
28
|
-
@record = subject.
|
30
|
+
@record = subject.new(params[subject.model_name.element])
|
31
|
+
@record.author = current_user
|
32
|
+
@record.save
|
29
33
|
set_element_variable
|
30
34
|
respond_with @record
|
31
35
|
end
|
@@ -5,11 +5,13 @@
|
|
5
5
|
- if Rails.application.assets.find_asset('cms_additions.css').present?
|
6
6
|
= stylesheet_link_tag 'cms_additions', media: 'all'
|
7
7
|
= javascript_include_tag 'application'
|
8
|
+
- if Rails.application.assets.find_asset('cms_additions.js').present?
|
9
|
+
= javascript_include_tag 'cms_additions', media: 'all'
|
8
10
|
= stylesheet_link_tag 'codemirror'
|
9
11
|
= javascript_include_tag 'cms'
|
10
12
|
= csrf_meta_tags
|
11
13
|
|
12
|
-
%body.cms
|
14
|
+
%body.cms{class: "#{if defined?(subject) then subject.name.underscore.dasherize end}"}
|
13
15
|
.navbar.navbar-fixed-top.main-navigation
|
14
16
|
.navbar-inner
|
15
17
|
.container
|
@@ -10,6 +10,7 @@ module CMS
|
|
10
10
|
if options[:only].present?
|
11
11
|
migration_template 'migration.rb', "db/migrate/create_#{options[:only].underscore.pluralize}"
|
12
12
|
else
|
13
|
+
@migration_types = CMS::Configuration.scoped_types(options)
|
13
14
|
migration_template 'migration.rb', 'db/migrate/create_cms'
|
14
15
|
end
|
15
16
|
end
|
@@ -1,10 +1,11 @@
|
|
1
1
|
class <%= migration_class_name %> < ActiveRecord::Migration
|
2
2
|
def change
|
3
|
-
<%
|
3
|
+
<% @migration_types.each do |type| -%>
|
4
4
|
create_table :<%= type.model_name.collection %> do |t|
|
5
5
|
<% type.attributes.each do |attribute| -%>
|
6
6
|
t.<%= attribute.migration_type %> :<%= attribute.name %><%= attribute.inject_options %>
|
7
7
|
<% end -%>
|
8
|
+
t.belongs_to :author
|
8
9
|
<% if type.options[:timestamps] -%>
|
9
10
|
t.timestamps
|
10
11
|
<% end -%>
|
@@ -27,10 +27,11 @@ class window.HtmlEditor extends Backbone.View
|
|
27
27
|
jQuery ($) ->
|
28
28
|
new HtmlEditor {el} for el in $('[role=html-editor]')
|
29
29
|
|
30
|
+
|
31
|
+
|
30
32
|
$('body.cms form textarea').each ->
|
31
33
|
$container = $('<div class="epiceditor-container">')
|
32
34
|
$textarea = $(this).hide().after($container)
|
33
|
-
console.log $textarea
|
34
35
|
|
35
36
|
editor = new EpicEditor
|
36
37
|
container: $container[0]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: honey-cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-12-08 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: redcarpet
|
16
|
-
requirement: &
|
16
|
+
requirement: &70295212960420 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,29 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70295212960420
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: kaminari
|
27
|
+
requirement: &70295212981320 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70295212981320
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: carrierwave
|
38
|
+
requirement: &70295212980560 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :runtime
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70295212980560
|
25
47
|
description: Some CMS functionality
|
26
48
|
email: quinn@tastehoneyco.com
|
27
49
|
executables: []
|