Skip to content

Commit

Permalink
adds simple styling using materialize
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshamann committed Jun 11, 2017
1 parent f69ea07 commit 6fd066f
Show file tree
Hide file tree
Showing 21 changed files with 33 additions and 29 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ gem 'pg'
gem 'paperclip'
gem 'aws-sdk', '~> 2.3'

gem 'materialize-sass'

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ GEM
nokogiri (>= 1.5.9)
mail (2.6.5)
mime-types (>= 1.16, < 4)
materialize-sass (0.98.2)
sass (~> 3.3)
method_source (0.8.2)
mime-types (3.1)
mime-types-data (~> 3.2015)
Expand Down Expand Up @@ -261,6 +263,7 @@ DEPENDENCIES
jbuilder (~> 2.5)
jquery-rails
listen (~> 3.0.5)
materialize-sass
paperclip
pg
puma (~> 3.0)
Expand Down
15 changes: 0 additions & 15 deletions app/assets/stylesheets/application.css

This file was deleted.

6 changes: 6 additions & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@import "materialize";
@import "https://fonts.googleapis.com/icon?family=Material+Icons";

h1,h5 {
text-align: center;
}
2 changes: 2 additions & 0 deletions app/views/application/index.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
<h1>WebShop</h1>

<h1><%= link_to "See all Items", items_path, class: "waves-effect waves-light btn" %></h1>
29 changes: 17 additions & 12 deletions app/views/items/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
<div class="container">
<h2>Items</h2>
<h1>Items</h1>

<% if @items.any? %>
<% @items.each do |i| %>
<p> <%= i.name %></p>
<p> <%= i.description %></p>
<%= image_tag i.avatar.url(:medium) %>
<% end %>
<% else %>
<h2>No items yet!</h2>
<% end %>

<%= link_to "Add a new Item", new_item_path %>

<% if @items.any? %>
<% @items.each do |i| %>
<div class="row">
<div class="col s3 offset-s1">
<p><b> <%= i.name %> </b></p>
<p> <%= i.description %></p>
<p> £<%= i.price %></p>
<p> <%= image_tag i.avatar.url(:medium), class: "responsive-img" %> </p>
</div>
<% end %>
<% else %>
<h5>No items yet!</h5>
<% end %>

</div>

<h1><%= link_to "Add a new Item", new_item_path, class: "waves-effect waves-light btn" %></h1>
5 changes: 3 additions & 2 deletions app/views/items/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<h1>Adding Items</h1>

<div class="container">
<%= form_for(@item, html: {multipart: true}) do |f| %>
Name: <%= f.text_field :name %>
Description: <%= f.text_field :description %>
Price: <%= f.number_field :price %>
<%= f.label :avatar %>
<%= f.file_field :avatar %>
<p><%= f.submit %></p>
<p><%= f.submit(class: "waves-effect waves-light btn") %>
<% end %>
</div>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6fd066f

Please sign in to comment.