ishapi 0.1.8.240 → 0.1.8.242

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,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 85ca1f21e8c474cc5201d6e0eb71c570f000130a3e2d9808714cf3f9db0cdc66
4
- data.tar.gz: 9ac856cdc83167a97e093897209753c5e11f356cd1adbc3e35ce6d37814c5ea7
3
+ metadata.gz: '0432395c7876153064c35c9c289c2442d2a425e52e954d5e51395e1c0e5d2bff'
4
+ data.tar.gz: f33e32b3dc91ca4f4289082639c7af54f4ff0c02a98053f5ecb356bad27f18c9
5
5
  SHA512:
6
- metadata.gz: 240daa3bbc3c8ed7bc1b56316ce950ff810d95f42751d8c48d393715306c79b97c49d2ebeacdf9ab74bfc9dea8dc0733971e34d571a1f87436350cd2400704b9
7
- data.tar.gz: 04e0dc0fe9dd0c3cf0a26d7f787883440024e4e5700ed48c158fc90c21fc831c2436d215da3d53be939ceb1b2ed6d62bedd30756e1e616fd39695530c4f3878e
6
+ metadata.gz: a5fef0cdd135e1bbe0679c2c0b3d271a19f7da7b76bb96e5f2fa72edba50572c709e3202bfef63088609e8b77b1853454db0dc93485cfd2f8a87e0f25674116f
7
+ data.tar.gz: f493726454f20993e09e88518a99c9f3c976538dacbd8c10588f9e170b51a1ba0b37e947431fd03595c06ff11f8c78b2836928d61bb4bdf714838e14a20aead7
@@ -10,6 +10,7 @@
10
10
  * files in this directory. Styles in this file should be added after the last require_* statement.
11
11
  * It is generally better to create a new file per style scope.
12
12
  *
13
- *= require ./galleries.scss
14
13
  *= require_self
14
+ *= require ./galleries.scss
15
+ *= require ./locations.scss
15
16
  */
@@ -0,0 +1,8 @@
1
+
2
+ .locations-show {
3
+ .markers {
4
+ border: 1px solid grey;
5
+
6
+ display: flex;
7
+ }
8
+ }
@@ -9,14 +9,25 @@ module Ishapi
9
9
 
10
10
  before_action :check_jwt
11
11
 
12
+ def rmtag
13
+ authorize! :email_conversations_rmtag, ::Ishapi
14
+ convos = Office::EmailConversation.find params[:ids]
15
+ outs = convos.map do |convo|
16
+ convo.rmtag( params[:emailtag] )
17
+ end
18
+ flash[:notice] = "outcome: #{outs}"
19
+ render json: { status: :ok }
20
+ end
21
+
12
22
  def delete
13
23
  authorize! :email_conversations_delete, ::Ishapi
14
24
  convos = Office::EmailConversation.find params[:ids]
15
25
  outs = convos.map do |convo|
16
- convo.add_tag( WpTag::EMAILTAG_TRASH )
17
- convo.remove_tag( WpTag::EMAILTAG_INBOX )
26
+ convo.add_tag( WpTag::TRASH )
27
+ convo.remove_tag( WpTag::INBOX )
18
28
  end
19
29
  flash[:notice] = "outcome: #{outs}"
30
+ render json: { status: :ok }
20
31
  end
21
32
 
22
33
  end
@@ -0,0 +1,54 @@
1
+
2
+ require_dependency "ishapi/application_controller"
3
+
4
+ ##
5
+ ## supersedes Ishapi::MapsController
6
+ ##
7
+ class Ishapi::LocationsController < Ishapi::ApplicationController
8
+
9
+ before_action :check_profile # , only: [ :show, :show_marker ]
10
+
11
+ def show
12
+ if 'self' == params[:slug] # @TODO: constantize _vp_ 2023-01-11
13
+ @location = ::Gameui::Map.where( slug: @current_profile[:email] ).first
14
+ else
15
+ @location = ::Gameui::Map.where( slug: params[:slug] ).first
16
+ @location ||= ::Gameui::Map.find params[:slug]
17
+ end
18
+
19
+ authorize! :show, @location
20
+ map = @location.map || @location # @TODO: remove _vp_ 2023-03-20
21
+
22
+ @newsitems = @location.newsitems.page( params[:newsitems_page]
23
+ ).per( @location.newsitems_page_size )
24
+
25
+ @markers = map.markers.permitted_to(@current_profile).order_by(ordering: :asc)
26
+ # case map.ordering_type
27
+ # when ::Gameui::Map::ORDERING_TYPE_ALPHABETIC
28
+ # @markers = @markers.order_by( name: :asc )
29
+ # when ::Gameui::Map::ORDERING_TYPE_CUSTOM
30
+ # @markers = @markers.order_by( ordering: :asc )
31
+ # end
32
+
33
+ if map.is_premium && !@current_profile.has_premium_purchase( map )
34
+ render 'show_restricted'
35
+ else
36
+ respond_to do |format|
37
+ format.json do
38
+ render 'show'
39
+ end
40
+ format.html do
41
+ render 'show'
42
+ end
43
+ end
44
+ end
45
+ end
46
+
47
+ def show_marker
48
+ @marker = ::Gameui::Marker.find_by slug: params[:slug]
49
+ authorize! :show, @marker
50
+ render json: @marker
51
+ end
52
+
53
+ end
54
+
@@ -1,6 +1,9 @@
1
1
 
