Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
venjob_nth
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
3
Merge Requests
3
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
Ngô Trung Hưng
venjob_nth
Commits
58b92a21
Commit
58b92a21
authored
Nov 03, 2020
by
Ngô Trung Hưng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimaze code
parent
cd393a68
Pipeline
#1121
failed with stages
in 0 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
43 additions
and
16 deletions
+43
-16
.gitignore
+1
-0
app/assets/stylesheets/admin.scss
+18
-0
app/controllers/admin/admin_controller.rb
+3
-8
app/controllers/application_controller.rb
+1
-1
app/views/admin/admin/index.html.erb
+13
-4
app/views/admin/admin/show_applied.html.erb
+4
-0
config/routes.rb
+3
-3
dump.rdb
+0
-0
No files found.
.gitignore
View file @
58b92a21
...
@@ -32,3 +32,4 @@
...
@@ -32,3 +32,4 @@
config/settings.local.yml
config/settings.local.yml
config/settings/*.local.yml
config/settings/*.local.yml
config/environments/*.local.yml
config/environments/*.local.yml
dump.rdb
app/assets/stylesheets/admin.scss
View file @
58b92a21
...
@@ -116,3 +116,20 @@
...
@@ -116,3 +116,20 @@
padding-top
:
60px
;
padding-top
:
60px
;
}
}
}
}
.box_menu_admin
{
margin-top
:
30px
;
}
.btn-col-6
{
width
:
100%
;
padding
:
10px
20px
;
background-color
:
rgb
(
43
,
131
,
185
);
color
:
#fff
;
font-weight
:
bold
;
border-radius
:
6px
;
&
:hover
{
background-color
:
rgb
(
175
,
214
,
238
);
color
:
rgb
(
0
,
0
,
0
);
text-decoration
:
none
;
}
}
\ No newline at end of file
app/controllers/admin/admin_controller.rb
View file @
58b92a21
...
@@ -7,20 +7,15 @@ class Admin::AdminController < ApplicationController
...
@@ -7,20 +7,15 @@ class Admin::AdminController < ApplicationController
before_action
:load_data_dropdown
before_action
:load_data_dropdown
include
InitApply
include
InitApply
# user input in url 'localhost:3000/admin' if admin signed redirect to applies page else admin login page
def
index
def
routing
return
redirect_to
new_admin_session_path
unless
admin_signed_in?
redirect_to
applies_index_path
end
end
def
index
def
show_applied
@applied
=
AppliedJob
.
includes
(
:job
).
all_result
.
page
(
params
[
:page
]).
per
(
6
)
@applied
=
AppliedJob
.
includes
(
:job
).
all_result
.
page
(
params
[
:page
]).
per
(
6
)
@apply
=
apply
@apply
=
apply
end
end
def
search
def
search
return
redirect_to
applies_index_path
if
params
[
:apply
].
blank?
return
redirect_to
applies_index_path
if
params
[
:apply
].
blank?
return
export_csv
(
result_for
(
params
[
:apply
]))
if
params
[
:export_csv
].
present?
return
export_csv
(
result_for
(
params
[
:apply
]))
if
params
[
:export_csv
].
present?
...
@@ -30,7 +25,7 @@ class Admin::AdminController < ApplicationController
...
@@ -30,7 +25,7 @@ class Admin::AdminController < ApplicationController
@industry_id
=
params
[
:apply
][
:industry_id
]
@industry_id
=
params
[
:apply
][
:industry_id
]
@params_date
=
params
[
:apply
]
@params_date
=
params
[
:apply
]
@apply
=
apply
@apply
=
apply
render
:
index
render
:
show_applied
end
end
def
load_data_dropdown
def
load_data_dropdown
...
...
app/controllers/application_controller.rb
View file @
58b92a21
...
@@ -17,7 +17,7 @@ class ApplicationController < ActionController::Base
...
@@ -17,7 +17,7 @@ class ApplicationController < ActionController::Base
end
end
def
after_sign_in_path_for
(
resource
)
def
after_sign_in_path_for
(
resource
)
return
a
pplies
_path
if
resource
.
model_name
==
Admin
.
name
return
a
dmin
_path
if
resource
.
model_name
==
Admin
.
name
stored_location_for
(
resource
)
||
root_path
stored_location_for
(
resource
)
||
root_path
end
end
...
...
app/views/admin/admin/index.html.erb
View file @
58b92a21
<%
provide
(
:title
,
'Admin'
)
%>
<div
class=
"container"
>
<%=
render
'box_filter'
%>
<div
class=
"box_menu_admin"
>
<%=
render
'shared/scroll_top'
%>
<h2>
Menu Admin
</h2><hr>
<%=
render
'box_result_applied'
%>
<div
class=
"row"
>
<div
class=
"col-lg-6"
>
<%=
link_to
"Danh sách ứng tuyển"
,
applies_index_path
,
class:
'btn-col-6'
%>
</div>
<div
class=
"col-lg-6"
>
<%=
link_to
"Cài đặt"
,
settings_path
,
class:
'btn-col-6'
%>
</div>
</div>
</div>
</div>
app/views/admin/admin/show_applied.html.erb
0 → 100644
View file @
58b92a21
<%
provide
(
:title
,
'Admin'
)
%>
<%=
render
'box_filter'
%>
<%=
render
'shared/scroll_top'
%>
<%=
render
'box_result_applied'
%>
config/routes.rb
View file @
58b92a21
...
@@ -8,10 +8,10 @@ Rails.application.routes.draw do
...
@@ -8,10 +8,10 @@ Rails.application.routes.draw do
get
'admin/setting'
,
to:
'admin/settings#index'
,
as: :settings
get
'admin/setting'
,
to:
'admin/settings#index'
,
as: :settings
post
'admin/setting/cronjob/:code_cron/:code_action'
,
to:
'admin/settings#cron_implement'
,
as: :settings_cron
post
'admin/setting/cronjob/:code_cron/:code_action'
,
to:
'admin/settings#cron_implement'
,
as: :settings_cron
get
'admin'
,
to:
'admin/admin#index'
,
as: :admin
get
'admin/search'
,
to:
'admin/admin#search'
,
as: :applies
get
'admin/search'
,
to:
'admin/admin#search'
,
as: :applies
get
'admin/applies'
,
to:
'admin/admin#index'
,
as: :applies_index
get
'admin/applies'
,
to:
'admin/admin#show_applied'
,
as: :applies_index
get
'admin'
,
to:
'admin/admin#routing'
,
as: :admin
get
'info/user/:user_id'
,
to:
'users#personal_page'
,
as: :personal_page
get
'info/user/:user_id'
,
to:
'users#personal_page'
,
as: :personal_page
...
...
dump.rdb
View file @
58b92a21
No preview for this file type
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