ish_manager 0.1.8.291 → 0.1.8.294

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: b2350852869b35c0d23dcc0f4ceb241e18421b85479016e496690e46ea692280
4
- data.tar.gz: cca6886cbb25473fc84af5f65b81c2b3246c2b3e442138b47e2c632ad7ee3d83
3
+ metadata.gz: 10efaa6d13f13e13e3f52df8ec0f7ab53a181e8e91c56cfa06f22155275c9fa6
4
+ data.tar.gz: cf51a5eeaf45dfaf848c1a86b4d18fdeff58484589c7195dab89d6c7ac4412c2
5
5
  SHA512:
6
- metadata.gz: 9919f8ad085a4d20ca85419c1db2b71e69b934c83a614860765f4fa411277d543204b5d98b0df402e95c0d122dcee9088a40633ba6151b5989e6203bed9a6f8b
7
- data.tar.gz: 48d64edadefb32ab2477b2399028b9f1a18262b78768bb379a4f8c7e22ff3fc4c0dc263b269117beccf8e69b1eeff45e36d3f52ac8e195ac3eb7250ad67be04a
6
+ metadata.gz: dd315d76a411fcdb406f2c37bce0961fc2a8a9dafbb61c758f6235e8c42c479793538d20dd46c13c3386caadf292d95ac16dedf0caeeb3f7e041f95fdbf6eb93
7
+ data.tar.gz: d719654b830ef000c0cfad3d4a582503a12b041c1da70f04c747045d7761a9a42ac5c3748d4e3af0408603f2c2f827fb26a1394ae75d5355c7d027c360210104
@@ -4,6 +4,8 @@ class IshManager::MapsController < IshManager::ApplicationController
4
4
  before_action :set_map, only: [ :destroy, :edit, :export, :map_editor, :show, :update, ] # alphabetized
5
5
  before_action :set_lists
6
6
 
7
+ layout 'ish_manager/application_no_material', only: %w| index |
8
+
7
9
  # alphabetized
8
10
 
9
11
  def create
@@ -49,6 +51,9 @@ class IshManager::MapsController < IshManager::ApplicationController
49
51
  send_data result
50
52
  end
51
53
 
54
+ ##
55
+ ## @TODO: move to models, yes?
56
+ ##
52
57
  def import
53
58
  authorize! :create, Map
54
59
 
@@ -62,7 +67,21 @@ class IshManager::MapsController < IshManager::ApplicationController
62
67
  end
63
68
  contents = JSON.parse contents
64
69
  contents.deep_symbolize_keys!
65
- puts! contents, 'contents'
70
+
71
+ ## Delete existing
72
+ if params[:delete_existing]
73
+ map_ids = contents[:maps].map { |m| m[:_id] }
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
+
82
+ Marker.where( :_id.in => marker_ids ).destroy_all
83
+ end
84
+
66
85
 
67
86
  ##
68
87
  ## process content
@@ -73,7 +92,6 @@ class IshManager::MapsController < IshManager::ApplicationController
73
92
  profiles = contents[:profiles]
74
93
  contents.delete :profiles
75
94
  profiles.each do |profile|
76
- puts! profile, 'a profile'
77
95
  if Ish::UserProfile.where( _id: profile[:_id] ).first
78
96
  errors.push({ message: "profile #{profile[:email]} already exists." })
79
97
  else
@@ -96,11 +114,10 @@ class IshManager::MapsController < IshManager::ApplicationController
96
114
 
97
115
  # everything else
98
116
  contents.each do |k, v|
99
- puts! [k,v], 'k-v'
117
+ # puts! [k, v], "Importing"
100
118
  item = Map.export_key_to_class[k].constantize
101
119
  v.map do |inn|
102
120
  n = item.new inn
103
- puts! n, 'n'
104
121
  begin
105
122
  flag = n.save
106
123
  rescue Mongo::Error::OperationFailure => e
@@ -109,7 +126,6 @@ class IshManager::MapsController < IshManager::ApplicationController
109
126
  if flag
110
127
  errors.push({ class: k, id: inn[:_id], messages: 'ok' })
111
128
  else
112
- puts! n.errors.full_messages.join(", ")
113
129
  errors.push({ class: k, id: inn[:_id], messages: "Could not save: |#{n.errors.full_messages.join(", ")}|." })
114
130
  end
115
131
  end
@@ -6,9 +6,13 @@
6
6
  %h1
7
7
  Maps (#{@maps.length})
8
8
  = link_to '[+]', new_map_path
9
+
9
10
  .red-border
10
11
  = form_tag import_map_path, :multipart => true do
11
12
  = file_field_tag :input
13
+ .a
14
+ = label_tag :delete_existing
15
+ = check_box_tag :delete_existing
12
16
  = submit_tag 'Import Map'
13
17
 
14
18
  - @maps.each do |map|
@@ -52,3 +52,6 @@
52
52
  = render 'form'
53
53
 
54
54
  = button_to 'Export Subtree', export_map_path(@map.id, format: :json)
55
+
56
+ = render 'index_item', map: @map
57
+
@@ -0,0 +1,43 @@
1
+ !!!
2
+ %html
3
+ %head
4
+ %title Ish Manager
5
+ %link{ :rel => 'icon', :href => "/favicon_#{ENV['RAILS_ENV']}.gif" }
6
+ %meta{ :name => :viewport, :content => 'width=device-width, initial-scale=1.0' }
7
+ %meta{ :charset => 'UTF-8' }
8
+ %meta{ :description => 'some description' }
9
+ %script{ :src => "//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js" }
10
+ %script{ :src => "//cdnjs.cloudflare.com/ajax/libs/tinymce/4.6.3/jquery.tinymce.min.js" }
11
+ %script{ :src => "//cdnjs.cloudflare.com/ajax/libs/tinymce/4.6.3/tinymce.min.js" }
12
+ %script{ :src => "//cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js" }
13
+ = stylesheet_link_tag "//cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css"
14
+ = stylesheet_link_tag "//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css", :media => 'all'
15
+ = stylesheet_link_tag "//fonts.googleapis.com/icon?family=Material+Icons"
16
+
17
+ = stylesheet_link_tag "ish_manager/application", media: "all"
18
+
19
+ = javascript_include_tag "ish_manager/application"
20
+
21
+ = csrf_meta_tags
22
+ %body{ class: [ params[:controller].gsub("ish_manager/",""), "#{params[:controller].gsub("ish_manager/","")}-#{params[:action]}", params[:action]] }
23
+ .bg-white
24
+ = render :partial => "ish_manager/application/main_header_#{current_user.profile.role_name}"
25
+ .container
26
+ .row
27
+ .col.s12
28
+ - if notice
29
+ - if notice.class == Array
30
+ %ul
31
+ - notice.map do |n|
32
+ %li
33
+ - n.map do |k,v|
34
+ <b>#{k} :</b> #{v}
35
+ %p.notice= notice
36
+ - if alert
37
+ %p.alert= alert
38
+ .container
39
+ = yield
40
+ = render 'ish_manager/application/main_footer'
41
+ = render 'analytics' if Rails.env.production?
42
+ = render 'debug' if !Rails.env.production?
43
+
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.291
4
+ version: 0.1.8.294
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
@@ -446,6 +446,7 @@ files:
446
446
  - app/views/layouts/ish_manager/application.haml
447
447
  - app/views/layouts/ish_manager/application.haml-trash
448
448
  - app/views/layouts/ish_manager/application2.haml
449
+ - app/views/layouts/ish_manager/application_no_material.haml
449
450
  - config/routes.rb
450
451
  - config/systemd/system/README.txt
451
452
  - config/systemd/system/stockwatcher.service