go_jobs 0.1.3 → 0.1.4

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: 065d633324026a316943d1817cdec77bf6a542d9
4
- data.tar.gz: 10bb640ebc425ec6cbfb6558462987dc8257b48b
3
+ metadata.gz: a790829be4ae14b1760082b59b32f4a15028f040
4
+ data.tar.gz: 31b5d52acf3ab86067786fa81d679dfb2a927ec6
5
5
  SHA512:
6
- metadata.gz: b9423522bfbd4fa9f98a003481088d2a23c212452cdcb1f30d745d1c4ef0802129736f6bf8fca2c5a4b1bf0e04e2995157d916f14ecd85f90f1824a0e082c54d
7
- data.tar.gz: 4800dbad77b7e86fdc93d0e71bbd499d0185ed8a6dcd46c40a1eb247222e589add9d3d368168a89fdf961d3f0c5c1d8194a33a546d4096856f9e48b1b7078f16
6
+ metadata.gz: 9cff93456f921afcc54e666c03bc6b8e38551ba759668496c9520f7112799d275030cb995c69b5601e81a58725d47fcb879af26fa1cc0f21a94ae5a86310f833
7
+ data.tar.gz: 957718805e517e60fd9626947e52d756b1e79929bcb86a886e6bbc253c62456904eab0a51f9d87a5a69b0f37afcf53e436cc97eae880bb80756be27187b27eaf
@@ -1,8 +1,8 @@
1
1
  module Jobs
2
2
  class JobsController < ApplicationController
3
- before_action :set_jobs_job, only: [:show, :edit, :update, :destroy]
4
- before_action :authenticate_user!, except: %i(index show)
5
- load_and_authorize_resource except: %i(index show create),param_method: :jobs_job_params
3
+ before_action :set_jobs_job, only: [:show, :edit, :update, :destroy,:show_jobs_list]
4
+ before_action :authenticate_user!, except: %i(index show jobs_list show_jobs_list)
5
+ load_and_authorize_resource except: %i(index show create jobs_list show_jobs_list),param_method: :jobs_job_params
6
6
  # GET /jobs/jobs
7
7
  def index
8
8
  if current_user and current_user.admin?
@@ -10,7 +10,14 @@ module Jobs
10
10
  else
11
11
  @jobs_jobs = Job.where(user_id:current_user.id).order(expiration_date: :desc).page params[:page]
12
12
  end
13
+ end
14
+
15
+ def jobs_list
16
+ @jobs_jobs = Job.where('expiration_date >= ? and ? >= published_at and status = ? ', DateTime.now,DateTime.now,true).includes(:user).page params[:page]
17
+ end
13
18
 
19
+ def show_jobs_list
20
+ @jobs_job.increment!(:access_count)
14
21
  end
15
22
 
16
23
  # GET /jobs/jobs/1
@@ -60,7 +67,7 @@ module Jobs
60
67
 
61
68
  # Only allow a trusted parameter "white list" through.
62
69
  def jobs_job_params
63
- params.require(:jobs_job).permit(:title, :location, :job_type, :week_hours, :description, :company_name, :company_url, :user_id, :positions, :sallary_low, :sallary_high, :contact_email, :expiration_date, :acess_count, :status)
70
+ params.require(:jobs_job).permit(:title, :location, :job_type, :week_hours, :description, :company_name, :company_url, :user_id, :positions, :sallary_low, :sallary_high, :contact_email, :expiration_date,:published_at, :access_count, :status)
64
71
  end
65
72
  end
66
73
  end
@@ -23,5 +23,37 @@ module Jobs
23
23
  end
24
24
  end
25
25
 
26
+ def link_to_title
27
+ h.link_to h.show_jobs_list_jobs_jobs_path(id: self.id),
28
+ class: 'text-primary-dark',
29
+ title: self.title do
30
+ h.content_tag :span do
31
+ self.title
32
+ end
33
+ end
34
+ end
35
+
36
+ def link_to_read_more
37
+ h.link_to h.show_jobs_list_jobs_jobs_path(id: self.id),
38
+ class: 'btn btn-info btn-sm',
39
+ title: 'Visualizar',
40
+ style: 'color: #FFF; float: none;' do
41
+ h.content_tag :span do
42
+ 'Continue Lendo...'
43
+ end
44
+ end
45
+ end
46
+
47
+ def link_to_author
48
+ h.link_to h.user_path(id: self.user),
49
+ class: 'link-effect font-s13 font-w600',
50
+ title: '',
51
+ style: '' do
52
+ h.content_tag :span do
53
+ self.user.decorate.name
54
+ end
55
+ end
56
+ end
57
+
26
58
  end
27
59
  end
@@ -11,5 +11,11 @@ module Jobs
11
11
  }.freeze
12
12
 
13
13
 
14
+ def job_type_to_s
15
+ JOB_TYPES.each do |key,value|
16
+ return value if self.job_type == key
17
+ end
18
+ end
19
+
14
20
  end
15
21
  end
@@ -13,6 +13,7 @@
13
13
  <%= form.input :sallary_high, id: :jobs_job_sallary_high %>
14
14
  <%= form.input :contact_email, id: :jobs_job_contact_email %>
15
15
  <%= form.input :expiration_date, id: :jobs_job_expiration_date %>
16
+ <%= form.input :published_at, id: :jobs_job_published_at %>
16
17
  <% if current_user and current_user.admin? %>
17
18
  <%= form.input :status, id: :jobs_job_status %>
18
19
  <% end %>
@@ -0,0 +1,29 @@
1
+ <% collection.each do |resource| %>
2
+ <div class="block" id="<%= dom_id(resource) %>">
3
+ <div class="block-content">
4
+ <div class="row items-push">
5
+ <!--<div class="col-md-4">-->
6
+ <!--<a href="frontend_blog_story.php">-->
7
+ <!--<img class="img-responsive" src="https://wallpaperbrowse.com/media/images/html-color-codes-color-tutorials-hero-00e10b1f.jpg" alt="">-->
8
+ <!--</a>-->
9
+ <!--</div>-->
10
+ <div class="col-md-12">
11
+ <div class="font-s12 push-10">
12
+ <em class="pull-right"></em>
13
+ Vaga postada por <%= resource.decorate.link_to_author %> - publicado em <%= converte_date(resource.updated_at) %>
14
+ </div>
15
+ <h4 class="text-uppercase push-10">
16
+ <%= resource.decorate.link_to_title %></h4>
17
+ <p>Local da Vaga: <%= resource.location %></p>
18
+ <p>Faixa salarial (<%= number_to_currency(resource.sallary_low, :precision => 2) %> - <%= number_to_currency(resource.sallary_high, :precision => 2) %>)</p>
19
+ <p>Tipo da Vaga: <%= resource.job_type_to_s %> </p>
20
+ <div class="btn-group btn-group-sm">
21
+ <!--<a class="btn btn-default" href="javascript:void(0)"><i class="fa fa-share-alt push-5-r"></i> Compartilhar</a>-->
22
+ <%= resource.decorate.link_to_read_more %>
23
+ </div>
24
+ </div>
25
+ </div>
26
+ </div>
27
+ </div>
28
+ <% end %>
29
+
@@ -0,0 +1,161 @@
1
+ <main id="main-container" style="min-height: 190px;"><div class="bg-primary-dark">
2
+ <section class="content content-full content-boxed overflow-hidden">
3
+ <div class="push-100-t push-50 text-center">
4
+ <h1 class="h2 text-white push-10 animated fadeInDown" data-toggle="appear" data-class="animated fadeInDown">As Últimas Vagas de emprego para você .</h1>
5
+ <h2 class="h5 text-white-op animated fadeInDown" data-toggle="appear" data-class="animated fadeInDown">Explore.</h2>
6
+ </div>
7
+ </section>
8
+ </div>
9
+ <section class="content content-boxed">
10
+ <div class="push-50-t push-50">
11
+ <div class="row">
12
+ <div class="col-md-12">
13
+
14
+
15
+
16
+
17
+ <%= render 'frontend_collection', collection: @jobs_jobs %>
18
+
19
+
20
+
21
+
22
+ <!--<nav>-->
23
+ <!--<ul class="pagination">-->
24
+ <!--<li class="active">-->
25
+ <!--<a href="javascript:void(0)">1</a>-->
26
+ <!--</li>-->
27
+ <!--<li>-->
28
+ <!--<a href="javascript:void(0)">2</a>-->
29
+ <!--</li>-->
30
+ <!--<li>-->
31
+ <!--<a href="javascript:void(0)">3</a>-->
32
+ <!--</li>-->
33
+ <!--<li>-->
34
+ <!--<a href="javascript:void(0)">4</a>-->
35
+ <!--</li>-->
36
+ <!--<li>-->
37
+ <!--<a href="javascript:void(0)">5</a>-->
38
+ <!--</li>-->
39
+ <!--<li>-->
40
+ <!--<a href="javascript:void(0)"><i class="fa fa-angle-right"></i></a>-->
41
+ <!--</li>-->
42
+ <!--</ul>-->
43
+ <!--</nav>-->
44
+ <%=render 'pagination',collection: @jobs_jobs%>
45
+
46
+ </div>
47
+ <!--<div class="col-md-4">-->
48
+ <!--<div class="block">-->
49
+ <!--<div class="block-header bg-gray-lighter">-->
50
+ <!--<h3 class="block-title">Search</h3>-->
51
+ <!--</div>-->
52
+ <!--<div class="block-content block-content-full">-->
53
+ <!--<form action="frontend_search.php" method="post">-->
54
+ <!--<div class="input-group input-group-lg">-->
55
+ <!--<input class="form-control" type="text" placeholder="Type and hit enter..">-->
56
+ <!--<div class="input-group-btn">-->
57
+ <!--<button class="btn btn-default"><i class="fa fa-search"></i></button>-->
58
+ <!--</div>-->
59
+ <!--</div>-->
60
+ <!--</form>-->
61
+ <!--</div>-->
62
+ <!--</div>-->
63
+ <!--<a class="block block-link-hover3" href="base_pages_profile.php">-->
64
+ <!--<div class="block-header bg-gray-lighter">-->
65
+ <!--<h3 class="block-title">About</h3>-->
66
+ <!--</div>-->
67
+ <!--<div class="block-content block-content-full text-center">-->
68
+ <!--<div>-->
69
+ <!--<img class="img-avatar img-avatar96" src="assets/img/avatars/avatar1.jpg" alt="">-->
70
+ <!--</div>-->
71
+ <!--<div class="h5 push-15-t push-5">Ann Parker</div>-->
72
+ <!--<div class="font-s13 text-muted">Publisher</div>-->
73
+ <!--</div>-->
74
+ <!--<div class="block-content border-t">-->
75
+ <!--<div class="row items-push text-center">-->
76
+ <!--<div class="col-xs-6">-->
77
+ <!--<div class="push-5"><i class="si si-pencil fa-2x"></i></div>-->
78
+ <!--<div class="h5 font-w300 text-muted">350 Stories</div>-->
79
+ <!--</div>-->
80
+ <!--<div class="col-xs-6">-->
81
+ <!--<div class="push-5"><i class="si si-users fa-2x"></i></div>-->
82
+ <!--<div class="h5 font-w300 text-muted">1.5k Followers</div>-->
83
+ <!--</div>-->
84
+ <!--</div>-->
85
+ <!--</div>-->
86
+ <!--</a>-->
87
+ <!--<div class="block">-->
88
+ <!--<div class="block-header bg-gray-lighter">-->
89
+ <!--<ul class="block-options">-->
90
+ <!--<li>-->
91
+ <!--<button type="button" data-toggle="block-option" data-action="refresh_toggle" data-action-mode="demo"><i class="si si-refresh"></i></button>-->
92
+ <!--</li>-->
93
+ <!--</ul>-->
94
+ <!--<h3 class="block-title">Recent Comments</h3>-->
95
+ <!--</div>-->
96
+ <!--<div class="block-content">-->
97
+ <!--<ul class="list list-simple">-->
98
+ <!--<li>-->
99
+ <!--<div class="push-5 clearfix">-->
100
+ <!--<span class="font-s13 text-muted push-10-l pull-right">25 min ago</span>-->
101
+ <!--<a class="font-w600" href="base_pages_profile.php">Sara Holland</a> on <a href="frontend_blog_story.php">Exploring the Alps</a>-->
102
+ <!--</div>-->
103
+ <!--<div class="font-s13">Awesome trip! Looking forward going there, I'm sure it will be a great experience!</div>-->
104
+ <!--</li>-->
105
+ <!--<li>-->
106
+ <!--<div class="push-5 clearfix">-->
107
+ <!--<span class="font-s13 text-muted push-10-l pull-right">42 min ago</span>-->
108
+ <!--<a class="font-w600" href="base_pages_profile.php">Joshua Munoz</a> on <a href="frontend_blog_story.php">Travel &amp; Work</a>-->
109
+ <!--</div>-->
110
+ <!--<div class="font-s13">Thank you for sharing your story with us! I really appreciate the info, it will come in handy for sure!</div>-->
111
+ <!--</li>-->
112
+ <!--<li>-->
113
+ <!--<div class="push-5 clearfix">-->
114
+ <!--<span class="font-s13 text-muted push-10-l pull-right">53 min ago</span>-->
115
+ <!--<a class="font-w600" href="base_pages_profile.php">Lisa Gordon</a> on <a href="frontend_blog_story.php">Black &amp; White</a>-->
116
+ <!--</div>-->
117
+ <!--<div class="font-s13">Really touching story.. I'm so happy everything went well at the end!</div>-->
118
+ <!--</li>-->
119
+ <!--<li>-->
120
+ <!--<div class="push-5 clearfix">-->
121
+ <!--<span class="font-s13 text-muted push-10-l pull-right">2 days ago</span>-->
122
+ <!--<a class="font-w600" href="base_pages_profile.php">George Stone</a> on <a href="frontend_blog_story.php">Sleep Better</a>-->
123
+ <!--</div>-->
124
+ <!--<div class="font-s13">Great advice! Thanks for sharing, I'm sure it will help many people sleep better and improve their lifes.</div>-->
125
+ <!--</li>-->
126
+ <!--</ul>-->
127
+ <!--<div class="text-center push">-->
128
+ <!--<small><a href="javascript:void(0)">Read More..</a></small>-->
129
+ <!--</div>-->
130
+ <!--</div>-->
131
+ <!--</div>-->
132
+ <!--<div class="block">-->
133
+ <!--<div class="block-header bg-gray-lighter">-->
134
+ <!--<h3 class="block-title">Social</h3>-->
135
+ <!--</div>-->
136
+ <!--<div class="block-content block-content-full">-->
137
+ <!--<div class="btn-group">-->
138
+ <!--<a class="btn btn-default" href="javascript:void(0)" data-toggle="tooltip" title="" data-original-title="Follow us on Twitter"><i class="fa fa-fw fa-twitter"></i></a>-->
139
+ <!--<a class="btn btn-default" href="javascript:void(0)" data-toggle="tooltip" title="" data-original-title="Like our Facebook page"><i class="fa fa-fw fa-facebook"></i></a>-->
140
+ <!--<a class="btn btn-default" href="javascript:void(0)" data-toggle="tooltip" title="" data-original-title="Follow us on Google Plus"><i class="fa fa-fw fa-google-plus"></i></a>-->
141
+ <!--<a class="btn btn-default" href="javascript:void(0)" data-toggle="tooltip" title="" data-original-title="Follow us on Dribbble"><i class="fa fa-fw fa-dribbble"></i></a>-->
142
+ <!--<a class="btn btn-default" href="javascript:void(0)" data-toggle="tooltip" title="" data-original-title="Subscribe on Youtube"><i class="fa fa-fw fa-youtube"></i></a>-->
143
+ <!--</div>-->
144
+ <!--</div>-->
145
+ <!--</div>-->
146
+ <!--</div>-->
147
+
148
+ </div>
149
+ </div>
150
+ </section>
151
+ <div class="bg-primary-dark">
152
+ <section class="content content-full content-boxed">
153
+ <div class="push-20-t push-20 text-center">
154
+ <div class="tags-cloud glassy-bg">
155
+
156
+ </div>
157
+ </div>
158
+ </section>
159
+ </div>
160
+ </main>
161
+
@@ -99,7 +99,7 @@
99
99
 
100
100
  <tr>
101
101
  <td><strong><%= t 'activerecord.attributes.jobs_job.acess_count' %>:</strong></td>
102
- <td><%= @jobs_job.acess_count %></td>
102
+ <td><%= @jobs_job.access_count %></td>
103
103
  </tr>
104
104
 
105
105
  <tr>
@@ -0,0 +1,41 @@
1
+
2
+ <main id="main-container" style="min-height: 190px;"><div class="bg-image" style="background-image: url('<%=asset_path "go_jobs/job-oportunities.jpg"%>');">
3
+ <div class="bg-primary-op">
4
+ <section class="content content-full content-boxed overflow-hidden">
5
+ <div class="push-150-t push-150 text-center">
6
+ <h1 class="text-white push-10 animated fadeInDown" data-toggle="appear" data-class="animated fadeInDown"><%= @jobs_job.title %></h1>
7
+ </div>
8
+ </section>
9
+ </div>
10
+ </div>
11
+ <div class="bg-white">
12
+ <section class="content content-boxed">
13
+ <div class="text-center">
14
+ Vaga postada por <%= @jobs_job.decorate.link_to_author %> <% if @jobs_job.published_at or (current_user and current_user.admin?) %> - <% end %> <%= converte_timestamp(@jobs_job.published_at) %> <% if current_user and current_user.admin? %><em>visualizada <%=@jobs_job.access_count%> <% end %></em>
15
+ </div>
16
+ <div class="row push-50-t push-50 nice-copy-story">
17
+ <div class="col-sm-8 col-sm-offset-2">
18
+ <p>Local da Vaga: <%= @jobs_job.location %></p>
19
+ <p>Faixa salarial (<%= number_to_currency(@jobs_job.sallary_low, :precision => 2) %> - <%= number_to_currency(@jobs_job.sallary_high, :precision => 2) %>)</p>
20
+ <p>Tipo da Vaga: <%= @jobs_job.job_type_to_s %> </p>
21
+ <p>Horas semanais: <%= @jobs_job.week_hours %> </p>
22
+ <p>Descrição da vaga: <%= @jobs_job.description %> </p>
23
+ <p>Empresa: <%= @jobs_job.company_name %> </p>
24
+ <p>Site Empresa <%= link_to @jobs_job.company_url, url_with_protocol(@jobs_job.company_url) ,target: :_blank%> </p>
25
+ <p>Vagas <%= @jobs_job.positions %> </p>
26
+ <p>E-mail Contato <%= @jobs_job.contact_email %> </p>
27
+ </div>
28
+ </div>
29
+
30
+ </section>
31
+ </div>
32
+
33
+ <section class="content content-full content-boxed">
34
+ <div class="push-20-t push-20 text-center">
35
+ <h3 class="h4 text-white-op push-20 animated fadeIn" data-toggle="appear"> </h3>
36
+ </div>
37
+ </section>
38
+
39
+ </main>
40
+
41
+
data/config/routes.rb CHANGED
@@ -1,5 +1,10 @@
1
1
  Rails.application.routes.draw do
