ish_manager 0.1.8.496 → 0.1.8.497

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: cff574ed65818864f7ed604581b4c43c5ee3b9783f1e93fbae03dd66015a2799
4
- data.tar.gz: e9928c499f62ab98ede00532156431f6c19651bdef8bca029b17980bc18ce596
3
+ metadata.gz: 4cc91f9b554ed9df6ac0f58a31e304f1724621e5a67f2e3e5215dd7ea30df711
4
+ data.tar.gz: 0725043735f539fab19f79235727127af569245611e84cc2c6747a24fc51ec93
5
5
  SHA512:
6
- metadata.gz: c5918d1ede4b37cd260839e05e3cc077b448093f0881fdcf53d944add1b454e14312908e1e1b5fde1d55a0e40e2b70e9427e57cb1aed4823418ea9bff886c35d
7
- data.tar.gz: 3a7103fe8b90ab38f7e0ed697b44b57133dee1af0d59f61ec0f8ad9100277169e01071d7e640ca394a8663d3a550244ac6cf1441037de4188752ad1368a7c7db
6
+ metadata.gz: 2f548df9bc7bb60a6a5a840e94c0e09f12eab494828c4125e3b9a57eec47c6c38be959aa5f69ec1625278254cd808c3c55d3d73edb1e103a52919b52583bf7c5
7
+ data.tar.gz: 76e9ba931280138047f57289577c31ee19b11ad4cd874af6f52d073f68ee03adf7f7d6a286687d48c4570eb6af831c8abe06aa4d46d53ea755f47677014210d6
@@ -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
- function logg (a, b="", c=null) {
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;
@@ -1,4 +1,12 @@
1
1
 
2
+ /* I */
3
+
4
+ .inline-block {
5
+ form {
6
+ display: inline-block;
7
+ }
8
+ }
9
+
2
10
  /* R */
3
11
 
4
12
  .right-0 {
@@ -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
@@ -15,6 +15,7 @@ IshManager::Engine.routes.draw do
15
15
  resources :appliance_tmpls
16
16
 
17
17
  # get 'categories', to: 'categories#index'
18
+ post '/categories/create-email-tag', to: 'categories#create_email_tag', as: :create_email_tag
18
19
  resources :categories
19
20
 
20
21
  resources 'events'
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.496
4
+ version: 0.1.8.497
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox