nocms-admin-pages 0.0.1
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 +7 -0
- data/Rakefile +23 -0
- data/app/assets/images/no_cms/admin/pages/stripe_5d3ba7190e7de9a95d82d43dce2917b1_a10.png +0 -0
- data/app/assets/javascripts/no_cms/admin/pages/application.js +2 -0
- data/app/assets/javascripts/no_cms/admin/pages/content_block_handler.js +108 -0
- data/app/assets/stylesheets/no_cms/admin/pages/application.css +13 -0
- data/app/assets/stylesheets/no_cms/admin/pages/pages.css.scss +107 -0
- data/app/controllers/no_cms/admin/pages/application_controller.rb +8 -0
- data/app/controllers/no_cms/admin/pages/pages_controller.rb +86 -0
- data/app/helpers/no_cms/admin/pages/application_helper.rb +8 -0
- data/app/helpers/no_cms/admin/pages/pages_helper.rb +25 -0
- data/app/views/no_cms/admin/pages/blocks/_default.html.erb +9 -0
- data/app/views/no_cms/admin/pages/blocks/_form.html.erb +20 -0
- data/app/views/no_cms/admin/pages/blocks/_index.html.erb +12 -0
- data/app/views/no_cms/admin/pages/pages/_content_fields.html.erb +15 -0
- data/app/views/no_cms/admin/pages/pages/_filter.html.erb +59 -0
- data/app/views/no_cms/admin/pages/pages/_page_listing.html.erb +3 -0
- data/app/views/no_cms/admin/pages/pages/_page_listing_item.html.erb +13 -0
- data/app/views/no_cms/admin/pages/pages/_search.html.erb +4 -0
- data/app/views/no_cms/admin/pages/pages/_toolbar_right.html.erb +3 -0
- data/app/views/no_cms/admin/pages/pages/edit.html.erb +38 -0
- data/app/views/no_cms/admin/pages/pages/index.html.erb +11 -0
- data/app/views/no_cms/admin/pages/pages/new.html.erb +16 -0
- data/config/initializers/admin_menu_items.rb +4 -0
- data/config/locales/en.yml +33 -0
- data/config/routes.rb +3 -0
- data/lib/no_cms/admin/pages/engine.rb +13 -0
- data/lib/no_cms/admin/pages/version.rb +7 -0
- data/lib/nocms-admin-pages.rb +8 -0
- data/lib/tasks/pages_tasks.rake +4 -0
- metadata +140 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 632c92fc7d5067172887bca9991102495727098d
|
4
|
+
data.tar.gz: c48113c93862f5180aa9226cc2d745045fabbae2
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6d1d6a288c9b45e987068e797b87e3b853932651712da46978b731d5d17d5ea4cfc919720390da18becc6777f71252e5c3e79a325e6569b332ee7a75b922e61c
|
7
|
+
data.tar.gz: 2142414c5a6a9a49afe01c3aed1905d5717972bde097fcce89b43aa371b0978e125e0bbbbaf5698f2cc3decb4ff40febf6502d8aa902ad8ea0c4d1cadbf05bf4
|
data/Rakefile
ADDED
@@ -0,0 +1,23 @@
|
|
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
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'Pages'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.rdoc')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
18
|
+
load 'rails/tasks/engine.rake'
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
Bundler::GemHelper.install_tasks
|
23
|
+
|
Binary file
|
@@ -0,0 +1,108 @@
|
|
1
|
+
// Place all the behaviors and hooks related to the matching controller here.
|
2
|
+
// All this logic will automatically be available in application.js.
|
3
|
+
|
4
|
+
NoCMS.ContentBlockHandler = function() {
|
5
|
+
|
6
|
+
|
7
|
+
var default_layout_block = $('#new_content_block_default'),
|
8
|
+
block_placeholder = $('#content_blocks_placeholder'),
|
9
|
+
new_content_link = $('#new_content_block'),
|
10
|
+
block_templates = $('.new.block'),
|
11
|
+
that = this;
|
12
|
+
|
13
|
+
new_content_link.on('click', function(e){
|
14
|
+
e.preventDefault();
|
15
|
+
that.createBlock();
|
16
|
+
});
|
17
|
+
|
18
|
+
block_placeholder.on('change', '.block_layout_selector', function(e){
|
19
|
+
that.updateBlock($(this).parents('.block'), $(this).val());
|
20
|
+
});
|
21
|
+
|
22
|
+
block_placeholder.on('click', '.ico-mini-move-down', function(e){
|
23
|
+
e.preventDefault();
|
24
|
+
var block = $(this).parents('.block'),
|
25
|
+
next_blocks = block.nextAll('.block');
|
26
|
+
|
27
|
+
if(next_blocks.length > 0) {
|
28
|
+
that.switchBlockPositions(block, next_blocks.first());
|
29
|
+
}
|
30
|
+
});
|
31
|
+
|
32
|
+
block_placeholder.on('click', '.ico-mini-move-up', function(e){
|
33
|
+
e.preventDefault();
|
34
|
+
var block = $(this).parents('.block'),
|
35
|
+
previous_blocks = block.prevAll('.block');
|
36
|
+
|
37
|
+
if(previous_blocks.length > 0) {
|
38
|
+
that.switchBlockPositions(previous_blocks.first(), block);
|
39
|
+
}
|
40
|
+
});
|
41
|
+
|
42
|
+
block_placeholder.on('click', '.ico-mini-show-hide', function(e){
|
43
|
+
e.preventDefault();
|
44
|
+
that.toggleDraft($(this).parents('.block'));
|
45
|
+
});
|
46
|
+
|
47
|
+
block_placeholder.on('click', '.ico-mini-delete', function(e){
|
48
|
+
e.preventDefault();
|
49
|
+
that.toggleDestroy($(this).parents('.block'));
|
50
|
+
});
|
51
|
+
|
52
|
+
this.updateBlock = function(block, new_layout){
|
53
|
+
new_template = block_templates.filter('#new_content_block_' + new_layout)
|
54
|
+
block.find('.layout_fields').html(new_template.find('.layout_fields').html());
|
55
|
+
this.modifyInputNames(block, block.find('.block_layout_selector').attr('id').match(/_([0-9]*)_/)[1]);
|
56
|
+
}
|
57
|
+
|
58
|
+
this.switchBlockPositions = function(block, next_block){
|
59
|
+
var next_block_position = next_block.find('.position').val();
|
60
|
+
|
61
|
+
next_block.find('.position').val(block.find('.position').val());
|
62
|
+
block.find('.position').val(next_block_position);
|
63
|
+
|
64
|
+
next_block.after(block);
|
65
|
+
}
|
66
|
+
|
67
|
+
this.createBlock = function(){
|
68
|
+
var position = $('.block').not('.new').length;
|
69
|
+
new_block = default_layout_block.clone();
|
70
|
+
new_block.removeClass('new');
|
71
|
+
new_block.removeAttr('id');
|
72
|
+
this.modifyInputNames(new_block, position);
|
73
|
+
new_block.find('.position').val(position);
|
74
|
+
|
75
|
+
block_placeholder.append(new_block);
|
76
|
+
}
|
77
|
+
|
78
|
+
this.modifyInputNames = function(block, position){
|
79
|
+
|
80
|
+
block.find('[for]').each(function(){
|
81
|
+
$(this).attr('for', $(this).attr('for').replace(/_[0-9]*_/, '_'+position+'_'))
|
82
|
+
});
|
83
|
+
block.find('[id]').each(function(){
|
84
|
+
$(this).attr('id', $(this).attr('id').replace(/_[0-9]*_/, '_'+position+'_'))
|
85
|
+
});
|
86
|
+
block.find('[name]').each(function(){
|
87
|
+
$(this).attr('name', $(this).attr('name').replace(/\[[0-9]*\]/, '['+position+']'))
|
88
|
+
});
|
89
|
+
|
90
|
+
}
|
91
|
+
|
92
|
+
this.toggleDraft = function(block) {
|
93
|
+
var draft_field = block.find('.draft');
|
94
|
+
block.toggleClass('oculto');
|
95
|
+
draft_field.val(draft_field.val() == '1' ? '0' : '1');
|
96
|
+
}
|
97
|
+
|
98
|
+
this.toggleDestroy = function(block) {
|
99
|
+
var draft_field = block.find('.destroy');
|
100
|
+
block.toggleClass('to-be-deleted');
|
101
|
+
draft_field.val(draft_field.val() == '1' ? '0' : '1');
|
102
|
+
}
|
103
|
+
|
104
|
+
block_templates.each(function() {
|
105
|
+
$(this).detach();
|
106
|
+
});
|
107
|
+
|
108
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
9
|
+
* compiled file, but it's generally better to create a new file per style scope.
|
10
|
+
*
|
11
|
+
*= require_self
|
12
|
+
*= require_tree .
|
13
|
+
*/
|
@@ -0,0 +1,107 @@
|
|
1
|
+
/*
|
2
|
+
Place all the styles related to the matching controller here.
|
3
|
+
They will automatically be included in application.css.
|
4
|
+
*/
|
5
|
+
|
6
|
+
/* Main BG color */
|
7
|
+
$bg: #272c2f;
|
8
|
+
$content_area_padding: 20px;
|
9
|
+
$accent: #f05a28;
|
10
|
+
$font_mono: 'pragmataproregular', 'Courier New', Courier, monospace;
|
11
|
+
$line_color: lighten($bg, 40%);
|
12
|
+
|
13
|
+
.new.block {
|
14
|
+
display:none;
|
15
|
+
}
|
16
|
+
section#content-area .content .row {
|
17
|
+
&.has-children {
|
18
|
+
counter-reset: term;
|
19
|
+
}
|
20
|
+
.block {
|
21
|
+
$line_color: lighten($bg, 40%);
|
22
|
+
position: relative;
|
23
|
+
margin: ($content_area_padding * 0.75) 0 ($content_area_padding * 0.75) $content_area_padding;
|
24
|
+
padding: 0;
|
25
|
+
border-left: 2px dotted $line_color;
|
26
|
+
border-right: 2px dotted $line_color;
|
27
|
+
border-top: 2px solid $line_color;
|
28
|
+
|
29
|
+
> .title {
|
30
|
+
width: 100%;
|
31
|
+
height: 24px;
|
32
|
+
background: #fff;
|
33
|
+
background: lighten($bg, 40%);
|
34
|
+
|
35
|
+
color: #fff;
|
36
|
+
font-weight: 700;
|
37
|
+
padding: 4px 0 0 8px;
|
38
|
+
|
39
|
+
> .mo {
|
40
|
+
opacity: 1;
|
41
|
+
float: right;
|
42
|
+
border: 0;
|
43
|
+
|
44
|
+
> input[type=submit],
|
45
|
+
> button,
|
46
|
+
> a {
|
47
|
+
background-color: $line_color;
|
48
|
+
border-left: 1px solid #fff;
|
49
|
+
&.active,
|
50
|
+
&:hover {
|
51
|
+
background-color: desaturate(darken($accent, 20%), 20%);
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
/* Contador */
|
58
|
+
&:before {
|
59
|
+
counter-increment: term;
|
60
|
+
content: counter(term);
|
61
|
+
display: block;
|
62
|
+
position: absolute;
|
63
|
+
padding: 4px 0 0 0;
|
64
|
+
width: 20px;
|
65
|
+
height: 22px;
|
66
|
+
top: -2px;
|
67
|
+
left: -22px;
|
68
|
+
background: $line_color;
|
69
|
+
|
70
|
+
font-family: $font_mono;
|
71
|
+
font-size: 18px;
|
72
|
+
font-weight: 700;
|
73
|
+
text-align: center;
|
74
|
+
color: #fff;
|
75
|
+
|
76
|
+
}
|
77
|
+
|
78
|
+
|
79
|
+
&.to-be-deleted {
|
80
|
+
.title {
|
81
|
+
.mo {
|
82
|
+
.ico-mini-delete {
|
83
|
+
background-color: $accent !important;
|
84
|
+
}
|
85
|
+
}
|
86
|
+
}
|
87
|
+
}
|
88
|
+
|
89
|
+
&.oculto {
|
90
|
+
.title {
|
91
|
+
.mo {
|
92
|
+
.ico-mini-show-hide {
|
93
|
+
background-color: $accent !important;
|
94
|
+
}
|
95
|
+
}
|
96
|
+
}
|
97
|
+
.row {
|
98
|
+
background-image: image-url('no_cms/admin/pages/stripe_5d3ba7190e7de9a95d82d43dce2917b1_a10.png');
|
99
|
+
}
|
100
|
+
}
|
101
|
+
>.row {
|
102
|
+
&:last-of-type {
|
103
|
+
border-bottom: 2px solid lighten($bg, 50%);
|
104
|
+
}
|
105
|
+
}
|
106
|
+
}
|
107
|
+
}
|
@@ -0,0 +1,86 @@
|
|
1
|
+
require_dependency "no_cms/admin/pages/application_controller"
|
2
|
+
|
3
|
+
module NoCms::Admin::Pages
|
4
|
+
class PagesController < ApplicationController
|
5
|
+
|
6
|
+
before_filter :load_menu_section
|
7
|
+
before_filter :load_page, only: [:edit, :update, :destroy]
|
8
|
+
before_filter :load_roots, only: [:index, :new, :edit]
|
9
|
+
|
10
|
+
|
11
|
+
def new
|
12
|
+
@page = NoCms::Pages::Page.new
|
13
|
+
end
|
14
|
+
|
15
|
+
def create
|
16
|
+
@page = NoCms::Pages::Page.new page_params
|
17
|
+
if @page.save
|
18
|
+
@logger.info(I18n.t('.no_cms.admin.pages.pages.create.success', title: @page.path), true)
|
19
|
+
redirect_after_save
|
20
|
+
else
|
21
|
+
@logger.error(I18n.t('.no_cms.admin.pages.pages.create.error', title: @page.path))
|
22
|
+
load_roots
|
23
|
+
render :new
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def edit
|
28
|
+
@logger.add_message :pages, I18n.t('.no_cms.admin.pages.pages.edit.log_messages', title: @page.path)
|
29
|
+
NoCms::Pages.block_layouts.each do |name, _|
|
30
|
+
@page.blocks.build layout: name
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def update
|
35
|
+
if @page.update_attributes page_params
|
36
|
+
@logger.info(I18n.t('.no_cms.admin.pages.pages.update.success', title: @page.path), true)
|
37
|
+
redirect_after_save
|
38
|
+
else
|
39
|
+
@logger.error(I18n.t('.no_cms.admin.pages.pages.update.error', title: @page.path))
|
40
|
+
load_roots
|
41
|
+
render :new
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def destroy
|
46
|
+
if @page.destroy
|
47
|
+
@logger.info(I18n.t('.no_cms.admin.pages.pages.destroy.success', title: @page.path), true)
|
48
|
+
else
|
49
|
+
@logger.error(I18n.t('.no_cms.admin.pages.pages.destroy.error', title: @page.path), true)
|
50
|
+
end
|
51
|
+
redirect_to pages_path
|
52
|
+
end
|
53
|
+
|
54
|
+
private
|
55
|
+
|
56
|
+
def load_menu_section
|
57
|
+
@current_section = 'pages'
|
58
|
+
end
|
59
|
+
|
60
|
+
def load_page
|
61
|
+
@page = NoCms::Pages::Page.find(params[:id])
|
62
|
+
end
|
63
|
+
|
64
|
+
def load_roots
|
65
|
+
@roots = NoCms::Pages::Page.roots
|
66
|
+
end
|
67
|
+
|
68
|
+
def page_params
|
69
|
+
page_params = params.require(:page).permit(:title, :body, :parent_id, :draft)
|
70
|
+
page_params.merge!(blocks_attributes: params[:page][:blocks_attributes]) unless params[:page][:blocks_attributes].blank?
|
71
|
+
page_params
|
72
|
+
end
|
73
|
+
|
74
|
+
def redirect_after_save
|
75
|
+
if params[:submit_and_hide]
|
76
|
+
redirect_to pages_path
|
77
|
+
elsif params[:submit_and_new]
|
78
|
+
redirect_to new_page_path
|
79
|
+
else params[:submit]
|
80
|
+
redirect_to edit_page_path(@page)
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
84
|
+
|
85
|
+
end
|
86
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module NoCms::Admin::Pages
|
2
|
+
module PagesHelper
|
3
|
+
|
4
|
+
def page_listing_item_classes page, current_page
|
5
|
+
classes = []
|
6
|
+
classes << 'current' if current_page == page
|
7
|
+
classes << 'oculto' if page.draft
|
8
|
+
classes
|
9
|
+
end
|
10
|
+
|
11
|
+
def block_form_classes block
|
12
|
+
classes = []
|
13
|
+
classes << 'oculto' if block.draft
|
14
|
+
classes << 'new' if block.new_record?
|
15
|
+
classes
|
16
|
+
end
|
17
|
+
|
18
|
+
def block_form_id block
|
19
|
+
block.new_record? ?
|
20
|
+
"new_content_block_#{block.layout}" :
|
21
|
+
"content_block_#{block.id}"
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<div class="title">
|
2
|
+
<%= I18n.t "no_cms.pages.blocks.layouts.#{f.object.layout}" %>
|
3
|
+
<div class="mo">
|
4
|
+
<a href="" class="ico-mini-delete">
|
5
|
+
<a href="" class="ico-mini-move-up"></a>
|
6
|
+
<a href="" class="ico-mini-move-down"></a>
|
7
|
+
<a href="" class="ico-mini-show-hide"></a>
|
8
|
+
</div>
|
9
|
+
</div>
|
10
|
+
<div class="row">
|
11
|
+
<%= f.label :layout %>
|
12
|
+
<%= f.select :layout, NoCms::Pages.block_layouts.map{|name, _| [ I18n.t("no_cms.pages.blocks.layouts.#{name}"), name ]}, {}, class: 'block_layout_selector' %>
|
13
|
+
</div>
|
14
|
+
<div class='layout_fields'>
|
15
|
+
<%= render "no_cms/admin/pages/blocks/#{f.object.template}" , f: f %>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<%= f.hidden_field :position, class: 'position', value: f.index %>
|
19
|
+
<%= f.hidden_field :draft, class: 'draft', value: f.object.draft ? '1' : '0' %>
|
20
|
+
<%= f.hidden_field :_destroy, class: 'destroy', value: '0' %>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<div class="row has-children" id='content_blocks_placeholder'>
|
2
|
+
<label><%= t('.title') %></label>
|
3
|
+
|
4
|
+
<%= link_to t('.new_block'), '#', id: 'new_content_block', class: 'btn _m0' %>
|
5
|
+
|
6
|
+
<%= f.fields_for :blocks do |f_block| %>
|
7
|
+
|
8
|
+
<div class="block row <%= block_form_classes(f_block.object).join(" ")%>" id="<%= block_form_id(f_block.object) %>">
|
9
|
+
<%= render 'no_cms/admin/pages/blocks/form', f: f_block %>
|
10
|
+
</div>
|
11
|
+
<% end %>
|
12
|
+
</div>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<div id="content_fields">
|
2
|
+
<div class="row">
|
3
|
+
<%= f.label :parent_id %>
|
4
|
+
<%= f.select :parent_id, NoCms::Pages::Page.with_translations.map{|p| [p.path, p.id]}, include_blank: t('.choose_page') %>
|
5
|
+
</div>
|
6
|
+
<div class="row">
|
7
|
+
<%= f.label :title %>
|
8
|
+
<%= f.text_field :title %>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<div class="row">
|
12
|
+
<%= f.label :body %>
|
13
|
+
<%= f.text_area :body %>
|
14
|
+
</div>
|
15
|
+
</div>
|
@@ -0,0 +1,59 @@
|
|
1
|
+
<form action="#">
|
2
|
+
<div class="row">
|
3
|
+
<label for="nombre">Nombre</label>
|
4
|
+
<input type="text" name="nombre" id="" placeholder="Placeholder de nombre">
|
5
|
+
</div>
|
6
|
+
<div class="row">
|
7
|
+
<label for="codigo-GG">Código GG</label>
|
8
|
+
<input type="text" name="codigo-GG" id="">
|
9
|
+
</div>
|
10
|
+
<div class="row">
|
11
|
+
<label for="ISBN">ISBN</label>
|
12
|
+
<input type="text" name="ISBN" id="">
|
13
|
+
</div>
|
14
|
+
<div class="row">
|
15
|
+
<label for="categoria">Categoría</label>
|
16
|
+
<input type="text" name="categoria" id="">
|
17
|
+
</div>
|
18
|
+
<div class="row">
|
19
|
+
<label for="xxx">Dos inputs en una sola línea</label>
|
20
|
+
<input type="text" name="Nombre" id="" class="half">
|
21
|
+
<input type="text" name="Apellidos" id="" class="half">
|
22
|
+
</div>
|
23
|
+
<div class="row">
|
24
|
+
<label for="editorial">Editorial</label>
|
25
|
+
<select name="editorial" id="">
|
26
|
+
<option value="">Editorial 1</option>
|
27
|
+
<option value="">Editorial 2</option>
|
28
|
+
<option value="">Editorial 3</option>
|
29
|
+
</select>
|
30
|
+
</div>
|
31
|
+
<div class="row">
|
32
|
+
<label for="coleccion">Colección y país</label>
|
33
|
+
<select name="coleccion" id="">
|
34
|
+
<option value="">Sleccione colección</option>
|
35
|
+
<option value="">Colección 1</option>
|
36
|
+
<option value="">Colección 2</option>
|
37
|
+
<option value="">Colección 3</option>
|
38
|
+
</select>
|
39
|
+
<select name="pais" id="">
|
40
|
+
<option value="">Sleccione país</option>
|
41
|
+
<option value="">Colección 1</option>
|
42
|
+
<option value="">Colección 2</option>
|
43
|
+
<option value="">Colección 3</option>
|
44
|
+
</select>
|
45
|
+
</div>
|
46
|
+
<div class="row">
|
47
|
+
<fieldset>
|
48
|
+
<legend>Título del grupos de checkboxes</legend>
|
49
|
+
<label><input type="checkbox" name="" id=""> Checkbox 1</label>
|
50
|
+
<label><input type="checkbox" name="" id=""> Checkbox 2</label>
|
51
|
+
<label><input type="checkbox" name="" id=""> Checkbox 4</label>
|
52
|
+
<label><input type="checkbox" name="" id=""> Checkbox 5</label>
|
53
|
+
</fieldset>
|
54
|
+
</div>
|
55
|
+
<div class="row filter-actions">
|
56
|
+
<input type="submit" value="Filtrar" class="btn right">
|
57
|
+
<input type="reset" value="Eliminar filtro" class="btn right">
|
58
|
+
</div>
|
59
|
+
</form>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<% current ||= nil %>
|
2
|
+
<li <%= raw "class='#{page_listing_item_classes(page, current).join(' ')}'"%>>
|
3
|
+
<%= link_to page.title, edit_page_path(page)%>
|
4
|
+
<div class="mo">
|
5
|
+
<%= button_to '', page_path(page), method: :delete, class: "ico-mini-delete", title: t('.destroy') %>
|
6
|
+
<%= button_to page_path(page), method: :put, class: "ico-mini-show-hide", title: (page.draft ? t('.show') : t('.hide')) do %>
|
7
|
+
<% fields_for page do |f| %>
|
8
|
+
<%= f.hidden_field :draft, value: (page.draft ? "0" : "1") %>
|
9
|
+
<% end %>
|
10
|
+
<% end %>
|
11
|
+
</div>
|
12
|
+
<%= render partial: 'page_listing_item', collection: page.children, as: 'page', layout: 'page_listing', locals: { current: current } unless page.children.blank? %>
|
13
|
+
</li>
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<% content_for :js do %>
|
2
|
+
<%= javascript_include_tag 'no_cms/admin/pages/content_block_handler' %>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<% content_for :ready_js do %>
|
6
|
+
NoCMS.ContentBlockHandler();
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<% content_for :stylesheets do %>
|
10
|
+
<%= stylesheet_link_tag 'no_cms/admin/pages/pages' %>
|
11
|
+
<% end %>
|
12
|
+
|
13
|
+
<% content_for :second_menu do %>
|
14
|
+
<%= render partial: 'page_listing_item', collection: @roots, as: 'page', layout: 'page_listing', locals: { current: @page } unless @roots.blank? %>
|
15
|
+
<% end %>
|
16
|
+
|
17
|
+
|
18
|
+
<%= no_cms_admin_form_for @page do |f| %>
|
19
|
+
<%= render partial: 'no_cms/admin/shared/toolbar', locals: { f: f } %>
|
20
|
+
<div class="content">
|
21
|
+
<%= render 'no_cms/admin/shared/log_messages' %>
|
22
|
+
<%= render 'content_fields', f: f %>
|
23
|
+
<%= render 'no_cms/admin/pages/blocks/index', f: f %>
|
24
|
+
</div>
|
25
|
+
|
26
|
+
<div class="advanced">
|
27
|
+
<p class="title collapsed">Opciones avanzadas</p>
|
28
|
+
<div>
|
29
|
+
Ojete
|
30
|
+
</div>
|
31
|
+
</div>
|
32
|
+
<% end %>
|
33
|
+
<div class="advanced">
|
34
|
+
<p class="title collapsed">Opciones avanzadas</p>
|
35
|
+
<div>
|
36
|
+
Ojete
|
37
|
+
</div>
|
38
|
+
</div>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<% content_for :second_menu do %>
|
2
|
+
<%= render partial: 'page_listing_item', collection: @roots, as: 'page', layout: 'page_listing' unless @roots.blank? %>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<% content_for :stylesheets do %>
|
6
|
+
<%= stylesheet_link_tag 'no_cms/admin/pages/pages' %>
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<div class="content">
|
10
|
+
<%= render 'no_cms/admin/shared/log_messages' %>
|
11
|
+
</div>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<% content_for :second_menu do %>
|
2
|
+
<%= render partial: 'page_listing_item', collection: @roots, as: 'page', layout: 'page_listing', locals: { current: @page } unless @roots.blank? %>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<% content_for :stylesheets do %>
|
6
|
+
<%= stylesheet_link_tag 'no_cms/admin/pages/pages' %>
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<%= no_cms_admin_form_for @page do |f| %>
|
10
|
+
<%= render partial: 'no_cms/admin/shared/toolbar', locals: { f: f } %>
|
11
|
+
<div class="content">
|
12
|
+
<%= render 'no_cms/admin/shared/log_messages' %>
|
13
|
+
<%= render 'content_fields', f: f %>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<% end %>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
en:
|
2
|
+
no_cms:
|
3
|
+
admin:
|
4
|
+
menu_items:
|
5
|
+
pages: Pages
|
6
|
+
pages:
|
7
|
+
blocks:
|
8
|
+
index:
|
9
|
+
new_block: Create new block
|
10
|
+
title: Blocks attached to this page
|
11
|
+
pages:
|
12
|
+
create:
|
13
|
+
success: "Page %{title} has been created"
|
14
|
+
error: "Some error was found and page %{title} couldn't be created"
|
15
|
+
destroy:
|
16
|
+
success: "Page %{title} has been deleted"
|
17
|
+
error: "Some error was found and page %{title} couldn't be deleted"
|
18
|
+
edit:
|
19
|
+
log_messages: "Page %{title} loaded for editing"
|
20
|
+
submit: 'Send'
|
21
|
+
new:
|
22
|
+
submit: 'Send'
|
23
|
+
page_listing_item:
|
24
|
+
destroy: Remove
|
25
|
+
show: Show Page
|
26
|
+
hide: Mark Page as draft
|
27
|
+
toolbar_right:
|
28
|
+
submit: Save
|
29
|
+
submit_and_new: Save and new
|
30
|
+
submit_and_hide: Save and hide
|
31
|
+
update:
|
32
|
+
success: "Page %{title} has been updated"
|
33
|
+
error: "Some error was found and page %{title} couldn't be updated"
|
data/config/routes.rb
ADDED
metadata
ADDED
@@ -0,0 +1,140 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: nocms-admin-pages
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Simplelogica
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-03-17 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: nocms-pages
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.0'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 0.0.1
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0.0'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 0.0.1
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: nocms-admin
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0.0'
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 0.0.1
|
43
|
+
type: :runtime
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0.0'
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 0.0.1
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: jquery-rails
|
55
|
+
requirement: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - "~>"
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '3.1'
|
60
|
+
type: :runtime
|
61
|
+
prerelease: false
|
62
|
+
version_requirements: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - "~>"
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '3.1'
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
name: sqlite3
|
69
|
+
requirement: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
type: :development
|
75
|
+
prerelease: false
|
76
|
+
version_requirements: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0'
|
81
|
+
description: Gem with custom back for nocms-pages gem
|
82
|
+
email:
|
83
|
+
- gems@simplelogica.net
|
84
|
+
executables: []
|
85
|
+
extensions: []
|
86
|
+
extra_rdoc_files: []
|
87
|
+
files:
|
88
|
+
- Rakefile
|
89
|
+
- app/assets/images/no_cms/admin/pages/stripe_5d3ba7190e7de9a95d82d43dce2917b1_a10.png
|
90
|
+
- app/assets/javascripts/no_cms/admin/pages/application.js
|
91
|
+
- app/assets/javascripts/no_cms/admin/pages/content_block_handler.js
|
92
|
+
- app/assets/stylesheets/no_cms/admin/pages/application.css
|
93
|
+
- app/assets/stylesheets/no_cms/admin/pages/pages.css.scss
|
94
|
+
- app/controllers/no_cms/admin/pages/application_controller.rb
|
95
|
+
- app/controllers/no_cms/admin/pages/pages_controller.rb
|
96
|
+
- app/helpers/no_cms/admin/pages/application_helper.rb
|
97
|
+
- app/helpers/no_cms/admin/pages/pages_helper.rb
|
98
|
+
- app/views/no_cms/admin/pages/blocks/_default.html.erb
|
99
|
+
- app/views/no_cms/admin/pages/blocks/_form.html.erb
|
100
|
+
- app/views/no_cms/admin/pages/blocks/_index.html.erb
|
101
|
+
- app/views/no_cms/admin/pages/pages/_content_fields.html.erb
|
102
|
+
- app/views/no_cms/admin/pages/pages/_filter.html.erb
|
103
|
+
- app/views/no_cms/admin/pages/pages/_page_listing.html.erb
|
104
|
+
- app/views/no_cms/admin/pages/pages/_page_listing_item.html.erb
|
105
|
+
- app/views/no_cms/admin/pages/pages/_search.html.erb
|
106
|
+
- app/views/no_cms/admin/pages/pages/_toolbar_right.html.erb
|
107
|
+
- app/views/no_cms/admin/pages/pages/edit.html.erb
|
108
|
+
- app/views/no_cms/admin/pages/pages/index.html.erb
|
109
|
+
- app/views/no_cms/admin/pages/pages/new.html.erb
|
110
|
+
- config/initializers/admin_menu_items.rb
|
111
|
+
- config/locales/en.yml
|
112
|
+
- config/routes.rb
|
113
|
+
- lib/no_cms/admin/pages/engine.rb
|
114
|
+
- lib/no_cms/admin/pages/version.rb
|
115
|
+
- lib/nocms-admin-pages.rb
|
116
|
+
- lib/tasks/pages_tasks.rake
|
117
|
+
homepage: https://github.com/simplelogica/nocms-admin-pages
|
118
|
+
licenses: []
|
119
|
+
metadata: {}
|
120
|
+
post_install_message:
|
121
|
+
rdoc_options: []
|
122
|
+
require_paths:
|
123
|
+
- lib
|
124
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
125
|
+
requirements:
|
126
|
+
- - ">="
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: '0'
|
129
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - ">="
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
requirements: []
|
135
|
+
rubyforge_project:
|
136
|
+
rubygems_version: 2.2.2
|
137
|
+
signing_key:
|
138
|
+
specification_version: 4
|
139
|
+
summary: Gem with custom back for nocms-pages gem
|
140
|
+
test_files: []
|