caboose-cms 0.6.19 → 0.6.20

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTA2NjFiZGRkMDZiMjJhNzJmNWMzZTUwN2ZhY2FkNmU2Y2M5MjNiMA==
4
+ M2E4ZjUxYTEyYzFjN2Q1ZTBlNmQ2Y2MwOGMyZjMyNmI4NDlkMjk4OQ==
5
5
  data.tar.gz: !binary |-
6
- ZmIxODVlNWMzZDAwZTBlN2MwMjczYjA5MmM3ODBlMzU4MjVmMjQ5ZA==
6
+ YmU0N2FkNDZiMjYyNjIxYjIyY2UxNjVmY2QzZTliOWZjYTAxMGQ0ZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDQ1NTk1ZDNiMjlkNmI4ZjUyZGM0ZTE2YjlhZGNlNTU3NmU1MmNiYjJkNzU1
10
- ODk1MGVmYjUzMmU0YTFkZmJhM2ZkZmJjMDZlNDYzMjNkODJjYjNhMDhkMGU0
11
- ZTY4ZjdiZDQ2NTg2MWQ4ZDljZTRhM2JkNGIyZGY4YTI0ZGJkODI=
9
+ ZjJmOGZjNzRkNzI2MmFhYjcyM2VlZGU4OTc4YWE0M2U3NjhjMmM5ZTVlMDg4
10
+ YzYyZTQxZGYxY2JiYmM0MjQyNmRkYThhOTcxMDFlNWFiYTllZjRmMTJhMTZh
11
+ YWNiOWVjZjFiMGZhZGE0MmI0ZTVlNWE3YzU2ZmQ4ZjQ3MDUzNTY=
12
12
  data.tar.gz: !binary |-
13
- NzA3ZmJhZjVjNWM0MTkxMzUwNTYwMzczZDI1MTM0ZGM3OWNhMWI5MmVlNWMx
14
- ZTc4YjlkMGU2ZTRjNWQ2NzY2Mjc2ZGI1NGNmZGE0NmEwYTNlNjZlZGQ5YjVj
15
- MmFjOTA0MjE2NjVjYTFiNWY0YWY1NWY3YTczNmM2OTI1OWNlZmU=
13
+ M2NjZjBmZDdiOTU2MDE4M2M0NjYxOWY2YmMwMWMzY2ExNTIzOTRlYzVlMDE4
14
+ MzRhMWRjN2FiZTVjNDQzY2Y2NTIxOGJmMTk5MmE1YjExM2Y2YWVmMjlkZjhj
15
+ YTEyOTExOTY5ZTE3YzAwZTdjMzBhZTk3ZWQzZjhhZDZkNzM3ZjU=
@@ -256,26 +256,34 @@ MediaController.prototype = {
256
256
  $.each(that.cat.media, function(i, m) {
257
257
  if (m.media_type == 'image' && m.processed == false)
258
258
  processing = true
259
- var li = $('<li/>')
259
+ var li = $('<li/>')
260
260
  .attr('id', 'media' + m.id)
261
261
  .addClass('media')
262
262
  .data('media_id', m.id)
263
263
  .click(function(e) { that.select_media($(this).data('media_id')); })
264
- .append($('<span/>').addClass('name').html(m.name).click(function(e) {
264
+ .append($('<span/>').addClass('name').html(m.original_name).click(function(e) {
265
265
  e.stopPropagation();
266
266
  that.edit_media_description($(this).parent().data('media_id'));
267
267
  }));
268
268
  if (m.image_urls)
269
- li.append($('<img/>').attr('src', m.image_urls.tiny_url).attr("id","image-" + m.id));
269
+ li.append($('<img/>').attr('src', m.image_urls.tiny_url).attr("id","image-" + m.id));
270
+ else if (m.original_name) {
271
+ var ext = m.original_name.match(/\.[0-9a-z]+$/i);
272
+ if (ext && ext.length > 0)
273
+ li.append($('<img/>').attr('src', '/assets/caboose/file_types/' + ext[0].replace(".","").toLowerCase() + '.png').addClass('file-icon').attr("width","80").attr("height","80"));
274
+ }
270
275
  if (that.selected_media.indexOf(m.id) > -1)
271
276
  li.addClass('selected ui-selected');
272
- if (that.allow_edit && m.image_urls)
273
- {
277
+ if (that.allow_edit && m.image_urls) {
274
278
  li.append($("<a/>")
275
279
  .html("Edit Image")
276
280
  .click(function() { that.edit_image($(this).parent().data('media_id')); })
277
281
  );
278
282
  }
283
+ if ( m.image_urls )
284
+ li.append($("<a/>").addClass("dl i").html("Download").click(function() { that.download_image($(this).parent().data('media_id')); }));
285
+ else
286
+ li.append($("<a/>").addClass("dl").html("Download").click(function() { that.download_image($(this).parent().data('media_id')); }));
279
287
  ul.append(li);
280
288
  });
281
289
  }
@@ -490,7 +498,18 @@ MediaController.prototype = {
490
498
  });
491
499
  }
492
500
  return m;
493
- },
501
+ },
502
+
503
+ download_image: function(media_id) {
504
+ var that = this;
505
+ var m = that.media_with_id(media_id);
506
+ var url = '';
507
+ if ( m.image_urls )
508
+ url = m.image_urls.original_url;
509
+ else
510
+ url = m.file_url
511
+ window.open(url);
512
+ },
494
513
 
