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
c4606e43
Commit
c4606e43
authored
Jul 18, 2017
by
Thanh Hung Pham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix log in to admin page
parent
b0a93a6e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
1 deletions
+16
-1
app/assets/javascripts/custom.js
+1
-0
app/controllers/application_controller.rb
+13
-0
app/models/job.rb
+1
-0
app/views/layouts/_header.html.erb
+0
-1
config/routes.rb
+1
-0
No files found.
app/assets/javascripts/custom.js
View file @
c4606e43
$
(
function
()
{
$
(
function
()
{
$
(
".alert"
).
fadeOut
(
3000
);
$
(
".favorite_add"
).
on
(
"click"
,
function
()
{
$
(
".favorite_add"
).
on
(
"click"
,
function
()
{
$
.
ajax
({
$
.
ajax
({
url
:
"/jobs/favorite"
,
url
:
"/jobs/favorite"
,
...
...
app/controllers/application_controller.rb
View file @
c4606e43
...
@@ -11,4 +11,17 @@ class ApplicationController < ActionController::Base
...
@@ -11,4 +11,17 @@ class ApplicationController < ActionController::Base
def
after_sign_out_path_for
(
resource
)
def
after_sign_out_path_for
(
resource
)
request
.
referrer
||
root_path
request
.
referrer
||
root_path
end
end
def
after_sign_in_path_for
(
resource
)
if
admin_signed_in?
admins_applies_path
else
stored_location_for
(
resource
)
||
if
resource
.
is_a?
(
User
)
&&
resource
.
can_publish?
publisher_url
else
super
end
end
end
end
end
app/models/job.rb
View file @
c4606e43
...
@@ -5,6 +5,7 @@ class Job < ApplicationRecord
...
@@ -5,6 +5,7 @@ class Job < ApplicationRecord
belongs_to
:contact
,
optional:
true
belongs_to
:contact
,
optional:
true
has_many
:job_category
has_many
:job_category
has_many
:applies
paginates_per
20
paginates_per
20
...
...
app/views/layouts/_header.html.erb
View file @
c4606e43
...
@@ -4,7 +4,6 @@
...
@@ -4,7 +4,6 @@
<nav>
<nav>
<ul
class=
"nav navbar-nav navbar-right"
>
<ul
class=
"nav navbar-nav navbar-right"
>
<%-
if
admin_signed_in?
-%>
<%-
if
admin_signed_in?
-%>
<li>
<%=
link_to
'Applied Jobs'
,
admins_applies_path
%>
</li>
<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?
-%>
...
...
config/routes.rb
View file @
c4606e43
...
@@ -23,6 +23,7 @@ Rails.application.routes.draw do
...
@@ -23,6 +23,7 @@ Rails.application.routes.draw do
get
'jobs/history_jobs'
,
to:
'jobs#history_jobs'
get
'jobs/history_jobs'
,
to:
'jobs#history_jobs'
get
'admins/applies'
,
to:
'admins#applies'
get
'admins/applies'
,
to:
'admins#applies'
get
'admins/search'
,
to:
'admins#search'
post
'admins/search'
,
to:
'admins#search'
post
'admins/search'
,
to:
'admins#search'
resource
:cities
resource
:cities
...
...
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