diff --git a/.project b/.project new file mode 100644 index 0000000..72f342c --- /dev/null +++ b/.project @@ -0,0 +1,18 @@ + + + Tab + + + + + + com.aptana.ide.core.unifiedBuilder + + + + + + org.radrails.rails.core.railsnature + com.aptana.ruby.core.rubynature + + diff --git a/Gemfile b/Gemfile index 41515a5..56b2b09 100644 --- a/Gemfile +++ b/Gemfile @@ -65,3 +65,6 @@ gem 'faker', '1.4.2' # Safety first gem 'paper_trail', '~> 4.0.0.beta' + +# Windoos sux +gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw] \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index a941b71..872b541 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -41,6 +41,7 @@ GEM rake (>= 0.8.7) arel (6.0.0) bcrypt (3.1.10) + bcrypt (3.1.10-x64-mingw32) bootstrap-sass (3.2.0.0) sass (~> 3.2) bootstrap-will_paginate (0.0.10) @@ -117,6 +118,8 @@ GEM net-ssh (2.9.2) nokogiri (1.6.6.2) mini_portile (~> 0.6.0) + nokogiri (1.6.6.2-x64-mingw32) + mini_portile (~> 0.6.0) orm_adapter (0.5.0) paper_trail (4.0.0.beta2) activerecord (>= 3.0, < 6.0) @@ -179,6 +182,7 @@ GEM activesupport (>= 3.0) sprockets (>= 2.8, < 4.0) sqlite3 (1.3.10) + sqlite3 (1.3.10-x64-mingw32) sshkit (1.6.1) colorize (>= 0.7.0) net-scp (>= 1.1.2) @@ -190,6 +194,8 @@ GEM coffee-rails tzinfo (1.2.2) thread_safe (~> 0.1) + tzinfo-data (1.2015.1) + tzinfo (>= 1.0.0) uglifier (2.7.0) execjs (>= 0.3.0) json (>= 1.8.0) @@ -199,6 +205,7 @@ GEM PLATFORMS ruby + x64-mingw32 DEPENDENCIES annotate @@ -223,5 +230,6 @@ DEPENDENCIES spring sqlite3 turbolinks + tzinfo-data uglifier (>= 1.3.0) will_paginate (= 3.0.7) diff --git a/app/assets/stylesheets/products.css.scss b/app/assets/stylesheets/products.css.scss index e77849f..9ec81e9 100644 --- a/app/assets/stylesheets/products.css.scss +++ b/app/assets/stylesheets/products.css.scss @@ -5,3 +5,20 @@ .orders .thumbnail { min-height: 200px; } + +.pic img { + padding-top: 10px; +} + +.caption{ + text-align: center; +} + +.caption h3 { + margin: 8px 0; +} + +.caption h6 { + margin-bottom: 20px; +} + diff --git a/app/assets/stylesheets/profile.css.scss b/app/assets/stylesheets/profile.css.scss new file mode 100644 index 0000000..db1dbac --- /dev/null +++ b/app/assets/stylesheets/profile.css.scss @@ -0,0 +1,9 @@ +/* User profile */ + +.user_info h2 { + display: inline; +} +.user_info h5 { + display: inline; + padding-left: 10px; +} diff --git a/app/assets/stylesheets/users.css.scss b/app/assets/stylesheets/users.css.scss index 6a2d220..45b8735 100644 --- a/app/assets/stylesheets/users.css.scss +++ b/app/assets/stylesheets/users.css.scss @@ -73,4 +73,4 @@ aside { margin-top: 0px; } } -} +} \ No newline at end of file diff --git a/app/views/orders/_order.html.erb b/app/views/orders/_order.html.erb index cdce779..532c2db 100644 --- a/app/views/orders/_order.html.erb +++ b/app/views/orders/_order.html.erb @@ -1,2 +1,2 @@ -<%= order.created_at %> +<%= order.created_at.strftime("%d %b %Y at %H:%M") %> <%= simple_format(order.to_sentence) %> diff --git a/app/views/products/_product.html.erb b/app/views/products/_product.html.erb index f220488..0f74d29 100644 --- a/app/views/products/_product.html.erb +++ b/app/views/products/_product.html.erb @@ -1,8 +1,10 @@
-
+
<%= image_tag product.avatar %>
-

<%= product.name %> - <%= euro(product.price) %> (<%= product.stock %>)

+

<%= product.name %>

+

<%= euro(product.price) %>

+
(In stock: <%= product.stock %>)
<% if current_user && current_user.admin? %>

<%= link_to "Edit", edit_product_path(product), class: "btn btn-default" %> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index ba4eef3..8fcf2ab 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,10 +1,8 @@ <%= render partial: 'flash' %>

diff --git a/db/schema.rb b/db/schema.rb index 47f2f07..54e2982 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -13,13 +13,13 @@ ActiveRecord::Schema.define(version: 20150210062809) do - create_table "order_items", force: true do |t| + create_table "order_items", force: :cascade do |t| t.integer "order_id" t.integer "product_id", null: false t.integer "count", default: 0 end - create_table "orders", force: true do |t| + create_table "orders", force: :cascade do |t| t.integer "user_id" t.integer "cost" t.datetime "created_at", null: false @@ -29,32 +29,24 @@ ActiveRecord::Schema.define(version: 20150210062809) do add_index "orders", ["user_id", "created_at"], name: "index_orders_on_user_id_and_created_at" add_index "orders", ["user_id"], name: "index_orders_on_user_id" - create_table "products", force: true do |t| + create_table "products", force: :cascade do |t| t.string "name", null: false t.integer "price_cents", default: 0, null: false - t.integer "category", default: 0 - t.integer "stock", default: 0, null: false + t.datetime "created_at" + t.datetime "updated_at" t.string "avatar_file_name" t.string "avatar_content_type" t.integer "avatar_file_size" t.datetime "avatar_updated_at" - t.datetime "created_at" - t.datetime "updated_at" + t.integer "category", default: 0 + t.integer "stock", default: 0, null: false end - create_table "users", force: true do |t| + create_table "users", force: :cascade do |t| t.string "name" t.string "last_name" t.integer "balance_cents", default: 0, null: false t.string "nickname" - t.boolean "admin" - t.boolean "koelkast", default: false - t.integer "dagschotel_id" - t.integer "orders_count", default: 0 - t.string "avatar_file_name" - t.string "avatar_content_type" - t.integer "avatar_file_size" - t.datetime "avatar_updated_at" t.datetime "created_at" t.datetime "updated_at" t.string "encrypted_password", default: "", null: false @@ -64,12 +56,20 @@ ActiveRecord::Schema.define(version: 20150210062809) do t.datetime "last_sign_in_at" t.string "current_sign_in_ip" t.string "last_sign_in_ip" + t.boolean "admin" + t.integer "dagschotel_id" + t.string "avatar_file_name" + t.string "avatar_content_type" + t.integer "avatar_file_size" + t.datetime "avatar_updated_at" + t.integer "orders_count", default: 0 + t.boolean "koelkast", default: false end add_index "users", ["koelkast"], name: "index_users_on_koelkast" add_index "users", ["orders_count"], name: "index_users_on_orders_count" - create_table "versions", force: true do |t| + create_table "versions", force: :cascade do |t| t.string "item_type", null: false t.integer "item_id", null: false t.string "event", null: false