ish_manager 0.1.8.122 → 0.1.8.123
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/ish_manager/leads_controller.rb +21 -9
- data/app/helpers/ish_manager/application_helper.rb +4 -0
- data/app/views/ish_manager/leads/_form.haml +7 -1
- data/app/views/ish_manager/leads/edit.haml +3 -0
- data/app/views/ish_manager/leads/index.haml +12 -4
- data/config/routes.rb +2 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60c6a0b6aa5fed07b31412424c50e2f14c395930
|
4
|
+
data.tar.gz: 63cce52eb81e45612c83ae89a3088c229f47805b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc8df32d95c61e57a56c3d297f65b5147dd74854a2e27a59b4d6ea90a373c0ba9d44764b17606def53253a752db793dfb11b791054ee14fea4e99b02536f33ed
|
7
|
+
data.tar.gz: 6195b25ea59759e07c2537e81eb392ce6ff8771b20d37395ad79f755e4e593c2e0db47f37f8c86ba27f8ca3c6068ab29e3ef1914ef948497eb789c9d7ae598ec
|
@@ -2,7 +2,12 @@ class IshManager::LeadsController < IshManager::ApplicationController
|
|
2
2
|
|
3
3
|
def index
|
4
4
|
authorize! :index, Ish::Lead
|
5
|
-
@leads = Ish::Lead.where( :profile => current_user.profile )
|
5
|
+
@leads = Ish::Lead.where( :profile => current_user.profile, :is_trash => false )
|
6
|
+
if params[:is_done]
|
7
|
+
@leads = @leads.where( :is_done => true )
|
8
|
+
else
|
9
|
+
@leads = @leads.where( :is_done => false )
|
10
|
+
end
|
6
11
|
end
|
7
12
|
|
8
13
|
def new
|
@@ -22,18 +27,25 @@ class IshManager::LeadsController < IshManager::ApplicationController
|
|
22
27
|
redirect_to :action => 'index'
|
23
28
|
end
|
24
29
|
|
25
|
-
|
30
|
+
def show
|
31
|
+
authorize! :redirect, IshManager::Ability
|
32
|
+
redirect_to :action => :edit, :id => params[:id]
|
33
|
+
end
|
34
|
+
|
35
|
+
def edit
|
36
|
+
@lead = Ish::Lead.find params[:id]
|
37
|
+
authorize! :edit, @lead
|
38
|
+
end
|
39
|
+
|
26
40
|
def update
|
27
|
-
@
|
28
|
-
authorize! :update, @
|
29
|
-
if @
|
30
|
-
flash[:notice] = '
|
31
|
-
redirect_to :action => 'index'
|
41
|
+
@lead = Ish::Lead.find params[:id]
|
42
|
+
authorize! :update, @lead
|
43
|
+
if @lead.update_attributes params[:lead].permit!
|
44
|
+
flash[:notice] = 'Successfully updated lead.'
|
32
45
|
else
|
33
|
-
flash[:alert] = "Cannot update
|
46
|
+
flash[:alert] = "Cannot update lead: #{@lead.errors.messages}"
|
34
47
|
end
|
35
48
|
redirect_to :action => 'index'
|
36
49
|
end
|
37
|
-
=end
|
38
50
|
|
39
51
|
end
|
@@ -14,6 +14,12 @@
|
|
14
14
|
.input-field
|
15
15
|
= f.label :description
|
16
16
|
= f.text_area :description
|
17
|
-
.
|
17
|
+
.field
|
18
|
+
= f.check_box :is_done
|
19
|
+
= f.label :is_done
|
20
|
+
.field
|
21
|
+
= f.check_box :is_trash
|
22
|
+
= f.label :is_trash
|
23
|
+
.actions{ :style => "margin-top: 1em;" }
|
18
24
|
= f.submit
|
19
25
|
|
@@ -1,18 +1,26 @@
|
|
1
1
|
|
2
2
|
.manager--leads-index
|
3
3
|
%h5
|
4
|
-
Leads
|
4
|
+
= link_to 'Leads', leads_path
|
5
|
+
(#{@leads.count})
|
5
6
|
= link_to raw("<i class='fa fa-plus-square'></i>"), new_lead_path
|
6
|
-
|
7
|
+
= link_to '(done)', done_leads_path
|
8
|
+
|
7
9
|
%table
|
8
10
|
%tr
|
11
|
+
%th
|
12
|
+
%th Created At
|
9
13
|
%th Company
|
10
14
|
%th Email
|
11
15
|
%th Job Url
|
12
16
|
%th Description
|
17
|
+
%th Done?
|
13
18
|
- @leads.each do |lead|
|
14
19
|
%tr
|
20
|
+
%td= link_to raw('<i class="fa fa-play"></i>'), lead_path( lead )
|
21
|
+
%td= pretty_date lead.created_at
|
15
22
|
%td= lead.company
|
16
|
-
%td= lead.email
|
17
|
-
%td= link_to
|
23
|
+
%td= link_to raw('<i class="fa fa-envelope"></i>'), "mailto:#{lead.email}"
|
24
|
+
%td= link_to raw('<i class="fa fa-user-md"></i>'), lead.job_url, :target => '_blank'
|
18
25
|
%td= lead.description
|
26
|
+
%td= lead.is_done ? raw('<i class="fa fa-check"></i>') : nil
|
data/config/routes.rb
CHANGED
@@ -26,6 +26,8 @@ IshManager::Engine.routes.draw do
|
|
26
26
|
resources :payments
|
27
27
|
end
|
28
28
|
|
29
|
+
get 'leads', :to => 'leads#index', :defaults => { :is_done => false }
|
30
|
+
get 'leads/done', :to => 'leads#index', :defaults => { :is_done => true }, :as => :done_leads
|
29
31
|
resources :leads
|
30
32
|
|
31
33
|
resources :newsitems
|
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.123
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-12-
|
11
|
+
date: 2017-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -262,6 +262,7 @@ files:
|
|
262
262
|
- app/views/ish_manager/kaminari/_prev_page.html.erb
|
263
263
|
- app/views/ish_manager/kaminari/_prev_page.html.erb~
|
264
264
|
- app/views/ish_manager/leads/_form.haml
|
265
|
+
- app/views/ish_manager/leads/edit.haml
|
265
266
|
- app/views/ish_manager/leads/index.haml
|
266
267
|
- app/views/ish_manager/leads/new.haml
|
267
268
|
- app/views/ish_manager/newsitems/_form.haml
|