From a7791635aa98f012d35f97c3c5288494bbb28e38 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Wed, 13 Mar 2024 18:03:43 +0100 Subject: Initial commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- app/views/things/_form.html.erb | 102 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 app/views/things/_form.html.erb (limited to 'app/views/things/_form.html.erb') diff --git a/app/views/things/_form.html.erb b/app/views/things/_form.html.erb new file mode 100644 index 0000000..da90302 --- /dev/null +++ b/app/views/things/_form.html.erb @@ -0,0 +1,102 @@ +<%= form_with(model: thing) do |form| %> + <%= render "layouts/errors", model: thing %> + +
+
+ <%= form.label :title %> + <%= form.text_field :title, autofocus: true, required: true %> +
+ +
+ <%= form.label :authors %> + <%= form.text_field :authors, required: true %> + <%= form.check_box :editors %> + <%= form.label :editors %> +
+ +
+ <%= form.label :note %> + <%= form.text_field :note %> +
+ +
+ <%= form.label :target %> + <%= form.text_field :target, required: true %> +
+ +
+ <%= form.label :publisher %> + <%= form.text_field :publisher %> +
+ +
+ <%= form.label :year %> + <%= form.number_field :year %> +
+ +
+ <%= form.label :address %> + <%= form.text_field :address %> +
+ +
+ <%= form.label :url %> + <%= form.text_field :url %> +
+ +
+ <%= form.label :access %> + <%= form.date_field :access %> +
+ +
+ <%= form.label :location %> + <%= form.text_field :location %> +
+ +
+ <%= form.label :insideof %> + <%= form.text_field :insideof %> +
+ +
+ <%= form.label :pages %> + <%= form.text_field :pages %> +
+ +
+ <%= form.label :rate %> + <%= form.number_field :rate, min: 0, max: 10, required: true %> +
+ +
+ <%= form.label :status %> + <%= form.select :status, options_for_select(Thing.statuses.map { |k, _| [I18n.t("things.status.#{k}"), k] }.sort, thing.status) %> +
+ +
+ <%= form.label :kind %> + <%= form.select :kind, options_for_select(Thing.kinds.map { |k, _| [I18n.t("things.kind.#{k}"), k] }.sort, thing.kind) %> +
+ +
+ <%= form.label :bought_at %> + <%= form.date_field :bought_at %> +
+ +
+ <%= form.label :where_is_it %> + <%= form.text_field :where_is_it %> +
+
+ + <%= render "tags/taggable", tag_references: thing.tag_references.pluck(:tag_id), form: form %> + +
+ <%= form.submit %> +
+<% end %> + +<% if thing.id %> + <%= button_to I18n.t('general.delete').capitalize, thing, id: 'thing-delete-button', form: { data: { turbo_confirm: I18n.t('general.sure') } }, method: :delete %> +<% end %> -- cgit v1.2.3