ish_manager 0.1.8.122 → 0.1.8.123

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
  SHA1:
3
- metadata.gz: 4e6f9c39cc27d8b44e998be4fbb42f037beb20d4
4
- data.tar.gz: 500aa4bfda9c3f8e135c9b8739112d232bd64b8f
3
+ metadata.gz: 60c6a0b6aa5fed07b31412424c50e2f14c395930
4
+ data.tar.gz: 63cce52eb81e45612c83ae89a3088c229f47805b
5
5
  SHA512:
6
- metadata.gz: 1874aa9677fd40fd60efae23fc3d2feb4dfc8e4e21818eae989a41f501dfd1938b758f3b56551a3ae4abf1522413426f46a6991cc56b0f9432bf17d05d9862d2
7
- data.tar.gz: 67bf5e18d6f8b9a5c2f8f6f211785b13b6b73f80a0dcc573220d69b28be31037fdda080b123bdd96967b11cd60b00930e7a24dba295b1cf4c5f7e0b51ca31d05
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
- =begin
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
- @invoice = Ish::Invoice.find params[:id]
28
- authorize! :update, @invoice
29
- if @invoice.update_attributes params[:invoice].permit!
30
- flash[:notice] = 'Success'
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 invoice: #{@invoice.errors.messages}"
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
@@ -19,5 +19,9 @@ module IshManager
19
19
  end
20
20
  end
21
21
 
22
+ def pretty_date date
23
+ date.to_s[0, 10]
24
+ end
25
+
22
26
  end
23
27
  end
@@ -14,6 +14,12 @@
14
14
  .input-field
15
15
  = f.label :description
16
16
  = f.text_area :description
17
- .actions
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
 
@@ -0,0 +1,3 @@
1
+
2
+ %h1 Edit lead
3
+ = render 'form', :lead => @lead
@@ -1,18 +1,26 @@
1
1
 
2
2
  .manager--leads-index
3
3
  %h5
4
- Leads (#{@leads.count})
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 &nbsp;
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 lead.job_url, lead.job_url, :target => '_blank'
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.122
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-17 00:00:00.000000000 Z
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