adminpanel 2.1.5 → 2.1.6
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/javascripts/adminpanel/bootstrap-datepicker.js +1135 -1135
- data/app/assets/javascripts/adminpanel/bootstrap-timepicker.js +8 -8
- data/app/assets/stylesheets/adminpanel/{datepicker.css → datepicker.min.css} +0 -0
- data/app/controllers/adminpanel/auths_controller.rb +3 -3
- data/app/helpers/adminpanel/adminpanel_form_builder.rb +111 -143
- data/app/models/concerns/adminpanel/sitemap.rb +3 -2
- data/lib/adminpanel/version.rb +1 -1
- metadata +3 -3
@@ -700,16 +700,16 @@
|
|
700
700
|
}
|
701
701
|
var templateContent = '<table class="'+ (this.showSeconds ? 'show-seconds' : '') +' '+ (this.showMeridian ? 'show-meridian' : '') +'">'+
|
702
702
|
'<tr>'+
|
703
|
-
'<td><a href="#" data-action="incrementHour"><i class="
|
703
|
+
'<td><a href="#" data-action="incrementHour"><i class="fa fa-chevron-up"></i></a></td>'+
|
704
704
|
'<td class="separator"> </td>'+
|
705
|
-
'<td><a href="#" data-action="incrementMinute"><i class="
|
705
|
+
'<td><a href="#" data-action="incrementMinute"><i class="fa fa-chevron-up"></i></a></td>'+
|
706
706
|
(this.showSeconds ?
|
707
707
|
'<td class="separator"> </td>'+
|
708
|
-
'<td><a href="#" data-action="incrementSecond"><i class="
|
708
|
+
'<td><a href="#" data-action="incrementSecond"><i class="fa fa-chevron-up"></i></a></td>'
|
709
709
|
: '') +
|
710
710
|
(this.showMeridian ?
|
711
711
|
'<td class="separator"> </td>'+
|
712
|
-
'<td class="meridian-column"><a href="#" data-action="toggleMeridian"><i class="
|
712
|
+
'<td class="meridian-column"><a href="#" data-action="toggleMeridian"><i class="fa fa-chevron-up"></i></a></td>'
|
713
713
|
: '') +
|
714
714
|
'</tr>'+
|
715
715
|
'<tr>'+
|
@@ -726,16 +726,16 @@
|
|
726
726
|
: '') +
|
727
727
|
'</tr>'+
|
728
728
|
'<tr>'+
|
729
|
-
'<td><a href="#" data-action="decrementHour"><i class="
|
729
|
+
'<td><a href="#" data-action="decrementHour"><i class="fa fa-chevron-down"></i></a></td>'+
|
730
730
|
'<td class="separator"></td>'+
|
731
|
-
'<td><a href="#" data-action="decrementMinute"><i class="
|
731
|
+
'<td><a href="#" data-action="decrementMinute"><i class="fa fa-chevron-down"></i></a></td>'+
|
732
732
|
(this.showSeconds ?
|
733
733
|
'<td class="separator"> </td>'+
|
734
|
-
'<td><a href="#" data-action="decrementSecond"><i class="
|
734
|
+
'<td><a href="#" data-action="decrementSecond"><i class="fa fa-chevron-down"></i></a></td>'
|
735
735
|
: '') +
|
736
736
|
(this.showMeridian ?
|
737
737
|
'<td class="separator"> </td>'+
|
738
|
-
'<td><a href="#" data-action="toggleMeridian"><i class="
|
738
|
+
'<td><a href="#" data-action="toggleMeridian"><i class="fa fa-chevron-down"></i></a></td>'
|
739
739
|
: '') +
|
740
740
|
'</tr>'+
|
741
741
|
'</table>';
|
File without changes
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module Adminpanel
|
2
2
|
class AuthsController < ApplicationController
|
3
3
|
private
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
def auth_params
|
5
|
+
params.require(:auth).permit(:name, :value, :key)
|
6
|
+
end
|
7
7
|
end
|
8
8
|
end
|
@@ -8,51 +8,24 @@ module Adminpanel
|
|
8
8
|
alias_method :number_field_original, :number_field
|
9
9
|
alias_method :email_field_original, :email_field
|
10
10
|
alias_method :file_field_original, :file_field
|
11
|
+
# alias_method :select_original, :select
|
11
12
|
|
12
13
|
def text_field(name, *args)
|
13
|
-
|
14
|
+
base_layout( name, *args, 'text_field_original' )
|
14
15
|
end
|
15
16
|
|
16
17
|
def file_field(name, *args)
|
17
|
-
|
18
|
+
image_input = base_layout(name, *args, 'file_field_original')
|
18
19
|
|
19
|
-
if object.nil?
|
20
|
-
|
20
|
+
if !object.nil? && !object.new_record? #if not new record
|
21
|
+
"#{thumbnail_layout(name)}#{image_input}".html_safe
|
21
22
|
else
|
22
|
-
|
23
|
-
@template.content_tag :div, :class => 'controls' do
|
24
|
-
@template.image_tag object.send("#{name}_url", :thumb)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
"#{thumbnail}#{image}".html_safe
|
28
|
-
|
23
|
+
image_input
|
29
24
|
end
|
30
25
|
end
|
31
26
|
|
32
27
|
def gallery_field(name, *args)
|
33
|
-
|
34
|
-
label = options['label']
|
35
|
-
options.delete('label')
|
36
|
-
|
37
|
-
@template.content_tag :div, :class => "control-group" do
|
38
|
-
label = @template.content_tag(:label, label, :class => "control-label")
|
39
|
-
input = @template.content_tag :div, :class => "controls" do
|
40
|
-
input = file_field_original(name, *args << options)
|
41
|
-
hidden_input = hidden_field(:_destroy)
|
42
|
-
delete_button = @template.content_tag(:button, I18n.t("action.delete"), :class => "btn btn-danger remove_fields")
|
43
|
-
|
44
|
-
if object.nil? || object.new_record?
|
45
|
-
"#{input}#{hidden_input}#{delete_button}".html_safe
|
46
|
-
else
|
47
|
-
thumbnail = @template.content_tag :div, :class => 'control-group' do
|
48
|
-
@template.image_tag object.send("#{name}_url", :thumb)
|
49
|
-
end
|
50
|
-
|
51
|
-
"#{thumbnail}#{input}#{hidden_input}#{delete_button}".html_safe
|
52
|
-
end
|
53
|
-
end
|
54
|
-
"#{label}#{input}".html_safe
|
55
|
-
end
|
28
|
+
base_layout(name, *args, 'gallery_base')
|
56
29
|
end
|
57
30
|
|
58
31
|
def wysiwyg_field(name, *args)
|
@@ -60,11 +33,11 @@ module Adminpanel
|
|
60
33
|
options = args.extract_options!
|
61
34
|
options.reverse_merge! class: 'wysihtml5 span7'
|
62
35
|
|
63
|
-
|
36
|
+
base_layout( name, options, 'text_area_original' )
|
64
37
|
end
|
65
38
|
|
66
39
|
def text_area(name, *args)
|
67
|
-
|
40
|
+
base_layout( name, *args, 'text_area_original' )
|
68
41
|
end
|
69
42
|
|
70
43
|
# def radio_button_group(name, buttons, options)
|
@@ -95,27 +68,7 @@ module Adminpanel
|
|
95
68
|
end
|
96
69
|
|
97
70
|
def boolean(name, *args)
|
98
|
-
|
99
|
-
|
100
|
-
@template.content_tag(
|
101
|
-
:div,
|
102
|
-
@template.content_tag(
|
103
|
-
:div,
|
104
|
-
options['label'],
|
105
|
-
:class => 'control-label') +
|
106
|
-
@template.content_tag(
|
107
|
-
:div,
|
108
|
-
@template.content_tag(
|
109
|
-
:label,
|
110
|
-
check_box(
|
111
|
-
name
|
112
|
-
),
|
113
|
-
:class => 'checkbox'
|
114
|
-
),
|
115
|
-
:class => 'controls'
|
116
|
-
),
|
117
|
-
:class => 'control-group'
|
118
|
-
)
|
71
|
+
base_layout(name, *args, 'boolean_base')
|
119
72
|
end
|
120
73
|
|
121
74
|
def select(name, select_options, *args)
|
@@ -132,15 +85,15 @@ module Adminpanel
|
|
132
85
|
end
|
133
86
|
|
134
87
|
def number_field(name, *args)
|
135
|
-
|
88
|
+
base_layout( name, *args, 'number_field_original' )
|
136
89
|
end
|
137
90
|
|
138
91
|
def password_field(name, *args)
|
139
|
-
|
92
|
+
base_layout( name, *args, 'password_field_original' )
|
140
93
|
end
|
141
94
|
|
142
95
|
def email_field(name, *args)
|
143
|
-
|
96
|
+
base_layout( name, *args, 'email_field_original' )
|
144
97
|
end
|
145
98
|
|
146
99
|
def submit(name, *args)
|
@@ -150,110 +103,125 @@ module Adminpanel
|
|
150
103
|
super(name, *args << options)
|
151
104
|
end
|
152
105
|
|
153
|
-
def datepicker(name, *args)
|
154
|
-
|
155
|
-
options = args.extract_options!
|
156
106
|
|
157
|
-
|
158
|
-
|
159
|
-
label = options['label']
|
160
|
-
options.delete('label')
|
161
|
-
|
162
|
-
@template.content_tag :div, :class => "control-group" do
|
163
|
-
@template.content_tag(:label, label, :class => "control-label") +
|
164
|
-
@template.content_tag(
|
165
|
-
:div,
|
166
|
-
@template.content_tag(
|
167
|
-
:div,
|
168
|
-
text_field_original(name, *args << options) +
|
169
|
-
@template.content_tag(
|
170
|
-
:span,
|
171
|
-
@template.content_tag(
|
172
|
-
:i,
|
173
|
-
nil,
|
174
|
-
:class => "fa fa-th"
|
175
|
-
),
|
176
|
-
:class => "add-on"
|
177
|
-
),
|
178
|
-
{
|
179
|
-
:class => "input-append date span5 datepicker datepicker-basic",
|
180
|
-
:data => {
|
181
|
-
:date_format => "dd-mm-yyyy",
|
182
|
-
:date => options[:value]
|
183
|
-
}
|
184
|
-
}
|
185
|
-
),
|
186
|
-
:class => "controls"
|
187
|
-
)
|
188
|
-
end
|
107
|
+
def datepicker(name, *args)
|
108
|
+
base_layout( name, *args, 'datepickerize_base' )
|
189
109
|
end
|
190
110
|
|
191
|
-
def prepend_field(name, *args)
|
111
|
+
# def prepend_field(name, *args)
|
112
|
+
#
|
113
|
+
# options = args.extract_options!
|
114
|
+
#
|
115
|
+
# options.reverse_merge! :label => name
|
116
|
+
# label = options['label']
|
117
|
+
# options.delete('label')
|
118
|
+
#
|
119
|
+
# options.reverse_merge! :symbol => "#"
|
120
|
+
# symbol = options[:symbol]
|
121
|
+
# options.delete(:symbol)
|
122
|
+
#
|
123
|
+
# @template.content_tag :div, :class => "control-group" do
|
124
|
+
# @template.content_tag(:label, label, :class => "control-label") +
|
125
|
+
# @template.content_tag(
|
126
|
+
# :div,
|
127
|
+
# @template.content_tag(
|
128
|
+
# :div,
|
129
|
+
# @template.content_tag(:span, symbol, :class => "add-on") +
|
130
|
+
# text_field_original(name, *args << options),
|
131
|
+
# :class => "input-prepend"
|
132
|
+
# ),
|
133
|
+
# :class => "controls"
|
134
|
+
# )
|
135
|
+
# end
|
136
|
+
# end
|
137
|
+
#
|
138
|
+
# def append_field(name, *args)
|
139
|
+
#
|
140
|
+
# options = args.extract_options!
|
141
|
+
#
|
142
|
+
# options.reverse_merge! :label => name
|
143
|
+
# label = options['label']
|
144
|
+
# options.delete('label')
|
145
|
+
#
|
146
|
+
# options.reverse_merge! :symbol => "#"
|
147
|
+
# symbol = options[:symbol]
|
148
|
+
# options.delete(:symbol)
|
149
|
+
#
|
150
|
+
# @template.content_tag :div, :class => "control-group" do
|
151
|
+
# @template.content_tag(:label, label, :class => "control-label") +
|
152
|
+
# @template.content_tag(
|
153
|
+
# :div,
|
154
|
+
# @template.content_tag(
|
155
|
+
# :div,
|
156
|
+
# text_field_original(name, *args << options) +
|
157
|
+
# @template.content_tag(:span, symbol, :class => "add-on"),
|
158
|
+
# :class => "input-append"
|
159
|
+
# ),
|
160
|
+
# :class => "controls"
|
161
|
+
# )
|
162
|
+
# end
|
163
|
+
# end
|
192
164
|
|
193
|
-
|
165
|
+
private
|
194
166
|
|
195
|
-
|
167
|
+
def base_layout(name, *args, input_type)
|
168
|
+
options = args.extract_options!
|
169
|
+
options.reverse_merge! class: 'span7'
|
196
170
|
label = options['label']
|
197
171
|
options.delete('label')
|
198
172
|
|
199
|
-
|
200
|
-
|
201
|
-
|
173
|
+
@template.content_tag :div, :class => 'control-group' do
|
174
|
+
@template.content_tag(:label, label, :class => 'control-label') +
|
175
|
+
@template.content_tag(:div, :class => 'controls') do
|
176
|
+
self.send(input_type, name, options)
|
177
|
+
end
|
178
|
+
end
|
179
|
+
end
|
202
180
|
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
181
|
+
def datepickerize_base(name, options)
|
182
|
+
options.reverse_merge! 'value' => Time.now.strftime("%d-%m-%Y")
|
183
|
+
@template.content_tag(
|
184
|
+
:div,
|
185
|
+
class: 'input-append date datepicker datepicker-basic',
|
186
|
+
data: {
|
187
|
+
date_format: 'dd-mm-yyyy',
|
188
|
+
date: options['value']
|
189
|
+
}
|
190
|
+
) do
|
191
|
+
text_field_original(name, options) +
|
192
|
+
(
|
193
|
+
@template.content_tag :span, class: 'add-on' do
|
194
|
+
@template.content_tag :i, nil, class: 'fa fa-th'
|
195
|
+
end
|
214
196
|
)
|
215
197
|
end
|
216
198
|
end
|
217
199
|
|
218
|
-
def
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
label = options['label']
|
224
|
-
options.delete('label')
|
200
|
+
def boolean_base(name, options)
|
201
|
+
@template.content_tag :label, class: 'checkbox' do
|
202
|
+
check_box(name)
|
203
|
+
end
|
204
|
+
end
|
225
205
|
|
226
|
-
|
227
|
-
|
228
|
-
|
206
|
+
def gallery_base(name, options)
|
207
|
+
file_field_input = file_field_original(name, options)
|
208
|
+
hidden_input = hidden_field(:_destroy)
|
209
|
+
delete_button = @template.content_tag(:button, I18n.t("action.delete"), :class => "btn btn-danger remove_fields")
|
229
210
|
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
@template.content_tag(
|
235
|
-
:div,
|
236
|
-
text_field_original(name, *args << options) +
|
237
|
-
@template.content_tag(:span, symbol, :class => "add-on"),
|
238
|
-
:class => "input-append"
|
239
|
-
),
|
240
|
-
:class => "controls"
|
241
|
-
)
|
211
|
+
if object.nil? || object.new_record?
|
212
|
+
"#{file_field_input}#{hidden_input}#{delete_button}".html_safe
|
213
|
+
else
|
214
|
+
"#{thumbnail_layout(name)}#{file_field_input}#{hidden_input}#{delete_button}".html_safe
|
242
215
|
end
|
243
216
|
end
|
244
217
|
|
245
|
-
def
|
246
|
-
options = args.extract_options!
|
247
|
-
options.reverse_merge! class: 'span7'
|
248
|
-
label = options['label']
|
249
|
-
options.delete('label')
|
250
|
-
|
218
|
+
def thumbnail_layout(attribute)
|
251
219
|
@template.content_tag :div, :class => 'control-group' do
|
252
|
-
@template.content_tag
|
253
|
-
|
254
|
-
self.send(parent_method, name, options)
|
220
|
+
@template.content_tag :div, :class => 'controls' do
|
221
|
+
@template.image_tag self.object.send("#{attribute}_url", :thumb)
|
255
222
|
end
|
256
223
|
end
|
257
224
|
end
|
225
|
+
|
258
226
|
end
|
259
227
|
end
|
@@ -9,10 +9,10 @@ module Adminpanel
|
|
9
9
|
after_destroy :ping_engines
|
10
10
|
end
|
11
11
|
|
12
|
+
private
|
12
13
|
def ping_urls
|
13
14
|
{
|
14
15
|
google: "http://www.google.com/webmasters/tools/ping?sitemap=%s",
|
15
|
-
ask: "http://submissions.ask.com/ping?sitemap=%s",
|
16
16
|
bing: "http://www.bing.com/webmaster/ping.aspx?siteMap=%s"
|
17
17
|
}
|
18
18
|
end
|
@@ -21,8 +21,9 @@ module Adminpanel
|
|
21
21
|
logger.info Time.now
|
22
22
|
ping_urls.each do |name, url|
|
23
23
|
request = url % CGI.escape("#{root_url}/sitemap.xml")
|
24
|
+
logger.info root_url
|
24
25
|
logger.info " Pinging #{name} with #{request}"
|
25
|
-
if Rails.env
|
26
|
+
if Rails.env != "development"
|
26
27
|
response = Net::HTTP.get_response(URI.parse(request))
|
27
28
|
logger.info " #{response.code}: #{response.message}"
|
28
29
|
logger.info " Body: #{response.body}"
|
data/lib/adminpanel/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adminpanel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jose Ramon Camacho
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-06-
|
12
|
+
date: 2014-06-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -477,7 +477,7 @@ files:
|
|
477
477
|
- app/assets/stylesheets/adminpanel/alertify.css
|
478
478
|
- app/assets/stylesheets/adminpanel/bootstrap-wysihtml5.css
|
479
479
|
- app/assets/stylesheets/adminpanel/bootstrap.css.erb
|
480
|
-
- app/assets/stylesheets/adminpanel/datepicker.css
|
480
|
+
- app/assets/stylesheets/adminpanel/datepicker.min.css
|
481
481
|
- app/assets/stylesheets/adminpanel/facybox.css
|
482
482
|
- app/assets/stylesheets/adminpanel/fullcalendar.css
|
483
483
|
- app/assets/stylesheets/adminpanel/fullcalendar.print.css
|