ish_manager 0.1.8.248 → 0.1.8.252

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.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/icons/10x10_red-cross.png +0 -0
  3. data/app/assets/javascripts/ish_manager/application.js +4 -3
  4. data/app/assets/javascripts/ish_manager/maps.js +53 -0
  5. data/app/assets/javascripts/ish_manager/shared.js +22 -0
  6. data/app/assets/stylesheets/ish_manager/application.css +1 -0
  7. data/app/assets/stylesheets/ish_manager/galleries.scss +42 -0
  8. data/app/assets/stylesheets/ish_manager/maps.scss +39 -8
  9. data/app/assets/stylesheets/ish_manager/photos.scss +12 -0
  10. data/app/controllers/ish_manager/application_controller.rb +3 -1
  11. data/app/controllers/ish_manager/cities_controller.rb +3 -3
  12. data/app/controllers/ish_manager/maps_controller.rb +23 -3
  13. data/app/controllers/ish_manager/markers_controller.rb +19 -0
  14. data/app/controllers/ish_manager/{ally_controller.rb → trash/ally_controller.rb} +0 -0
  15. data/app/controllers/ish_manager/user_profiles_controller.rb +1 -0
  16. data/app/views/ish_manager/galleries/_index.haml +6 -4
  17. data/app/views/ish_manager/galleries/show.haml +14 -15
  18. data/app/views/ish_manager/maps/_form.haml +12 -16
  19. data/app/views/ish_manager/maps/_map_meta_row.haml +1 -0
  20. data/app/views/ish_manager/maps/index.haml +9 -1
  21. data/app/views/ish_manager/maps/map_editor.haml +28 -0
  22. data/app/views/ish_manager/maps/show.haml +19 -3
  23. data/app/views/ish_manager/markers/_form.haml +29 -14
  24. data/app/views/ish_manager/newsitems/_item.haml +3 -3
  25. data/app/views/ish_manager/photos/_meta_manager.haml +7 -0
  26. data/app/views/ish_manager/reports/_form.haml +1 -0
  27. data/app/views/ish_manager/reports/_show_mini.haml +1 -1
  28. data/app/views/ish_manager/user_profiles/_form.haml +10 -10
  29. data/app/views/ish_manager/user_profiles/index.haml +8 -0
  30. data/app/views/ish_manager/venues/_form.haml +6 -3
  31. data/app/views/layouts/ish_manager/application.haml +1 -1
  32. data/config/routes.rb +1 -0
  33. metadata +10 -4
  34. data/app/assets/stylesheets/ish_manager/galleries.css +0 -28
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 38f82f782d8fee6247ee92d440fd9984c2a560e192f877eb9cfffa591f5c8045
4
- data.tar.gz: e29fba83dd1c1426c83a4991dbf4968c4affafae2542c6d0cf490cb12aed3344
3
+ metadata.gz: ce1f4be644e4657cfd435c7d86997e039ad652cc8685338b4631755da901da63
4
+ data.tar.gz: dea2c34dbd447eb1161d01852ff402e19fc0475d478c6e37e9064bff5170bba1
5
5
  SHA512:
6
- metadata.gz: 28c18da1165de872522f64252f6e0fdfec5217b5806d4527b7b38717826c39041241521762917f799fe14d320bd08de59fa05ebeb9157286c9792134a1d5e5d9
7
- data.tar.gz: 6e984c0cf9031c26bd6f29f86ab9f0f9ad977b22527e848f57c39cb456398ee5fdc5e722cabd75fc163d3e23b9ccb2f81cc604178300312157ea6e13db8f683d
6
+ metadata.gz: 9272f4cf891018c0a5cd97193c24e21c2c0b80185f9ebf54d01213d12f9359a4f9e5e1460fadcb186b8f64a703a6fe17a016b046907543118cd602cf226b6b71
7
+ data.tar.gz: e05796ed3cf5417795eeef7434450490efe1b741031b2e011f55c7040f532fc9c366d9db11258dd3d84ece4dee9cc0a088abb77008200f9eb959153db2a15ce4
@@ -16,7 +16,8 @@
16
16
  //= require ish_manager/jquery.ui.widget
17
17
  //= require ish_manager/jquery.fileupload
18
18
  //= require ish_manager/jquery-ui.min
19
- //
19
+ //= require ish_manager/shared
20
+ //= require ish_manager/maps
20
21
 