495
514
  //============================================================================
496
515
  // Aviary
@@ -90,6 +90,7 @@
90
90
  background-size: contain;
91
91
  background-repeat: no-repeat;
92
92
  border: #666 4px solid;
93
+ text-align: center;
93
94
  img {
94
95
  max-height: 120px;
95
96
  max-width: 90%;
@@ -97,25 +98,39 @@
97
98
  span.name {
98
99
  display: block;
99
100
  position: absolute;
100
- bottom: 18px;
101
+ bottom: 18px;
102
+ font-size: 13px;
101
103
  width: 150px;
102
104
  text-align: center;
103
105
  color: #fff;
104
106
  text-decoration: none !important;
105
107
  }
108
+ .file-icon {
109
+ display: block;
110
+ width: 80px;
111
+ margin: 10px auto 0 auto;
112
+ }
106
113
  a {
107
114
  text-decoration: underline;
108
115
  cursor: pointer;
109
- display: block;
116
+ display: inline-block;
110
117
  font-size: 13px;
111
118
  position: absolute;
112
119
  bottom: 0;
120
+ left: 0;
113
121
  text-align: center;
114
- width: 100%;
115
122
  color: #000;
116
123
  &:hover {
117
124
  color: blue;
118
125
  }
126
+ &.dl {
127
+ right: 0;
128
+ left: initial;
129
+ width: 100%;
130
+ &.i {
131
+ width: auto;
132
+ }
133
+ }
119
134
  }
120
135
  &:hover {
121
136
  background-color: #fff799;
@@ -85,7 +85,7 @@ $(document).ready(function() {
85
85
  media_id: <% if @block.media_id %><%= @block.media_id %><% else %>false<% end %>,
86
86
  authenticity_token: '<%= form_authenticity_token %>',
87
87
  top_cat_id: <%= raw Caboose.json(@top_media_category.id) %>,
88
- cat_id: <% if @block.media_id %><%= @block.media.media_category_id %><% else %><%= @top_media_category.id %><% end %>,
88
+ cat_id: <% if @block.media %><%= @block.media.media_category_id %><% else %><%= @top_media_category.id %><% end %>,
89
89
  s3_upload_url: '<%= raw @s3_upload_url %>',
90
90
  aws_access_key_id: '<%= raw @aws_access_key_id %>',
91
91
  policy: '<%= raw @policy %>',
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.6.19'
2
+ VERSION = '0.6.20'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.19
4
+ version: 0.6.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-11 00:00:00.000000000 Z
11
+ date: 2015-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg
@@ -369,6 +369,24 @@ files:
369
369
  - app/assets/images/caboose/caboose_nav_black.png
370
370
  - app/assets/images/caboose/credit_cards.png
371
371
  - app/assets/images/caboose/default_user_pic.png
372
+ - app/assets/images/caboose/file_types/doc.png
373
+ - app/assets/images/caboose/file_types/docx.png
374
+ - app/assets/images/caboose/file_types/gif.png
375
+ - app/assets/images/caboose/file_types/jpeg.png
376
+ - app/assets/images/caboose/file_types/jpg.png
377
+ - app/assets/images/caboose/file_types/mp3.png
378
+ - app/assets/images/caboose/file_types/mp4.png
379
+ - app/assets/images/caboose/file_types/pdf.png
380
+ - app/assets/images/caboose/file_types/png.png
381
+ - app/assets/images/caboose/file_types/pps.png
382
+ - app/assets/images/caboose/file_types/ppt.png
383
+ - app/assets/images/caboose/file_types/pptx.png
384
+ - app/assets/images/caboose/file_types/psd.png
385
+ - app/assets/images/caboose/file_types/rtf.png
386
+ - app/assets/images/caboose/file_types/tiff.png
387
+ - app/assets/images/caboose/file_types/xls.png
388
+ - app/assets/images/caboose/file_types/xlsx.png
389
+ - app/assets/images/caboose/file_types/zip.png
372
390
  - app/assets/images/caboose/loading_black_on_white.gif
373
391
  - app/assets/images/caboose/loading_black_on_yellow.gif
374
392
  - app/assets/images/caboose/loading_green.gif