Commit 1decb8d5 authored by Christiana Tan's avatar Christiana Tan

Final

parent cf2850f3
File added
File added
This diff is collapsed.
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
......@@ -13,3 +13,45 @@
*= require_tree .
*= require_self
*/
html {
height: 100%;
box-sizing: border-box;
}
body {
position: relative;
width: 100%;
height: 100%;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;
background-position: center;
background-repeat:no-repeat;
background-image: url('bg.jpg');
background-color: black;
text-align: center;
color: white;
}
th {
text-align: center;
}
input {
color: black;
}
.footer {
position: absolute;
bottom: 0;
padding: 1rem;
float: left;
}
.inner {
position: relative;
text-align: center;
padding: 100px 15px 100px;
width: 100%;
}
This diff is collapsed.
// Place all the styles related to the Pages controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
class PagesController < ApplicationController
def index
@pages = CarLog.all
end
end
module PagesHelper
end
<div class="container-fluid">
<h1> Car Records </h1>
<table>
<table class = "table">
<thead>
<th> ID </th>
<th> Plate Number </th>
......@@ -20,7 +21,7 @@
<td><%=car.slot_number%> </td>
<td><%=car.created_at%> </td>
<td><%= car.is_taken%> </td>
<td><%= link_to "Delete", carlog_destroy_path(car.id) %></td>
<td><%= link_to "Delete", carlog_destroy_path(car.id), class: "btn btn-danger" %></td>
</tr>
<% end%>
......@@ -28,4 +29,5 @@
</tbody>
</table>
<%= link_to 'New Car', new_carlog_path%>
\ No newline at end of file
<%= link_to 'New Car', new_carlog_path, class: "btn btn-primary"%>
</div>
\ No newline at end of file
<h1> New Car Record</h1>
<%= form_tag '/carlogs/create' do %>
<!--ID <br/>
<input type: "text" name = "ID"><br> -->
Plate Number <br/>
<input type= "text" name = "plate_number"><br>
Brand
<select name = "brand">
<option value = "honda">Honda</option>
<option value = "toyota">Toyota</option>
<option value = "mitsubishi">Mitsubishi</option>
<option value = "hyundai">Hyundai</option>
<option value = "ford">Ford</option>
<option value = "audi">Audi</option>
<option value = "mazda">Mazda</option>
</select> <br>
Slot Number <br/>
<input type= "text" name = "slot_number"><br>
Is Taken <br>
<input type="checkbox" name="is_taken"><br>
<%= submit_tag "Submit" %>
<%end%>
<div class="container-fluid">
<div class="inner">
<h1> New Car Record</h1> <br>
<%= form_tag '/carlogs/create' do %>
Plate Number <br/>
<input type= "text" name = "plate_number"><br><br>
Brand
<select name = "brand">
<option value = "Honda">Honda</option>
<option value = "Toyota">Toyota</option>
<option value = "Mitsubishi">Mitsubishi</option>
<option value = "Hyundai">Hyundai</option>
<option value = "Ford">Ford</option>
<option value = "Audi">Audi</option>
<option value = "Mazda">Mazda</option>
</select> <br><br>
Slot Number <br/>
<input type= "text" name = "slot_number"><br><br>
Is Taken ?
<input type="checkbox" name="is_taken"><br><br>
<%= submit_tag "Submit", class: "btn btn-success"%>
<%= link_to 'View Records', carlogs_path, class: "btn btn-success"%>
<%end%>
</div>
</div>
\ No newline at end of file
<%= notice %>
<p>
<strong>ID</strong>
<%= @carlog.id%></br>
<strong>Plate Number</strong>
<%= @carlog.plate_number%></br>
<strong>Brand</strong>
<%= @carlog.brand%></br>
<strong>Slot Number</strong>
<%= @carlog.slot_number %> </br>
<strong>Is Taken</strong>
<%= @carlog.is_taken %> </br>
<strong>Created At</strong>
<%= @user.created_at %></br>
</p>
......@@ -5,10 +5,37 @@
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
<link href="parkinglot_144056_145165/app/assets/stylesheets/bootstrap.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">Parking Lot</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<%= yield %>
<div class="footer">
<p> Created by: Trina Tan & Zen Tiongson</p>
</div>
</body>
</html>
<div class="container-fluid">
<div class="inner">
<h1> Welcome to the Parking Lot </h1>
<h4> An App which records your car's details </h4>
<br>
<br>
<%= link_to 'View Records', carlogs_path, class: "btn btn-success"%>
<%= link_to 'Create Car Record', new_carlog_path, class: "btn btn-success"%>
</div>
</div>
......@@ -6,6 +6,8 @@ Rails.application.routes.draw do
get '/carlogs/:id', to: 'car_logs#destroy', as: :carlog_destroy
root 'pages#index'
post '/carlogs/create', to: 'car_logs#create', as: :carlog
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".
......
require 'test_helper'
class PagesControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
end
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