21
22
  $(function () {
22
23
  $('#fileupload').fileupload({
@@ -29,7 +30,7 @@ $(function () {
29
30
  });
30
31
  });
31
32
 
32
- $(document).ready(function () {
33
+ $(function () {
33
34
 
34
35
  $('*[data-confirm]').click(function(){
35
36
  return confirm($(this).attr('data-confirm'));
@@ -43,7 +44,7 @@ $(document).ready(function () {
43
44
  });
44
45
  }
45
46
 
46
- if ($('body#application').length > 0) {
47
+ if ($('body').length > 0) {
47
48
  $('select').material_select()
48
49
  }
49
50
 
@@ -0,0 +1,53 @@
1
+
2
+ /*
3
+ * only for maps map editor
4
+ */
5
+ $(document).ready(() => {
6
+ if (!$("body.maps-map_editor").length) { return }
7
+ logg('maps#map_editor')
8
+
9
+ const mapEditorEl = $(".maps-map-editor .map-editor")
10
+ const mapEditorX = mapEditorEl.offset().left
11
+ const mapEditorY = mapEditorEl.offset().top
12
+
13
+ $(".maps-map-editor .map-editor .marker").each(function() {
14
+ const m = $(this)
15
+ const centerOffsetX = parseInt(m.attr('data-center-offset-x'))
16
+ const centerOffsetY = parseInt(m.attr('data-center-offset-y'))
17
+ const slug = m.attr('data-slug')
18
+ logg(slug, 'slug')
19
+
20
+ $(m).draggable({
21
+ drag: function () {
22
+ const x = $(this).offset().left - mapEditorX + centerOffsetX
23
+ const y = $(this).offset().top - mapEditorY + centerOffsetY
24
+ logg(`${x}, ${y}`, 'marker')
25
+ $(`.${slug} input[name='gameui_marker[x]']`).val(x)
26
+ $(`.${slug} input[name='gameui_marker[y]']`).val(y)
27
+ },
28
+ })
29
+ })
30
+
31
+ })
32
+
33
+ /*
34
+ * only for markers#edit
35
+ */
36
+ $(document).ready(() => {
37
+ if (!$("body.markers-edit").length) { return }
38
+ logg('markers#edit')
39
+
40
+ $($(".image-thumb img")[0]).click(function (e) {
41
+ var posX = $(this).offset().left,
42
+ posY = $(this).offset().top;
43
+ logg((e.pageX - posX) + ' , ' + (e.pageY - posY));
44
+ const x = e.pageX - posX
45
+ const y = e.pageY - posY
46
+ $(".image-thumb .red-cross").css('top', y-10)
47
+ $(".image-thumb .red-cross").css('left', x-10)
48
+ $("#gameui_marker_centerOffsetX").val(x)
49
+ $("#gameui_marker_centerOffsetY").val(y)
50
+ })
51
+
52
+ })
53
+
@@ -0,0 +1,22 @@
1
+
2
+ /**
3
+ * Usage: logg(someObject, 'label')
4
+ *
5
+ * This development-grade logger can be used instead of console.log() with some advantages:
6
+ * * It encourages consistent labeling of logs. By labeling each log line, you can have dozens of log lines
7
+ * written per action, and still know which log line comes from where.
8
+ * The recommended label is the component name, or function name.
9
+ * * If the label is present, the logged object is placed in the window, allowing you to inspect it in the console. The
10
+ * label becomes the name of the object (stripped to [0-9a-zA-Z\-_] chars). If you're logging a function, you can execute it.
11
+ * If you log more than one thing, they can interact, allowing you to validate control flow.
12
+ * * the logger can be turned off by making this function simply return.
13
+ */
14
+ logg = (a, b="", c=null) => {
15
+ c = "string" === typeof c ? c : b.replace(/\W/g, "");
16
+ if (c.length > 0) {
17
+ window[c] = a;
18
+ }
19
+
20
+ console.log(`+++ ${b}:`, a); // eslint-disable-line no-console
21
+ };
22
+
@@ -18,6 +18,7 @@
18
18
  *= require ish_manager/utils
19
19
  *= require ish_manager/jquery-ui
20
20
  *= require ish_manager/galleries
21
+ *= require ish_manager/photos
21
22
  *= require ish_manager/user_profiles
22
23
  */
23
24
 
@@ -0,0 +1,42 @@
1
+ /* utils */
2
+
3
+ .thumbnails {
4
+ display: flex;
5
+ }
6
+
7
+ .row-thumbs .item {
8
+ margin-bottom: 1em;
9
+ border: 1px solid red;
10
+ padding: 10px;
11
+ img {
12
+ margin-top: 10px;
13
+ }
14
+ }
15
+
16
+ .row-large .item {
17
+ border: 1px solid red;
18
+ display: block;
19
+
20
+ padding: 10px;
21
+ margin: 10px;
22
+
23
+ height: 90vh;
24
+ max-width: 100vw;
25
+
26
+ .goto {
27
+ display: none;
28
+ }
29
+
30
+ .wrapper {
31
+ width: 100%;
32
+ height: 80vh;
33
+ background-repeat: no-repeat;
34
+ background-position: center center;
35
+ background-size: contain;
36
+
37
+ img {
38
+ max-height: 100%;
39
+ max-width: 100%;
40
+ }
41
+ }
42
+ }
@@ -1,3 +1,10 @@
1
+ /**
2
+ * utils first
3
+ */
4
+ .red-cross {
5
+ position: absolute;
6
+ }
7
+
1
8
 
2
9
  .maps-index {
3
10
  h1 {
@@ -22,7 +29,7 @@
22
29
  align-content: flex-start;
23
30
 
24
31
  height: 3em;
25
- line-height: 3em;
32
+ line-height: 3em;
26
33
 
27
34
  width: 100%;
28
35
  margin: 0 0 1em 0;
@@ -43,17 +50,41 @@
43
50
  border: 1px solid yellow;
44
51
  }
45
52
  }
53
+ .markers-list {
54
+ .item {
55
+ border: 1px solid #d59d05; /* brown*/
56
+ padding: .5em;
57
+ margin: 1em 0 0 0;
58
+ }
59
+ }
46
60
  }
47
61
 
48
62
  .markers--form {
49
- /* width: 300px;
50
- margin: auto; */
63
+ .image-thumb {
64
+ border: 1px solid yellow;
65
+ position: relative;
66
+ display: inline-block;
67
+
68
+
69
+ }
51
70
  }
52
71
 
53
- .markers-list {
54
- .item {
55
- border: 1px solid #d59d05; /* brown*/
56
- padding: .5em;
57
- margin: 1em 0 0 0;
72
+ .maps-map-editor {
73
+ .map-editor {
74
+ border: 1px solid red;
75
+ position: relative;
76
+
77
+ .marker {
78
+ position: absolute;
79
+ top: 0;
80
+ left: 0;
81
+
82
+ border: 1px solid yellow;
83
+ }
84
+ }
85
+ .markers-list {
86
+ .item {
87
+ border: 1px solid green;
88
+ }
58
89
  }
59
90
  }
@@ -0,0 +1,12 @@
1
+
2
+ .--meta-manager {
3
+ display: flex;
4
+ justify-content: space-between;
5
+
6
+ .right-hand a {
7
+ }
8
+ .right-hand a:not(:last-child):after {
9
+ content: "|";
10
+ padding: 0 10px 0 15px;
11
+ }
12
+ }
@@ -25,9 +25,11 @@ module IshManager
25
25
  end
26
26
 
27
27
  def set_lists
28
- @sites_list = Site.all.list
29
28
  @cities_list = City.list
29
+ @locations_list = ::Gameui::Map.list
30
+ @sites_list = Site.all.list
30
31
  @venues_list = Venue.all.list
32
+
31
33
  @reports_list = Report.all.list
32
34
  @galleries_list = Gallery.all.list
33
35
  @videos_list = Video.all.list
@@ -8,7 +8,7 @@ class IshManager::CitiesController < IshManager::ApplicationController
8
8
  @city = City.new
9
9
  @photo = Photo.new
10
10
  end
11
-
11
+
12
12
  def show
13
13
  authorize! :show, @city
14
14
  @videos = @city.videos.page( params[:videos_page] ).per( Video::PER_PAGE )
@@ -20,7 +20,7 @@ class IshManager::CitiesController < IshManager::ApplicationController
20
20
  @venues = @venues.where({ :name => /#{params[:q]}/i })
21
21
  end
22
22
  end
23
-
23
+
24
24
  def new
25
25
  @city = City.new
26
26
  authorize! :new, City
@@ -44,7 +44,7 @@ class IshManager::CitiesController < IshManager::ApplicationController
44
44
  def edit
45
45
  authorize! :edit, @city
46
46
  end
47
-
47
+
48
48
  def update
49
49
  @city = City.find( params[:id] )
50
50
  authorize! :update, @city
@@ -1,15 +1,17 @@
1
1
 
2
2
  class IshManager::MapsController < IshManager::ApplicationController
3
3
 
4
- before_action :set_map, only: [:show, :edit, :update, :destroy]
4
+ before_action :set_map, only: [:destroy, :edit, :map_editor, :show, :update, ]
5
5
 
6
6
  def index
7
7
  authorize! :index, ::Gameui::Map
8
- @maps = ::Gameui::Map.all
8
+ @maps = ::Gameui::Map.where( parent_slug: "" )
9
+ @all_maps = Gameui::Map.all
9
10
  end
10
11
 
11
12
  def show
12
13
  authorize! :show, @map
14
+ @maps = Gameui::Map.where( parent_slug: @map.slug )
13
15
  end
14
16
 
15
17
  def new
@@ -23,6 +25,13 @@ class IshManager::MapsController < IshManager::ApplicationController
23
25
 
24
26
  def create
25
27
  @map = ::Gameui::Map.new(map_params)
28
+
29
+ if params[:image]
30
+ image = ::Ish::ImageAsset.new :image => params[:image]
31
+ @map.image = image
32
+ image.save
33
+ end
34
+
26
35
  if map_params[:parent_slug].present?
27
36
  @map.parent = ::Gameui::Map.find_by({ slug: map_params[:parent_slug] })
28
37
  end
@@ -39,6 +48,12 @@ class IshManager::MapsController < IshManager::ApplicationController
39
48
 
40
49
  def update
41
50
  authorize! :update, @map
51
+
52
+ if params[:image]
53
+ image = ::Ish::ImageAsset.new :image => params[:image]
54
+ @map.image = image
55
+ end
56
+
42
57
  respond_to do |format|
43
58
  if map_params[:parent_slug].present?
44
59
  @map.parent = ::Gameui::Map.find_by({ slug: map_params[:parent_slug] })
@@ -61,10 +76,15 @@ class IshManager::MapsController < IshManager::ApplicationController
61
76
  end
62
77
  end
63
78
 
79
+ def map_editor
80
+ authorize! :update, @map
81
+ end
82
+
64
83
  private
65
84
 
66
85
  def set_map
67
- @map = ::Gameui::Map.find(params[:id])
86
+ @map = ::Gameui::Map.where(id: params[:id]).first
87
+ @map ||= Gameui::Map.find_by(slug: params[:id])
68
88
  end
69
89
 
70
90
  def map_params
@@ -25,6 +25,15 @@ class IshManager::MarkersController < IshManager::ApplicationController
25
25
  authorize! :create_marker, @map
26
26
  @map_id = @map.id
27
27
 
28
+ if params[:image]
29
+ @marker.image = ::Ish::ImageAsset.new :image => params[:image]
30
+ @marker.image.save
31
+ end
32
+ if params[:title_image]
33
+ @marker.title_image = ::Ish::ImageAsset.new :image => params[:title_image]
34
+ @marker.title_image.save
35
+ end
36
+
28
37
  respond_to do |format|
29
38
  if @marker.save
30
39
  @marker.map.touch
@@ -37,6 +46,16 @@ class IshManager::MarkersController < IshManager::ApplicationController
37
46
 
38
47
  def update
39
48
  authorize! :update_marker, @map
49
+
50
+ if params[:image]
51
+ @marker.image = ::Ish::ImageAsset.new :image => params[:image]
52
+ @marker.image.save
53
+ end
54
+ if params[:title_image]
55
+ @marker.title_image = ::Ish::ImageAsset.new :image => params[:title_image]
56
+ @marker.title_image.save
57
+ end
58
+
40
59
  respond_to do |format|
41
60
  if @marker.update(marker_params)
42
61
  @marker.map.touch
@@ -21,6 +21,7 @@ class IshManager::UserProfilesController < IshManager::ApplicationController
21
21
  def update
22
22
  @profile = IshModels::UserProfile.find params[:id]
23
23
  authorize! :update, @profile
24
+
24
25
  flag = @profile.update_attributes params[:profile].permit!
25
26
  if flag
26
27
  flash[:notice] = "Updated profile #{@profile.email}"
@@ -1,5 +1,6 @@
1
-
2
- -# = render 'ish_manager/sites/header', :site => @site if @site
1
+ -#
2
+ -# ish_manager / galleries / _index.haml
3
+ -#
3
4
 
4
5
  = render 'ish_manager/galleries/menu'
5
6
 
@@ -23,8 +24,9 @@
23
24
  - if g.photos.length == 0
24
25
  = image_missing
25
26
  - else
26
- - g.photos.limit( n_thumbs ).each do |photo|
27
- = link_to image_tag(photo.photo.url(:thumb), :alt => g.name, :class => :thumb ), gallery_path(g.galleryname)
27
+ .thumbnails
28
+ - g.photos.limit( n_thumbs ).each do |photo|
29
+ = link_to image_tag(photo.photo.url(:thumb), :alt => g.name), gallery_path(g.galleryname)
28
30
 
29
31
  - if @galleries.respond_to? :total_pages
30
32
  = paginate @galleries, :param_name => param_name, :views_prefix => 'ish_manager'
@@ -1,3 +1,6 @@
1
+ -#
2
+ -# ish_manager / galleries / show.haml
3
+ -#
1
4
 
2
5
  = render 'title', :gallery => @gallery
3
6
  = render 'ish_manager/photos/multinew', :gallery => @gallery
@@ -15,28 +18,24 @@
15
18
  .row
16
19
  %ul
17
20
  - @photos.each do |photo|
18
- %li.col-xs-1= image_tag photo.photo.url( :mini ), :alt => ''
21
+ %li.col-xs-1
22
+ = link_to image_tag(photo.photo.url( :mini ), :alt => ''), "#large_#{photo.id}"
23
+
19
24
  .spacer{ :style => 'height: 500px' }
20
25
 
21
26
  -# thumb
22
- .row
23
- .a
24
- - @photos.each do |photo|
25
- .col-xs-4
26
- .item{ :style => "border: 1px solid red;" }
27
- .float-left= button_to '[x]', photo_path( :id => photo.id ), :method => :delete, :data => { :confirm => 'Are you sure?' }
28
- = link_to "go to", "#large_#{photo.id}"
29
- %br
30
- = image_tag photo.photo.url( :thumb ), :alt => ''
27
+ .row.row-thumbs
28
+ - @photos.each do |photo|
29
+ .col-xs-3
30
+ .item
31
+ = render 'ish_manager/photos/meta_manager', photo: photo
32
+ = image_tag photo.photo.url( :thumb ), :alt => ''
31
33
  .spacer{ :style => 'height: 100px' }
32
34
 
33
35
  -# large
34
- .center.large-photos
36
+ .row.row-large
35
37
  - @photos.each do |photo|
36
38
  .item
37
39
  %a{id: "large_#{photo.id}" }
38
- .float-left= button_to '[x]', photo_path( :id => photo.id ), :method => :delete, :data => { :confirm => 'Are you sure?' }
39
- = link_to "large", photo.photo.url(:large)
40
- &nbsp;|&nbsp;
41
- = link_to "original", photo.photo.url(:original)
40
+ = render 'ish_manager/photos/meta_manager', photo: photo
42
41
  .wrapper{ style: "background-image: url('#{photo.photo.url( :large )}')" }
@@ -2,9 +2,9 @@
2
2
  -# ish_manager / maps / _form
3
3
  -#
4
4
 
5
- - url = params[:action] == 'new' ? maps_path : map_path(@map)
5
+ - url = params[:action] == 'new' ? maps_path : map_path(@map.id)
6
6
 
7
- = form_for @map, url: url do |f|
7
+ = form_for @map, :html => { :multipart => true }, url: url do |f|
8
8
  - if @map.errors.any?
9
9
  #error_explanation
10
10
  %h2= "#{pluralize(@map.errors.count, "error")} prohibited this map from being saved:"
@@ -17,6 +17,9 @@
17
17
  .field
18
18
  = f.label :name
19
19
  = f.text_field :name
20
+ .field
21
+ = f.label :map_slug, "Map slug (if any)"
22
+ = f.text_field :map_slug
20
23
  .col-md-3
21
24
  .field
22
25
  = f.label :slug
@@ -24,27 +27,20 @@
24
27
  .field
25
28
  = f.label :parent_slug
26
29
  = f.text_field :parent_slug
27
-
28
-
29
30
  .col-md-2
30
31
  .field
31
- = f.label :w
32
- = f.number_field :w
32
+ = f.label :ordering_type
33
+ = f.select :ordering_type, options_for_select(::Gameui::Map::ORDERING_TYPES)
34
+ .col-md-4
35
+
33
36
  .field
34
- = f.label :h
35
- = f.number_field :h
37
+ = f.label :image
38
+ = file_field_tag :image
39
+ = image_tag @map.image.image.url(:thumb) rescue nil
36
40
 
37
41
  .field
38
42
  = f.label :description
39
43
  = f.text_area :description, class: 'tinymce'
40
44
 
41
- .field
42
- = f.label :img_path
43
- = f.text_field :img_path
44
- .row
45
- .col-md-4
46
- .field
47
- = f.label :ordering_type
48
- = select_tag :ordering_type, options_for_select(::Gameui::Map::ORDERING_TYPES)
49
45
  .actions
50
46
  = f.submit 'Save'
@@ -2,6 +2,7 @@
2
2
  .flat-row
3
3
  .a= link_to map.slug, map_path(map)
4
4
  .a= button_to '~', edit_map_path(map), method: :get
5
+ .a= button_to 'map editor', location_map_editor_path(map.id), method: :get
5
6
  .a <b>#{map.w}x#{map.h}_#{map.slug}</b>
6
7
  .a= button_to '+marker', new_map_marker_path(map), method: :get
7
8
  .a= button_to '+newsitem', new_map_newsitem_path(map), method: :get
@@ -1,6 +1,14 @@
1
+ -#
2
+ -# ish_manager / maps / index.haml
3
+ -#
1
4
 
2
5
  .maps-index
3
- %h1 Maps #{link_to '[+]', new_map_path}
6
+ %h1 Maps (#{@maps.length}) #{link_to '[+]', new_map_path}
4
7
  - @maps.each do |map|
5
8
  .item
6
9
  = render 'map_meta_row', map: map
10
+
11
+ %h1 All Maps (#{@all_maps.length})
12
+ %ul
13
+ - @all_maps.each do |m|
14
+ %li= link_to m.slug, edit_map_path(m.id)
@@ -0,0 +1,28 @@
1
+
2
+ .maps-map-editor
3
+ %h1 Map Editor
4
+
5
+ .map-editor
6
+ = image_tag @map.image.image.url(:original)
7
+ - @map.markers.each do |m|
8
+ .marker{ data: { 'slug': m.slug, 'center-offset-x': m.centerOffsetX, 'center-offset-y': m.centerOffsetY }, style: "top: #{m.y-m.centerOffsetY}px; left: #{m.x-m.centerOffsetX}px;" }
9
+ = image_tag m.image.image.url(:original)
10
+ = image_tag('icons/10x10_red-cross.png', class: 'red-cross', style: "top: #{m.centerOffsetY-10}px; left: #{m.centerOffsetX-10}px;" )
11
+
12
+ .markers-list
13
+ %h1
14
+ Markers (#{@map.markers.length})
15
+ = link_to '[+]', new_marker_path({ map_id: @map.id })
16
+ - @map.markers.each do |m|
17
+ = form_for m, { html: { class: "item #{m.slug}" }, url: marker_path(m.id) } do |f|
18
+ = m.slug
19
+ = link_to '[~]', edit_marker_path(m.id)
20
+ .field
21
+ = f.label :x
22
+ = f.text_field :x
23
+ .field
24
+ = f.label :y
25
+ = f.text_field :y
26
+ .field
27
+ = f.submit 'Save'
28
+
@@ -1,14 +1,22 @@
1
+ -#
2
+ -# ish_manager / maps / show.haml
3
+ -#
1
4
 
2
5
  .maps-show
3
6
  = render 'map_meta_row', map: @map
4
7
  %p.addToggle Description [<>]
5
8
  .descr= raw @map.description
6
9
 
7
- %p.addToggle The Map [<>]
10
+ %p.addToggle
11
+ The Map (#{@map.w}x#{@map.h})
12
+ = link_to 'Map Editor', location_map_editor_path(@map.id)
13
+ [<>]
8
14
  .the-map
9
- = image_tag @map.img_path, width: @map.w
15
+ = image_tag @map.image.image.url(:original) rescue nil
10
16
  - @map.markers.each do |marker|
11
- .marker{ style: "position: absolute; left: #{marker.x}px; top: #{marker.y}px;" }= image_tag marker.img_path
17
+ -# @TODO: this should be a partial
18
+ .marker{ style: "position: absolute; left: #{marker.x - marker.centerOffsetX}px; top: #{marker.y - marker.centerOffsetY}px;" }
19
+ = image_tag marker.image.image.url(:original)
12
20
 
13
21
  %p.addToggle Markers (#{@map.markers.count}) [<>]
14
22
  .markers-list
@@ -19,6 +27,7 @@
19
27
  .a= button_to '~', edit_marker_path(marker), method: :get
20
28
  .a= button_to 'x', marker_path(marker), method: :delete, data: { confirm: 'Are you sure?' }
21
29
  .a= link_to '[api]', api_marker_path(marker)
30
+ .a= link_to '[this map]', edit_map_path(marker.slug)
22
31
  %ul.bullets
23
32
  %li <b>item_type:</b> #{marker.item_type}
24
33
 
@@ -27,3 +36,10 @@
27
36
  - @map.newsitems.each do |newsitem|
28
37
  .item
29
38
  = newsitem.inspect
39
+
40
+ %p.addToggle Maps (#{@maps.count}) [<>]
41
+ .maps-list
42
+ - @maps.each do |m|
43
+ .item
44
+ = link_to m.slug, edit_map_path(m.id)
45
+
@@ -1,6 +1,13 @@
1
- - url = params[:action] == 'new' ? markers_path : marker_path(@marker)
1
+
2
+ -#
3
+ -# ish_manager / markers / _form
4
+ -#
5
+
6
+ -# @TODO: can I not have this url at all?
7
+ - url = %w|new create|.include?(params[:action]) ? markers_path : marker_path(@marker.id)
2
8
  .markers--form
3
- = form_for @marker, url: url do |f|
9
+ = form_for @marker, :html => { :multipart => true }, url: url do |f|
10
+ -# @TODO: yeah move the map id into this hidden field.
4
11
  -# = f.hidden_field :map_id, value: (params['map_id']||@map_id)
5
12
 
6
13
  - if @marker.errors.any?
@@ -25,26 +32,34 @@
25
32
  .row
26
33
  .col-md-3
27
34
  .field
28
- = f.label :w
29
- = f.number_field :w
35
+ = f.label :image
36
+ = file_field_tag :image
37
+ .image-thumb
38
+ = image_tag(@marker.image.image.url(:thumb)) rescue nil
39
+ = image_tag('icons/10x10_red-cross.png', class: 'red-cross', style: "top: #{@marker.centerOffsetY-10}px; left: #{@marker.centerOffsetX-10}px;" )
30
40
  .col-md-3
31
41
  .field
32
- = f.label :h
33
- = f.number_field :h
42
+ = f.label :centerOffsetX
43
+ = f.text_field :centerOffsetX
44
+ .field
45
+ = f.label :centerOffsetY
46
+ = f.text_field :centerOffsetY
34
47
  .col-md-3
35
48
  .field
36
49
  = f.label :x
37
- = f.number_field :x
38
- .col-md-3
50
+ = f.text_field :x
39
51
  .field
40
52
  = f.label :y
41
- = f.number_field :y
42
- .field
43
- = f.label :img_path
44
- = f.text_field :img_path
53
+ = f.text_field :y
54
+ .col-md-3
55
+ .field
56
+ = f.label :title_image
57
+ = file_field_tag :title_image
58
+ = image_tag @marker.title_image.image.url(:thumb) rescue nil
59
+
45
60
  .field
46
- = f.label :title_img_path
47
- = f.text_field :title_img_path
61
+ = f.label :url, "URL (if any)"
62
+ = f.text_field :url
48
63
  .row
49
64
  .col-md-3 &nbsp;
50
65
  .col-md-6
@@ -40,9 +40,9 @@
40
40
  - n.gallery.tags do |tag|
41
41
  = link_to tag, tag_path(tag.name_seo)
42
42
  - unless 0 == n.gallery.photos.length
43
- - n.gallery.photos.where( :is_trash => false )[0...8].each do |photo|
44
- = link_to image_tag( photo.photo.url(:thumb), :alt => photo.name ), photo.photo.url(:small), :rel => "lightbox[#{n.gallery.galleryname}]"
45
- -# .subhead= n.descr
43
+ .thumbnails
44
+ - n.gallery.photos.where( :is_trash => false )[0...8].each do |photo|
45
+ = link_to image_tag( photo.photo.url(:thumb), :alt => photo.name ), photo.photo.url(:small), :rel => "lightbox[#{n.gallery.galleryname}]"
46
46
  .c
47
47
 
48
48
  - if n.video_id
@@ -0,0 +1,7 @@
1
+
2
+ .--meta-manager
3
+ = button_to '[x]', photo_path( :id => photo.id ), :method => :delete, :data => { :confirm => 'Are you sure?' }
4
+ .right-hand
5
+ = link_to "go to", "#large_#{photo.id}", class: 'goto'
6
+ = link_to "large", photo.photo.url(:large)
7
+ = link_to "original", photo.photo.url(:original)
@@ -72,6 +72,7 @@
72
72
  %button.btn.btn-primary.btn-lg.btn-block{:type => "button", :onClick => "upload()"} Upload File
73
73
  = file_field_tag :photo, :style => "display:none", :id=>"photo"
74
74
  .div.center
75
+ -# @TODO: wtf?
75
76
  %img#thumbnail_image_boy.img-thumbnail{:alt => "uploaded image", :width=>"200px"}
76
77
 
77
78
 
@@ -11,5 +11,5 @@
11
11
  - if report.city
12
12
  In #{link_to report.city.name, city_path( report.city )}
13
13
 
14
- - if report.subhead.length > 3
14
+ - if report.subhead.present?
15
15
  .subhead= report.subhead
@@ -5,15 +5,11 @@
5
5
  .input-field
6
6
  %label name
7
7
  = f.text_field :name
8
-
9
- .input-field
10
- %label username
11
- = f.text_field :username
12
-
8
+
13
9
  .input-field
14
10
  %label email
15
11
  = f.text_field :email
16
-
12
+
17
13
  .input-field
18
14
  = f.select :role_name, options_for_select( [[nil, nil]] + IshModels::UserProfile::ROLES.map { |r| [ r, r ] }, :selected => profile.role_name )
19
15
  %label role name
@@ -21,14 +17,18 @@
21
17
  .input-field
22
18
  = f.select :current_city, options_for_select( @cities_list, :selected => profile.current_city_id )
23
19
  %label City
24
-
20
+
25
21
  .input-field
26
22
  = f.label :fb_access_token
27
23
  = f.text_field :fb_access_token
28
24
  .input-field
29
25
  = f.label :fb_long_access_token
30
26
  = f.text_field :fb_long_access_token
31
-
27
+
28
+ .input-field
29
+ = f.label :bookmarked_location_ids
30
+ = f.select :bookmarked_location_ids, @locations_list, {}, { multiple: true }
31
+
32
32
  = f.submit 'Save', :class => %w(button)
33
-
34
-
33
+
34
+
@@ -28,6 +28,14 @@
28
28
  - profile.newsitems.each do |n|
29
29
  = render 'ish_manager/newsitems/item', n: n, profile_id: profile.id
30
30
  <hr />
31
+
32
+ %h5 Bookmarked Locations
33
+ %ul
34
+ - profile.bookmarked_locations.each do |n|
35
+ %li
36
+ = n.id
37
+ = n.inspect
38
+
31
39
  .row
32
40
  Address:
33
41
  = profile.addresses[0].inspect
@@ -7,14 +7,14 @@
7
7
  .col-sm-6
8
8
  = f.label :name_seo
9
9
  = f.text_field :name_seo
10
-
10
+
11
11
  .row
12
12
  .col-sm-6
13
13
  = f.label :subhead
14
14
  = f.text_area :subhead
15
15
  .col-sm-6
16
16
  = render 'profile_pic', :resource => venue
17
-
17
+
18
18
  .row
19
19
  .col-sm-12
20
20
  = f.label :descr
@@ -34,7 +34,10 @@
34
34
  .col-sm-6
35
35
  = f.label :tags
36
36
  = f.select :tag_ids, options_for_select( @tags_list, :selected => venue.tag_ids ), {}, { :multiple => true }
37
-
37
+ .col-sm-6
38
+ = f.label :address
39
+ = f.text_field :address
40
+
38
41
  .row
39
42
  .col-sm-12
40
43
  = f.submit
@@ -21,7 +21,7 @@
21
21
  = javascript_include_tag "ish_manager/materialize"
22
22
 
23
23
  = csrf_meta_tags
24
- %body#application
24
+ %body{ class: [ params[:controller].gsub("ish_manager/",""), "#{params[:controller].gsub("ish_manager/","")}-#{params[:action]}", params[:action]] }
25
25
  .bg-white
26
26
  - role = current_user ? current_user.profile.role_name : ''
27
27
  = render :partial => "ish_manager/application/main_header_#{role}"
data/config/routes.rb CHANGED
@@ -43,6 +43,7 @@ IshManager::Engine.routes.draw do
43
43
  resources :leads
44
44
 
45
45
  scope 'gameui' do
46
+ get 'maps/:id/map-editor', to: 'maps#map_editor', as: :location_map_editor
46
47
  resources 'maps' do
47
48
  resources 'markers'
48
49
  resources 'newsitems'
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.248
4
+ version: 0.1.8.252
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-17 00:00:00.000000000 Z
11
+ date: 2021-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -136,6 +136,7 @@ files:
136
136
  - app/assets/images/bg/triangular.png
137
137
  - app/assets/images/bg/weather.png
138
138
  - app/assets/images/favicon.gif
139
+ - app/assets/images/icons/10x10_red-cross.png
139
140
  - app/assets/images/icons/20x20/private.png
140
141
  - app/assets/images/icons/20x20/public2.png
141
142
  - app/assets/images/missing.png
@@ -173,20 +174,22 @@ files:
173
174
  - app/assets/javascripts/ish_manager/jquery.fileupload.js
174
175
  - app/assets/javascripts/ish_manager/jquery.iframe-transport.js
175
176
  - app/assets/javascripts/ish_manager/jquery.ui.widget.js
177
+ - app/assets/javascripts/ish_manager/maps.js
176
178
  - app/assets/javascripts/ish_manager/materialize.js
179
+ - app/assets/javascripts/ish_manager/shared.js
177
180
  - app/assets/stylesheets/ish_manager/application.css
178
181
  - app/assets/stylesheets/ish_manager/bootstrap.css
179
- - app/assets/stylesheets/ish_manager/galleries.css
182
+ - app/assets/stylesheets/ish_manager/galleries.scss
180
183
  - app/assets/stylesheets/ish_manager/jquery-ui.css
181
184
  - app/assets/stylesheets/ish_manager/maps.scss
182
185
  - app/assets/stylesheets/ish_manager/materialize.css
186
+ - app/assets/stylesheets/ish_manager/photos.scss
183
187
  - app/assets/stylesheets/ish_manager/reset.css
184
188
  - app/assets/stylesheets/ish_manager/tags.css
185
189
  - app/assets/stylesheets/ish_manager/trash/bootstrap.min.css
186
190
  - app/assets/stylesheets/ish_manager/trash/bootstrap.min.css.map
187
191
  - app/assets/stylesheets/ish_manager/user_profiles.scss
188
192
  - app/assets/stylesheets/ish_manager/utils.scss
189
- - app/controllers/ish_manager/ally_controller.rb
190
193
  - app/controllers/ish_manager/application_controller.rb
191
194
  - app/controllers/ish_manager/campaigns_controller.rb
192
195
  - app/controllers/ish_manager/cities_controller.rb
@@ -209,6 +212,7 @@ files:
209
212
  - app/controllers/ish_manager/sites_controller.rb
210
213
  - app/controllers/ish_manager/stock_watches_controller.rb
211
214
  - app/controllers/ish_manager/tags_controller.rb
215
+ - app/controllers/ish_manager/trash/ally_controller.rb
212
216
  - app/controllers/ish_manager/trash/stock_actions_controller.rb
213
217
  - app/controllers/ish_manager/trash/stock_options_controller.rb
214
218
  - app/controllers/ish_manager/user_profiles_controller.rb
@@ -291,6 +295,7 @@ files:
291
295
  - app/views/ish_manager/maps/edit.haml
292
296
  - app/views/ish_manager/maps/index.haml
293
297
  - app/views/ish_manager/maps/index.haml-trash
298
+ - app/views/ish_manager/maps/map_editor.haml
294
299
  - app/views/ish_manager/maps/new.haml
295
300
  - app/views/ish_manager/maps/show.haml
296
301
  - app/views/ish_manager/markers/_form.haml
@@ -304,6 +309,7 @@ files:
304
309
  - app/views/ish_manager/newsitems/new.haml
305
310
  - app/views/ish_manager/payments/index.haml
306
311
  - app/views/ish_manager/photos/_meta.haml
312
+ - app/views/ish_manager/photos/_meta_manager.haml
307
313
  - app/views/ish_manager/photos/_multinew.haml
308
314
  - app/views/ish_manager/photos/show.haml
309
315
  - app/views/ish_manager/photos/without_gallery.haml
@@ -1,28 +0,0 @@
1
-
2
- .panel-body img.thumb {
3
- display: inline;
4
- }
5
-
6
- .large-photos .item {
7
- border: 1px solid red;
8
- display: block;
9
-
10
- padding: 10px;
11
- margin: 10px;
12
-
13
- height: 100vh;
14
- max-width: 100vw;
15
- }
16
-
17
- .large-photos .item .wrapper {
18
- width: 100%;
19
- height: 100%;
20
- background-repeat: no-repeat;
21
- background-position: center center;
22
- background-size: contain;
23
- }
24
-
25
- .large-photos .item .wrapper img {
26
- max-height: 100%;
27
- max-width: 100%;
28
- }