ish_manager 0.1.8.397 → 0.1.8.399

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: 48dd240bd2406498ff4432cced69350c3c66efb13c339ed5dfaefb421d256e5b
4
- data.tar.gz: 97c1195165ccac014df21e423315cebacf3bcdc51aac7c40095f7d8a3bd4ac2f
3
+ metadata.gz: ab3eb4ae2c3ce1d114b30a3327dcb37631d38599df86c5e12dbe4cc1ce0fd44a
4
+ data.tar.gz: 109c4fe36fc77458ea0fbfdd6615e1264a2985116f16b5466ef1d3594fde8b9c
5
5
  SHA512:
6
- metadata.gz: dc4895c6a5da8056ef2557cb3609fd512a71f3c14bd4181120337323b6ec6161863e385e8aa119ae7827260406ae07e2888e0bbb2c21fe28873f2838dc58c251
7
- data.tar.gz: dcee31234fecc15bfd8db0f09d6169c99116ddbd63edd81a871a7e55d5b23e9243add1870d8951d62620398317a82562a46be04830f95032a0dac76a4aebe0c5
6
+ metadata.gz: 0e262ac280849d4fab6fcb951224a813d9664e097b2a28b11399d380d145f6f8d4623b086702b3898c60d553270e230f09874093f56647ac994a2cb5e0056338
7
+ data.tar.gz: 1a684d88b90fc52f9ceac39bf4380eb57153f48c653c0e4eefa711e9e47306eed8b5ae5af4c5d007bfdab2b7074fd0f7a63ce8a08baf0073e48b97b41bed977a
@@ -94,6 +94,7 @@
94
94
 
95
95
  .my-actions {
96
96
  display: flex;
97
+ flex-direction: column;
97
98
  }
98
99
 
99
100
  .preview {
@@ -1,99 +1,101 @@
1
1
 
2
2
  require 'business_time'
3
3
 
4
- module IshManager
5
- class ApplicationController < ActionController::Base
6
-
7
- protect_from_forgery :with => :exception, :prepend => true
8
- before_action :set_current_ability
9
- before_action :set_changelog
10
- before_action :set_title
11
- before_action :set_jwt
12
- check_authorization
13
- rescue_from ::CanCan::AccessDenied, :with => :access_denied
14
-
15
- before_action :basic_auth
16
- def basic_auth
17
- return if Rails.env.test?
18
- http_basic_authenticate_or_request_with :name => BASIC_AUTH_NAME, :password => BASIC_AUTH_PASSWORD
19
- end
20
4
 
21
- def home
22
- authorize! :home, IshManager::Ability
23
- render 'home'
24
- end
5
+ class IshManager::ApplicationController < ActionController::Base
25
6
 
26
- #
27
- # private
28
- #
29
- private
7
+ protect_from_forgery :with => :exception, :prepend => true
8
+ before_action :set_current_ability
9
+ before_action :set_changelog
10
+ before_action :set_title
11
+ before_action :set_jwt
12
+ check_authorization
13
+ rescue_from ::CanCan::AccessDenied, :with => :access_denied
30
14
 
31
- def access_denied exception
32
- store_location_for :user, request.path
33
- redirect_to user_signed_in? ? root_path : Rails.application.routes.url_helpers.new_user_session_path, :alert => exception.message
34
- end
15
+ before_action :basic_auth
16
+ def basic_auth
17
+ return if Rails.env.test?
18
+ http_basic_authenticate_or_request_with :name => BASIC_AUTH_NAME, :password => BASIC_AUTH_PASSWORD
19
+ end
35
20
 
36
- def encode(payload, exp = 48.hours.from_now) # @TODO: definitely change, right now I expire once in 2 days.
37
- payload[:exp] = exp.to_i
38
- JWT.encode(payload, Rails.application.secrets.secret_key_base.to_s)
39
- end
21
+ def home
22
+ authorize! :home, IshManager::Ability
23
+ render 'home'
24
+ end
40
25
 
41
- def pp_errors err
42
- err
43
- end
26
+ #
27
+ # private
28
+ #
29
+ private
44
30
 
45
- def puts! a, b=''
46
- puts "+++ +++ #{b}"
47
- puts a.inspect
48
- end
31
+ def access_denied exception
32
+ store_location_for :user, request.path
33
+ redirect_to user_signed_in? ? root_path : Rails.application.routes.url_helpers.new_user_session_path, :alert => exception.message
34
+ end
49
35
 
50
- def set_changelog
51
- @version = Gem.loaded_specs['ish_manager'].version.to_s
52
- end
36
+ def encode(payload, exp = 48.hours.from_now) # @TODO: definitely change, right now I expire once in 2 days.
37
+ payload[:exp] = exp.to_i
38
+ JWT.encode(payload, Rails.application.secrets.secret_key_base.to_s)
39
+ end
53
40
 
54
- def set_current_ability
55
- if !current_user
56
- raise ::CanCan::AccessDenied
57
- end
58
- @current_profile ||= ::Ish::UserProfile.find_by({ email: current_user.email })
59
- @current_ability ||= ::IshManager::Ability.new( @current_profile )
60
- end
41
+ def pp_errors err
42
+ err
43
+ end
61
44
 
62
- def set_jwt
63
- @jwt_token = encode(user_profile_id: @current_user.profile.id.to_s)
64
- end
45
+ def puts! a, b=''
46
+ puts "+++ +++ #{b}"
47
+ puts a.inspect
48
+ end
65
49
 
66
- def set_lists
67
- @galleries_list = Gallery.all.list
68
- @locations_list = ::Gameui::Map.list
69
- @maps_list = ::Gameui::Map.list # @TODO: missing nonpublic!
70
- @reports_list = Report.all.list
71
- @user_profiles_list = Ish::UserProfile.list
72
- @videos_list = Video.all.list
73
- @leads_list = Lead.list
74
- @leadsets_list = Leadset.list
75
- @email_actions_list = [[nil,nil]] + Office::EmailAction.all.map { |a| [ a.slug, a.id ] }
76
- @email_templates_list = [[nil,nil]] + Ish::EmailTemplate.all.map { |t| [ t.slug, t.id ] }
77
- end
50
+ def set_changelog
51
+ @version = Gem.loaded_specs['ish_manager'].version.to_s
52
+ end
78
53
 
79
- def set_title
80
- @page_title = "#{ params[:controller].gsub('ish_manager/', '') } #{params[:action]} #{params[:slug]||params[:id]} ".gsub(" ", " ")
54
+ def set_current_ability
55
+ if !current_user
56
+ raise ::CanCan::AccessDenied
81
57
  end
58
+ @current_profile ||= ::Ish::UserProfile.find_by({ email: current_user.email })
59
+ @current_ability ||= ::IshManager::Ability.new( @current_profile )
60
+ end
82
61
 
83
- # @TODO: obsolete, remove _vp_ 2022-10-15
84
- def update_profile_pic
85
- return unless params[:photo]
86
- @photo = Photo.new :photo => params[:photo]
87
- @photo.user_profile = @current_profile
88
- flag = @photo.save
89
- @resource.profile_photo = @photo
90
- flagg = @resource.save
91
- if flag && flagg
92
- flash[:notice] = 'Success'
93
- else
94
- flash[:alert] = "No Luck. #{@photo.errors.messages} #{@resource.errors.messages}"
95
- end
96
- end
62
+ def set_jwt
63
+ @jwt_token = encode(user_profile_id: @current_user.profile.id.to_s)
64
+ end
97
65
 
66
+ def set_lists
67
+ @blank_template = Tmpl.new
68
+
69
+ @email_actions_list = [[nil,nil]] + Office::EmailAction.all.map { |a| [ a.slug, a.id ] }
70
+ @email_templates_list = [[nil,nil]] + Ish::EmailTemplate.all.map { |t| [ t.slug, t.id ] }
71
+ @galleries_list = Gallery.all.list
72
+ @leads_list = Lead.list
73
+ @leadsets_list = Leadset.list
74
+ @locations_list = ::Gameui::Map.list
75
+ @maps_list = ::Gameui::Map.list # @TODO: missing nonpublic!
76
+ @profiles_list = Ish::UserProfile.list
77
+ @reports_list = Report.all.list
78
+ @user_profiles_list = Ish::UserProfile.list
79
+ @videos_list = Video.all.list
98
80
  end
81
+
82
+ def set_title
83
+ @page_title = "#{ params[:controller].gsub('ish_manager/', '') } #{params[:action]} #{params[:slug]||params[:id]} ".gsub(" ", " ")
84
+ end
85
+
86
+ # @TODO: obsolete, remove _vp_ 2022-10-15
87
+ def update_profile_pic
88
+ return unless params[:photo]
89
+ @photo = Photo.new :photo => params[:photo]
90
+ @photo.user_profile = @current_profile
91
+ flag = @photo.save
92
+ @resource.profile_photo = @photo
93
+ flagg = @resource.save
94
+ if flag && flagg
95
+ flash[:notice] = 'Success'
96
+ else
97
+ flash[:alert] = "No Luck. #{@photo.errors.messages} #{@resource.errors.messages}"
98
+ end
99
+ end
100
+
99
101
  end
@@ -5,7 +5,7 @@ class IshManager::NewsitemsController < IshManager::ApplicationController
5
5
 
6
6
  def create
7
7
  @newsitem = Newsitem.new params[:newsitem].permit!
8
- @resource ||= Ish::UserProfile.find params[:newsitem][:user_profile_id] if !params[:newsitem][:user_profile_id].blank?
8
+ @resource ||= Ish::UserProfile.find params[:newsitem][:profile_id] if !params[:newsitem][:profile_id].blank?
9
9
  @resource ||= ::Gameui::Map.find params[:newsitem][:map_id] if !params[:newsitem][:map_id].blank?
10
10
  @resource.newsitems << @newsitem
11
11
  @resource.touch
@@ -6,11 +6,14 @@ class IshManager::UserProfilesController < IshManager::ApplicationController
6
6
  def index
7
7
  @user_profiles = Ish::UserProfile.all
8
8
  authorize! :index, Ish::UserProfile
9
+ if params[:q]
10
+ @user_profiles = @user_profiles.where({ :email => /#{params[:q]}/i })
11
+ end
9
12
  end
10
13
 
11
14
  def show
12
- @user_profile = Ish::UserProfile.find params[:id]
13
- authorize! :show, @user_profile
15
+ @profile = Ish::UserProfile.find params[:id]
16
+ authorize! :show, @profile
14
17
  end
15
18
 
16
19
  def edit
@@ -26,10 +26,14 @@
26
26
  %li= link_to 'Categories & Tags', categories_path
27
27
  %ul
28
28
  %li= link_to '+Newsitem', new_newsitem_path
29
- %li= link_to 'Ish::UserProfiles', user_profiles_path
29
+ %li
30
+ = link_to 'Ish::UserProfiles', user_profiles_path
31
+ .inline-search
32
+ = form_tag user_profiles_path, method: :get do
33
+ = text_field_tag :q
30
34
  %li= link_to "Ish::ImageAsset's", image_assets_path
31
35
  %li
32
- = link_to 'Locations (maps)', maps_path
36
+ = link_to 'Locations', maps_path
33
37
  .inline-search
34
38
  = form_tag maps_path, method: :get do
35
39
  = text_field_tag :q
@@ -54,6 +54,8 @@
54
54
 
55
55
  .my-actions.hide
56
56
  = render 'ish_manager/email_contexts/form_reply', lead: lead
57
+ .bordered-card
58
+ = render 'ish_manager/email_contexts/form', ctx: Ctx.new({ lead_id: lead.id, email_template: Tmpl.blank_template, from_email: msg.to, subject: msg.subject, body: (msg.part_html||msg.part_txt) }), lead: lead
57
59
  -# = button_to 'Reply'
58
60
  -# = button_to 'Reply All'
59
61
  -# = button_to 'New Template'
@@ -2,6 +2,7 @@
2
2
  .item{ style: "display: flex; flex-direction: column;" }
3
3
  = render 'map_meta_row', map: map
4
4
  - if map.childs.length > 0
5
+ .collapse-expand{ id: map.id.to_s } <e>
5
6
  %ul{ style: "margin-left: 5em;" }
6
7
  - map.childs.each do |m|
7
8
  %li
@@ -2,10 +2,11 @@
2
2
  -# ish_manager / maps / index.haml
3
3
  -#
4
4
 
5
- .maps-index
6
- %h1
7
- Maps (#{@maps.length})
8
- = link_to '[+]', new_map_path
5
+ .maps-index.padded
6
+ .header
7
+ %h1.title
8
+ Maps (#{@maps.length})
9
+ = link_to '[+]', new_map_path
9
10
 
10
11
  .red-border
11
12
  = form_tag import_map_path, :multipart => true do
@@ -15,11 +16,12 @@
15
16
  = check_box_tag :delete_existing
16
17
  = submit_tag 'Import Map'
17
18
 
18
- - @maps.each do |map|
19
- = render 'index_item', map: map
19
+ .collapse-expand#collapseExpandMapsIndex Maps
20
+ .a
21
+ - @maps.each do |map|
22
+ = render 'index_item', map: map
20
23
 
21
-
22
- %h1 All Maps (#{@all_maps.length})
24
+ .collapse-expand#collapseExpandMapsIndex2 All Maps (#{@all_maps.length})
23
25
  %ul
24
26
  - @all_maps.each do |m|
25
27
  %li
@@ -8,6 +8,9 @@
8
8
  .field
9
9
  = f.label :map
10
10
  = f.select :map_id, options_for_select( @maps_list, selected:( newsitem[:map_id] || params[:map_id] ) ), {}, class: 'select2'
11
+ .field
12
+ = f.label :profile
13
+ = f.select :profile_id, options_for_select( @profiles_list, selected: newsitem[:profile_id] ), {}, class: 'select2'
11
14
  .col-sm-6
12
15
  = f.submit :submit
13
16
 
@@ -0,0 +1 @@
1
+ app/views/ish_manager/newsitems/_item.haml
@@ -1,5 +1,5 @@
1
1
 
2
- .newsitems-new
2
+ .newsitems-new.max-width
3
3
  %h1
4
4
  New Newsitem
5
5
  = render 'form', :newsitem => @newsitem
@@ -1,4 +1,6 @@
1
1
 
2
- %h5 Editing profile for: `#{@profile.email}`
2
+ .user-profiles-edit.max-width
3
+ .header
4
+ %h2.title Editing profile for: `#{@profile.email}`
3
5
 
4
- = render 'form', :profile => @profile
6
+ = render 'form', :profile => @profile
@@ -10,5 +10,5 @@
10
10
  - @user_profiles.each do |profile|
11
11
  %li
12
12
  = link_to '[~]', edit_user_profile_path(profile)
13
- = profile.email
13
+ = link_to profile.email, user_profile_path(profile)
14
14
 
@@ -1,15 +1,16 @@
1
1
 
2
- .user-profiles--show
3
- %ul
4
- %li
5
- User profile: #{@user_profile.inspect}
6
- %li
7
- Purchased Items:
8
- %ul
9
- - @user_profile.premium_purchases.each do |purchase|
10
- %li
11
- = purchase.item_type.constantize.find(purchase.item_id).inspect
12
- -## this doesn't work b/c an unlocked map has no city.
13
- -# = render 'ish_manager/reports/show_mini', report: purchase.item_type.constantize.find(purchase.item_id)
2
+ .user-profiles-show.max-width
3
+ .header
4
+ %h2.title Profile #{@profile.email}
14
5
 
6
+ .newsitems
7
+ .title Newsitems (#{@profile.newsitems.length})
8
+ - @profile.newsitems.each do |newsitem|
9
+ = render 'ish_manager/newsitems/show', newsitem: newsitem
15
10
 
11
+ .premium-purchases
12
+ Payments (purchased items) (#{@profile.payments.length}):
13
+ - @profile.payments.each do |payment|
14
+ .Card.item
15
+ = payment.inspect
16
+ = payment.item&.inspect
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.397
4
+ version: 0.1.8.399
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-28 00:00:00.000000000 Z
11
+ date: 2023-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -521,6 +521,7 @@ files:
521
521
  - app/views/ish_manager/newsitems/_header.haml
522
522
  - app/views/ish_manager/newsitems/_index.haml
523
523
  - app/views/ish_manager/newsitems/_item.haml
524
+ - app/views/ish_manager/newsitems/_show.haml
524
525
  - app/views/ish_manager/newsitems/edit.haml
525
526
  - app/views/ish_manager/newsitems/index.haml
526
527
  - app/views/ish_manager/newsitems/new.haml