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
f21c2000
Commit
f21c2000
authored
Jul 20, 2017
by
Thanh Hung Pham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix disable link_to
parent
4be23420
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
7 deletions
+20
-7
app/assets/javascripts/custom.js
+4
-0
app/controllers/registrations_controller.rb
+4
-0
app/views/admins/search.html.erb
+1
-1
app/views/devise/registrations/show.html.erb
+10
-5
app/views/layouts/_header.html.erb
+1
-1
No files found.
app/assets/javascripts/custom.js
View file @
f21c2000
$
(
function
()
{
$
(
function
()
{
$
(
'a[disabled=disabled]'
).
click
(
function
(
event
){
event
.
preventDefault
();
// Prevent link from following its href
});
$
(
".alert"
).
fadeOut
(
3000
);
$
(
".alert"
).
fadeOut
(
3000
);
$
(
".favorite_add"
).
on
(
"click"
,
function
()
{
$
(
".favorite_add"
).
on
(
"click"
,
function
()
{
$
.
ajax
({
$
.
ajax
({
...
...
app/controllers/registrations_controller.rb
View file @
f21c2000
...
@@ -24,6 +24,10 @@ class RegistrationsController < Devise::RegistrationsController
...
@@ -24,6 +24,10 @@ class RegistrationsController < Devise::RegistrationsController
end
end
end
end
def
show
@user
=
User
.
find
(
params
[
:user_id
])
end
def
download_file
def
download_file
send_file
(
"
#{
Rails
.
root
}
/app/upload/
#{
current_user
.
cv_name
}
"
,
filename:
current_user
.
cv_name
)
send_file
(
"
#{
Rails
.
root
}
/app/upload/
#{
current_user
.
cv_name
}
"
,
filename:
current_user
.
cv_name
)
end
end
...
...
app/views/admins/search.html.erb
View file @
f21c2000
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
<%-
@applied_jobs
.
each
do
|
apply
|
-%>
<%-
@applied_jobs
.
each
do
|
apply
|
-%>
<tr>
<tr>
<td>
<%=
link_to
apply
.
job
.
name
,
jobs_detail_path
(
id:
apply
.
job
.
id
)
%>
</td>
<td>
<%=
link_to
apply
.
job
.
name
,
jobs_detail_path
(
id:
apply
.
job
.
id
)
%>
</td>
<td>
<%=
link_to
apply
.
user
.
fullname
,
registrations_show_path
%>
</td>
<td>
<%=
link_to
apply
.
user
.
fullname
,
registrations_show_path
(
user_id:
apply
.
user
.
id
)
%>
</td>
<td>
<%=
link_to
apply
.
user
.
cv_name
,
registrations_download_file_path
%>
</td>
<td>
<%=
link_to
apply
.
user
.
cv_name
,
registrations_download_file_path
%>
</td>
<td>
<%=
apply
.
user
.
email
%>
</td>
<td>
<%=
apply
.
user
.
email
%>
</td>
<td>
<%=
apply
.
applied_at
.
strftime
(
'%F'
)
%>
</td>
<td>
<%=
apply
.
applied_at
.
strftime
(
'%F'
)
%>
</td>
...
...
app/views/devise/registrations/show.html.erb
View file @
f21c2000
...
@@ -4,19 +4,24 @@
...
@@ -4,19 +4,24 @@
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label>
Email
</label><br
/>
<label>
Email
</label><br
/>
<input
type=
"text"
value=
"
<%=
current_user
.
email
unless
current_user
.
nil?
%>
"
,
class=
"form-control"
,
readonly
/>
<input
type=
"text"
value=
"
<%=
@user
.
email
%>
"
,
class=
"form-control"
,
readonly
/>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label>
Full name
</label><br
/>
<label>
Full name
</label><br
/>
<input
type=
"text"
value=
"
<%=
current_user
.
fullname
unless
current_user
.
nil?
%>
"
,
class=
"form-control"
,
readonly
/>
<input
type=
"text"
value=
"
<%=
@user
.
fullname
%>
"
,
class=
"form-control"
,
readonly
/>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label>
Cv name
</label><br
/>
<label>
Cv name
</label><br
/>
<%=
link_to
current_user
.
nil?
?
''
:
current_
user
.
cv_name
,
registrations_download_file_path
%>
<%=
link_to
@
user
.
cv_name
,
registrations_download_file_path
%>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<a
class=
"btn btn-primary"
href=
"
<%=
edit_user_registration_path
%>
"
>
Update
</a>
<%-
if
admin_signed_in?
-%>
<a
class=
"btn btn-primary"
href=
"
<%=
jobs_applied_jobs_path
%>
"
>
My Jobs
</a>
<%=
link_to
'Update'
,
edit_user_registration_path
,
class:
'btn btn-primary'
,
disabled:
true
%>
<%=
link_to
'My Jobs'
,
jobs_applied_jobs_path
,
class:
'btn btn-primary'
,
disabled:
true
%>
<%-
else
-%>
<%=
link_to
'Update'
,
edit_user_registration_path
,
class:
'btn btn-primary'
%>
<%=
link_to
'My Jobs'
,
jobs_applied_jobs_path
,
class:
'btn btn-primary'
%>
<%-
end
-%>
</div>
</div>
</div>
</div>
app/views/layouts/_header.html.erb
View file @
f21c2000
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
<li>
<%=
link_to
'Log out'
,
destroy_admin_session_path
,
method: :delete
%>
</li>
<li>
<%=
link_to
'Log out'
,
destroy_admin_session_path
,
method: :delete
%>
</li>
<%-
else
-%>
<%-
else
-%>
<%-
if
user_signed_in?
-%>
<%-
if
user_signed_in?
-%>
<li>
<%=
link_to
'My profile'
,
registrations_show_path
%>
</li>
<li>
<%=
link_to
'My profile'
,
registrations_show_path
(
user_id:
current_user
.
id
)
%>
</li>
<li>
<%=
link_to
'Log out'
,
destroy_user_session_path
,
method: :delete
%>
</li>
<li>
<%=
link_to
'Log out'
,
destroy_user_session_path
,
method: :delete
%>
</li>
<li>
<%=
link_to
'Favorite'
,
jobs_favorited_jobs_path
%>
</li>
<li>
<%=
link_to
'Favorite'
,
jobs_favorited_jobs_path
%>
</li>
<li>
<%=
link_to
'History'
,
jobs_history_jobs_path
%>
</li>
<li>
<%=
link_to
'History'
,
jobs_history_jobs_path
%>
</li>
...
...
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