From b8825ebf82afa60948ae4730c7a29af7e1f44dc7 Mon Sep 17 00:00:00 2001 From: kd00506 <kd00506@surrey.ac.uk> Date: Sat, 28 Nov 2020 16:52:13 +0000 Subject: [PATCH] Cleaned out views --- app/views/lists/_form.html.haml | 16 ------------- app/views/lists/_list.json.jbuilder | 2 -- app/views/lists/edit.html.haml | 7 ------ app/views/lists/index.html.haml | 23 ------------------- app/views/lists/index.json.jbuilder | 1 - app/views/lists/new.html.haml | 5 ---- app/views/lists/show.html.haml | 12 ---------- app/views/lists/show.json.jbuilder | 1 - app/views/products/_form.html.haml | 22 ------------------ app/views/products/_product.json.jbuilder | 2 -- app/views/products/edit.html.haml | 7 ------ app/views/products/index.html.haml | 28 ----------------------- app/views/products/index.json.jbuilder | 1 - app/views/products/new.html.haml | 5 ---- app/views/products/show.html.haml | 18 --------------- app/views/products/show.json.jbuilder | 1 - app/views/users/_form.html.haml | 19 --------------- app/views/users/_user.json.jbuilder | 2 -- app/views/users/edit.html.haml | 7 ------ app/views/users/index.html.haml | 25 -------------------- app/views/users/index.json.jbuilder | 1 - app/views/users/new.html.haml | 5 ---- app/views/users/show.html.haml | 15 ------------ app/views/users/show.json.jbuilder | 1 - 24 files changed, 226 deletions(-) delete mode 100644 app/views/lists/_form.html.haml delete mode 100644 app/views/lists/_list.json.jbuilder delete mode 100644 app/views/lists/edit.html.haml delete mode 100644 app/views/lists/index.html.haml delete mode 100644 app/views/lists/index.json.jbuilder delete mode 100644 app/views/lists/new.html.haml delete mode 100644 app/views/lists/show.html.haml delete mode 100644 app/views/lists/show.json.jbuilder delete mode 100644 app/views/products/_form.html.haml delete mode 100644 app/views/products/_product.json.jbuilder delete mode 100644 app/views/products/edit.html.haml delete mode 100644 app/views/products/index.html.haml delete mode 100644 app/views/products/index.json.jbuilder delete mode 100644 app/views/products/new.html.haml delete mode 100644 app/views/products/show.html.haml delete mode 100644 app/views/products/show.json.jbuilder delete mode 100644 app/views/users/_form.html.haml delete mode 100644 app/views/users/_user.json.jbuilder delete mode 100644 app/views/users/edit.html.haml delete mode 100644 app/views/users/index.html.haml delete mode 100644 app/views/users/index.json.jbuilder delete mode 100644 app/views/users/new.html.haml delete mode 100644 app/views/users/show.html.haml delete mode 100644 app/views/users/show.json.jbuilder diff --git a/app/views/lists/_form.html.haml b/app/views/lists/_form.html.haml deleted file mode 100644 index e0b5f92..0000000 --- a/app/views/lists/_form.html.haml +++ /dev/null @@ -1,16 +0,0 @@ -= form_for @list do |f| - - if @list.errors.any? - #error_explanation - %h2= "#{pluralize(@list.errors.count, "error")} prohibited this list from being saved:" - %ul - - @list.errors.full_messages.each do |message| - %li= message - - .field - = f.label :name - = f.text_field :name - .field - = f.label :user - = f.text_field :user - .actions - = f.submit 'Save' diff --git a/app/views/lists/_list.json.jbuilder b/app/views/lists/_list.json.jbuilder deleted file mode 100644 index c4ad659..0000000 --- a/app/views/lists/_list.json.jbuilder +++ /dev/null @@ -1,2 +0,0 @@ -json.extract! list, :id, :name, :user_id, :created_at, :updated_at -json.url list_url(list, format: :json) diff --git a/app/views/lists/edit.html.haml b/app/views/lists/edit.html.haml deleted file mode 100644 index 068883c..0000000 --- a/app/views/lists/edit.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -%h1 Editing list - -= render 'form' - -= link_to 'Show', @list -\| -= link_to 'Back', lists_path diff --git a/app/views/lists/index.html.haml b/app/views/lists/index.html.haml deleted file mode 100644 index fa6821f..0000000 --- a/app/views/lists/index.html.haml +++ /dev/null @@ -1,23 +0,0 @@ -%h1 Listing lists - -%table - %thead - %tr - %th Name - %th User - %th - %th - %th - - %tbody - - @lists.each do |list| - %tr - %td= list.name - %td= list.user - %td= link_to 'Show', list - %td= link_to 'Edit', edit_list_path(list) - %td= link_to 'Destroy', list, method: :delete, data: { confirm: 'Are you sure?' } - -%br - -= link_to 'New List', new_list_path diff --git a/app/views/lists/index.json.jbuilder b/app/views/lists/index.json.jbuilder deleted file mode 100644 index d13d467..0000000 --- a/app/views/lists/index.json.jbuilder +++ /dev/null @@ -1 +0,0 @@ -json.array! @lists, partial: "lists/list", as: :list diff --git a/app/views/lists/new.html.haml b/app/views/lists/new.html.haml deleted file mode 100644 index 1b16b6c..0000000 --- a/app/views/lists/new.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -%h1 New list - -= render 'form' - -= link_to 'Back', lists_path diff --git a/app/views/lists/show.html.haml b/app/views/lists/show.html.haml deleted file mode 100644 index d6e09f0..0000000 --- a/app/views/lists/show.html.haml +++ /dev/null @@ -1,12 +0,0 @@ -%p#notice= notice - -%p - %b Name: - = @list.name -%p - %b User: - = @list.user - -= link_to 'Edit', edit_list_path(@list) - -= link_to 'Back', lists_path diff --git a/app/views/lists/show.json.jbuilder b/app/views/lists/show.json.jbuilder deleted file mode 100644 index 5d6a7eb..0000000 --- a/app/views/lists/show.json.jbuilder +++ /dev/null @@ -1 +0,0 @@ -json.partial! "lists/list", list: @list diff --git a/app/views/products/_form.html.haml b/app/views/products/_form.html.haml deleted file mode 100644 index 5562226..0000000 --- a/app/views/products/_form.html.haml +++ /dev/null @@ -1,22 +0,0 @@ -= form_for @product do |f| - - if @product.errors.any? - #error_explanation - %h2= "#{pluralize(@product.errors.count, "error")} prohibited this product from being saved:" - %ul - - @product.errors.full_messages.each do |message| - %li= message - - .field - = f.label :name - = f.text_field :name - .field - = f.label :quantity - = f.number_field :quantity - .field - = f.label :acquired - = f.check_box :acquired - .field - = f.label :list - = f.number_field :list - .actions - = f.submit 'Save' diff --git a/app/views/products/_product.json.jbuilder b/app/views/products/_product.json.jbuilder deleted file mode 100644 index a991fb6..0000000 --- a/app/views/products/_product.json.jbuilder +++ /dev/null @@ -1,2 +0,0 @@ -json.extract! product, :id, :name, :quantity, :price, :acquired, :list, :created_at, :updated_at -json.url product_url(product, format: :json) diff --git a/app/views/products/edit.html.haml b/app/views/products/edit.html.haml deleted file mode 100644 index 9c16087..0000000 --- a/app/views/products/edit.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -%h1 Editing product - -= render 'form' - -= link_to 'Show', @product -\| -= link_to 'Back', products_path diff --git a/app/views/products/index.html.haml b/app/views/products/index.html.haml deleted file mode 100644 index 860d32c..0000000 --- a/app/views/products/index.html.haml +++ /dev/null @@ -1,28 +0,0 @@ -%h1 Listing products - -%table - %thead - %tr - %th Name - %th Quantity - %th Price - %th Accuired - %th List - %th - %th - %th - - %tbody - - @products.each do |product| - %tr - %td= product.name - %td= product.quantity - %td= product.acquired - %td= product.list - %td= link_to 'Show', product - %td= link_to 'Edit', edit_product_path(product) - %td= link_to 'Destroy', product, method: :delete, data: { confirm: 'Are you sure?' } - -%br - -= link_to 'New Product', new_product_path diff --git a/app/views/products/index.json.jbuilder b/app/views/products/index.json.jbuilder deleted file mode 100644 index d9c9c1f..0000000 --- a/app/views/products/index.json.jbuilder +++ /dev/null @@ -1 +0,0 @@ -json.array! @products, partial: "products/product", as: :product diff --git a/app/views/products/new.html.haml b/app/views/products/new.html.haml deleted file mode 100644 index 71ed863..0000000 --- a/app/views/products/new.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -%h1 New product - -= render 'form' - -= link_to 'Back', products_path diff --git a/app/views/products/show.html.haml b/app/views/products/show.html.haml deleted file mode 100644 index 484cd24..0000000 --- a/app/views/products/show.html.haml +++ /dev/null @@ -1,18 +0,0 @@ -%p#notice= notice - -%p - %b Name: - = @product.name -%p - %b Quantity: - = @product.quantity -%p - %b Accuired: - = @product.acquired -%p - %b List: - = @product.list - -= link_to 'Edit', edit_product_path(@product) -\| -= link_to 'Back', products_path diff --git a/app/views/products/show.json.jbuilder b/app/views/products/show.json.jbuilder deleted file mode 100644 index 03b16ec..0000000 --- a/app/views/products/show.json.jbuilder +++ /dev/null @@ -1 +0,0 @@ -json.partial! "products/product", product: @product diff --git a/app/views/users/_form.html.haml b/app/views/users/_form.html.haml deleted file mode 100644 index ec456c4..0000000 --- a/app/views/users/_form.html.haml +++ /dev/null @@ -1,19 +0,0 @@ -= form_for @user do |f| - - if @user.errors.any? - #error_explanation - %h2= "#{pluralize(@user.errors.count, "error")} prohibited this user from being saved:" - %ul - - @user.errors.full_messages.each do |message| - %li= message - - .field - = f.label :name - = f.text_field :name - .field - = f.label :email - = f.text_field :email - .field - = f.label :password - = f.text_field :password - .actions - = f.submit 'Save' diff --git a/app/views/users/_user.json.jbuilder b/app/views/users/_user.json.jbuilder deleted file mode 100644 index 4ceb898..0000000 --- a/app/views/users/_user.json.jbuilder +++ /dev/null @@ -1,2 +0,0 @@ -json.extract! user, :id, :name, :email, :password, :created_at, :updated_at -json.url user_url(user, format: :json) diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml deleted file mode 100644 index 44f7526..0000000 --- a/app/views/users/edit.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -%h1 Editing user - -= render 'form' - -= link_to 'Show', @user -\| -= link_to 'Back', users_path diff --git a/app/views/users/index.html.haml b/app/views/users/index.html.haml deleted file mode 100644 index e496e5b..0000000 --- a/app/views/users/index.html.haml +++ /dev/null @@ -1,25 +0,0 @@ -%h1 Listing users - -%table - %thead - %tr - %th Name - %th Email - %th Password - %th - %th - %th - - %tbody - - @users.each do |user| - %tr - %td= user.name - %td= user.email - %td= user.password - %td= link_to 'Show', user - %td= link_to 'Edit', edit_user_path(user) - %td= link_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' } - -%br - -= link_to 'New User', new_user_path diff --git a/app/views/users/index.json.jbuilder b/app/views/users/index.json.jbuilder deleted file mode 100644 index 98788da..0000000 --- a/app/views/users/index.json.jbuilder +++ /dev/null @@ -1 +0,0 @@ -json.array! @users, partial: "users/user", as: :user diff --git a/app/views/users/new.html.haml b/app/views/users/new.html.haml deleted file mode 100644 index 7b9e858..0000000 --- a/app/views/users/new.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -%h1 New user - -= render 'form' - -= link_to 'Back', users_path diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml deleted file mode 100644 index 6b7051e..0000000 --- a/app/views/users/show.html.haml +++ /dev/null @@ -1,15 +0,0 @@ -%p#notice= notice - -%p - %b Name: - = @user.name -%p - %b Email: - = @user.email -%p - %b Password: - = @user.password - -= link_to 'Edit', edit_user_path(@user) -\| -= link_to 'Back', users_path diff --git a/app/views/users/show.json.jbuilder b/app/views/users/show.json.jbuilder deleted file mode 100644 index ff40bb9..0000000 --- a/app/views/users/show.json.jbuilder +++ /dev/null @@ -1 +0,0 @@ -json.partial! "users/user", user: @user -- GitLab