Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified app/assets/images/Site/gameland.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,27 @@
document.addEventListener("turbolinks:load", function() {
// whatever you want to make sure is loaded on each page

// Footer fix
// function to set the height on fly
function autoHeight() {
$('.mainCont').css('min-height', 0);
$('.mainCont').css('min-height', (
$(document).height() -
$('.header').height() -
$('.foot').height()
));
}

// onDocumentReady function bind
$(document).ready(function() {
autoHeight();
});

// onResize bind of the function
$(window).resize(function() {
autoHeight();
});

// End Footer fix

})
97 changes: 64 additions & 33 deletions app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ body {
text-align: center;
padding-left: 0;
padding-right: 0;
min-height: 100%;
}

.button {
Expand Down Expand Up @@ -71,31 +72,6 @@ body {
width: 100%;
}


.icon {
width: 5em;
opacity: 0.5;
}


.icon {
width: 5em;
opacity: 0.5;
}

.iconsdiv {
width: 23%;
text-align: center;
display: block;
background-color: transparent;
border: 1px solid transparent;
margin-right: 0;
margin-bottom: 1px;
float: left;
padding: 2em;
padding-left: 0;
}

#notice {
padding-left: 2%;
}
Expand All @@ -121,6 +97,12 @@ body {
text-align: center;
}

.header ul {
list-style-type: none;
overflow: hidden;
background-color: rgba(0, 0, 0, .9);
}

.header li {
float: left;
}
Expand All @@ -133,10 +115,15 @@ body {
padding: 14px 16px;
}