2
2
  namespace :jobs do
3
- resources :jobs
3
+ resources :jobs do
4
+ collection do
5
+ get 'jobs_list'
6
+ get 'show_jobs_list'
7
+ end
8
+ end
4
9
  end
5
10
  end
@@ -0,0 +1,5 @@
1
+ class AlterTableJobsAlterFieldName < ActiveRecord::Migration[5.1]
2
+ def change
3
+ rename_column :jobs_jobs, :acess_count, :access_count
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module GoJobs
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: go_jobs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - João Carlos Ottobboni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-24 00:00:00.000000000 Z
11
+ date: 2017-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: draper
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: sqlite3
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  description: Jobs engine
42
56
  email:
43
57
  - jcottobboni@gmail.com
@@ -49,6 +63,10 @@ files:
49
63
  - README.md
50
64
  - Rakefile
51
65
  - app/assets/config/go_jobs_manifest.js
66
+ - app/assets/images/go_jobs/background-jobs.jpg
67
+ - app/assets/images/go_jobs/job-oportunities.jpg
68
+ - app/assets/images/go_jobs/job-search.jpg
69
+ - app/assets/images/go_jobs/jobs-bg.jpg
52
70
  - app/assets/javascripts/jobs/jobs.js
53
71
  - app/assets/stylesheets/jobs/jobs.css