2
2
  require_dependency "ishapi/application_controller"
3
3
 
4
+ ##
5
+ ## @deprecated, use Ishapi::LocationsController
6
+ ##
4
7
  class Ishapi::MapsController < Ishapi::ApplicationController
5
8
  before_action :check_profile, only: [ :show ]
6
9
 
@@ -15,6 +15,8 @@ Ishapi::EmailMessageIntakeJob.perform_now( stub.id.to_s )
15
15
  ## 2023-03-02 _vp_ Continue
16
16
  ## 2023-03-07 _vp_ Continue
17
17
  ##
18
+ ## class name: EIJ
19
+ ##
18
20
  class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
19
21
 
20
22
  # include Sidekiq::Worker ## From: https://stackoverflow.com/questions/59114063/sidekiq-options-giving-sidekiqworker-cannot-be-included-in-an-activejob-for
@@ -65,7 +67,7 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
65
67
  the_mail = Mail.new(_mail)
66
68
  message_id = the_mail.header['message-id'].decoded
67
69
  in_reply_to_id = the_mail.header['in-reply-to']&.to_s
68
- email_inbox_tag_id = WpTag.email_inbox_tag.id
70
+ email_inbox_tag_id = WpTag.emailtag(WpTag::INBOX).id
69
71
 
70
72
  @message = ::Office::EmailMessage.where( message_id: message_id ).first
71
73
  @message ||= ::Office::EmailMessage.new
@@ -142,7 +144,9 @@ class Ishapi::EmailMessageIntakeJob < Ishapi::ApplicationJob
142
144
  ## Actions & Filters
143
145
  email_filters = Office::EmailFilter.active
144
146
  email_filters.each do |filter|
145
- if @message.from.match( filter.from_regex ) # || @message.part_html.match( filter.body_regex ) ) # || MiaTagger.analyze( @message.part_html, :is_spammy_recruite ).score > .5
147
+ if @message.from.match( filter.from_regex )
148
+ # || @message.part_html.match( filter.body_regex ) )
149
+ # || MiaTagger.analyze( @message.part_html, :is_spammy_recruite ).score > .5
146
150
  @message.apply_filter( filter )
147
151
  end
148
152
  end
@@ -34,7 +34,7 @@ class Ishapi::Ability
34
34
  ##
35
35
  if %w| victor@wasya.co victor@piousbox.com piousbox@gmail.com |.include?( user_profile.email )
36
36
 
37
- can [ :email_conversations_delete ], ::Ishapi
37
+ can [ :manage ], ::Ishapi
38
38
 
39
39
  can [ :show ], ::Office::EmailMessage
40
40
  end
