push_type_admin 0.1.0.beta3 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/push_type/admin.scss +21 -0
- data/app/assets/stylesheets/push_type/foundation_and_overrides.scss +1 -1
- data/app/controllers/push_type/admin_controller.rb +8 -0
- data/app/controllers/push_type/nodes_controller.rb +1 -1
- data/app/helpers/push_type/admin_helper.rb +7 -0
- data/app/views/layouts/push_type/admin.html.erb +4 -2
- data/app/views/push_type/admin/info.html.haml +20 -0
- data/app/views/push_type/nodes/_form_fields.html.haml +5 -3
- data/app/views/push_type/nodes/_new_node_button.html.haml +4 -4
- data/app/views/push_type/nodes/edit.html.haml +2 -2
- data/app/views/push_type/nodes/index.html.haml +1 -1
- data/app/views/push_type/nodes/new.html.haml +2 -2
- data/app/views/push_type/users/_form.html.haml +5 -3
- data/config/routes.rb +2 -0
- data/lib/push_type/admin.rb +0 -1
- data/test/controllers/push_type/admin_controller_test.rb +13 -0
- data/test/dummy/config/secrets.yml +2 -2
- data/test/dummy/db/schema.rb +1 -1
- data/test/dummy/log/test.log +1932 -1833
- data/test/dummy/tmp/cache/assets/test/sass/806626419a476c98acb0fcf38feea6623fb99ce0/admin.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sass/806626419a476c98acb0fcf38feea6623fb99ce0/foundation_and_overrides.scssc +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/12375f1bf3d91db0a06c3fc436918949 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/b3b2a83d3d7d735130f0b029e58b29b8 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/dd803fd7a93619599c7e703c2b307411 +0 -0
- metadata +17 -15
- data/lib/push_type/rails/form_builder.rb +0 -13
- /data/test/dummy/db/migrate/{20141205213506_create_push_type_users.push_type.rb → 20150102204418_create_push_type_users.push_type.rb} +0 -0
- /data/test/dummy/db/migrate/{20141205213507_create_push_type_nodes.push_type.rb → 20150102204419_create_push_type_nodes.push_type.rb} +0 -0
- /data/test/dummy/db/migrate/{20141205213508_create_push_type_node_hierarchies.push_type.rb → 20150102204420_create_push_type_node_hierarchies.push_type.rb} +0 -0
- /data/test/dummy/db/migrate/{20141205213509_create_push_type_assets.push_type.rb → 20150102204421_create_push_type_assets.push_type.rb} +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6ca575684bea0f00a9dfeb1215090ce1eed8a2d7
|
|
4
|
+
data.tar.gz: cea04749d65fadc65367c8d7508f5c32a7a98574
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7230cf3ec37d7b22b5ffe420f837a87ca914b517d23b152a24b195e8e407526af2343ad09bc27883815cf658ee4f5a64bb8dca1d6887097ae233efe2b5000b6c
|
|
7
|
+
data.tar.gz: 2b19efefc3928accbd3d29530b4b344e7a21b760beeacb0fa078ececef9e17ed6bf67bb3218e56c21b495cd8cb02efbad475a291a9249da781a300e360ebae91
|
|
@@ -40,6 +40,20 @@ html.turbolinks-progress-bar::before {
|
|
|
40
40
|
margin-right: rem-calc(5);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
.reveal-modal-bg {
|
|
44
|
+
z-index: 1005;
|
|
45
|
+
}
|
|
46
|
+
.reveal-modal, dialog {
|
|
47
|
+
z-index: 1006;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
table {
|
|
51
|
+
width: 100%;
|
|
52
|
+
td p:last-child {
|
|
53
|
+
margin-bottom: 0;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
43
57
|
/* Custom styles */
|
|
44
58
|
|
|
45
59
|
%block-link-bg {
|
|
@@ -323,6 +337,12 @@ html.turbolinks-progress-bar::before {
|
|
|
323
337
|
}
|
|
324
338
|
}
|
|
325
339
|
}
|
|
340
|
+
.side-nav {
|
|
341
|
+
padding: rem-calc(24 0);
|
|
342
|
+
.heading {
|
|
343
|
+
padding: rem-calc(0 14);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
326
346
|
}
|
|
327
347
|
|
|
328
348
|
.meta-table {
|
|
@@ -511,5 +531,6 @@ form .asset-upload {
|
|
|
511
531
|
}
|
|
512
532
|
|
|
513
533
|
|
|
534
|
+
|
|
514
535
|
@import "foundation-icons";
|
|
515
536
|
@import "froala_theme";
|
|
@@ -1133,7 +1133,7 @@ $reveal-max-width: rem-calc(768);
|
|
|
1133
1133
|
// $side-nav-link-color: $primary-color;
|
|
1134
1134
|
// $side-nav-link-color-active: scale-color($side-nav-link-color, $lightness: 30%);
|
|
1135
1135
|
// $side-nav-link-color-hover: scale-color($side-nav-link-color, $lightness: 30%);
|
|
1136
|
-
|
|
1136
|
+
$side-nav-link-bg-hover: scale-color($panel-bg, $lightness: 75%);
|
|
1137
1137
|
// $side-nav-link-margin: 0;
|
|
1138
1138
|
// $side-nav-link-padding: rem-calc(7 14);
|
|
1139
1139
|
// $side-nav-font-size: rem-calc(14);
|
|
@@ -4,11 +4,19 @@ module PushType
|
|
|
4
4
|
layout 'push_type/admin'
|
|
5
5
|
before_filter :initial_breadcrumb
|
|
6
6
|
|
|
7
|
+
def info
|
|
8
|
+
render layout: false
|
|
9
|
+
end
|
|
10
|
+
|
|
7
11
|
protected
|
|
8
12
|
|
|
9
13
|
def push_type_user
|
|
10
14
|
respond_to?(:current_user) ? current_user : nil
|
|
11
15
|
end
|
|
16
|
+
|
|
17
|
+
def initial_breadcrumb
|
|
18
|
+
true
|
|
19
|
+
end
|
|
12
20
|
|
|
13
21
|
end
|
|
14
22
|
end
|
|
@@ -70,7 +70,7 @@ module PushType
|
|
|
70
70
|
|
|
71
71
|
def node_params
|
|
72
72
|
fields = [:title, :slug, :status, :published_at, :published_to] + @node.fields.keys
|
|
73
|
-
params.fetch(@node.type.
|
|
73
|
+
params.fetch(@node.type.underscore.to_sym, {}).permit(*fields)
|
|
74
74
|
end
|
|
75
75
|
|
|
76
76
|
def redirect_path
|
|
@@ -11,5 +11,12 @@ module PushType
|
|
|
11
11
|
[el, label].compact.join(' ').html_safe
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
+
def render_custom_field(field, form_builder)
|
|
15
|
+
classes = [ field.kind, field.column_class, 'columns end' ]
|
|
16
|
+
content_tag :div, class: classes.compact do
|
|
17
|
+
render "push_type/fields/#{ field.template }", f: form_builder, field: field
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
14
21
|
end
|
|
15
22
|
end
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
</nav>
|
|
26
26
|
<nav class="small-4 medium-3 large-2 columns">
|
|
27
27
|
<ul class="inline-list right">
|
|
28
|
-
<%= content_tag :li, link_to(ficon(:info), '
|
|
29
|
-
<%= content_tag :li, link_to(ficon(:widget),
|
|
28
|
+
<%= content_tag :li, link_to(ficon(:info), push_type.info_path, data: { :'reveal-id' => 'reveal-ajax', :'reveal-ajax' => true }) %>
|
|
29
|
+
<%= content_tag :li, link_to(ficon(:widget), push_type.edit_profile_path) rescue nil %>
|
|
30
30
|
<%= content_tag :li, link_to(ficon(:power), push_type.destroy_user_session_path, method: 'delete') rescue nil %>
|
|
31
31
|
</ul>
|
|
32
32
|
</nav>
|
|
@@ -51,5 +51,7 @@
|
|
|
51
51
|
</div>
|
|
52
52
|
</section>
|
|
53
53
|
|
|
54
|
+
<div id="reveal-ajax" class="reveal-modal" data-reveal></div>
|
|
55
|
+
|
|
54
56
|
</body>
|
|
55
57
|
</html>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
%p.text-center= image_tag 'push_type/pushtype-logo.png', alt: 'PushType'
|
|
2
|
+
|
|
3
|
+
%p PushType is an open source content management system for Ruby on Rails, developed and maintained by #{ link_to 'Push Code Ltd', 'http://www.pushcode.com' }.
|
|
4
|
+
|
|
5
|
+
%table
|
|
6
|
+
%tr
|
|
7
|
+
%th Version
|
|
8
|
+
%td= PushType::VERSION
|
|
9
|
+
%tr
|
|
10
|
+
%th Homepage
|
|
11
|
+
%td= link_to 'http://type.pushcode.com'
|
|
12
|
+
%tr
|
|
13
|
+
%th Source code
|
|
14
|
+
%td= link_to 'http://github.com/pushcode/push_type'
|
|
15
|
+
%tr
|
|
16
|
+
%th Copyright
|
|
17
|
+
%td 2014 Push Code Ltd
|
|
18
|
+
%tr
|
|
19
|
+
%th License
|
|
20
|
+
%td= link_to 'MIT', 'http://opensource.org/licenses/MIT'
|
|
@@ -22,8 +22,10 @@
|
|
|
22
22
|
= f.text_field :slug, :'ng-model' => 'node.slug'
|
|
23
23
|
- if @node.errors.include? :slug
|
|
24
24
|
.error-icon= ficon :info, 'Error'
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
|
|
26
|
+
.row.custom-fields
|
|
27
|
+
- @node.fields.each do |key, field|
|
|
28
|
+
= render_custom_field field, f
|
|
27
29
|
|
|
28
30
|
.large-4.columns
|
|
29
31
|
.side-panel{ :'side-panel' => true }
|
|
@@ -56,6 +58,6 @@
|
|
|
56
58
|
|
|
57
59
|
- unless @node.new_record?
|
|
58
60
|
.delete-link
|
|
59
|
-
= link_to "Delete #{@node.type.downcase}", push_type.node_path(@node), method: 'delete', data: { confirm: { body: 'Deleted content will be moved to the trash. You can restore trashed content later.' } }
|
|
61
|
+
= link_to "Delete #{@node.type.underscore.humanize.downcase}", push_type.node_path(@node), method: 'delete', data: { confirm: { body: 'Deleted content will be moved to the trash. You can restore trashed content later.' } }
|
|
60
62
|
|
|
61
63
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
- if @parent
|
|
2
2
|
- if @parent.child_node_types.size == 1
|
|
3
|
-
= link_to ficon(:page_add, "New #{ @parent.child_node_types.first.humanize }"), push_type.new_node_node_path(kind: @parent.child_node_types.first), class: 'button radius success'
|
|
3
|
+
= link_to ficon(:page_add, "New #{ @parent.child_node_types.first.humanize.downcase }"), push_type.new_node_node_path(kind: @parent.child_node_types.first), class: 'button radius success'
|
|
4
4
|
- elsif @parent.child_node_types.size > 1
|
|
5
5
|
= link_to ficon(:page_add, 'New content'), push_type.new_node_node_path(kind: @parent.child_node_types.first), class: 'button radius success dropdown', data: { dropdown: 'new-node' }
|
|
6
6
|
%ul#new-node.f-dropdown
|
|
7
7
|
- for kind in @parent.child_node_types
|
|
8
|
-
%li= link_to "New #{ kind.humanize }", push_type.new_node_node_path(kind: kind)
|
|
8
|
+
%li= link_to "New #{ kind.humanize.downcase }", push_type.new_node_node_path(kind: kind)
|
|
9
9
|
|
|
10
10
|
- else
|
|
11
11
|
- if PushType.root_node_types.size == 1
|
|
12
|
-
= link_to ficon(:page_add, "New #{ PushType.root_node_types.first.humanize }"), push_type.new_node_path(kind: PushType.root_node_types.first), class: 'button radius success'
|
|
12
|
+
= link_to ficon(:page_add, "New #{ PushType.root_node_types.first.humanize.downcase }"), push_type.new_node_path(kind: PushType.root_node_types.first), class: 'button radius success'
|
|
13
13
|
- elsif PushType.root_node_types.size > 1
|
|
14
14
|
= link_to ficon(:page_add, 'New content'), push_type.new_node_path(kind: PushType.root_node_types.first), class: 'button radius success dropdown', data: { dropdown: 'new-node' }
|
|
15
15
|
%ul#new-node.f-dropdown
|
|
16
16
|
- for kind in PushType.root_node_types
|
|
17
|
-
%li= link_to "New #{ kind.humanize }", push_type.new_node_path(kind: kind)
|
|
17
|
+
%li= link_to "New #{ kind.humanize.downcase }", push_type.new_node_path(kind: kind)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
- title "Edit #{ @node.type }"
|
|
1
|
+
- title "Edit #{ @node.type.underscore.humanize.downcase }"
|
|
2
2
|
- for node in @node.ancestors.reverse
|
|
3
3
|
- breadcrumbs.add node.title, push_type.node_nodes_path(node)
|
|
4
4
|
- breadcrumbs.add @node.title, push_type.edit_node_path(@node)
|
|
5
5
|
|
|
6
|
-
= form_for @node, url: push_type.node_path(@node)
|
|
6
|
+
= form_for @node, url: push_type.node_path(@node) do |f|
|
|
7
7
|
= render 'form_fields', f: f
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
= link_to push_type.edit_node_path(node) do
|
|
33
33
|
.title= node.title
|
|
34
34
|
.meta
|
|
35
|
-
%span.label.secondary.radius= node.type
|
|
35
|
+
%span.label.secondary.radius= node.type.to_s.underscore.humanize
|
|
36
36
|
%span.label.radius{ class: node.published? ? 'success' : 'warning' }= node.status.titlecase
|
|
37
37
|
%time Updated #{ time_ago_in_words node.updated_at } ago
|
|
38
38
|
\-
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
- title "New #{ @node.type }"
|
|
1
|
+
- title "New #{ @node.type.underscore.humanize.downcase }"
|
|
2
2
|
|
|
3
3
|
- if @parent
|
|
4
4
|
- for node in @parent.self_and_ancestors.reverse
|
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
- else
|
|
8
8
|
- breadcrumbs.add yield(:title), push_type.new_node_path
|
|
9
9
|
|
|
10
|
-
= form_for @node, url: (@parent ? push_type.node_nodes_path(@parent, kind: @node.type.underscore) : push_type.nodes_path(kind: @node.type.underscore))
|
|
10
|
+
= form_for @node, url: (@parent ? push_type.node_nodes_path(@parent, kind: @node.type.underscore) : push_type.nodes_path(kind: @node.type.underscore)) do |f|
|
|
11
11
|
= render 'form_fields', f: f
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
= form_for @user
|
|
1
|
+
= form_for @user do |f|
|
|
2
2
|
.large-8.columns
|
|
3
3
|
.container
|
|
4
4
|
.head
|
|
@@ -13,8 +13,10 @@
|
|
|
13
13
|
.columns
|
|
14
14
|
= f.label :email
|
|
15
15
|
= f.email_field :email
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
|
|
17
|
+
.row.custom-fields
|
|
18
|
+
- @user.fields.each do |key, field|
|
|
19
|
+
= render_custom_field field, f
|
|
18
20
|
|
|
19
21
|
.large-4.columns
|
|
20
22
|
.side-panel{ :'side-panel' => true }
|
data/config/routes.rb
CHANGED
data/lib/push_type/admin.rb
CHANGED
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
# if you're sharing your code publicly.
|
|
12
12
|
|
|
13
13
|
development:
|
|
14
|
-
secret_key_base:
|
|
14
|
+
secret_key_base: fdce6af8f15d1de2cd324e5f6c5c4acaa8cac39a3865db771b0b20dd3d8620ccc47c0cb4ca8410632429412c979fc6af1f67e42a0ebba570ac829853af9382eb
|
|
15
15
|
|
|
16
16
|
test:
|
|
17
|
-
secret_key_base:
|
|
17
|
+
secret_key_base: 7660d04073b52f452410b46c26a04e17bfeda1140ee6c335250e01be4eaf6d6ac71c12923bd49f47dfb3bc4e03f6d49a6f1bbef353f0e9d5d3e876938133e4f7
|
|
18
18
|
|
|
19
19
|
# Do not keep production secrets in the repository,
|
|
20
20
|
# instead read values from the environment.
|
data/test/dummy/db/schema.rb
CHANGED
|
@@ -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:
|
|
14
|
+
ActiveRecord::Schema.define(version: 20150102204421) do
|
|
15
15
|
|
|
16
16
|
# These are extensions that must be enabled in order to support this database
|
|
17
17
|
enable_extension "plpgsql"
|