Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VenShop
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
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Dao Minh Nhut
VenShop
Commits
610b05fc
Commit
610b05fc
authored
Jul 27, 2015
by
Dao Minh Nhut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add file
parent
2a52ca08
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
81 additions
and
468 deletions
+81
-468
app/assets/stylesheets/bootstrap.css
+2
-0
app/assets/stylesheets/custom.css.scss.bk
+0
-229
app/controllers/application_controller.rb
+2
-1
app/controllers/categories_controller.rb
+3
-9
app/views/home/index.html.erb
+9
-184
app/views/layouts/_footer.html.erb
+13
-4
app/views/layouts/_header.html.erb
+16
-6
app/views/layouts/application.html.erb
+36
-25
app/views/static_pages/_category.html.erb
+0
-10
No files found.
app/assets/stylesheets/bootstrap.css
View file @
610b05fc
...
...
@@ -5582,6 +5582,8 @@ a.thumbnail:focus {
.thumbnail
>
img
{
display
:
block
;
max-width
:
100%
;
height
:
300px
;
crop
:
fill
;
margin-right
:
auto
;
margin-left
:
auto
;
}
...
...
app/assets/stylesheets/custom.css.scss.bk
deleted
100644 → 0
View file @
2a52ca08
@import "bootstrap-sprockets";
@import "bootstrap";
/* mixins, variables, etc. */
$grayMediumLight: #eaeaea;
@mixin box_sizing {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
/* miscellaneous */
.debug_dump {
clear: both;
float: left;
width: 100%;
margin-top: 45px;
@include box_sizing;
}
/* universal */
html {
overflow-y: scroll;
}
body {
padding-top: 60px;
}
section {
overflow: auto;
}
textarea {
resize: vertical;
}
.center {
text-align: center;
h1 {
margin-bottom: 10px;
}
}
/* typography */
h1, h2, h3, h4, h5, h6 {
line-height: 1;
}
h1 {
font-size: 3em;
letter-spacing: -2px;
margin-bottom: 30px;
text-align: center;
}
h2 {
font-size: 1.7em;
letter-spacing: -1px;
margin-bottom: 30px;
text-align: center;
font-weight: normal;
color: white;
}
p {
font-size: 1.1em;
line-height: 1.7em;
}
/* header */
#logo {
float: left;
margin-right: 10px;
font-size: 1.7em;
color: white;
text-transform: uppercase;
letter-spacing: -1px;
padding-top: 9px;
font-weight: bold;
line-height: 1;
&:hover {
color: white;
text-decoration: none;
}
}
/* footer */
footer {
margin-top: 45px;
padding-top: 5px;
border-top: 1px solid $grayMediumLight;
color: $grayLight;
a {
color: $gray;
&:hover {
color: $grayDarker;
}
}
small {
float: left;
}
ul {
float: right;
list-style: none;
li {
float: left;
margin-left: 10px;
}
}
}
/* sidebar */
aside {
section {
padding: 10px 0;
border-top: 1px solid $grayLighter;
&:first-child {
border: 0;
padding-top: 0;
}
span {
display: block;
margin-bottom: 3px;
line-height: 1;
}
h1 {
font-size: 1.4em;
text-align: left;
letter-spacing: -1px;
margin-bottom: 3px;
margin-top: 0px;
}
}
}
.gravatar {
float: left;
margin-right: 10px;
}
/* forms */
input, textarea, select, .uneditable-input {
border: 1px solid #bbb;
width: 100%;
padding: 10px;
margin-bottom: 15px;
@include box_sizing;
}
input {
height: auto !important;
}
#error_explanation {
color: #f00;
ul {
list-style: none;
margin: 0 0 18px 0;
}
}
.field_with_errors {
@extend .control-group;
@extend .error;
}
/* users index */
.users {
list-style: none;
margin: 0;
li {
overflow: auto;
padding: 10px 0;
border-top: 1px solid $grayLighter;
&:last-child {
border-bottom: 1px solid $grayLighter;
}
}
}
/* microposts */
.microposts {
list-style: none;
margin: 10px 0 0 0;
li {
padding: 10px 0;
border-top: 1px solid #e8e8e8;
}
}
.content {
display: block;
}
.timestamp {
color: $grayLight;
}
.gravatar {
float: left;
margin-right: 10px;
}
aside {
textarea {
height: 100px;
margin-bottom: 5px;
}
}
/*sidebar*/
@media (min-width: 768px) {
.sb-fixed{
position: fixed;
}
}
\ No newline at end of file
app/controllers/application_controller.rb
View file @
610b05fc
class
ApplicationController
<
ActionController
::
Base
protect_from_forgery
protect_from_forgery
with: :exception
#include SessionsHelper
# Force signout to prevent CSRF attacks
...
...
@@ -7,4 +7,5 @@ class ApplicationController < ActionController::Base
sign_out
super
end
end
app/controllers/categories_controller.rb
View file @
610b05fc
require
'will_paginate/array'
class
CategoriesController
<
ApplicationController
def
new
end
def
show
@items_of_category
=
Category
.
find
(
params
[
:id
]).
items
# @items_of_category = Item.all.select do |i|
# i.category_id == params[:id].to_i
# end
@items_of_category
=
@items_of_category
.
paginate
(
:page
=>
params
[
:page
],
:per_page
=>
6
)
@categories
=
Category
.
find
(
params
[
:id
])
@products
=
@category
.
products
.
page
(
params
[
:page
])
end
end
\ No newline at end of file
app/views/home/index.html.erb
View file @
610b05fc
<div
class=
"navbar navbar-inverse navbar-fixed-top"
>
<div
class=
"navbar-inner"
>
<div
class=
"container"
>
<button
class=
"btn btn-navbar"
data-target=
".nav-collapse"
data-toggle=
"collapse"
type=
"button"
>
<span
class=
"icon-bar"
></span>
<span
class=
"icon-bar"
></span>
<span
class=
"icon-bar"
></span>
</button>
<a
class=
"brand"
href=
"/"
>
RWM
</a>
<div
class=
"nav-collapse collapse"
>
<ul
class=
"nav"
>
<li
class=
"dropdown"
>
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
E-Commerce
<b
class=
"caret"
></b></a>
<ul
class=
"dropdown-menu"
>
<li><a
href=
"index.html"
>
E-commerce
</a></li>
<li><a
href=
"ecommerce-item.html"
>
E-commerce Item
</a></li>
<li><a
href=
"ecommerce-cart.html"
>
E-commerce Cart
</a></li>
<li><a
href=
"ecommerce-checkout.html"
>
E-commerce Checkout
</a></li>
</ul>
</li>
</ul>
<form
class=
"navbar-form form-search pull-right"
>
<input
id=
"Search"
name=
"Search"
type=
"text"
placeholder=
"type text to search for"
class=
"input-medium search-query"
>
<button
type=
"submit"
class=
"btn"
>
Search
</button>
</form>
</div>
</div>
</div>
</div>
<div
class=
"container"
>
<div
class=
"row"
>
<div
class=
"span3"
>
<div
class=
"well"
>
<div
class=
"dropdown"
>
<a
class=
"dropdown-toggle"
data-toggle=
"dropdown"
href=
"#"
>
<i
class=
"icon-shopping-cart"
></i>
3 item - $999.99
<b
class=
"caret"
></b></a>
</a>
<div
class=
"dropdown-menu well"
role=
"menu"
aria-labelledby=
"dLabel"
>
<p>
Item x 1
<span
class=
"pull-right"
>
$333.33
</span></p>
<p>
Item x 1
<span
class=
"pull-right"
>
$333.33
</span></p>
<p>
Item x 1
<span
class=
"pull-right"
>
$333.33
</span></p>
<a
href=
"#"
class=
"btn btn-primary"
>
Checkout
</a>
</div>
</div>
</div>
<div
class=
"well"
>
<ul
class=
"nav nav-list"
>
<li
class=
"nav-header"
>
Sidebar
</li>
<li
class=
"active"
>
<a
href=
"#"
>
Link
</a>
</li>
<li>
<a
href=
"#"
>
Link
</a>
</li>
<li>
<a
href=
"#"
>
Link
</a>
</li>
<li
class=
"nav-header"
>
Sidebar
</li>
<li>
<a
href=
"#"
>
Link
</a>
</li>
<li>
<a
href=
"#"
>
Link
</a>
</li>
<li>
<a
href=
"#"
>
Link
</a>
</li>
<li
class=
"nav-header"
>
Sidebar
</li>
<li>
<a
href=
"#"
>
Link
</a>
</li>
<li>
<a
href=
"#"
>
Link
</a>
</li>
<li>
<a
href=
"#"
>
Link
</a>
</li>
</ul>
</div>
<div
class=
"well"
>
<h4>
Filters
</h4>
<form>
<label
class=
"checkbox"
>
<input
type=
"checkbox"
value=
""
>
Filter 1
</label>
<label
class=
"checkbox"
>
<input
type=
"checkbox"
value=
""
>
Filter 1
</label>
<label
class=
"checkbox"
>
<input
type=
"checkbox"
value=
""
>
Filter 1
</label>
<label
class=
"checkbox"
>
<input
type=
"checkbox"
value=
""
>
Filter 1
</label>
<button
class=
"btn btn-primary pull-right"
type=
"submit"
>
Filter
</button>
</form>
</div>
<div
class=
"well"
>
<h4>
Sort
</h4>
<form>
<label
class=
"radio"
>
<input
type=
"radio"
name=
"optionsRadios"
id=
"optionsRadios1"
value=
"option1"
checked
>
Sort 1
</label>
<label
class=
"radio"
>
<input
type=
"radio"
name=
"optionsRadios"
id=
"optionsRadios2"
value=
"option2"
>
Sort 2
</label>
<button
class=
"btn btn-primary pull-right"
type=
"submit"
>
Sort
</button>
</form>
</div>
<div
class=
"well"
>
<form
class=
"form login-form"
>
<h2>
Sign in
</h2>
<div>
<label>
Username
</label>
<input
id=
"Username"
name=
"Username"
type=
"text"
/>
<label>
Password
</label>
<input
id=
"Password"
name=
"Password"
type=
"password"
/>
<label
class=
"checkbox inline"
>
<input
type=
"checkbox"
id=
"RememberMe"
value=
"option1"
>
Remember me
</label>
<br
/><br
/>
<button
type=
"submit"
class=
"btn btn-success"
>
Login
</button>
</div>
<br
/>
<a
href=
"#"
>
register
</a>
|
<a
href=
"#"
>
forgot password?
</a>
</form>
</div>
</div>
<div
class=
"span9"
>
<div
class=
"hero-unit"
>
<h1
class=
""
>
Special Offer
</h1>
<p
class=
""
>
here is the best offer of the month! Do not loose it!
</p>
<p><a
href=
"#"
class=
"btn btn-primary btn-large"
>
Learn more »
</a></p>
</div>
<ul
class=
"thumbnails"
>
<li
class=
"span3"
>
<ul
class=
"thumbnails"
>
<%
@products
.
each
do
|
product
|
%>
<li
class=
"span3"
>
<div
class=
"thumbnail"
>
<%=
image_tag
products
.
image
%>
<%=
image_tag
product
.
image
%>
<div
class=
"caption"
>
<h4>
Thumbnail label
</h4>
<p><strike>
Euro 150,00
</strike>
Euro 100,00
</p>
<h4>
<%=
truncate
(
product
.
name
,
:length
=>
25
,
:omission
=>
'...'
)
%>
</h4>
<p>
<%=
product
.
price
%>
$
</p>
<a
class=
"btn btn-primary"
href=
"#"
>
View
</a>
<a
class=
"btn btn-success"
href=
"#"
>
Add to Cart
</a>
</div>
</div>
<%
end
%>
</li>
</ul>
<div
class=
"pagination"
>
<ul>
<li
class
"
disabled
"
><span>
Prev
</span></li>
<li
class
"
disabled
"
><span>
1
</span></li>
<li><a
href=
"#"
>
2
</a></li>
<li><a
href=
"#"
>
3
</a></li>
<li><a
href=
"#"
>
4
</a></li>
<li><a
href=
"#"
>
5
</a></li>
<li><a
href=
"#"
>
Next
</a></li>
</ul>
</div>
</div>
</div>
</div>
\ No newline at end of file
<%
end
%>
</ul>
<%=
will_paginate
@products
%>
\ No newline at end of file
app/views/layouts/_footer.html.erb
View file @
610b05fc
<footer
class=
"footer"
>
<div
class=
"navbar-inner"
>
<footer
id=
"footer"
class=
"vspace20"
>
<div
class=
"container"
>
<nav>
<div
class=
"row"
>
<div
class=
"span6"
>
<p>
VenShop Ruby on Rails
</p>
</div>
<div
class=
"span6"
>
<nav
class=
"pull-right"
>
<%=
link_to
"About"
,
about_path
%>
<%=
link_to
"Contact"
,
contact_path
%>
<a
href=
"http://news.railstutorial.org/"
>
News
</a>
</nav>
</div>
</div>
</div>
</footer>
\ No newline at end of file
app/views/layouts/_header.html.erb
View file @
610b05fc
<header
class=
"navbar navbar-fixed-top navbar-inverse"
>
<div
class=
"navbar navbar-inverse navbar-fixed-top"
>
<div
class=
"navbar-inner"
>
<div
class=
"container"
>
<a
class=
"brand"
href=
"/"
>
VenShop
</a>
<div
class=
"nav-collapse collapse"
>
<!--%= link_to "VenShop", root_path, id: "logo" %-->
<nav>
<ul
class=
"nav pull-right
"
>
<ul
class=
"nav
"
>
<li>
<%=
link_to
"Home"
,
root_path
%>
</li>
<li>
<%=
link_to
"Help"
,
help_path
%>
</li>
<%
if
signed_in?
%>
<li>
<%=
link_to
"Users"
,
users_path
%>
</li>
<li>
<%=
link_to
"Users"
,
"#"
%>
</li>
<li
id=
"fat-menu"
class=
"dropdown"
>
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
Account
<b
class=
"caret"
></b>
</a>
<ul
class=
"dropdown-menu"
>
<li>
<%=
link_to
"Profile"
,
current_user
%>
</li>
<li>
<%=
link_to
"Settings"
,
edit_user_path
(
current_user
)
%>
</li>
<li>
<%=
link_to
"Profile"
,
"#"
%>
</li>
<li>
<%=
link_to
"Settings"
,
"#"
%>
</li>
<li
class=
"divider"
></li>
<li>
<%=
link_to
"Sign out"
,
signout_path
,
method:
"delete"
%>
<%=
link_to
"Sign out"
,
"#"
,
method:
"delete"
%>
</li>
</ul>
</li>
<%
else
%>
<li>
<%=
link_to
"Sign in"
,
signin_path
%>
</li>
<li>
<%=
link_to
"Sign in"
,
"#"
%>
</li>
<%
end
%>
</ul>
</nav>
<form
class=
"navbar-form form-search pull-right"
>
<input
id=
"Search"
name=
"Search"
type=
"text"
placeholder=
"type text to search for"
class=
"input-medium search-query"
>
<button
type=
"submit"
class=
"btn"
>
Search
</button>
</form>
</div>
</div>
</div>
</div>
</header>
\ No newline at end of file
app/views/layouts/application.html.erb
View file @
610b05fc
<!DOCTYPE html>
<html>
<head>
<title>
<!--%= full_title(yield(:title)) %-->
</title>
<%=
stylesheet_link_tag
"application"
,
media:
"all"
%>
<%=
javascript_include_tag
"application"
%>
<title>
VenShop
</title>
<%=
stylesheet_link_tag
'application'
,
media:
'all'
,
'data-turbolinks-track'
=>
true
%>
<%=
javascript_include_tag
'application'
,
'data-turbolinks-track'
=>
true
%>
<%=
csrf_meta_tags
%>
<!--%= render 'layouts/shim' %-->
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
<!-- Included Bootstrap CSS Files -->
<link
rel=
"stylesheet"
href=
"./js/bootstrap/css/bootstrap.min.css"
/>
<link
rel=
"stylesheet"
href=
"./js/bootstrap/css/bootstrap-responsive.min.css"
/>
<!-- Includes FontAwesome -->
<link
rel=
"stylesheet"
href=
"./css/font-awesome/css/font-awesome.min.css"
/>
<!-- Css -->
<link
rel=
"stylesheet"
href=
"./css/style.css"
/>
</head>
<body>
<
!--%= render 'layouts/header' %--
>
<
%=
render
'layouts/header'
%
>
<div
class=
"container"
>
<%
flash
.
each
do
|
key
,
value
|
%>
<div
class=
"alert alert-
<%=
key
%>
"
>
<%=
value
%>
</div>
<%
end
%>
<div
class=
"span12 span-fixed-sidebar"
>
<div
class=
"center hero-unit"
>
<h1
style=
"color:blue"
>
Welcome to VenShop
</h1>
<%
if
!
signed_in?
%>
<!--%= link_to "Sign up now!", signup_path, class: "btn btn-large btn-primary" %-->
<div
class=
"row"
>
<div
class=
"span3"
>
<div
class=
"well"
>
<ul
class=
"nav nav-list"
>
<li
class=
"nav-header"
>
Category
</li>
<%
Category
.
all
.
each
do
|
category
|
%>
<li>
<%=
link_to
category
.
name
%>
</li>
<%
end
%>
</ul>
</div>
<%=
render
'layouts/search'
%>
<%
if
signed_in?
%>
<div
class=
"span3"
>
<%=
button_to
"My cart"
,
'/user/cart/'
,
:class
=>
"btn btn-primary"
,
:method
=>
:get
%>
</div>
<%
end
%>
<div
style=
"clear: both"
></div>
<div
class=
"row-fluid"
>
<!--%= render 'layouts/sidebar' %-->
<div
class=
"span9"
>
<div
class=
"hero-unit"
>
<h1
class=
""
>
Ventura Trainee
</h1>
<p
class=
""
>
Ruby on Rails
</p>
<p><a
href=
"#"
class=
"btn btn-primary btn-large"
>
Learn more »
</a></p>
</div>
<%=
yield
%>
</div>
</div>
</div>
<hr
/>
<%=
render
'layouts/footer'
%>
<!--
<%=
debug
(
params
)
if
Rails
.
env
.
development?
%>
-->
</body>
</html>
\ No newline at end of file
app/views/static_pages/_category.html.erb
deleted
100644 → 0
View file @
2a52ca08
<div
class=
"span3 sb-fixed"
>
<div
class=
"well sidebar-nav"
>
<!-- Sidebar Contents -->
<%
@category_list
.
each
do
|
cat
|
%>
<%=
link_to
"
#{
cat
.
name
}
"
,
signup_path
,
class:
"btn btn-large btn-primary"
%>
<h1>
hello
</h1>
<%
end
%>
</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