ish_manager 0.1.8.356 → 0.1.8.357
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/ish_manager/application.js +1 -0
- data/app/assets/javascripts/ish_manager/galleries.js +78 -0
- data/app/assets/stylesheets/ish_manager/galleries.scss +10 -0
- data/app/controllers/ish_manager/galleries_controller.rb +23 -8
- data/app/mailers/ish_manager/application_mailer.rb +1 -1
- data/app/mailers/ish_manager/meeting_mailer.rb +2 -1
- data/app/mailers/ish_manager/office_mailer.rb +2 -1
- data/app/views/ish_manager/email_actions/_form.haml +16 -6
- data/app/views/ish_manager/email_actions/index.haml +4 -2
- data/app/views/ish_manager/email_contexts/show.haml +1 -1
- data/app/views/ish_manager/email_templates/_form.haml +3 -0
- data/app/views/ish_manager/email_templates/_wasyaco_roundborders.html.erb +5 -6
- data/app/views/ish_manager/galleries/show.haml +10 -1
- data/app/views/ish_manager/photos/_index_thumbs.haml +1 -1
- data/config/routes.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76cc27a494947841dfe406703bd47dc759864338a4ff20d4e140f990136ed87c
|
4
|
+
data.tar.gz: fd94bcd0eb392cf1d66785b710488c822339d058ca20729849905cd3c40fe7a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6945c3b629c8d6ad8cff0aea1c139611dd3665e59278109762be0ce52433ab0e6ee550073787a6b7acd38e92ca562b71f3b833ab2feeb93d4d830594601546e7
|
7
|
+
data.tar.gz: d5c953475df34ced1be74b808444646755a4069314e0823f8186a0cd814382606abb1838b9daf8a5ebf9441309cbdae7d3fb7bfc3168b114f0f51db4ddf591f9
|
@@ -0,0 +1,78 @@
|
|
1
|
+
|
2
|
+
const AppRouter = {
|
3
|
+
gallery_update_ordering_path: ({ id, slug }) => `/manager/galleries/${slug || id}/update_ordering`,
|
4
|
+
}
|
5
|
+
$(document).ready(function () {
|
6
|
+
|
7
|
+
if ( $(".orderable-items").length ) {
|
8
|
+
if ($(".orderable-items").length > 1) {
|
9
|
+
logg("There are many .orderable-items! This was only meant to work with one.")
|
10
|
+
}
|
11
|
+
// let slug = $( $(".orderable-items")[0] ).data('slug')
|
12
|
+
let id = $( $(".orderable-items")[0] ).data('id')
|
13
|
+
let token = $( $(".orderable-items")[0] ).data('token')
|
14
|
+
|
15
|
+
$(".orderable-items .items > div").each(function (idx, item) {
|
16
|
+
let $el = $(this)
|
17
|
+
|
18
|
+
$(this).find('a.mvLeft').click(function() {
|
19
|
+
// move element up one step
|
20
|
+
if ($el.not(':first-child'))
|
21
|
+
$el.prev().before($el);
|
22
|
+
})
|
23
|
+
|
24
|
+
$(this).find('a.mvRight').click(function() {
|
25
|
+
// move element down one step
|
26
|
+
if ($el.not(':last-child'))
|
27
|
+
$el.next().after($el);
|
28
|
+
})
|
29
|
+
|
30
|
+
})
|
31
|
+
$(".save-ordering").click(function() {
|
32
|
+
|
33
|
+
let els = $(this).parent().find(".items .item")
|
34
|
+
let ids = []
|
35
|
+
$(els).map((idx, item) => {
|
36
|
+
ids.push( $(item).data('id') )
|
37
|
+
})
|
38
|
+
|
39
|
+
$.ajax({
|
40
|
+
type: 'PATCH',
|
41
|
+
url: AppRouter.gallery_update_ordering_path({ id: id }),
|
42
|
+
data: {
|
43
|
+
authenticity_token: token,
|
44
|
+
gallery: {
|
45
|
+
sorted_photo_ids: ids,
|
46
|
+
},
|
47
|
+
},
|
48
|
+
success: (e) => {
|
49
|
+
logg('success')
|
50
|
+
},
|
51
|
+
|
52
|
+
})
|
53
|
+
|
54
|
+
logg('ok')
|
55
|
+
})
|
56
|
+
}
|
57
|
+
|
58
|
+
})
|
59
|
+
|
60
|
+
/*
|
61
|
+
//element to move
|
62
|
+
var $el = $(selector);
|
63
|
+
|
64
|
+
//move element down one step
|
65
|
+
if ($el.not(':last-child'))
|
66
|
+
$el.next().after($el);
|
67
|
+
|
68
|
+
//move element up one step
|
69
|
+
if ($el.not(':first-child'))
|
70
|
+
$el.prev().before($el);
|
71
|
+
|
72
|
+
//move element to top
|
73
|
+
$el.parent().prepend($el);
|
74
|
+
|
75
|
+
//move element to end
|
76
|
+
$el.parent().append($el);
|
77
|
+
*/
|
78
|
+
|
@@ -1,7 +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
|
+
before_action :set_gallery, only: %w|destroy edit j_show show update update_ordering|
|
5
5
|
|
6
6
|
# alphabetized! : )
|
7
7
|
|
@@ -86,22 +86,37 @@ class IshManager::GalleriesController < IshManager::ApplicationController
|
|
86
86
|
|
87
87
|
def show
|
88
88
|
authorize! :show, @gallery
|
89
|
-
@photos = @gallery.photos.unscoped.where({ :is_trash => false })
|
90
|
-
@deleted_photos = @gallery.photos.unscoped.where({ :is_trash => true })
|
89
|
+
@photos = @gallery.photos.unscoped.where({ :is_trash => false }).order_by( ordering: :asc )
|
90
|
+
@deleted_photos = @gallery.photos.unscoped.where({ :is_trash => true }).order_by( ordering: :asc )
|
91
|
+
end
|
92
|
+
|
93
|
+
def update_ordering
|
94
|
+
authorize! :update, @gallery
|
95
|
+
out = []
|
96
|
+
params[:gallery][:sorted_photo_ids].each_with_index do |id, idx|
|
97
|
+
out.push Photo.find( id ).update_attribute( :ordering, idx )
|
98
|
+
end
|
99
|
+
flash[:notice] = "Outcomes: #{out}."
|
100
|
+
redirect_to action: 'show', id: @gallery.id
|
91
101
|
end
|
92
102
|
|
93
103
|
def update
|
94
104
|
old_shared_profile_ids = @gallery.shared_profiles.map(&:id)
|
95
105
|
authorize! :update, @gallery
|
96
106
|
|
97
|
-
params[:gallery][:shared_profiles].
|
107
|
+
if params[:gallery][:shared_profiles].present?
|
108
|
+
params[:gallery][:shared_profiles].delete('')
|
109
|
+
end
|
98
110
|
params[:gallery][:shared_profile_ids] = params[:gallery][:shared_profiles]
|
99
111
|
params[:gallery].delete :shared_profiles
|
100
112
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
113
|
+
flag = @gallery.update_attributes( params[:gallery].permit! )
|
114
|
+
if flag
|
115
|
+
if params[:gallery][:shared_profile_ids].present?
|
116
|
+
new_shared_profiles = Ish::UserProfile.find( params[:gallery][:shared_profile_ids]
|
117
|
+
).select { |p| !old_shared_profile_ids.include?( p.id ) }
|
118
|
+
::IshManager::ApplicationMailer.shared_galleries( new_shared_profiles, @gallery ).deliver
|
119
|
+
end
|
105
120
|
flash[:notice] = 'Success.'
|
106
121
|
redirect_to edit_gallery_path(@gallery)
|
107
122
|
else
|
@@ -1,5 +1,6 @@
|
|
1
1
|
|
2
2
|
class IshManager::OfficeMailer < IshManager::ApplicationMailer
|
3
|
+
default from: 'WasyaCo Consulting <no-reply@wasya.co>'
|
3
4
|
|
4
5
|
def send_campaign_email campaign_id, c_lead_id
|
5
6
|
@ctx = @campaign = ::Ish::EmailContext.find campaign_id
|
@@ -82,7 +83,7 @@ class IshManager::OfficeMailer < IshManager::ApplicationMailer
|
|
82
83
|
end
|
83
84
|
|
84
85
|
|
85
|
-
## 2022-11-10 backup
|
86
|
+
## 2022-11-10 _vp_ backup
|
86
87
|
# def send_context_email ctx_id
|
87
88
|
# @email_ctx = ::Ish::EmailContext.find ctx_id
|
88
89
|
# template = "render/_#{@email_ctx.email_template.slug}"
|
@@ -14,15 +14,12 @@
|
|
14
14
|
.field
|
15
15
|
%label Slug
|
16
16
|
= f.text_field :slug
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
.field
|
18
|
+
%label Descr
|
19
|
+
= f.text_area :descr
|
20
20
|
.field
|
21
21
|
%label Template
|
22
22
|
= f.select :email_template_id, options_for_select( @email_templates_list, selected: act.email_template_id ), {}, class: 'select2'
|
23
|
-
-# .field
|
24
|
-
-# %label State
|
25
|
-
-# = f.select :state, options_for_select( ::Office::EmailAction::STATES, selected: act.state )
|
26
23
|
|
27
24
|
.col-md-6
|
28
25
|
.field
|
@@ -40,3 +37,16 @@
|
|
40
37
|
.row
|
41
38
|
.col-sm-6
|
42
39
|
= f.submit :submit
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
-# .field
|
48
|
+
-# %label State
|
49
|
+
-# = f.select :state, options_for_select( ::Office::EmailAction::STATES, selected: act.state )
|
50
|
+
-# .field
|
51
|
+
-# %label Lead
|
52
|
+
-# = f.select :lead_id, options_for_select( @leads_list, selected: act.lead_id ), {}, class: 'select2'
|
@@ -8,15 +8,17 @@
|
|
8
8
|
|
9
9
|
%table.bordered
|
10
10
|
%tr
|
11
|
-
%th
|
11
|
+
%th= check_box_tag 'abba'
|
12
12
|
%th actions
|
13
13
|
%th slug
|
14
|
+
%th descr
|
14
15
|
%th next actions
|
15
16
|
- @email_actions.each do |act|
|
16
17
|
%tr
|
17
|
-
%td
|
18
|
+
%td= check_box_tag 'abba'
|
18
19
|
%td= link_to '[~]', edit_email_action_path( act )
|
19
20
|
%td= act.slug
|
21
|
+
%td= act.descr
|
20
22
|
-# %td= act.lead&.email
|
21
23
|
%td
|
22
24
|
%ul
|
@@ -13,7 +13,7 @@
|
|
13
13
|
<meta charset="UTF-8">
|
14
14
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
15
15
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
16
|
-
<title
|
16
|
+
<title><%= @ctx.preview_str %></title>
|
17
17
|
|
18
18
|
<style type="text/css">
|
19
19
|
.mcnTextBlock {
|
@@ -839,12 +839,11 @@ h4 {
|
|
839
839
|
|
840
840
|
<body>
|
841
841
|
|
842
|
-
|
843
|
-
<!--[if !gte mso 9]
|
844
|
-
style="display:none; font-size:0px; line-height:0px; max-height:0px; max-width:0px; opacity:0; overflow:hidden; visibility:hidden; mso-hide:all;"
|
845
|
-
|
842
|
+
|
843
|
+
<!--[if !gte mso 9]>-->
|
844
|
+
<span class="mcnPreviewText" style="display:none; font-size:0px; line-height:0px; max-height:0px; max-width:0px; opacity:0; overflow:hidden; visibility:hidden; mso-hide:all;"
|
845
|
+
><%= @ctx.preview_str %></span>
|
846
846
|
<!--<![endif]-->
|
847
|
-
<!--*|END:IF|*-->
|
848
847
|
|
849
848
|
<center>
|
850
849
|
<table align="center" border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable">
|
@@ -22,7 +22,16 @@
|
|
22
22
|
|
23
23
|
.row-thumbs
|
24
24
|
%p.collapse-expand#rowThumbs Thumbs
|
25
|
-
|
25
|
+
.orderable-items{ data: { id: @gallery.id.to_s, slug: @gallery.slug, token: form_authenticity_token } }
|
26
|
+
.flex-row.items
|
27
|
+
- @photos.each do |photo|
|
28
|
+
.itemW
|
29
|
+
%a.mvLeft <
|
30
|
+
%a.mvRight >
|
31
|
+
.item{ data: { id: photo.id.to_s } }
|
32
|
+
= render 'ish_manager/photos/meta_manager', photo: photo
|
33
|
+
= image_tag photo.photo.url( :thumb )
|
34
|
+
= button_tag 'Save ordering', class: 'save-ordering'
|
26
35
|
|
27
36
|
.row-large
|
28
37
|
%p.collapse-expand#rowLarge Large
|
data/config/routes.rb
CHANGED
@@ -5,6 +5,7 @@ IshManager::Engine.routes.draw do
|
|
5
5
|
|
6
6
|
get 'categories', to: 'categories#index'
|
7
7
|
|
8
|
+
patch 'galleries/:id/update_ordering', to: 'galleries#update_ordering'
|
8
9
|
get 'galleries', :to => 'galleries#index', :defaults => { :render_type => Gallery::RENDER_THUMBS }
|
9
10
|
get 'galleries/index_titles', :to => 'galleries#index', :defaults => { :render_type => Gallery::RENDER_TITLES }
|
10
11
|
get 'galleries/index_thumbs', :to => 'galleries#index', :defaults => { :render_type => Gallery::RENDER_THUMBS }
|
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.
|
4
|
+
version: 0.1.8.357
|
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-
|
11
|
+
date: 2023-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -235,6 +235,7 @@ files:
|
|
235
235
|
- app/assets/javascripts/ish_manager/application.js
|
236
236
|
- app/assets/javascripts/ish_manager/email_contexts.js
|
237
237
|
- app/assets/javascripts/ish_manager/email_templates.js
|
238
|
+
- app/assets/javascripts/ish_manager/galleries.js
|
238
239
|
- app/assets/javascripts/ish_manager/maps.js
|
239
240
|
- app/assets/javascripts/ish_manager/shared.js
|
240
241
|
- app/assets/javascripts/ish_manager/trash/application_materialize.js
|