54
72
  - app/assets/stylesheets/scaffold.css
@@ -60,11 +78,14 @@ files:
60
78
  - app/models/jobs/job.rb
61
79
  - app/views/jobs/jobs/_collection.html.erb
62
80
  - app/views/jobs/jobs/_form.html.erb
81
+ - app/views/jobs/jobs/_frontend_collection.html.erb
63
82
  - app/views/jobs/jobs/_pagination.html.erb
64
83
  - app/views/jobs/jobs/edit.html.erb
65
84
  - app/views/jobs/jobs/index.html.erb
85
+ - app/views/jobs/jobs/jobs_list.html.erb
66
86
  - app/views/jobs/jobs/new.html.erb
67
87
  - app/views/jobs/jobs/show.html.erb
88
+ - app/views/jobs/jobs/show_jobs_list.html.erb
68
89
  - config/database.travis.yml
69
90
  - config/locales/go_jobs/en.yml
70
91
  - config/locales/go_jobs/pt-BR.yml
@@ -72,6 +93,7 @@ files:
72
93
  - db/migrate/20171019010055_create_jobs_jobs.rb
73
94
  - db/migrate/20171020005851_ater_column_type_jobs.rb
74
95
  - db/migrate/20171020013256_add_column_jobs_jobs_status.rb
96
+ - db/migrate/20171105225613_alter_table_jobs_alter_field_name.rb
75
97
  - lib/go_jobs.rb
76
98
  - lib/go_jobs/engine.rb
77
99
  - lib/go_jobs/version.rb