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
0
Merge Requests
0
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
Nguyen Ngoc Nghia
VeNJOB
Commits
d6b94eef
Commit
d6b94eef
authored
Nov 28, 2019
by
nnnghia98
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
header
parent
86dbf669
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
60 additions
and
16 deletions
+60
-16
app/assets/stylesheets/custom.scss
+31
-0
app/helpers/application_helper.rb
+8
-0
app/views/layouts/_header.html.erb
+8
-1
app/views/layouts/application.html.erb
+5
-2
app/views/static_pages/top_page.html.erb
+0
-1
config/routes.rb
+2
-2
test/controllers/static_pages_controller_test.rb
+6
-10
No files found.
app/assets/stylesheets/custom.scss
0 → 100644
View file @
d6b94eef
/* mixin, variables, etc. */
$gray-medium-light
:
#eaeaea
;
$light-gray
:
#777
;
@mixin
box_sizing
{
-moz-box-sizing
:
border-box
;
-webkit-box-sizing
:
border-box
;
box-sizing
:
border-box
;
}
/* universal */
body
{
padding-top
:
30px
;
}
section
{
overflow
:
auto
;
}
textarea
{
resize
:
vertical
;
}
.center
{
text-align
:
center
;
h1
{
margin-bottom
:
10px
;
}
}
app/helpers/application_helper.rb
View file @
d6b94eef
module
ApplicationHelper
module
ApplicationHelper
def
full_title
(
page_title
=
''
)
base_title
=
"VeNJOB"
if
page_title
.
empty?
base_title
else
page_title
+
" | "
+
base_title
end
end
end
end
app/views/layouts/_header.html.erb
View file @
d6b94eef
<header
class=
"navbar navbar-fixed-top navbar-inverse"
>
<header
class=
"navbar navbar-fixed-top navbar-inverse"
>
<div
class=
"container"
>
<div
class=
"container"
>
<%=
link_to
image_tag
(
"venjob_logo.png"
,
alt:
"VeNJOB Logo"
)
,
root_path
%>
<%=
link_to
image_tag
(
"venjob_logo.png"
,
alt:
"VeNJOB Logo"
)
,
root_path
,
id:
"logo"
%>
<nav>
<ul
class=
"nav navbar-nav navbar-right"
>
<%=
link_to
"Favorite"
,
favorite_path
%>
<%=
link_to
"History"
,
history_path
%>
</ul>
</nav>
</div>
</div>
</header>
</header>
app/views/layouts/application.html.erb
View file @
d6b94eef
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<html>
<head>
<head>
<title>
<%=
yield
(
:title
)
%>
| VeNJOB
</title>
<title>
<%=
full_title
(
yield
(
:title
))
%>
</title>
<%=
render
"layouts/rails_default"
%>
<%=
render
"layouts/rails_default"
%>
</head>
</head>
<body>
<body>
<%=
render
"layouts/header"
%>
<%=
render
"layouts/header"
%>
<%=
yield
%>
<div
class=
"container"
>
<%=
yield
%>
<%=
render
"layouts/footer"
%>
</div>
</body>
</body>
</html>
</html>
app/views/static_pages/top_page.html.erb
View file @
d6b94eef
<%
provide
(
:title
,
"Top Page"
)
%>
<h1>
VeNJOB Top page
</h1>
<h1>
VeNJOB Top page
</h1>
config/routes.rb
View file @
d6b94eef
...
@@ -3,6 +3,6 @@ Rails.application.routes.draw do
...
@@ -3,6 +3,6 @@ Rails.application.routes.draw do
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
root
"static_pages#top_page"
root
"static_pages#top_page"
get
"static_pages/top_page"
get
"static_pages/top_page"
get
"
static_pages/
favorite"
get
"
/favorite"
,
to:
"static_pages#
favorite"
get
"
static_pages/
history"
get
"
/history"
,
to:
"static_pages#
history"
end
end
test/controllers/static_pages_controller_test.rb
View file @
d6b94eef
require
'test_helper'
require
'test_helper'
class
StaticPagesControllerTest
<
ActionDispatch
::
IntegrationTest
class
StaticPagesControllerTest
<
ActionDispatch
::
IntegrationTest
def
setup
@base_title
=
"VeNJOB"
end
test
"should get top_page"
do
test
"should get top_page"
do
get
static_pages_top_page_url
get
root_path
assert_response
:success
assert_response
:success
assert_select
"title"
,
"
Top Page |
#{
@base_title
}
"
assert_select
"title"
,
"
VeNJOB
"
end
end
test
"should get favorite"
do
test
"should get favorite"
do
get
static_pages_
favorite_url
get
favorite_url
assert_response
:success
assert_response
:success
assert_select
"title"
,
"Favorite |
#{
@base_title
}
"
assert_select
"title"
,
"Favorite |
VeNJOB
"
end
end
test
"should get history"
do
test
"should get history"
do
get
static_pages_
history_url
get
history_url
assert_response
:success
assert_response
:success
assert_select
"title"
,
"History |
#{
@base_title
}
"
assert_select
"title"
,
"History |
VeNJOB
"
end
end
end
end
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