diff --git a/app/views/customers/_form.html.erb b/app/views/customers/_form.html.erb index 979fedb..8751d7b 100644 --- a/app/views/customers/_form.html.erb +++ b/app/views/customers/_form.html.erb @@ -1,44 +1,30 @@ -<%= form_for @customer do |f| %> +<%# + Customer form, in Redmine's form style. Also loaded by redmine_qbo_calendar's quick-create popup + (hide_submit / hide_toolbar), which relies on the form tag being here and the name field's + customer_name id. +%> +<%= labelled_form_for @customer do |f| %> <%= error_messages_for 'customer' %>
- -

- <%= f.label :name, t(:label_display_name) %> - <%= f.text_field :name, required: true, class: "customer-name", autocomplete: "off", data: { autocomplete_url: "/customers/autocomplete" } %> -

- -

- <%= f.label :primary_phone, t(:label_primary_phone) %> - <%= f.telephone_field :primary_phone, autocomplete: "off" %> -

- -

- <%= f.label :mobile_phone, t(:label_mobile_phone) %> - <%= f.telephone_field :mobile_phone, autocomplete: "off" %> -

- -

- <%= f.label :email, t(:label_email) %> - <%= f.email_field :email, autocomplete: "off" %> -

- -

- <%= f.label :notes, t(:field_notes) %> - <%= f.text_area :notes, - rows: 8, - class: 'wiki-edit', - style: 'width: 99%;', - id: 'customer_notes' %> - <% unless local_assigns[:hide_toolbar] %> - <%= wikitoolbar_for 'customer_notes' %> - <% end %> -

+

+ <%= f.text_field :name, label: :label_display_name, required: true, size: 60, + class: 'customer-name', autocomplete: 'off', + data: { autocomplete_url: '/customers/autocomplete' } %> +

+

<%= f.telephone_field :primary_phone, label: :label_primary_phone, size: 20, autocomplete: 'off' %>

+

<%= f.telephone_field :mobile_phone, label: :label_mobile_phone, size: 20, autocomplete: 'off' %>

+

<%= f.email_field :email, label: :label_email, size: 60, autocomplete: 'off' %>

+

+ <%= f.text_area :notes, label: :field_notes, rows: 8, class: 'wiki-edit', id: 'customer_notes' %> + <% unless local_assigns[:hide_toolbar] %> + <%= wikitoolbar_for 'customer_notes' %> + <% end %> +

<% unless local_assigns[:hide_submit] %> -

- <%= submit_tag t(:button_save) %> -

+ <%= submit_tag @customer.new_record? ? l(:button_create) : l(:button_save) %> + <%= link_to l(:button_cancel), @customer.new_record? ? customers_path : customer_path(@customer) %> <% end %> -<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/customers/edit.html.erb b/app/views/customers/edit.html.erb index c6eef66..dc690c2 100644 --- a/app/views/customers/edit.html.erb +++ b/app/views/customers/edit.html.erb @@ -1,3 +1,5 @@ -

<%=t(:label_edit_customer)%>

-
+

<%= link_to l(:label_customers), customers_path %> » <%= link_to @customer.to_s, customer_path(@customer) %>

+ <%= render partial: 'customers/form' %> + +<% html_title(l(:label_edit_customer)) -%> diff --git a/app/views/customers/new.html.erb b/app/views/customers/new.html.erb index 9295442..2206582 100644 --- a/app/views/customers/new.html.erb +++ b/app/views/customers/new.html.erb @@ -1,2 +1,5 @@ -

<%=t(:label_new_customer)%>

-<%= render partial: 'customers/form' %> \ No newline at end of file +

<%= link_to l(:label_customers), customers_path %> » <%= l(:label_new_customer) %>

+ +<%= render partial: 'customers/form' %> + +<% html_title(l(:label_new_customer)) -%>