.header ul {
list-style-type: none;
overflow: hidden;
background-color: rgba(100, 68, 100, 0.3);
.header li a:hover {
color: rgb(222, 62, 62);
}

.isAdminLi {
color: red;
padding-top: 13px;
font-size: 18px;
margin-left: 20px;
}

/* Footer */
Expand All @@ -149,8 +136,8 @@ body {
-o-background-size: cover;
background-size: cover;
width: 100%;
margin-bottom: 0em;
overflow: auto;
overflow: hidden;
bottom: 0;
}

.footer-buttons {
Expand All @@ -167,7 +154,7 @@ body {
margin-bottom: 20px;
font-size: 18px;
font-weight: 700;
color: black;
color: white;
}

#freeIconsCredits {
Expand All @@ -190,9 +177,47 @@ body {
text-align: right;
}

.icon {
width: 5em;
opacity: 0.9;
}

.iconsdiv {
width: 23%;
text-align: center;
display: block;
background-color: transparent;
border: 1px solid transparent;
margin-right: 0;
margin-bottom: 1px;
float: left;
padding: 2em;
padding-left: 0;
}

.home-catButton {
width: 25%;
margin-right: auto;
margin-left: auto;
}

@media only screen and (max-width: 1440px) {
.icon {
padding-left: 1.5em;
}

.iconsdiv {
width: 22%;
}
}

@media only screen and (max-width: 1024px) {
.icon {
padding-left: 3.2em;
}

.iconsdiv {
width: 21%;
width: 20%;
}
}

Expand Down Expand Up @@ -253,6 +278,12 @@ h1 {
display: block;
}

@media only screen and (max-width: 768px) {
.item {
width: 80%;
}
}

#itemsContainer h2 {
display: block;
color: #555;
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/static_pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ def help
end

def paid
flash[:notice] = "transaction complete"
flash[:notice] = "Transaction successfully complete."
@order = Order.last
@order.update_attribute(:status, "paid by user #{current_user.email}")
@order.update_attribute(:status, "Paid by #{current_user.email}")
session[:cart] = nil

end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/user_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class UserController < ApplicationController

def login
session[:login] = 1
flash[:notice] = "you are logged in"
flash[:notice] = "You are logged in!"
redirect_to :controller => :items
#session[:cart] = nil

Expand Down
2 changes: 1 addition & 1 deletion app/views/cart/createOrder.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<% @overall = shipping + @total %>

<tr>
<td colspan="4">Shipping &euro; 10</td>
<td colspan="4">Shipping &euro; 10.00</td>

</tr>
<tr>
Expand Down
4 changes: 2 additions & 2 deletions app/views/cart/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<p id="notice"><%= notice %></p>

<div id="itemsContainer">
<div id="itemsContainer" class="mainCont">

<% if@cart.empty? %>
<p>Your cart is empty, please add somthing to make a purchase</p>
<p>Your cart is empty, please add somthing to make a purchase.</p>
<% end %>

<table id="customers">
Expand Down
40 changes: 26 additions & 14 deletions app/views/items/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,44 @@
<%= form.text_field :title, id: :item_title %>
</div>

<div class="field">
<%= form.label :console %>
<!-- Generate console categories but dont show them on item page-->
<!--<div class="field">-->
<!-- <%= form.label :console %>-->

<select>
<% @consoles.each do |console| %>
<option value="<%= :item_console %>"><%= console.title %></option>
<!-- <select>-->
<!-- <% @consoles.each do |console| %>-->
<!-- <option value="<%= :item_console %>"><%= console.title %></option>-->

<% end %>
</select>
<!-- <% end %>-->
<!-- </select>-->

<!--</div>-->

<div class="field">
<%= form.label :console %>
<%= form.select :console, ['Playstation 4', 'Xbox One', 'PC', 'Nintendo Switch'], id: :item_console %>
</div>

<div class="field">
<%= form.label :publisher %>
<%= form.text_field :brand, id: :item_brand %>
</div>

<div class="field">
<%= form.label :genre %>
<select>
<% @genres.each do |genre| %>
<option value="<%= :item_genre %>"><%= genre.title %></option>
<!-- Generate genre categories but dont show them on item page-->
<!--<div class="field">-->
<!-- <%= form.label :genre %>-->
<!-- <select>-->
<!-- <% @genres.each do |genre| %>-->
<!-- <option value="<%= :item_genre %>"><%= genre.title %></option>-->

<% end %>
</select>
<!-- <% end %>-->
<!-- </select>-->

<!--</div>-->

<div class="field">
<%= form.label :genre %>
<%= form.select :genre, ['Adventure', 'Racing', 'Sports', 'Action'], id: :item_console %>
</div>

<div class="field">
Expand Down
6 changes: 2 additions & 4 deletions app/views/layouts/_consoles.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@


<% @consoles.each do |console| %>
<div class="mainCont">
<div class = "iconsdiv">

<div class="iconsdiv">

<%= image_tag console.image, :class=>"icon" %>


<p><a href="/console/<%= console.title %>" class="button"><%= console.title %></a></p>
<p class="home-catButton"><a href="/console/<%= console.title %>" class="button"><%= console.title %></a></p>

</div>
</div>
<% end %>


10 changes: 2 additions & 8 deletions app/views/layouts/_genres.html.erb
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@


<% @genres.each do |genre| %>
<div class="mainCont">

<div class = "iconsdiv">


<div class="iconsdiv">

<%= image_tag genre.image, :class=>"icon" %>
<p><a href="/genre/<%= genre.title %>" class="button"><%= genre.title %></a></p>

<p class="home-catButton"><a href="/genre/<%= genre.title %>" class="button"><%= genre.title %></a></p>

</div>
</div>
<% end %>

2 changes: 1 addition & 1 deletion app/views/layouts/_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<header class="header">

<%= image_tag("Site/game-land-logo-white.png") %>
<%= image_tag("Site/game-land-logo.png") %>

<ul>
<li><%= link_to "Home", root_path %></li>
Expand Down
11 changes: 5 additions & 6 deletions app/views/static_pages/home.html.erb
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
<% provide(:title, 'Home') %>

<div class="mainCont search">

<div class="mainCont">

<div class="search">
<%= render 'layouts/search' %>
</div>

<div class="mainCont">
<%= render 'layouts/genres' %>
</div>

<div class="mainCont">
<%= render 'layouts/consoles' %>
</div>

</div>



Binary file modified db/development.sqlite3
Binary file not shown.