adminpanel 1.2.12 → 2.0.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 +7 -0
- data/.travis.yml +3 -4
- data/Gemfile +22 -20
- data/README.md +12 -9
- data/adminpanel.gemspec +29 -28
- data/app/assets/fonts/.keep +0 -0
- data/app/assets/javascripts/adminpanel/images_form.js +5 -2
- data/app/assets/javascripts/adminpanel/imagesloaded.js +5 -2
- data/app/assets/javascripts/adminpanel/tables.js +6 -3
- data/app/assets/javascripts/application-admin.js +2 -1
- data/app/assets/stylesheets/adminpanel/{_clearfix.css.scss → _clearfix.css} +0 -0
- data/app/assets/stylesheets/adminpanel/bootstrap.css +2 -2
- data/app/assets/stylesheets/adminpanel/medium-editor.css.scss +1 -1
- data/app/assets/stylesheets/application-admin.css +2 -1
- data/app/controllers/adminpanel/application_controller.rb +28 -21
- data/app/controllers/adminpanel/categories_controller.rb +16 -5
- data/app/controllers/adminpanel/galleries_controller.rb +11 -5
- data/app/controllers/adminpanel/sections_controller.rb +14 -0
- data/app/controllers/adminpanel/users_controller.rb +10 -80
- data/app/controllers/concerns/adminpanel/galleryzable_actions.rb +33 -0
- data/app/controllers/concerns/adminpanel/rest_actions.rb +109 -0
- data/app/helpers/adminpanel/application_helper.rb +0 -1
- data/app/helpers/adminpanel/custom_form_builder.rb +12 -13
- data/app/helpers/adminpanel/router_helper.rb +11 -2
- data/app/helpers/adminpanel/shared_pages_helper.rb +0 -1
- data/app/models/adminpanel/analytic.rb +3 -2
- data/app/models/adminpanel/gallery.rb +8 -4
- data/app/models/adminpanel/group.rb +1 -1
- data/app/models/adminpanel/image.rb +1 -2
- data/app/models/adminpanel/section.rb +19 -10
- data/app/models/adminpanel/user.rb +11 -3
- data/app/models/concerns/adminpanel/base.rb +149 -0
- data/app/models/concerns/adminpanel/galleryzation.rb +66 -0
- data/app/models/contact.rb +16 -9
- data/app/views/adminpanel/analytics/index.html.erb +2 -1
- data/app/views/adminpanel/categories/_categories_table.html.erb +6 -7
- data/app/views/adminpanel/categories/_category_form.html.erb +2 -2
- data/app/views/adminpanel/categories/create.js.erb +2 -2
- data/app/views/adminpanel/categories/index.html.erb +1 -1
- data/app/views/adminpanel/galleries/_galleries_table.html.erb +7 -7
- data/app/views/adminpanel/galleries/index.html.erb +6 -5
- data/app/views/adminpanel/sections/_sections_table.html.erb +2 -2
- data/app/views/adminpanel/sections/edit.html.erb +5 -3
- data/app/views/adminpanel/sections/show.html.erb +3 -3
- data/app/views/adminpanel/sessions/new.html.erb +1 -1
- data/app/views/layouts/_side_menu.html.erb +2 -2
- data/app/views/layouts/_top_bar.html.erb +3 -3
- data/app/views/layouts/admin-login.html.erb +0 -1
- data/app/views/layouts/admin.html.erb +3 -3
- data/app/views/shared/_delete_icon_button.html.erb +16 -0
- data/app/views/shared/_edit_icon_button.html.erb +14 -0
- data/app/views/shared/_error_messages.html.erb +1 -1
- data/app/views/shared/_form_fields.html.erb +15 -13
- data/app/views/shared/_gallery_entries.html.erb +2 -2
- data/app/views/shared/_init_editor.html.erb +5 -2
- data/app/views/shared/_new_resource_button.html.erb +18 -0
- data/app/views/shared/_remote_form_fields.html.erb +1 -1
- data/app/views/shared/_show_icon_button.html.erb +14 -0
- data/app/views/shared/edit.html.erb +3 -3
- data/app/views/shared/index.html.erb +13 -48
- data/app/views/shared/new.html.erb +3 -3
- data/app/views/shared/show.html.erb +5 -5
- data/config/initializers/pluralization_es.rb +16 -0
- data/config/locales/en.yml +89 -0
- data/config/locales/es.yml +4 -4
- data/config/routes.rb +15 -16
- data/lib/adminpanel.rb +8 -8
- data/lib/adminpanel/version.rb +1 -1
- data/lib/generators/adminpanel/gallery/gallery_generator.rb +12 -8
- data/lib/generators/adminpanel/gallery/templates/gallery_template.rb +2 -3
- data/lib/generators/adminpanel/initialize/templates/category_template.rb +2 -3
- data/lib/generators/adminpanel/resource/resource_generator.rb +24 -18
- data/lib/generators/adminpanel/resource/templates/controller.rb +5 -0
- data/lib/generators/adminpanel/resource/templates/resource.rb +3 -3
- data/lib/tasks/adminpanel/adminpanel.rake +43 -90
- data/spec/dummy/app/controllers/adminpanel/mugs_controller.rb +9 -0
- data/spec/dummy/app/controllers/adminpanel/products_controller.rb +12 -0
- data/spec/dummy/app/models/ability.rb +1 -1
- data/spec/dummy/app/models/adminpanel/categorization.rb +1 -2
- data/spec/dummy/app/models/adminpanel/category.rb +18 -19
- data/spec/dummy/app/models/adminpanel/mug.rb +37 -0
- data/spec/dummy/app/models/adminpanel/photo.rb +3 -3
- data/spec/dummy/app/models/adminpanel/product.rb +2 -2
- data/spec/dummy/config/application.rb +2 -11
- data/spec/dummy/config/database.yml +0 -6
- data/spec/dummy/config/environments/development.rb +11 -23
- data/spec/dummy/config/environments/production.rb +40 -32
- data/spec/dummy/config/environments/test.rb +13 -18
- data/spec/dummy/config/initializers/adminpanel_setup.rb +2 -1
- data/spec/dummy/config/locales/.keep +0 -0
- data/spec/dummy/db/schema.rb +68 -2
- data/spec/features/authentication_pages_spec.rb +15 -15
- data/spec/features/galleries_pages_spec.rb +30 -22
- data/spec/features/section_pages_spec.rb +15 -18
- data/spec/features/shared_pages_spec.rb +97 -127
- data/spec/generators/gallery_generator_spec.rb +2 -3
- data/spec/generators/resource_generator_spec.rb +20 -3
- data/spec/models/gallery_spec.rb +2 -2
- data/spec/models/section_spec.rb +8 -15
- data/spec/models/user_spec.rb +23 -39
- data/spec/spec_helper.rb +9 -1
- data/spec/support/factories.rb +52 -0
- data/spec/support/helper_methods.rb +25 -5
- data/spec/tasks/adminpanel_rake_spec.rb +11 -10
- metadata +361 -353
- data/app/assets/fonts/FontAwesome.otf +0 -0
- data/app/assets/fonts/fontawesome-webfont.eot +0 -0
- data/app/assets/fonts/fontawesome-webfont.svg +0 -255
- data/app/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/app/assets/fonts/fontawesome-webfont.woff +0 -0
- data/app/assets/stylesheets/adminpanel/colorpicker.css +0 -7
- data/app/assets/stylesheets/adminpanel/elfinder.min.css +0 -59
- data/app/assets/stylesheets/adminpanel/font-awesome.min.css +0 -34
- data/app/helpers/adminpanel/pluralizations_helper.rb +0 -25
- data/app/helpers/adminpanel/rest_actions_helper.rb +0 -128
- data/app/views/adminpanel/galleries/delete.html.erb +0 -2
- data/app/views/adminpanel/galleries/edit.html.erb +0 -19
- data/app/views/adminpanel/galleries/new.html.erb +0 -18
- data/app/views/adminpanel/galleries/show.html.erb +0 -18
- data/app/views/adminpanel/galleries/update.html.erb +0 -2
- data/lib/adminpanel/active_record/adminpanel_extension.rb +0 -187
- data/spec/dummy/config/locales/en.yml +0 -5
- data/spec/support/define_factory_models.rb +0 -45
- data/spec/support/submit_forms_without_button.rb +0 -17
- data/spec/support/test_database.rb +0 -76
- data/spec/uploaders/gallery_uploader_spec.rb +0 -37
- data/spec/uploaders/image_uploader_spec.rb +0 -31
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
module Adminpanel
|
|
2
2
|
class User < ActiveRecord::Base
|
|
3
|
-
|
|
3
|
+
include Adminpanel::Base
|
|
4
4
|
has_secure_password
|
|
5
5
|
belongs_to :group
|
|
6
6
|
|
|
@@ -85,13 +85,21 @@ module Adminpanel
|
|
|
85
85
|
|
|
86
86
|
end
|
|
87
87
|
|
|
88
|
+
def User.new_remember_token
|
|
89
|
+
SecureRandom.urlsafe_base64
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def User.digest(token)
|
|
93
|
+
Digest::SHA1.hexdigest(token.to_s)
|
|
94
|
+
end
|
|
95
|
+
|
|
88
96
|
def self.icon
|
|
89
|
-
'
|
|
97
|
+
'user'
|
|
90
98
|
end
|
|
91
99
|
|
|
92
100
|
private
|
|
93
101
|
def create_remember_token
|
|
94
|
-
self.remember_token =
|
|
102
|
+
self.remember_token = User.digest(User.new_remember_token)
|
|
95
103
|
end
|
|
96
104
|
end
|
|
97
105
|
end
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
module Adminpanel
|
|
2
|
+
module Base
|
|
3
|
+
extend ActiveSupport::Concern
|
|
4
|
+
#instance methods
|
|
5
|
+
# static(class) methods
|
|
6
|
+
module ClassMethods
|
|
7
|
+
|
|
8
|
+
def mount_images(relation)
|
|
9
|
+
has_many relation, :dependent => :destroy
|
|
10
|
+
accepts_nested_attributes_for relation, :allow_destroy => true
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def form_attributes
|
|
14
|
+
[{
|
|
15
|
+
'name' => {
|
|
16
|
+
'type' => 'text_field',
|
|
17
|
+
'label' => 'name'
|
|
18
|
+
}
|
|
19
|
+
}]
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def display_name
|
|
23
|
+
'please overwrite self.display_name'
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def get_attribute_label(field)
|
|
27
|
+
form_attributes.each do |attribute|
|
|
28
|
+
attribute.each do |name, properties|
|
|
29
|
+
if name == field
|
|
30
|
+
return properties["label"]
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
return "field #{field} 'label' property not found :("
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def get_attribute_placeholder(field)
|
|
38
|
+
form_attributes.each do |attribute|
|
|
39
|
+
attribute.each do |name, properties|
|
|
40
|
+
if name == field
|
|
41
|
+
return properties['placeholder']
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
return "field #{field} 'placeholder' property not found :("
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def display_attributes(type)
|
|
49
|
+
display_attributes = []
|
|
50
|
+
form_attributes.each do |attribute|
|
|
51
|
+
attribute.each do |name, properties|
|
|
52
|
+
if properties['show'].nil? ||
|
|
53
|
+
properties['show'] == 'true' ||
|
|
54
|
+
properties['show'] == type
|
|
55
|
+
display_attributes << attribute
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
return display_attributes
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def has_images?
|
|
64
|
+
form_attributes.each do |fields|
|
|
65
|
+
fields.each do |attribute, properties|
|
|
66
|
+
if properties['type'] == 'adminpanel_file_field'
|
|
67
|
+
return true
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
return false
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def get_image_relationship
|
|
75
|
+
form_attributes.each do |fields|
|
|
76
|
+
fields.each do |attribute, properties|
|
|
77
|
+
if properties['type'] == 'adminpanel_file_field'
|
|
78
|
+
return attribute
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
return false
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def belongs_to_relationships
|
|
86
|
+
belongs_to_classes = []
|
|
87
|
+
form_attributes.each do |fields|
|
|
88
|
+
fields.each do |attribute, properties|
|
|
89
|
+
if properties['type'] == 'belongs_to'
|
|
90
|
+
belongs_to_classes << properties['model'].classify.constantize
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
return belongs_to_classes
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
def has_many_relationships
|
|
98
|
+
has_many_classes = []
|
|
99
|
+
form_attributes.each do |fields|
|
|
100
|
+
fields.each do |attribute, properties|
|
|
101
|
+
if properties['type'] == 'has_many'
|
|
102
|
+
has_many_classes << properties['model'].classify.constantize
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
return has_many_classes
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
def icon
|
|
110
|
+
'truck'
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
def gallery_children
|
|
114
|
+
nil
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
def routes_options
|
|
118
|
+
{ path: display_name.pluralize(I18n.default_locale).downcase }
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
def has_route?(route)
|
|
122
|
+
if (!exlude?(route)) && include_route(route)
|
|
123
|
+
true
|
|
124
|
+
else
|
|
125
|
+
false
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
private
|
|
130
|
+
def exlude?(route)
|
|
131
|
+
if routes_options[:except].nil?
|
|
132
|
+
false
|
|
133
|
+
elsif routes_options[:except].include?(route)
|
|
134
|
+
true
|
|
135
|
+
else
|
|
136
|
+
false
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
def include_route(route)
|
|
141
|
+
if routes_options[:only].nil? || routes_options[:only].include?(route)
|
|
142
|
+
true
|
|
143
|
+
else
|
|
144
|
+
false
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
end
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
module Adminpanel
|
|
2
|
+
module Galleryzation
|
|
3
|
+
extend ActiveSupport::Concern
|
|
4
|
+
|
|
5
|
+
included do
|
|
6
|
+
before_create :set_position
|
|
7
|
+
before_destroy :rearrange_positions
|
|
8
|
+
default_scope { order("position ASC")}
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def move_to_better_position
|
|
12
|
+
if self.position > 1
|
|
13
|
+
conflicting_gallery = get_conflicting_gallery(position - 1)
|
|
14
|
+
|
|
15
|
+
self.update_attribute(:position, self.position - 1)
|
|
16
|
+
|
|
17
|
+
conflicting_gallery.update_attribute(
|
|
18
|
+
:position, conflicting_gallery.position + 1
|
|
19
|
+
)
|
|
20
|
+
true
|
|
21
|
+
else
|
|
22
|
+
false
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def move_to_worst_position
|
|
27
|
+
records = self.class.count
|
|
28
|
+
if self.position < records
|
|
29
|
+
conflicting_gallery = get_conflicting_gallery(position + 1)
|
|
30
|
+
|
|
31
|
+
update_attribute(:position, self.position + 1)
|
|
32
|
+
|
|
33
|
+
conflicting_gallery.update_attribute(
|
|
34
|
+
:position, conflicting_gallery.position - 1
|
|
35
|
+
)
|
|
36
|
+
true
|
|
37
|
+
else
|
|
38
|
+
false
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
private
|
|
43
|
+
def get_conflicting_gallery(conflicting_position)
|
|
44
|
+
self.class.where(
|
|
45
|
+
self.class.relation_field => self.send(self.class.relation_field)
|
|
46
|
+
).find_by_position(conflicting_position)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def rearrange_positions
|
|
50
|
+
unarranged_galleries = self.class.where(self.class.relation_field => self.send(self.class.relation_field)).where("position > ?", self.position)
|
|
51
|
+
unarranged_galleries.each do |gallery|
|
|
52
|
+
gallery.update_attribute(:position, gallery.position - 1)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def set_position
|
|
58
|
+
last_record = self.class.where(self.class.relation_field => self.send(self.class.relation_field)).last
|
|
59
|
+
if last_record.nil?
|
|
60
|
+
self.position = 1
|
|
61
|
+
else
|
|
62
|
+
self.position = last_record.position + 1
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
data/app/models/contact.rb
CHANGED
|
@@ -2,22 +2,29 @@ class Contact
|
|
|
2
2
|
include ActiveModel::Validations
|
|
3
3
|
include ActiveModel::Conversion
|
|
4
4
|
extend ActiveModel::Naming
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
attr_accessor :name, :email, :subject, :body
|
|
7
|
-
|
|
8
|
-
validates_presence_of :name
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
validates_presence_of :
|
|
12
|
-
validates_presence_of :body
|
|
7
|
+
|
|
8
|
+
validates_presence_of :name, message: "#{I18n.t('model.attributes.name')} #{I18n.t('activerecord.errors.messages.blank')}"
|
|
9
|
+
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
|
|
10
|
+
validates_format_of :email, :with => VALID_EMAIL_REGEX, message: "#{I18n.t('model.attributes.email')} #{I18n.t('activerecord.errors.messages.invalid')}"
|
|
11
|
+
validates_presence_of :body, message: "#{I18n.t('model.attributes.body')} #{I18n.t('activerecord.errors.messages.blank')}"
|
|
13
12
|
|
|
14
13
|
def initialize(attributes = {})
|
|
15
14
|
attributes.each do |name, value|
|
|
16
15
|
send("#{name}=", value)
|
|
17
16
|
end
|
|
18
17
|
end
|
|
19
|
-
|
|
18
|
+
|
|
19
|
+
def self.display_name
|
|
20
|
+
'Correo'
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.get_attribute_label(label)
|
|
24
|
+
return label
|
|
25
|
+
end
|
|
26
|
+
|
|
20
27
|
def persisted?
|
|
21
28
|
false
|
|
22
29
|
end
|
|
23
|
-
end
|
|
30
|
+
end
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
<% provide(:page_title, "Google Analytics") -%>
|
|
1
2
|
<% content_for :scripts do %>
|
|
2
3
|
<%#= javascript_include_tag "adminpanel/analytics/analytics" %>
|
|
3
4
|
<% end %>
|
|
4
5
|
<div class="row-fluid">
|
|
5
6
|
<div class="widget widget-padding span12">
|
|
6
7
|
<div class="widget-header">
|
|
7
|
-
<i class="
|
|
8
|
+
<i class="fa fa-dashboard"></i><h5>Estadísticas del Sitio</h5>
|
|
8
9
|
</div>
|
|
9
10
|
<%= content_tag "div", :id => "graphic-container", :class => "widget-body", :data => { :visits => @visits, :dates => @visitDates } do %>
|
|
10
11
|
<% end %>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
content_tag(
|
|
6
6
|
:i,
|
|
7
7
|
nil,
|
|
8
|
-
:class => '
|
|
8
|
+
:class => 'fa fa-plus-circle fa-2x') +
|
|
9
9
|
content_tag(
|
|
10
10
|
:span,
|
|
11
11
|
I18n.t("action.create") + " #{@model.display_name} para #{model}",
|
|
@@ -36,12 +36,11 @@
|
|
|
36
36
|
<tr>
|
|
37
37
|
<td><%= link_to category.name, category_path(category) %></td>
|
|
38
38
|
<td>
|
|
39
|
-
<%=
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
:data => { :confirm => "Eliminar #{category.name}?"} %>
|
|
39
|
+
<%= render 'shared/show_icon_button', resource: category %>
|
|
40
|
+
|
|
41
|
+
<%= render 'shared/edit_icon_button', resource: category %>
|
|
42
|
+
|
|
43
|
+
<%= render 'shared/delete_icon_button', resource: category %>
|
|
45
44
|
</td>
|
|
46
45
|
</tr>
|
|
47
46
|
<% end %>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<%= custom_form_for(resource, :url => {:action => :create, :model => params[:model], :model_name => params[:model_name], :currentcontroller => params[:currentcontroller]}, :remote => true, :html => {:class => "form-horizontal", :id => "new-category-form"}) do |f| -%>
|
|
1
|
+
<%= custom_form_for(resource, :url => {:action => :create, :model => params[:model], :model_name => params[:model_name], :currentcontroller => params[:currentcontroller], :belongs_request => params[:belongs_request]}, :remote => true, :html => {:class => "form-horizontal", :id => "new-category-form"}) do |f| -%>
|
|
2
2
|
<div class="row-fluid">
|
|
3
3
|
<div class="modal-body">
|
|
4
4
|
<%= render 'shared/error_messages', :object => resource %>
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
</div>
|
|
9
9
|
<div class="modal-footer">
|
|
10
10
|
<button id="modal-button" class="btn" data-dismiss="modal" aria-hidden="true"><%= I18n.t('action.close') %></button>
|
|
11
|
-
<%= f.submit t("action.add") + " " + @model.display_name, :disable_with => t("action.submitting"), :id =>"new-#{@model.name.demodulize}-button" %>
|
|
11
|
+
<%= f.submit t("action.add") + " " + @model.display_name, data:{:disable_with => t("action.submitting")}, :id =>"new-#{@model.name.demodulize}-button" %>
|
|
12
12
|
</div>
|
|
13
13
|
<% end -%>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// $("#modal-button").trigger("click");
|
|
2
2
|
$('#new-category').modal('toggle');
|
|
3
3
|
row = "<tr><td><%= escape_javascript link_to resource.name, category_path(resource) %></td>";
|
|
4
|
-
row = row + "<td><%= escape_javascript link_to content_tag(:i, nil, :class => '
|
|
5
|
-
row = row + "<%= escape_javascript link_to content_tag(:i, nil, :class => '
|
|
4
|
+
row = row + "<td><%= escape_javascript link_to content_tag(:i, nil, :class => 'fa fa-pencil'), edit_category_path(category), :title => 'Editar' %> ";
|
|
5
|
+
row = row + "<%= escape_javascript link_to content_tag(:i, nil, :class => 'fa fa-remove'),[category], :title => 'Editar', :method => :delete %></td>";
|
|
6
6
|
row = row + "</tr>";
|
|
7
7
|
$("#<%= resource.model %>-table").append(row);
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
<tr>
|
|
3
3
|
<td><%= link_to image_tag(gallery.file_url(:thumb)), gallery_path(gallery) %></td>
|
|
4
4
|
<td>
|
|
5
|
-
<%= link_to content_tag(:i, nil, :class => "
|
|
6
|
-
<%= link_to content_tag(:i, nil, :class => "
|
|
5
|
+
<%= link_to content_tag(:i, nil, :class => "fa fa-chevron-up"), move_to_better_gallery_path(gallery), :method => :put, :remote => true %>
|
|
6
|
+
<%= link_to content_tag(:i, nil, :class => "fa fa-chevron-down"), move_to_worst_gallery_path(gallery), :method => :put, :remote => true %>
|
|
7
7
|
</td>
|
|
8
8
|
<td>
|
|
9
|
-
<%=
|
|
10
|
-
<%=
|
|
11
|
-
|
|
12
|
-
%>
|
|
9
|
+
<%= render 'shared/show_icon_button', resource: gallery %>
|
|
10
|
+
<%= render 'shared/edit_icon_button', resource: gallery %>
|
|
11
|
+
|
|
12
|
+
<%= render 'shared/delete_icon_button', resource: gallery %>
|
|
13
13
|
</td>
|
|
14
14
|
</tr>
|
|
15
|
-
<% end %>
|
|
15
|
+
<% end %>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<%= provide(:page_title,
|
|
1
|
+
<%= provide(:page_title, @model.display_name.pluralize(I18n.default_locale)) %>
|
|
2
2
|
<div class="row-fluid">
|
|
3
3
|
<%=
|
|
4
4
|
link_to(
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
content_tag(
|
|
8
8
|
:i,
|
|
9
9
|
nil,
|
|
10
|
-
:class => '
|
|
10
|
+
:class => 'fa fa-plus-circle fa-2x'
|
|
11
11
|
) +
|
|
12
12
|
content_tag(
|
|
13
13
|
:span,
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
),
|
|
17
17
|
:class => "btn btn-box span2"
|
|
18
18
|
),
|
|
19
|
-
new_gallery_path
|
|
19
|
+
new_gallery_path,
|
|
20
|
+
data: { no_turbolink: true }
|
|
20
21
|
)
|
|
21
22
|
%>
|
|
22
23
|
</div>
|
|
@@ -24,8 +25,8 @@
|
|
|
24
25
|
<div class="row-fluid">
|
|
25
26
|
<div class="widget widget-padding span12">
|
|
26
27
|
<div class="widget-header">
|
|
27
|
-
|
|
28
|
-
<h5><%=
|
|
28
|
+
<%= content_tag :i, nil, class: "fa fa-#{@model.icon}" %>
|
|
29
|
+
<h5><%= @model.display_name.pluralize(I18n.default_locale) %></h5>
|
|
29
30
|
</div>
|
|
30
31
|
<div class="widget-body">
|
|
31
32
|
<div class="dataTables_wrapper form-inline">
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
<td><%= link_to section.name, section_path(section) %></td>
|
|
10
10
|
<td><%= strip_tags section.description %></td>
|
|
11
11
|
<td>
|
|
12
|
-
<%=
|
|
12
|
+
<%= render 'shared/edit_icon_button', resource: section, resource_name: @model.display_name %>
|
|
13
13
|
</td>
|
|
14
14
|
</tr>
|
|
15
15
|
<% end %>
|
|
16
16
|
|
|
17
|
-
</table>
|
|
17
|
+
</table>
|
|
@@ -3,14 +3,16 @@
|
|
|
3
3
|
<% breadcrumb_add(@section.name, section_path(@section)) %>
|
|
4
4
|
<div class="row-fluid">
|
|
5
5
|
<div class = "widget widget-padding span12">
|
|
6
|
-
<div class = "widget-header"><i class = "
|
|
6
|
+
<div class = "widget-header"><i class = "fa fa-tasks"></i><h5><%= @section.name %></h5></div>
|
|
7
7
|
<div class = "widget-body">
|
|
8
8
|
<div class = "widget-forms clearfix">
|
|
9
9
|
<%= custom_form_for(@section, :url => section_path(@section)) do |f| %>
|
|
10
10
|
<%= render 'shared/error_messages', :object => @section %>
|
|
11
11
|
|
|
12
12
|
<% if @section.has_description %>
|
|
13
|
-
|
|
13
|
+
<div style="display:none;">
|
|
14
|
+
<%= f.hidden_field 'description', :id => "description-field", :value => @section.description %>
|
|
15
|
+
</div>
|
|
14
16
|
<%= f.wysiwyg_field 'description', 'label' => I18n.t('section.description'), :name => 'description' %>
|
|
15
17
|
<%= content_for :scripts do %>
|
|
16
18
|
<script type="text/javascript">
|
|
@@ -33,7 +35,7 @@
|
|
|
33
35
|
</div>
|
|
34
36
|
</div>
|
|
35
37
|
<div class = "widget-footer">
|
|
36
|
-
<%= f.submit t("action.save"), :disable_with => t("action.submitting"), :id => "save-button" %>
|
|
38
|
+
<%= f.submit t("action.save"), data: {:disable_with => t("action.submitting")}, :id => "save-button" %>
|
|
37
39
|
</div>
|
|
38
40
|
<% end -%>
|
|
39
41
|
</div>
|