Commit 610b05fc by Dao Minh Nhut

add file

parent 2a52ca08
......@@ -5582,6 +5582,8 @@ a.thumbnail:focus {
.thumbnail > img {
display: block;
max-width: 100%;
height: 300px;
crop: fill;
margin-right: auto;
margin-left: auto;
}
......
@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
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
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
<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>
<ul class="thumbnails">
<% @products.each do |product| %>
<li class="span3">
<div class="thumbnail">
<%= image_tag product.image %>
<div class="caption">
<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>
<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>&nbsp;&#124;&nbsp;<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">
<% @products.each do |product| %>
<div class="thumbnail">
<%= image_tag products.image %>
<div class="caption">
<h4>Thumbnail label</h4>
<p><strike>Euro 150,00</strike>&nbsp;Euro 100,00</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
</li>
<% end %>
</ul>
<%= will_paginate @products%>
\ No newline at end of file
<footer class="footer">
<div class="navbar-inner">
<div class="container">
<nav>
<%= link_to "About", about_path %>
<%= link_to "Contact", contact_path %>
<a href="http://news.railstutorial.org/">News</a>
<footer id="footer" class="vspace20">
<div class="container">
<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 %>
</nav>
</div>
</div>
</div>
</footer>
</footer>
\ No newline at end of file
<header class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar-inner">
<div class="container">
<!--%= link_to "VenShop", root_path, id: "logo" %-->
<nav>
<ul class="nav pull-right">
<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 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 class="divider"></li>
<li>
<%= link_to "Sign out", signout_path, method: "delete" %>
<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">
<li><%= link_to "Home", root_path %></li>
<li><%= link_to "Help", help_path %></li>
<% if signed_in? %>
<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", "#" %></li>
<li><%= link_to "Settings", "#" %></li>
<li class="divider"></li>
<li>
<%= link_to "Sign out", "#", method: "delete" %>
</li>
</ul>
</li>
</ul>
</li>
<% else %>
<li><%= link_to "Sign in", signin_path %></li>
<% end %>
</ul>
</nav>
<% else %>
<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
<!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" %-->
<% end %>
<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>
</div>
<%= render 'layouts/search' %>
<% if signed_in? %>
<div class= "span3">
<%= button_to "My cart", '/user/cart/',
:class => "btn btn-primary", :method => :get %>
<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>
<% end %>
<div style= "clear: both"></div>
<div class="row-fluid">
<!--%= render 'layouts/sidebar' %-->
<%= yield %>
<%= yield %>
</div>
</div>
</div>
<hr />
<%= render 'layouts/footer' %>
<!-- <%= debug(params) if Rails.env.development? %> -->
</body>
</html>
\ No newline at end of file
<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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment