caboose-cms 0.5.235 → 0.5.236
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/assets/javascripts/caboose/admin_media_index.js +37 -1
- data/app/controllers/caboose/media_controller.rb +7 -0
- data/app/views/caboose/media/admin_edit_description.html.erb +32 -0
- data/app/views/caboose/media/admin_index.html.erb +1 -0
- data/config/routes.rb +1 -0
- data/lib/caboose/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MmJhOGVmMjM4NDEyNWU3NDllNmI0M2Y5MDAzNTQ5MzcyY2VkZDI5MQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MDE0MmZkZjIxZjBjYzc2MWUwNzU2YTgxNzk5YjExZjhjYzI3MmVlZA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZmUxYjA5ZWUzY2Q5MzRiZDYxOTFiZDkyMGFkOGMzNDBlNDYzMTk4ZTllNGRk
|
10
|
+
YzJiM2Y0NmYyZTE0ZjljNTJlNDM3Y2E4ZjIyYzg1MTQ4NjM4ZWQzMDNkMmIw
|
11
|
+
OGM1ZjBlNzFkY2VlOWNkNjk4OGI1NjhiZTI0ZGNmZmU4MzgyOWQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YmIyMjhmMmZhMWI1M2FmMWRmZTc4MWUwNTE0NWU1M2FmOTQ4Y2I2MDlmMTE5
|
14
|
+
MjRiOWEwNDE4ZGI5OTE4YzRkNmQ3MjdmODVkNGM5Y2FhMzdjZWIxYmNjMzBi
|
15
|
+
ZTU2YzVlZDBjODhiYzY1NWVhMzVhZjc0Y2ZmZTVmODMwMDU5Njk=
|
@@ -237,7 +237,10 @@ MediaController.prototype = {
|
|
237
237
|
.addClass('media')
|
238
238
|
.data('media_id', m.id)
|
239
239
|
.click(function(e) { that.select_media($(this).data('media_id')); })
|
240
|
-
.append($('<span/>').addClass('name').html(m.name))
|
240
|
+
.append($('<span/>').addClass('name').html(m.name).click(function(e) {
|
241
|
+
e.stopPropagation();
|
242
|
+
that.edit_media_description($(this).parent().data('media_id'));
|
243
|
+
}))
|
241
244
|
if (m.image_urls)
|
242
245
|
li.append($('<img/>').attr('src', m.image_urls.tiny_url));
|
243
246
|
if (that.selected_media.indexOf(m.id) > -1)
|
@@ -330,6 +333,39 @@ MediaController.prototype = {
|
|
330
333
|
});
|
331
334
|
},
|
332
335
|
|
336
|
+
edit_media_description: function(media_id)
|
337
|
+
{
|
338
|
+
var that = this;
|
339
|
+
caboose_modal_url('/admin/media/' + media_id + '/description');
|
340
|
+
|
341
|
+
//var div = $('<div/>').attr('id', 'media_' + media_id + '_description');
|
342
|
+
//$('#media').append(div);
|
343
|
+
//new ModelBinder({
|
344
|
+
// name: 'Media',
|
345
|
+
// id: media_id,
|
346
|
+
// update_url: '/admin/media/' + media_id,
|
347
|
+
// authenticity_token: that.authenticity_token,
|
348
|
+
// attributes: [
|
349
|
+
// {
|
350
|
+
// name: 'description', nice_name: 'Description', type: 'textarea', value: '', width: 400, height: 100, fixed_placeholder: true,
|
351
|
+
// after_update: function() { $('#media_' + media_id + '_description_container').remove(); },
|
352
|
+
// after_cancel: function() { $('#media_' + media_id + '_description_container').remove(); }
|
353
|
+
// }
|
354
|
+
// ]
|
355
|
+
//});
|
356
|
+
//var options = {
|
357
|
+
// iframe: true,
|
358
|
+
// innerWidth: 200,
|
359
|
+
// innerHeight: 50,
|
360
|
+
// scrolling: false,
|
361
|
+
// transition: 'fade',
|
362
|
+
// closeButton: false,
|
363
|
+
// onComplete: caboose_fix_colorbox,
|
364
|
+
// opacity: 0.50
|
365
|
+
//};
|
366
|
+
//setTimeout(function() { $('#media_' + media_id + '_description_container').colorbox(options); }, 2000);
|
367
|
+
},
|
368
|
+
|
333
369
|
//============================================================================
|
334
370
|
|
335
371
|
select_category: function(cat_id)
|
@@ -62,6 +62,13 @@ module Caboose
|
|
62
62
|
@media = Media.find(params[:id])
|
63
63
|
render :layout => 'caboose/admin'
|
64
64
|
end
|
65
|
+
|
66
|
+
# GET /admin/media/:id/description
|
67
|
+
def admin_edit_description
|
68
|
+
return unless user_is_allowed('media', 'edit')
|
69
|
+
@media = Media.find(params[:id])
|
70
|
+
render :layout => 'caboose/modal'
|
71
|
+
end
|
65
72
|
|
66
73
|
# PUT /admin/media/:id
|
67
74
|
def admin_update
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<%
|
2
|
+
m = @media
|
3
|
+
%>
|
4
|
+
<h1>Edit Description</h1>
|
5
|
+
<p><div id='media_<%= m.id %>_description' ></div></p>
|
6
|
+
|
7
|
+
<div id='message'></div>
|
8
|
+
<p><input type='button' value='Close' onclick="modal.close();" /></p>
|
9
|
+
|
10
|
+
<% content_for :caboose_js do %>
|
11
|
+
<%= javascript_include_tag "caboose/model/all" %>
|
12
|
+
<script type="text/javascript">
|
13
|
+
|
14
|
+
var modal = false;
|
15
|
+
$(window).load(function() {
|
16
|
+
modal = new CabooseModal(600);
|
17
|
+
});
|
18
|
+
|
19
|
+
$(document).ready(function() {
|
20
|
+
m = new ModelBinder({
|
21
|
+
name: 'Media',
|
22
|
+
id: <%= m.id %>,
|
23
|
+
update_url: '/admin/media/<%= m.id %>',
|
24
|
+
authenticity_token: '<%= form_authenticity_token %>',
|
25
|
+
attributes: [
|
26
|
+
{ name: 'description' , nice_name: 'Description' , type: 'textarea' , value: <%= raw Caboose.json(m.description) %>, width: 560, height: 200, fixed_placeholder: false }
|
27
|
+
]
|
28
|
+
});
|
29
|
+
});
|
30
|
+
|
31
|
+
</script>
|
32
|
+
<% end %>
|
data/config/routes.rb
CHANGED
@@ -215,6 +215,7 @@ Caboose::Engine.routes.draw do
|
|
215
215
|
get "/admin/media/json" => "media#admin_json"
|
216
216
|
get "/admin/media/:id/process" => "media#admin_process"
|
217
217
|
get "/admin/media/:id/finished" => "media#admin_process_finished"
|
218
|
+
get "/admin/media/:id/description" => "media#admin_edit_description"
|
218
219
|
get "/admin/media/:id" => "media#admin_edit"
|
219
220
|
put "/admin/media/:id" => "media#admin_update"
|
220
221
|
post "/admin/media/:id/image" => "media#admin_update_image"
|
data/lib/caboose/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caboose-cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.236
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
@@ -881,6 +881,7 @@ files:
|
|
881
881
|
- app/views/caboose/login/reset_password_form.html.erb
|
882
882
|
- app/views/caboose/login_mailer/forgot_password_email.html.erb
|
883
883
|
- app/views/caboose/media/admin_edit.html.erb
|
884
|
+
- app/views/caboose/media/admin_edit_description.html.erb
|
884
885
|
- app/views/caboose/media/admin_index.html.erb
|
885
886
|
- app/views/caboose/modal/index.html.erb
|
886
887
|
- app/views/caboose/modification_value_input_fields/admin_edit.html.erb
|