Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.

Commit 6db61d5

Browse files
Update jobs partials and layout
1 parent 27b6a63 commit 6db61d5

File tree

10 files changed

+129
-59
lines changed

10 files changed

+129
-59
lines changed

app/assets/stylesheets/custom.scss

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,24 @@ p.member_profile_invalid {
293293
margin-top: 25px;
294294
}
295295

296-
.clear-padding-margin{
296+
.clear-padding-margin {
297297
padding:0px;
298298
margin:0px;
299+
}
300+
301+
.lb-sm {
302+
font-size: 12px;
303+
}
304+
305+
.lb-md {
306+
font-size: 14px;
307+
}
308+
309+
.lb-lg {
310+
font-size: 18px;
311+
}
312+
313+
.center-content {
314+
margin:auto;
315+
text-align:center;
299316
}

app/controllers/jobs_controller.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,15 @@ def approve
114114
end
115115
end
116116

117+
# PATCH/PUT /jobs/1/reject
118+
def reject
119+
if @job.publish!
120+
redirect_to(@job, notice: 'The job is now live.')
121+
else
122+
render :edit
123+
end
124+
end
125+
117126
# PATCH/PUT /jobs/1/take_down
118127
def take_down
119128
if @job.take_down!

app/models/job.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class Job < ApplicationRecord
5757
end
5858

5959
event :publish do
60-
transitions :from => [:under_review, :disabled], :to => :approved
60+
transitions :from => [:under_review, :edited, :disabled], :to => :approved
6161

6262
after do
6363
unless self.posted_to_slack?
@@ -69,6 +69,10 @@ class Job < ApplicationRecord
6969
end
7070
end
7171

72+
# event :reject do
73+
# transitions :from => [:under_review, :edited, :disabled], :to => :rejected
74+
# end
75+
7276
event :modify do
7377
transitions :from => [:under_review, :approved, :disabled], :to => :edited
7478
end

app/views/jobs/_admin_job_actions.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<%= link_to("Approve", approve_job_path(job), class: "button button-3d button-small button-green", method: 'put') %>
44
</div>
55
<div class="button-container">
6-
<%= link_to("Reject", approve_job_path(job), class: "button button-3d button-small button-red", method: 'put') %>
6+
<%= link_to("Reject", reject_job_path(job), class: "button button-3d button-small button-red", method: 'put') %>
77
</div>
88
<% elsif job.online? %>
99
<div class="button-container">
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<!-- Sidebar Company
2+
============================================= -->
3+
<div class="sidebar nobottommargin col_last clearfix visible-lg visible-md">
4+
<div class="sidebar-widgets-wrap">
5+
<div class="panel">
6+
<div class="panel-body">
7+
<div class="row">
8+
<!-- Display company details -->
9+
<div class="col-lg-12 clear-padding-margin">
10+
<h3><%= job.company_name %></h3>
11+
<strong><%= job.location_name %></strong>
12+
13+
<% if @job.online? %>
14+
<hr/>
15+
<div class="center-content">
16+
<%= link_to("Apply for this position", @job.external_link, class: "button button-3d button-small", target: "_blank") %>
17+
18+
<% unless @job.apply_email.blank? %>
19+
<%= mail_to(@job.apply_email, "Apply via email", class: "button button-3d button-yellow button-small", target: "_blank") %>
20+
<% end %>
21+
</div>
22+
<% end %>
23+
</div>
24+
</div>
25+
</div>
26+
</div>
27+
28+
<div class="panel">
29+
<div class="panel-body">
30+
<div class="row">
31+
<!-- Display company details -->
32+
<div class="col-lg-12 center-content">
33+
<% if @job.online? %>
34+
<p>Share this job:</p>
35+
<%= link_to("mailto:?subject=Job on MENAdevs&body=Hi, you might be interested in this job I found on MENAdevs #{job_url(@job)}") do %>
36+
<%= fa_icon("envelope 2x") %>
37+
<% end %>
38+
&nbsp;
39+
<%= link_to("https://twitter.com/intent/tweet?" + @job.to_text_for_twitter, target: "_blank") do %>
40+
<%= fa_icon("twitter 2x") %>
41+
<% end %>
42+
<% end %>
43+
</div>
44+
</div>
45+
</div>
46+
</div>
47+
</div>
48+
</div>
49+
<!-- .sidebar company end -->

app/views/jobs/show.html.erb

Lines changed: 31 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<div class="row clearfix">
44
<div class="col-md-8 col-xs-12">
55
<h1><%= @job.title %></h1>
6-
<h2><%= @job.company_name %> <%= location_str(@job) %></h2>
76
</div>
87
</div>
98
</div>
@@ -38,16 +37,15 @@
3837
<!-- Entry Content
3938
============================================= -->
4039
<div class="entry-content notopmargin">
41-
<span class="label label-primary"><%= @job.employment_type.try(:humanize) %></span>
40+
<span class="label label-primary lb-md"><%= @job.employment_type.try(:humanize) %></span>
4241

43-
<span class="label label-primary"><%= @job.experience.try(:humanize) %></span>
42+
<span class="label label-primary lb-md"><%= @job.experience.try(:humanize) %></span>
4443

45-
<span class="label label-primary">Equity or stock options: <%= @job.equity? ? 'Yes' : 'No' %></span>
44+
<span class="label label-primary lb-md">Equity or stock options: <%= @job.equity? ? 'Yes' : 'No' %></span>
4645

47-
<span class="label label-primary">Remote: <%= @job.remote? ? 'Yes' : 'No' %></span>
48-
<p>
49-
<span class="label label-success"><%= @job.salary_to_s %></span>
50-
</p>
46+
<span class="label label-primary lb-md">Remote: <%= @job.remote? ? 'Yes' : 'No' %></span>
47+
48+
<span class="label label-success lb-md"><%= @job.salary_to_s %></span>
5149

5250
<div class="job-description">
5351
<% if @job.description.blank? %>
@@ -60,47 +58,40 @@
6058
<!-- .entry-content end -->
6159
</div>
6260
</div>
63-
64-
<!-- .actions starts -->
65-
<% if @job.online? %>
66-
<div class="job-post-user-actions">
67-
<div class="col-md-6 col-xs-12">
68-
<%= link_to("Apply for this position", @job.external_link, class: "button button-3d", target: "_blank") %>
69-
70-
<%# unless @job.apply_email.blank? %>
71-
<%= mail_to(@job.apply_email, "Apply for this position via email", class: "button button-3d button-yellow button-mini", target: "_blank") %>
72-
<%# end %>
73-
</div>
74-
75-
<div class="col-md-6 col-xs-12" style="text-align:right">
76-
<p style="margin:0px;">Share this job:</p>
77-
<%= link_to("mailto:?subject=Job on MENAdevs&body=Hi, you might be interested in this job I found on MENAdevs #{job_url(@job)}") do %>
78-
<%= fa_icon("inbox 2x") %>
79-
<% end %>
80-
&nbsp;
81-
<%= link_to("https://twitter.com/intent/tweet?" + @job.to_text_for_twitter, target: "_blank") do %>
82-
<%= fa_icon("twitter 2x") %>
83-
<% end %>
84-
</div>
85-
</div>
86-
<% end %>
87-
<!-- .actions end -->
8861
</div>
8962

90-
<%= render('job_sidebar', job: @job, job_statistics: @job_statistics) %>
63+
<%= render('job_info_sidebar', job: @job) %>
9164

65+
<%= render('job_actions_sidebar', job: @job, job_statistics: @job_statistics) %>
9266
</div>
9367
</div>
9468
</section>
9569

9670
<script type="application/ld+json">
9771
{
98-
"@context": "http://schema.org",
99-
"@type": "NewsArticle",
100-
"mainEntityOfPage": {
101-
"@type": "WebPage",
102-
"@id": "https://google.com/article"
72+
"@context": "https://schema.org",
73+
"@type": "JobPosting",
74+
"baseSalary": "<%= @job.from_salary %>",
75+
"datePosted": <% if @job.posted_on %>"<%= @job.posted_on.strftime('%Y-%m-%d') %>"<% end %>,
76+
"validThrough": <% if @job.expires_on %>"<%= @job.expires_on.strftime('%Y-%m-%d') %>"<% end %>,
77+
"description": "<%= @job.description %>",
78+
"educationRequirements": "<%= @job.education %>",
79+
"employmentType": "<%= @job.employment_type %>",
80+
"experienceRequirements": "<%= @job.experience %>",
81+
"incentiveCompensation": "<%= @job.equity %>",
82+
"industry": "Computer Software",
83+
"hiringOrganization": "<%= @job.company_name %>",
84+
"jobLocation": {
85+
"@type": "Place",
86+
"address": {
87+
"@type": "Text",
88+
"addressCountry": "<%= @job.location_name %>"
89+
}
10390
},
104-
"headline": "<%= @job.title %>",
91+
"occupationalCategory": "15-1132.00 Software Developers, Application",
92+
"qualifications": "Ability to work in a team environment with members of varying skill levels. Highly motivated. Learns quickly.",
93+
"responsibilities": "Design and write specifications for tools for in-house customers Build tools according to specifications",
94+
"salaryCurrency": "<%= @job.currency %>",
95+
"title": "<%= @job.title %>"
10596
}
10697
</script>

config/routes.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
member do
129129
put :pre_approve
130130
put :approve
131+
put :reject
131132
put :take_down
132133
get :feedback
133134
end

spec/requests/jobs_spec.rb

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122

123123
expect(page).to have_content('Test Title')
124124

125-
expect(page).to have_content('By: ' + user.name)
125+
expect(page).to have_content('By ' + user.name)
126126

127127
expect(page).to have_content('Submit for approval')
128128
expect(page).to have_content('Edit')
@@ -139,7 +139,7 @@
139139
visit(job_path(@job))
140140

141141
expect(page).to have_content(@job.title)
142-
expect(page).to have_content('Tell a friend')
142+
expect(page).to have_content('Share this job:')
143143
expect(page).to_not have_content('Statistics')
144144
end
145145

@@ -224,14 +224,13 @@
224224
visit(job_path(@draft_job))
225225

226226
expect(page).to have_content(@draft_job.title)
227-
expect(page).to_not have_content('Tell a friend')
227+
expect(page).to_not have_content('Share this job')
228228
expect(page).to have_content('Edit')
229229

230230
click_on('Submit for approval', match: :first)
231-
232-
expect(page).to have_content('Job is under review')
231+
expect(page).to have_content('Pending Approval')
233232
expect(page).to have_content('The job post was successfully submitted for approval before made public.')
234-
expect(page).to_not have_content('Tell a friend')
233+
expect(page).to_not have_content('Share this job')
235234
end
236235
end
237236

@@ -250,13 +249,13 @@
250249

251250
expect(page).to have_content(@pending_job.title)
252251
# not approved yet
253-
expect(page).to_not have_content('Tell a friend')
252+
expect(page).to_not have_content('Share this job:')
254253

255254
click_on('Approve', match: :first)
256255

257256
expect(page).to have_content('The job is now live.')
258257
expect(page).to have_content('Take down')
259-
expect(page).to have_content('Tell a friend')
258+
expect(page).to have_content('Share this job:')
260259
expect(page).to have_content('Statistics')
261260
end
262261

@@ -266,8 +265,8 @@
266265

267266
expect(page).to have_content(@pending_job.title)
268267
# not approved yet
269-
expect(page).to_not have_content('Tell a friend')
270-
expect(page).to have_content('Job is under review')
268+
expect(page).to_not have_content('Share this job:')
269+
expect(page).to have_content('Pending Approval')
271270
expect(page).to have_content('Edit')
272271

273272
expect(page).to_not have_content('Approve')
@@ -288,13 +287,13 @@
288287
visit(job_path(@approved_job))
289288

290289
expect(page).to have_content(@approved_job.title)
291-
expect(page).to have_content('Tell a friend')
290+
expect(page).to have_content('Share this job:')
292291
expect(page).to have_content('Statistics')
293292

294293
click_on('Take down', match: :first)
295294

296295
expect(page).to have_content('The job is no longer published.')
297-
expect(page).to_not have_content('Tell a friend')
296+
expect(page).to_not have_content('Share this job:')
298297
end
299298
end
300299

spec/requests/users_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
before do
1313
visit new_user_session_path
1414

15-
expect(page).to have_content('Personal email and password')
15+
expect(page).to have_content('Login with your email and password')
1616
expect(page).to have_content('Email')
1717
expect(page).to have_content('Password')
1818
end
@@ -60,9 +60,9 @@
6060

6161
click_on('Send me reset password instructions')
6262

63-
expect(page).to have_content("Use ONE of the login options below to login")
63+
expect(page).to have_content("Use any of the login options below to login")
6464
expect(page).to have_content("MENAdevs Slack credentials")
65-
expect(page).to have_content("Personal email and password")
65+
expect(page).to have_content("Login with your email and password")
6666
end
6767
end
6868

@@ -125,7 +125,7 @@
125125
before do
126126
visit new_user_session_path
127127

128-
expect(page).to have_content('Personal email and password')
128+
expect(page).to have_content('Login with your email and password')
129129
expect(page).to have_content('Email')
130130
expect(page).to have_content('Password')
131131
end

0 commit comments

Comments
 (0)