ish_manager 0.1.8.382 → 0.1.8.383

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b3577db8734f36721f678b56eaafa27a45aaced767e8d348a4eb67f0f51b2b40
4
- data.tar.gz: ff1cbed5a6fd1452341c6a96b093d2995e435d2eb7ef164d3a851578368d8361
3
+ metadata.gz: 3aae4c46f6f96a6a9caa0d44d807ca0f6e84c81d8bce8211bda475be394bf3f5
4
+ data.tar.gz: c9021cf3ec2a606fc8d6111f1dff32d17094b0fa829b0055304a93f75027c6d2
5
5
  SHA512:
6
- metadata.gz: b3be716f9fae264d5b3c28ac69c6f055565e33d09c77d5d0875aa6ba09b31c87074d2ddbcd2911fe8c110da4e83682c6da5c01d69ab7769c7481cf2bded4827a
7
- data.tar.gz: ed2dfd2a0878cd1f1cd360edf12bb76dd41cf7a01ac1485722ba6f21bda4d32982a8b90b7634cf8be2f9346a6601cdfc016abbcd1f294904804e8230b8d45e90
6
+ metadata.gz: 7f4f9255e0fa368ec06d6c1b55f5c93fa2f09ea180f32f41f59f7ce70c3b73c81cd32472258df83a115a5bab3d2e3e2c69a3e076eaf17f3e1cc520c50efab7df
7
+ data.tar.gz: 6168704327873458aa4c885277e0c96241e721ce97365bbfe9ffb6ab7299d6387cddc296778e6622113469394c514bb1586b99b77b37fd3037704cbf60b84112
@@ -33,13 +33,35 @@ const AppRouter = {
33
33
 
34
34
  $(function () {
35
35
 
36
+ var fileuploadCount = 0
36
37
  $('#fileupload').fileupload({
37
38
  dataType: 'json',
38
- done: function (e, data) {
39
- var photos = $('#photos');
40
- var tempUrl = data.result[0].thumbnail_url;
41
- $('<img/>').attr('src', tempUrl).appendTo(photos);
42
- }
39
+ success: function(ev) {
40
+ logg(ev, 'success')
41
+ ev = ev[0]
42
+ fileuploadCount += 1
43
+
44
+ var el = $('<div class="item" />')
45
+ var photosEl = $('#photos')
46
+
47
+ $('<div/>').html(fileuploadCount).appendTo(el)
48
+ $('<img/>').attr('src', ev.thumbnail_url).appendTo(el)
49
+ $('<div/>').html(ev.name).appendTo(el)
50
+ el.appendTo(photosEl)
51
+ },
52
+ error: function(err) {
53
+ logg(err, 'error')
54
+ err = err.responseJSON
55
+ fileuploadCount += 1
56
+
57
+ var el = $('<div class="item" />')
58
+ var errorsEl = $('.photos--multinew .errors')
59
+
60
+ $('<div/>').html(fileuploadCount).appendTo(el)
61
+ $('<div />').html(err.filename).appendTo(el)
62
+ $('<div />').html(err.message).appendTo(el)
63
+ el.appendTo(errorsEl)
64
+ },
43
65
  });
44
66
 
45
67
  $('*[data-confirm]').click(function(){
@@ -97,7 +119,6 @@ $(function () {
97
119
  })
98
120
 
99
121
  $(".expand-next").click(function (_e) {
100
- // logg($(this).next(), 'expand?')
101
122
  $(this).next().slideToggle()
102
123
  })
103
124
 
@@ -34,6 +34,17 @@
34
34
  overflow-x: auto;
35
35
  max-width: Max( 300px, 50vw );
36
36
  }
37
+
38
+ .errors > div {
39
+ border: 1px solid red;
40
+ }
41
+
42
+ .thumbnails {
43
+ .item {
44
+ border: 1px solid blue;
45
+ }
46
+ }
47
+
37
48
  }
38
49
 
39
50
  .row-deleted {
@@ -3,7 +3,7 @@ class IshManager::GalleriesController < IshManager::ApplicationController
3
3
  before_action :set_lists
4
4
  before_action :set_gallery, only: %w|destroy edit j_show show update update_ordering|
5
5
 
6
- # alphabetized! : )
6
+ # Alphabetized! : )
7
7
 
8
8
  def create
9
9
  params[:gallery][:shared_profiles] ||= []
@@ -19,7 +19,7 @@ class IshManager::GalleriesController < IshManager::ApplicationController
19
19
  redirect_to edit_gallery_path(@gallery)
20
20
  else
21
21
  puts! @gallery.errors.messages
22
- flash[:alert] = "Cannot create the gallery: #{@gallery.errors.full_messages}"
22
+ flash[:alert] = "Cannot create the gallery: #{@gallery.errors.full_messages.join(', ')}"
23
23
  render :action => 'new'
24
24
  end
25
25
  end
@@ -27,11 +27,10 @@ class IshManager::PhotosController < IshManager::ApplicationController
27
27
  end
28
28
 
29
29
  def j_create
30
- # find this gallery
31
30
  if params[:slug]
32
31
  gallery = Gallery.unscoped.where( :slug => params[:slug] ).first
33
32
  gallery ||= Gallery.unscoped.find params[:slug]
34
- elsif params[:gallery_id] # this one, let's normalize on id everywhere in manager.
33
+ elsif params[:gallery_id]
35
34
  gallery = Gallery.unscoped.find( params[:gallery_id] )
36
35
  gallery ||= Gallery.unscoped.where( :slug => params[:gallery_id] ).first
37
36
  end
@@ -41,7 +40,6 @@ class IshManager::PhotosController < IshManager::ApplicationController
41
40
  @photo.is_public = true
42
41
  @photo.gallery = gallery
43
42
 
44
- # cache
45
43
  @photo.gallery.touch
46
44
 
47
45
  if @photo.save
@@ -55,7 +53,10 @@ class IshManager::PhotosController < IshManager::ApplicationController
55
53
  }
56
54
  render :json => [ j ]
57
55
  else
58
- render :json => { "errors" => @photo.errors }
56
+ render :json => {
57
+ message: @photo.errors.full_messages.join(", "),
58
+ filename: @photo.photo.original_filename,
59
+ }, status: 400
59
60
  end
60
61
  end
61
62
 
@@ -2,11 +2,11 @@
2
2
  -# ish_manager / galleries / show
3
3
  -#
4
4
 
5
- .galleries-show
5
+ .galleries-show.padded
6
6
  .row
7
- .col-sm-12.col-md-6
7
+ .col-md-6
8
8
  = render 'title', :gallery => @gallery
9
- .col-sm-12.col-md-6
9
+ .col-md-6
10
10
  = render 'ish_manager/photos/multinew', :gallery => @gallery
11
11
 
12
12
  .row-deleted
@@ -1,5 +1,6 @@
1
1
 
2
2
  .photos--multinew
3
3
  %h3 Add Photos
4
+ .errors
4
5
  %ul{ :id => 'photos', :class => 'thumbnails' }
5
6
  %input{ :id => 'fileupload', :type => 'file', :name => 'photo[photo]', 'data-url' => gallery_multiadd_path( gallery.id ), :multiple => '' }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.382
4
+ version: 0.1.8.383
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox