diff --git a/app/views/items/edit.html.erb b/app/views/items/edit.html.erb index 3fa5e3ff..e586a49a 100644 --- a/app/views/items/edit.html.erb +++ b/app/views/items/edit.html.erb @@ -126,6 +126,10 @@ .btn-primary { width: 100%; } + + select { + width: 100%; + } <%= link_to @item do %> diff --git a/app/views/items/new.html.erb b/app/views/items/new.html.erb index 63ff1967..0077f5c0 100644 --- a/app/views/items/new.html.erb +++ b/app/views/items/new.html.erb @@ -1,9 +1,231 @@ -

New item

+

<%= notice %>

+<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> -<%= render "form", item: @item %> -
+ +
- <%= link_to "Back to items", items_path %> -
+<%= form_with(model: @item, :html => {:multipart => true}) do |form| %> +
+
+
+ + <% if @item.errors.any? %> +
+

<%= pluralize(@item.errors.count, "error") %> prohibited this item from being saved:

+ +
    + <% @item.errors.each do |error| %> +
  • <%= error.full_message %>
  • + <% end %> +
+
+ <% end %> + +
+ +
+ image +
+
+ + <%= form.file_field :image, multiple: false, direct_upload: true, :onchange => "readURL(this)"%> + + +
+

+ <%= form.text_field :name, class: "borderedInput", placeholder: t('views.new_item.item_name') %> +

+
+
+

+ location_on + <%= form.text_field :location, class: "locationInput borderedInput", placeholder: t('views.new_item.location') %> +

+
+
+

<%= t('views.show_item.category')%>

+ <%= form.text_field :category, class: "borderedInput body1" %> + +

<%= t('views.show_item.description')%>

+ <%= form.text_area :description, class: "borderedInput body1" %> + +

<%= t('views.show_item.owner')%>

+
+ <%= form.collection_select(:owner, User.all, :id, :email, :include_blank => true)%> +
+ +

<%= t('views.show_item.holder')%>

+
+ <%= form.collection_select(:holder, User.all, :id, :email, :include_blank => true)%> +
+ +

<%= t('views.edit_item.price_ct')%>

+ <%= form.number_field :price_ct, class: "borderedInput body1" %> + +

<%= t('views.edit_item.rental_duration_sec')%>

+ <%= form.number_field :rental_duration_sec, class: "borderedInput body1" %> + +

<%= t('views.edit_item.return_checklist')%>

+ <%= form.text_area :return_checklist, class: "borderedInput body1" %> + +
+ <%= form.submit t('defaults.submit'), class: "btn-primary"%> + <%= link_to @item_new do %> + + <% end %> +
+
+
+<% end %> + \ No newline at end of file diff --git a/app/views/items/show.html.erb b/app/views/items/show.html.erb index 00dc753f..c3ad03bc 100644 --- a/app/views/items/show.html.erb +++ b/app/views/items/show.html.erb @@ -133,7 +133,7 @@ grade - <%= image_tag @item.image, class: "img img-responsive img-fluid rounded mx-auto d-block" if @item.image.attached? %> + <%= image_tag @item.image, class: "img img-responsive img-fluid rounded mx-auto d-block" if @item.image.attached?%>

<%=@item.name %>

diff --git a/config/locales/de.yml b/config/locales/de.yml index b3386f44..8a086035 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -4,6 +4,7 @@ de: close: "Schließen" accept: "Annehmen" decline: "Ablehnen" + submit: "Anbieten" check: "Prüfen" views: landing_page: @@ -62,6 +63,8 @@ de: title: "Startseite" new_item: title: "Neuer Gegenstand" + item_name: "Name des Gegenstands" + location: "Standort" show_item: author: "Autor" category: "Kategorie" diff --git a/config/locales/en.yml b/config/locales/en.yml index cdccc964..885b015e 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -35,6 +35,7 @@ en: close: "Close" accept: "Accept" decline: "Decline" + submit: "Submit" check: "Check" views: landing_page: @@ -93,6 +94,8 @@ en: title: "Home" new_item: title: "New Item" + item_name: "Item Name" + location: "Location" show_item: author: "Author" category: "Category"