ish_manager 0.1.8.293 → 0.1.8.296

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: 003ba4fc5ca38c36425d1f37b39d8b20b1867ce3fb40d335981f5642b056107a
4
- data.tar.gz: 07f4a1584f2e74dca16ba689bc21191db95b70110f03fb50235852f25bf88ad2
3
+ metadata.gz: '0900762368466c418a8408b768fbe394d12e7f44f7a52a3cb0f976c36fc38d39'
4
+ data.tar.gz: ade02a4092251747453c5cda8681d24b35eed5844d96d4dc3da364d981cefb95
5
5
  SHA512:
6
- metadata.gz: e18578b798026116b629a2a00c0c928175d07ea0ee6e9bc8dfafcbeaac09942b589737edcb15270ac1cd4f5a851bb187116c334f7a972294db793d9ff5101c4b
7
- data.tar.gz: 8ddbc3c909e71fc40df9695fe98f963b833ee07973162f9452e9fd68c549c3ec9081b315eedc6417a63d2b55be8af46ef7dc87da91e97156e55739ab0fb9a70c
6
+ metadata.gz: 7b543d8120e6317b6b51ad4d9a8a42ef4213f54097301d9066911433da8d3b6b45dacbf457b2156c593a15651c27b09af400ba9980553ab33fea10751b45e5a4
7
+ data.tar.gz: 0ee35c37737ee2c9380455f0776852ab58b4de4a585b238c2fca6129b76a1045771e24412a1900ca55f4c066d3a70b561a4e9694efbbe616a44d21e87b90a878
@@ -62,8 +62,13 @@ ul:not(.browser-default).bullets, {
62
62
 
63
63
  /* A */
64
64
 
65
- .addToggle + * {
66
- display: none;
65
+ .addToggle::after {
66
+ content: " [<>]";
67
+ }
68
+ .addToggle {
69
+ + * {
70
+ display: none;
71
+ }
67
72
  }
68
73
  .alert {
69
74
  border: 1px solid yellow;
@@ -92,11 +97,19 @@ ul:not(.browser-default).bullets, {
92
97
  padding: .5em;
93
98
  border-radius: 8px;
94
99
  margin-bottom: .5em;
100
+ padding: 0.5em;
95
101
  }
96
102
 
97
103
 
98
104
  /* C */
99
105
 
106
+ .Card {
107
+ border: 1px solid gray;
108
+ border-radius: 8px;
109
+ display: inline-block;
110
+ margin-bottom: .5em;
111
+ }
112
+
100
113
  .center {
101
114
  text-align: center;
102
115
  }
@@ -111,8 +124,17 @@ ul:not(.browser-default).bullets, {
111
124
 
112
125
  /* D */
113
126
  /* E */
127
+ .error_explanation {
128
+ border: 1px solid red;
129
+ padding: .8em;
130
+ }
131
+
114
132
  /* F */
115
133
 
134
+ .--form {
135
+ margin-bottom: 2em;
136
+ }
137
+
116
138
  .flat-row {
117
139
  display: flex;
118
140
  flex-direction: row;
@@ -226,6 +248,13 @@ textarea.large {
226
248
  display: inline;
227
249
  }
228
250
 
251
+ /* N */
252
+
253
+ .notice {
254
+ border: 1px solid green;
255
+ padding: .8em;
256
+ }
257
+
229
258
  /* P */
230
259
  .panel-content {
231
260
  padding: .5em;
@@ -246,10 +275,7 @@ ul.inline li {
246
275
  padding-right: 1em;
247
276
  }
248
277
 
249
- .notice {
250
- border: 1px solid green;
251
- padding: .8em;
252
- }
278
+
253
279
 
254
280
  .youtube_img {
255
281
  width: 100px;
@@ -1,6 +1,7 @@
1
1
  class IshManager::GalleriesController < IshManager::ApplicationController
2
2
 
3
3
  before_action :set_lists
4
+ before_action :set_gallery, only: %w|destroy edit j_show show update|
4
5
 
5
6
  # alphabetized! : )
6
7
 
@@ -24,7 +25,6 @@ class IshManager::GalleriesController < IshManager::ApplicationController
24
25
  end
25
26
 
26
27
  def destroy
27
- @gallery = Gallery.unscoped.find params[:id]
28
28
  authorize! :destroy, @gallery
29
29
  @gallery.is_trash = true
30
30
  @gallery.save
@@ -33,27 +33,25 @@ class IshManager::GalleriesController < IshManager::ApplicationController
33
33
  end
34
34
 
35
35
  def edit
36
- @gallery = Gallery.unscoped.find params[:id]
37
36
  authorize! :edit, @gallery
38
37
  end
39
38
 
40
39
  def index
41
40
  authorize! :index, Gallery
42
41
  @galleries = Gallery.unscoped.where(
43
- :is_done.in => [false, nil],
44
- :is_trash.in => [false, nil],
45
- :user_profile => current_user.profile
42
+ # :is_done.in => [false, nil],
43
+ # :is_trash.in => [false, nil],
44
+ # :user_profile => current_user.profile
46
45
  ).order_by( :created_at => :desc )
47
46
  if params[:q]
48
47
  @galleries = @galleries.where({ :name => /#{params[:q]}/i })
49
- @galleries.selector.delete('is_done')
48
+ # @galleries.selector.delete('is_done')
50
49
  end
51
50
  @galleries = @galleries.page( params[:galleries_page] ).per( 10 )
52
51
  render params[:render_type]
53
52
  end
54
53
 
55
54
  def j_show
56
- @gallery = Gallery.unscoped.find( params[:id] )
57
55
  authorize! :show, @gallery
58
56
  respond_to do |format|
59
57
  format.json do
@@ -82,18 +80,12 @@ class IshManager::GalleriesController < IshManager::ApplicationController
82
80
  end
83
81
 
84
82
  def show
85
- begin
86
- @gallery = Gallery.unscoped.find_by :slug => params[:id]
87
- rescue
88
- @gallery = Gallery.unscoped.find params[:id]
89
- end
90
83
  authorize! :show, @gallery
91
84
  @photos = @gallery.photos.unscoped.where({ :is_trash => false })
92
85
  @deleted_photos = @gallery.photos.unscoped.where({ :is_trash => true })
93
86
  end
94
87
 
95
88
  def update
96
- @gallery = Gallery.unscoped.find params[:id]
97
89
  old_shared_profile_ids = @gallery.shared_profiles.map(&:id)
98
90
  authorize! :update, @gallery
99
91
 
@@ -116,5 +108,15 @@ class IshManager::GalleriesController < IshManager::ApplicationController
116
108
  end
117
109
  end
118
110
 
111
+ private
112
+
113
+ def set_gallery
114
+ begin
115
+ @gallery = Gallery.unscoped.find_by :slug => params[:id]
116
+ rescue
117
+ @gallery = Gallery.unscoped.find params[:id]
118
+ end
119
+ end
120
+
119
121
  end
120
122
 
@@ -51,6 +51,9 @@ class IshManager::MapsController < IshManager::ApplicationController
51
51
  send_data result
52
52
  end
53
53
 
54
+ ##
55
+ ## @TODO: move to models, yes?
56
+ ##
54
57
  def import
55
58
  authorize! :create, Map
56
59
 
@@ -65,11 +68,17 @@ class IshManager::MapsController < IshManager::ApplicationController
65
68
  contents = JSON.parse contents
66
69
  contents.deep_symbolize_keys!
67
70
 
71
+ ## Delete existing
68
72
  if params[:delete_existing]
69
73
  map_ids = contents[:maps].map { |m| m[:_id] }
70
- Map.where( :_id.in => map_ids ).destroy_all
71
-
72
74
  marker_ids = contents[:markers].map { |m| m[:_id] }
75
+
76
+ maps = Map.where( :_id.in => map_ids )
77
+ maps.each do |m|
78
+ marker_ids += m.markers.map(&:_id)
79
+ end
80
+ maps.destroy_all
81
+
73
82
  Marker.where( :_id.in => marker_ids ).destroy_all
74
83
  end
75
84
 
@@ -91,7 +91,7 @@ class IshManager::VideosController < IshManager::ApplicationController
91
91
  end
92
92
 
93
93
  def show
94
- @video = Video.unscoped.where( :youtube_id => params[:youtube_id] ).first
94
+ @video = Video.unscoped.where( :youtube_id => params[:youtube_id] ).first if params[:youtube_id].present?
95
95
  @video ||= Video.unscoped.find params[:id]
96
96
  authorize! :show, @video
97
97
 
@@ -1,7 +1,4 @@
1
1
 
2
2
  - if item.errors.any?
3
- .error-explanation
4
- %h5= t('e.there_are_errors')
5
- %ul
6
- - item.errors.full_messages.each do |msg|
7
- %li= msg
3
+ .error_explanation
4
+ = "#{pluralize(item.errors.count, "error")} prohibited this map from being saved: #{item.errors.full_messages.join(", ")}."
@@ -30,6 +30,8 @@
30
30
  = form_tag videos_path, method: :get do
31
31
  = text_field_tag :q
32
32
  = link_to '[+]', new_video_path
33
+ %li{ :class => params[:controller] == 'ish_manager/tags' ? 'active' : '' }
34
+ = link_to 'Tags', tags_path
33
35
  %ul
34
36
  %li{ class: params[:controller] == 'ish_manager/newsitems' ? 'active' : '' }= link_to '+Newsitem', new_newsitem_path
35
37
  -# %li{ :class => params[:controller] == 'ish_manager/stock_watches' ? 'active' : '' }= link_to 'Stock Watches (old m3)', stock_watches_path
@@ -4,7 +4,11 @@
4
4
 
5
5
  - url = params[:action] == 'new' ? maps_path : map_path(@map.id)
6
6
 
7
- = form_for @map, :html => { :multipart => true, class: 'maps--form' }, url: url do |f|
7
+
8
+ = form_for @map, :html => { :multipart => true, class: '--form maps--form' }, url: url do |f|
9
+ .actions
10
+ = f.submit 'Save'
11
+
8
12
  - if @map.errors.any?
9
13
  #error_explanation
10
14
  %h2= "#{pluralize(@map.errors.count, "error")} prohibited this map from being saved:"
@@ -49,6 +53,11 @@
49
53
 
50
54
  = render 'ish_manager/application/form_nonpublic', f: f, model: @map
51
55
 
56
+
57
+ .row
58
+ = f.label :tags
59
+ = f.select :tag_ids, @tags_list, {}, { multiple: true }
60
+
52
61
  .field
53
62
  = f.label :description
54
63
  = f.text_area :description, class: 'tinymce'
@@ -66,7 +75,22 @@
66
75
  = f.label "Config"
67
76
  = f.text_area :config, class: 'large'
68
77
  %pre.small
69
- description.collapsible: bool
70
- map_panel_type: "Equirectangular" | "MapPanel" | "MapPanelNoZoom" | "ThreePanelV1" | "ThreePanelV4"
78
+ :plain
79
+ description.collapsible: bool
80
+ map_panel_type: "Equirectangular" |
81
+ "MapPanel" | "MapPanelNoZoom" |
82
+ "ThreePanelV1" | "ThreePanelV4" |
83
+ "GoogleMaps"
84
+ .row
85
+ .col.s6
86
+ .google-maps.row
87
+ .col.s4
88
+ = f.label "x, y"
89
+ .col.s4
90
+ = f.text_field :x
91
+ .col.s4
92
+ = f.text_field :y
93
+ .col.s6
94
+ unused
71
95
  .actions
72
96
  = f.submit 'Save'
@@ -4,13 +4,12 @@
4
4
 
5
5
  .maps-show
6
6
  = render 'map_meta_row', map: @map
7
- %p.addToggle Description [<>]
7
+ %p.addToggle Description
8
8
  .descr= raw @map.description
9
9
 
10
10
  %p.addToggle
11
11
  The Map (#{@map.w}x#{@map.h})
12
12
  = link_to 'Map Editor', location_map_editor_path(@map.id)
13
- [<>]
14
13
  .the-map
15
14
  = image_tag @map.image.image.url(:original) rescue nil
16
15
  - @markers.each do |marker|
@@ -21,28 +20,13 @@
21
20
  - else
22
21
  = image_missing_tag
23
22
 
24
- %p.addToggle Markers (#{@markers.count}) [<>]
25
- .markers-list
26
- - @markers.each do |marker|
27
- .flex-row.bordered
28
- - if marker.title_image
29
- = image_tag marker.title_image.image.url(:original)
30
- - else
31
- = image_missing_tag
32
- .flat-row
33
- .a= marker.slug
34
- .a= button_to '~', edit_marker_path(marker), method: :get
35
- .a= button_to 'x', marker_path(marker), method: :delete, data: { confirm: 'Are you sure?' }
36
- .a= link_to '[api]', api_marker_path(marker)
37
- .a= link_to '[this map]', edit_map_path(marker.slug)
38
- .hide
39
- %ul.bullets
40
- %li <b>item_type:</b> #{marker.item_type}
41
-
42
- %p.addToggle Newsitems (#{@map.newsitems.count}) [<>]
23
+ = render 'ish_manager/markers/header', markers: @markers, map: @map
24
+ = render 'ish_manager/markers/index', markers: @markers, map: @map
25
+
26
+ %p.addToggle= render 'ish_manager/newsitems/header', newsitems: @map.newsitems
43
27
  = render 'ish_manager/newsitems/index', newsitems: @map.newsitems
44
28
 
45
- %p.addToggle Maps (#{@maps.count}) [<>]
29
+ %p.addToggle Maps (#{@maps.count})
46
30
  .maps-list
47
31
  - @maps.each do |m|
48
32
  .item
@@ -5,18 +5,12 @@
5
5
 
6
6
  -# @TODO: can I not have this url at all?
7
7
  - url = %w|new create|.include?(params[:action]) ? markers_path : marker_path(@marker.id)
8
+
8
9
  .markers--form
9
10
  = form_for @marker, :html => { :multipart => true }, url: url do |f|
10
- -# @TODO: yeah move the map id into this hidden field.
11
- -# = f.hidden_field :map_id, value: (params['map_id']||@map_id)
12
-
13
- - if @marker.errors.any?
14
- #error_explanation
15
- %p= "#{pluralize(@marker.errors.count, "error")} prohibited this map from being saved:"
16
- %ul.errors
17
- - @marker.errors.full_messages.each do |message|
18
- %li= message
19
-
11
+ = render 'ish_manager/application/form_errors', item: @marker
12
+ .actions
13
+ = f.submit 'Save'
20
14
  .row
21
15
  .col.s1
22
16
  = f.label :map
@@ -87,5 +81,17 @@
87
81
  = f.check_box :is_active
88
82
  = f.label :is_active
89
83
  .col.s6
90
- .actions
91
- = f.submit 'Save'
84
+ unused
85
+ .row
86
+ .col.s6
87
+ .google-maps.row
88
+ .col.s4
89
+ = f.label "x, y"
90
+ .col.s4
91
+ = f.text_field :x
92
+ .col.s4
93
+ = f.text_field :y
94
+ .col.s6
95
+ unused
96
+ .actions
97
+ = f.submit 'Save'
@@ -0,0 +1,8 @@
1
+
2
+ -#
3
+ -# ish_manager / markers / _header.haml
4
+ -#
5
+
6
+ %p.addToggle
7
+ Markers (#{markers.count})
8
+ = link_to image_new, new_marker_path(map_id: map.id)
@@ -0,0 +1,18 @@
1
+
2
+ .markers--index
3
+ - markers.each do |marker|
4
+ .Card
5
+ - if marker.title_image
6
+ = image_tag marker.title_image.image.url(:original)
7
+ - else
8
+ = image_missing_tag
9
+ .flex-row
10
+ .a= marker.slug
11
+ .a= button_to '~', edit_marker_path(marker), method: :get
12
+ .a= button_to 'x', marker_path(marker), method: :delete, data: { confirm: 'Are you sure?' }
13
+ .flex-row
14
+ .a= link_to '[api]', api_marker_path(marker)
15
+ .a= link_to '[this map]', edit_map_path(marker.slug)
16
+ .hide
17
+ %ul.bullets
18
+ %li <b>item_type:</b> #{marker.item_type}
@@ -0,0 +1,3 @@
1
+
2
+ -# %h5 Newsitems (#{newsitems.count}) #{link_to image_new, new_newsitem_path }
3
+ Newsitems (#{newsitems.count}) #{link_to image_new, new_newsitem_path }
@@ -5,23 +5,9 @@
5
5
  - newsitems = newsitems.page( params[:newsitems_page] ).per( 10 )
6
6
 
7
7
  .manager-newsitems--index
8
- %h5 Newsitems (#{newsitems.count}) #{link_to image_new, new_newsitem_path }
9
8
  = paginate newsitems, :param_name => :newsitems_page, :views_prefix => 'ish_manager'
10
9
  - newsitems.each do |n|
11
- .card
12
- .card-content
13
- %ul
14
- %li
15
- .float-left= link_to '[~]', edit_newsitem_path(n)
16
- .float-left= button_to '[x]', newsitem_path( n ), :method => :delete, :data => { :confirm => 'Are you sure?' }
17
- Name: #{n.name}
18
- %li Desc: #{n.descr}
19
- %li Created at: #{n.created_at}
20
- %li Report id: #{n.report_id}
21
- %li Gallery id: #{n.gallery_id}
22
- %li username: #{n.username}
23
- - if n.photo
24
- %li Photo id: #{n.photo.id}
25
- = render 'ish_manager/newsitems/item', :newsitem => n
10
+ = render 'ish_manager/newsitems/item', :newsitem => n
11
+
26
12
  = paginate newsitems, :param_name => :newsitems_page, :views_prefix => 'ish_manager'
27
13
 
@@ -1,9 +1,16 @@
1
+
2
+ -#
3
+ -# ish_manager / newsitems / _item.haml
4
+ -#
5
+
1
6
  - n ||= newsitem
2
- .newsitems--item
3
- -# - if n.profile_id
4
- -# = button_to '[x]', profile_newsitem_path(n.profile_id, n.id), method: :delete, data: { confirm: 'Are you sure?' }
5
- - if !n.photo.blank?
6
- .Nphoto.panel
7
+
8
+ .card.newsitems--item{ class: n.item_type }
9
+ .card-content
10
+ .float-left= link_to '[~]', edit_newsitem_path(n)
11
+ .float-left= button_to '[x]', newsitem_path( n ), :method => :delete, :data => { :confirm => 'Are you sure?' }
12
+
13
+ - if !n.photo.blank?
7
14
  .the-photo
8
15
  - if n.photo.gallery.blank?
9
16
  = link_to image_tag( n.photo.photo.url(:small) ), n.photo.photo.url(:large), :rel => 'lightbox[newsitem]'
@@ -11,8 +18,7 @@
11
18
  = link_to image_tag( n.photo.photo.url(:small) ), gallery_path( n.photo.gallery.slug, n.photo.gallery.photos.index(n.photo) )
12
19
  .meta= render 'ish_manager/photos/meta', :photo => n.photo
13
20
 
14
- - if n.report
15
- .Nreport.newsitem-report
21
+ - if n.report
16
22
  %ul
17
23
  %li <b>Report</b> #{n.report.id}
18
24
  %li Premium Tier #{n.report.premium_tier}
@@ -26,9 +32,7 @@
26
32
  .subhead= n.report.subhead
27
33
  .c
28
34
 
29
- - if !n.gallery.blank?
30
- .Ngallery
31
-
35
+ - if !n.gallery.blank?
32
36
  %h3= link_to n.gallery.name, gallery_path(n.gallery.slug, 0)
33
37
  .meta
34
38
  #{t('newsitems.gallery', :username => n.gallery.username, :date => pretty_date(n.gallery.created_at))}
@@ -43,20 +47,20 @@
43
47
  .thumbnails
44
48
  - n.gallery.photos.where( :is_trash => false )[0...8].each do |photo|
45
49
  = link_to image_tag( photo.photo.url(:thumb), :alt => photo.name ), photo.photo.url(:small), :rel => "lightbox[#{n.gallery.slug}]"
46
- .c
47
50
 
48
- - if n.video_id
49
- - video = Video.unscoped.find n.video_id
50
- .Nvideo
51
- = link_to video.video.url, video.video.url
52
- -# %h3= link_to (video.name.blank? ? t('videos.no_title') : video.name), video_path(video.youtube_id)
53
- = render 'ish_manager/application/meta', :item => video
54
- = render 'ish_manager/videos/embed_half', :video => video
55
- .c
56
51
 
57
- - if !n.descr.blank? && n.gallery.blank? && n.report.blank?
58
- .Ndescr.panel
59
- .meta= pretty_date n.created_at
60
- .subhead= simple_format n.descr
61
- .c
52
+ - if n.video_id
53
+ - video = Video.unscoped.find n.video_id
54
+ .a
55
+ = link_to video.video.url, video.video.url
56
+ -# %h3= link_to (video.name.blank? ? t('videos.no_title') : video.name), video_path(video.youtube_id)
57
+ = render 'ish_manager/application/meta', :item => video
58
+ = render 'ish_manager/videos/embed_half', :video => video
59
+ .c
60
+
61
+ - if !n.descr.blank? && n.gallery.blank? && n.report.blank?
62
+ .Ndescr.panel
63
+ .meta= pretty_date n.created_at
64
+ .subhead= simple_format n.descr
65
+ .c
62
66
 
@@ -34,6 +34,10 @@
34
34
  .col.s12.m3
35
35
  = f.check_box :is_trash
36
36
  = f.label :is_trash
37
+ .row
38
+ = f.label :maps, 'Maps'
39
+ = f.select :map_ids, @maps_list, {}, { multiple: true }
40
+
37
41
  .row
38
42
  .actions
39
43
  %br
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.293
4
+ version: 0.1.8.296
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-21 00:00:00.000000000 Z
11
+ date: 2022-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -366,10 +366,13 @@ files:
366
366
  - app/views/ish_manager/maps/new.haml
367
367
  - app/views/ish_manager/maps/show.haml
368
368
  - app/views/ish_manager/markers/_form.haml
369
+ - app/views/ish_manager/markers/_header.haml
370
+ - app/views/ish_manager/markers/_index.haml
369
371
  - app/views/ish_manager/markers/_index_small.haml
370
372
  - app/views/ish_manager/markers/edit.haml
371
373
  - app/views/ish_manager/markers/new.haml
372
374
  - app/views/ish_manager/newsitems/_form.haml
375
+ - app/views/ish_manager/newsitems/_header.haml
373
376
  - app/views/ish_manager/newsitems/_index.haml
374
377
  - app/views/ish_manager/newsitems/_item.haml
375
378
  - app/views/ish_manager/newsitems/edit.haml