ish_manager 0.1.8.496 → 0.1.8.498
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/email_conversations.js +66 -0
- data/app/assets/javascripts/ish_manager/shared.js +2 -2
- data/app/assets/stylesheets/ish_manager/utils_bootstrap.scss +8 -0
- data/app/controllers/ish_manager/categories_controller.rb +7 -0
- data/app/controllers/ish_manager/email_conversations_controller.rb +4 -0
- data/app/views/ish_manager/email_conversations/index.haml +25 -9
- data/app/views/ish_manager/email_conversations/show.haml +2 -1
- data/config/routes.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01f24c43ee2d5b50d59771c4eeedea644cd07a30accde9b1a189ddde004deeb7
|
4
|
+
data.tar.gz: 942aefc0638ab813bbef8b065595e672c6eef459e19c78ffa2aba74b83a288fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47a795e6bcb6d82e373fbc7841545c97af812be5684eb5c0a295035c351cf3e87a82dc1df93eb7d3d595146775bc62e2eda899cde4911a79fe4f68ede1c1bdf0
|
7
|
+
data.tar.gz: 3ba886401812ad306fd5bf3f901e02b272c085951775610b11f6d186b08d159f41bb0cf17588932ee95b794df50d007b20c79019acbb4d13b6fcade2bcc1e0af
|
@@ -47,6 +47,72 @@ $(document).ready(() => {
|
|
47
47
|
|
48
48
|
})
|
49
49
|
|
50
|
+
$(".add-tag-btn").click(function(e) {
|
51
|
+
if ( !confirm('Are you sure?') ) { return; }
|
52
|
+
|
53
|
+
const jwt_token = $("#Config").data('jwt-token')
|
54
|
+
const action_path = $(this).data('url')
|
55
|
+
const emailtag = $("select[name='emailtag']").val()
|
56
|
+
const out = []
|
57
|
+
|
58
|
+
$( $("input[type='checkbox'].i-sel:checked") ).each( idx => {
|
59
|
+
let val = $($("input[type='checkbox'].i-sel:checked")[idx]).val()
|
60
|
+
out.push(val)
|
61
|
+
})
|
62
|
+
|
63
|
+
$.ajax({
|
64
|
+
url: action_path,
|
65
|
+
type: 'POST',
|
66
|
+
data: {
|
67
|
+
ids: out,
|
68
|
+
jwt_token: jwt_token,
|
69
|
+
emailtag: emailtag,
|
70
|
+
|
71
|
+
},
|
72
|
+
success: e => {
|
73
|
+
logg((e||{}).responseText, 'Ok')
|
74
|
+
location.reload()
|
75
|
+
},
|
76
|
+
error: e => {
|
77
|
+
logg((e||{}).responseText, 'Err')
|
78
|
+
},
|
79
|
+
})
|
80
|
+
|
81
|
+
})
|
82
|
+
|
83
|
+
$(".remove-tag-btn").click(function(e) {
|
84
|
+
if ( !confirm('Are you sure?') ) { return; }
|
85
|
+
|
86
|
+
const jwt_token = $("#Config").data('jwt-token')
|
87
|
+
const action_path = $(this).data('url')
|
88
|
+
const emailtag = $("select[name='emailtag']").val()
|
89
|
+
const out = []
|
90
|
+
|
91
|
+
$( $("input[type='checkbox'].i-sel:checked") ).each( idx => {
|
92
|
+
let val = $($("input[type='checkbox'].i-sel:checked")[idx]).val()
|
93
|
+
out.push(val)
|
94
|
+
})
|
95
|
+
|
96
|
+
$.ajax({
|
97
|
+
url: action_path,
|
98
|
+
type: 'POST',
|
99
|
+
data: {
|
100
|
+
ids: out,
|
101
|
+
jwt_token: jwt_token,
|
102
|
+
emailtag: emailtag,
|
103
|
+
|
104
|
+
},
|
105
|
+
success: e => {
|
106
|
+
logg((e||{}).responseText, 'Ok')
|
107
|
+
location.reload()
|
108
|
+
},
|
109
|
+
error: e => {
|
110
|
+
logg((e||{}).responseText, 'Err')
|
111
|
+
},
|
112
|
+
})
|
113
|
+
|
114
|
+
})
|
115
|
+
|
50
116
|
$(".delete-btn").click(function(e) {
|
51
117
|
if ( !confirm('Are you sure?') ) { return; }
|
52
118
|
|
@@ -10,8 +10,8 @@
|
|
10
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
11
|
* If you log more than one thing, they can interact, allowing you to validate control flow.
|
12
12
|
* * the logger can be turned off by making this function simply return.
|
13
|
-
|
14
|
-
|
13
|
+
**/
|
14
|
+
function logg (a, b="", c=null) {
|
15
15
|
c = "string" === typeof c ? c : b.replace(/\W/g, "");
|
16
16
|
if (c.length > 0) {
|
17
17
|
window[c] = a;
|
@@ -22,5 +22,12 @@ class ::IshManager::CategoriesController < IshManager::ApplicationController
|
|
22
22
|
@leads = @leads.page( params[:leads_page] ).per( current_profile.per_page )
|
23
23
|
end
|
24
24
|
|
25
|
+
def create_email_tag
|
26
|
+
@tag = WpTag.emailtag( params[:tag][:name] )
|
27
|
+
authorize! :create, @tag
|
28
|
+
@tag.persisted? ? flash_notice('persisted') : flash_alert('cannot save tag')
|
29
|
+
redirect_to request.referrer ? request.referrer : email_conversations_path
|
30
|
+
end
|
31
|
+
|
25
32
|
end
|
26
33
|
|
@@ -7,6 +7,10 @@ class ::IshManager::EmailConversationsController < IshManager::ApplicationContro
|
|
7
7
|
authorize! :email_conversations_index, IshManager::Ability
|
8
8
|
@email_conversations = ::Office::EmailConversation.all
|
9
9
|
|
10
|
+
@new_tag = WpTag.new
|
11
|
+
@emailtags = WpTag.emailtags
|
12
|
+
@emailtags_list = [[nil,nil]] + WpTag.emailtags.map { |p| [ p.name, p.slug ] }
|
13
|
+
|
10
14
|
per_page = current_profile.per_page
|
11
15
|
# if current_profile.per_page > 100
|
12
16
|
# flash_notice "Cannot display more than 100 conversations per page."
|
@@ -3,21 +3,26 @@
|
|
3
3
|
|
4
4
|
.second-header
|
5
5
|
%i.material-icons mail
|
6
|
-
= link_to email_conversations_in_path(WpTag::INBOX) do
|
7
|
-
Inbox (#{Office::EmailConversation.in_emailtag(WpTag::INBOX).length})
|
8
|
-
= link_to email_conversations_notin_path(WpTag::INBOX) do
|
9
|
-
Not Inbox (#{Office::EmailConversation.not_in_emailtag(WpTag::INBOX).length})
|
10
|
-
|
11
|
-
= link_to email_conversations_in_path(WpTag::TRASH) do
|
12
|
-
Trash (#{Office::EmailConversation.in_emailtag(WpTag::TRASH).length})
|
13
|
-
= link_to email_conversations_notin_path(WpTag::TRASH) do
|
14
|
-
Not Trash (#{Office::EmailConversation.not_in_emailtag(WpTag::TRASH).length})
|
15
6
|
|
16
7
|
- if params[:slug]
|
17
8
|
slug: #{params[:slug]}
|
18
9
|
- if params[:not_slug]
|
19
10
|
not slug: #{params[:not_slug]}
|
20
11
|
|
12
|
+
- @emailtags.each do |emailtag|
|
13
|
+
.bordered.inline-block
|
14
|
+
= link_to email_conversations_in_path(emailtag.slug) do
|
15
|
+
#{emailtag.name} (#{Office::EmailConversation.in_emailtag(emailtag.slug).length})
|
16
|
+
= link_to email_conversations_notin_path(emailtag.slug) do
|
17
|
+
Not #{emailtag.name} (#{Office::EmailConversation.not_in_emailtag(emailtag.slug).length})
|
18
|
+
|
19
|
+
|
20
|
+
.bordered.inline-block
|
21
|
+
= form_for @new_tag, url: :create_email_tag, as: :tag do |f|
|
22
|
+
%label New Tag:
|
23
|
+
= f.text_field :name
|
24
|
+
= f.submit '>'
|
25
|
+
|
21
26
|
.actions
|
22
27
|
|
23
28
|
%a.btn.archive-btn{ href: "javascript: void(0)", data: { url: "/api/email_conversations/rmtag/#{WpTag::INBOX}" } }
|
@@ -30,6 +35,17 @@
|
|
30
35
|
%i.material-icons refresh
|
31
36
|
refresh
|
32
37
|
|
38
|
+
.bordered.inline-block
|
39
|
+
= select_tag :emailtag, options_for_select(@emailtags_list)
|
40
|
+
%a.btn.add-tag-btn{ href: "javascript: void(0)", data: { url: "/api/email_conversations/addtag" } }
|
41
|
+
%i.material-icons add
|
42
|
+
Addtag
|
43
|
+
%a.btn.remove-tag-btn{ href: "javascript: void(0)", data: { url: "/api/email_conversations/rmtag" } }
|
44
|
+
%i.material-icons remove
|
45
|
+
Rmtag
|
46
|
+
|
47
|
+
|
48
|
+
|
33
49
|
%br
|
34
50
|
%br
|
35
51
|
= render 'paginate', resource: @email_conversations, param_name: :conv_page, views_prefix: :ish_manager
|
data/config/routes.rb
CHANGED
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.498
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|