@@ -0,0 +1,14 @@
1
+
2
+ .locations-show
3
+ .max-width
4
+ .header
5
+ %h3.title Location #{@location.slug}
6
+
7
+ .map
8
+ .markers
9
+ .title Markers (#{@markers.length}):
10
+ .items
11
+ - @markers.each do |marker|
12
+ = render 'ishapi/markers/card', marker: marker
13
+ .actions
14
+ .newsitems
@@ -0,0 +1,28 @@
1
+
2
+ - destination = marker.destination
3
+
4
+ .markers--card.Card
5
+ - if destination.premium_tier && !@current_profile&.has_premium_purchase( destination )
6
+ #{marker.name} [purchase]
7
+ - else
8
+ - if marker.url
9
+ #{marker.url} [external]
10
+ - else
11
+ = link_to marker.name, location_path(destination)
12
+
13
+
14
+
15
+ -# const goto = (e) => {
16
+ -# e.preventDefault()
17
+ -# if (marker.premium_tier && !marker.is_purchased) {
18
+ -# setItemToUnlock(marker)
19
+ -# } else {
20
+ -# if (marker.url) {
21
+ -# setShowUrl(marker.url) // @TODO: this should be encoded in the (server-side) router eventually. _vp_ 2022-09-11
22
+ -# }
23
+ -# else {
24
+ -# history.push(href)
25
+ -# }
26
+ -# }
27
+ -# }
28
+
data/config/routes.rb CHANGED
@@ -8,10 +8,11 @@ Ishapi::Engine.routes.draw do
8
8
  resources :addresses
9
9
 
10
10
  # E
11
- post 'email_messages', to: 'email_messages#receive'
11
+ post 'email_messages', to: 'email_messages#receive'
12
12
  get 'email_messages/:id', to: 'email_messages#show', as: :email_message
13
13
 
14
- delete 'email_conversations', to: 'email_conversations#delete'
14
+ delete 'email_conversations', to: 'email_conversations#delete'
15
+ post 'email_conversations/rmtag/:emailtag', to: 'email_conversations#rmtag'
15
16
 
16
17
  # G
17
18
  get 'galleries', :to => 'galleries#index'
@@ -27,6 +28,9 @@ Ishapi::Engine.routes.draw do
27
28
  get 'leadsets', to: 'leadsets#index'
28
29
  delete 'leadsets', to: 'leadsets#destroy'
29
30
 
31
+ get 'locations/show/:slug', to: 'locations#show'
32
+ resources :locations
33
+
30
34
  get 'maps', to: 'maps#index'
31
35
  get 'maps/view/:slug', to: 'maps#show'
32
36
  get 'markers/view/:slug', to: 'maps#show_marker'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ishapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.240
4
+ version: 0.1.8.242
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-20 00:00:00.000000000 Z
11
+ date: 2023-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -204,8 +204,9 @@ files:
204
204
  - Rakefile
205
205
  - app/assets/config/ishapi_manifest.js
206
206
  - app/assets/javascripts/ishapi/application.js
207
- - app/assets/stylesheets/ishapi/application.css
207
+ - app/assets/stylesheets/ishapi/application.scss
208
208
  - app/assets/stylesheets/ishapi/galleries.scss
209
+ - app/assets/stylesheets/ishapi/locations.scss
209
210
  - app/assets/stylesheets/scaffold.css
210
211
  - app/controllers/ishapi/addresses_controller.rb
211
212
  - app/controllers/ishapi/application_controller.rb
@@ -215,6 +216,7 @@ files:
215
216
  - app/controllers/ishapi/gameui_controller.rb
216
217
  - app/controllers/ishapi/invoices_controller.rb
217
218
  - app/controllers/ishapi/leadsets_controller.rb
219
+ - app/controllers/ishapi/locations_controller.rb
218
220
  - app/controllers/ishapi/maps_controller.rb
219
221
  - app/controllers/ishapi/my/galleries_controller.rb
220
222
  - app/controllers/ishapi/my/reports_controller.rb
@@ -249,6 +251,7 @@ files:
249
251
  - app/views/ishapi/galleries/show.json.jbuilder
250
252
  - app/views/ishapi/galleries/show_premium_locked.jbuilder
251
253
  - app/views/ishapi/galleries/show_premium_unlocked.jbuilder
254
+ - app/views/ishapi/locations/show.haml
252
255
  - app/views/ishapi/mailer/confirmation_instructions.html.erb
253
256
  - app/views/ishapi/mailer/email_changed.html.erb
254
257
  - app/views/ishapi/mailer/password_change.html.erb
@@ -259,6 +262,7 @@ files:
259
262
  - app/views/ishapi/maps/index.jbuilder
260
263
  - app/views/ishapi/maps/show.jbuilder
261
264
  - app/views/ishapi/maps/show_restricted.jbuilder
265
+ - app/views/ishapi/markers/_card.haml
262
266
  - app/views/ishapi/markers/_index.jbuilder
263
267
  - app/views/ishapi/my/videos/index.jbuilder
264
268
  - app/views/ishapi/newsitems/_index.jbuilder