Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
veNJOB
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thanh Hung Pham
veNJOB
Commits
a93fa166
Commit
a93fa166
authored
Jul 10, 2017
by
Thanh Hung Pham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix layout
parent
3e6bc17b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
18 deletions
+27
-18
app/controllers/jobs_controller.rb
+1
-0
app/views/jobs/detail.html.erb
+8
-3
app/views/jobs/history_jobs.html.erb
+18
-15
No files found.
app/controllers/jobs_controller.rb
View file @
a93fa166
...
...
@@ -6,6 +6,7 @@ class JobsController < ApplicationController
def
detail
@job
=
Job
.
find
(
params
[
:id
])
History
.
new
(
user:
current_user
,
job:
@job
).
save
if
History
.
where
(
user:
current_user
,
job:
@job
).
blank?
end
def
apply
...
...
app/views/jobs/detail.html.erb
View file @
a93fa166
<%-
provide
(
:title
,
'Job Detail'
)
-%>
<div
class=
"well"
>
<h2>
<%=
@job
.
name
%>
</h2>
<div
class=
"row"
>
<div
class=
"col-md-
8
"
>
<div
class=
"row
form-group
"
>
<div
class=
"col-md-
10
"
>
<div
class=
"row"
>
<%=
@job
.
company
.
name
unless
@job
.
city
.
nil?
%>
</div>
...
...
@@ -16,7 +16,7 @@
<%=
@job
.
description
%>
</div>
</div>
<div
class=
"col-md-
4
"
>
<div
class=
"col-md-
2
"
>
<%=
link_to
'Apply'
,
jobs_apply_path
,
class:
'btn btn-primary'
%>
</div>
</div>
...
...
@@ -24,7 +24,12 @@
<div
class=
"col-md-offset-3 "
>
<%=
link_to
'Apply'
,
jobs_apply_path
,
class:
'btn btn-primary'
%>
<%-
if
Favorite
.
where
(
user:
current_user
,
job:
@job
).
blank?
-%>
<%-
if
user_signed_in?
-%>
<%=
link_to
'Favorite'
,
'#'
,
class:
'favorite_add btn btn-primary'
%>
<%-
else
-%>
<%=
link_to
'Favorite'
,
new_user_session_path
,
class:
'btn btn-primary'
%>
<%-
end
-%>
<input
type=
"hidden"
id=
"job_id"
name=
"job_id"
value=
"
<%=
@job
.
id
%>
"
>
<%-
else
-%>
<%=
link_to
'Favorite'
,
'#'
,
class:
'favorite_add btn btn-primary'
,
disabled:
true
%>
...
...
app/views/jobs/history_jobs.html.erb
View file @
a93fa166
<%-
provide
(
:title
,
'History Jobs'
)
-%>
<div
class=
"well"
>
<h2>
History Jobs
</h2>
<div
class=
"table-responsive"
>
<table
class=
"table"
>
<thead>
<th>
Job
</th>
<th>
Description
</th>
<th>
Location
</th>
<th>
Salary
</th>
</thead>
<tbody>
<%-
@history_jobs
.
each
do
|
history
|
-%>
<div
class=
"row"
>
<%=
history
.
job
.
name
%>
</div>
<div
class=
"row"
>
<%=
truncate
(
history
.
job
.
description
,
length:
250
)
%>
</div>
<div
class=
"row"
>
<div
class=
"col-md-4"
>
<%=
history
.
job
.
city
.
name
unless
history
.
job
.
city
.
nil?
%>
</div>
<div
class=
"col-md-4"
>
<%=
history
.
job
.
salary
%>
</div>
</div>
<tr>
<td>
<%=
history
.
job
.
name
%>
</td>
<td>
<%=
truncate
(
history
.
job
.
description
,
length:
250
)
%>
</td>
<td>
<%=
history
.
job
.
city
.
name
unless
history
.
job
.
city
.
nil?
%>
</td>
<td>
<%=
history
.
job
.
salary
%>
</td>
</tr>
<%-
end
-%>
</tbody>
</table>
</div>
</div>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment