mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-11-18 02:20:37 -05:00
Customer new/edit pages in Redmine's form style
- labelled_form_for with Redmine's "box tabular" layout: labels on the
left, Display name marked required
- Breadcrumb headings ("Customers » customer"), Create/Save buttons and
a Cancel link back to the customer (or the customer list)
- Keeps the form tag in the partial and the customer_name / customer_notes
ids used by redmine_qbo_calendar's quick-create popup (hide_submit /
hide_toolbar still supported)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
This commit is contained in:
3 files changed
+23
-32
No files matched your search
@@ -1,35 +1,22 @@
|
||||
<%= 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' %>
|
||||
|
||||
<div class="box tabular">
|
||||
|
||||
<p>
|
||||
<%= f.label :name, t(:label_display_name) %>
|
||||
<%= f.text_field :name, required: true, class: "customer-name", autocomplete: "off", data: { autocomplete_url: "/customers/autocomplete" } %>
|
||||
<%= f.text_field :name, label: :label_display_name, required: true, size: 60,
|
||||
class: 'customer-name', autocomplete: 'off',
|
||||
data: { autocomplete_url: '/customers/autocomplete' } %>
|
||||
</p>
|
||||
|
||||
<p><%= f.telephone_field :primary_phone, label: :label_primary_phone, size: 20, autocomplete: 'off' %></p>
|
||||
<p><%= f.telephone_field :mobile_phone, label: :label_mobile_phone, size: 20, autocomplete: 'off' %></p>
|
||||
<p><%= f.email_field :email, label: :label_email, size: 60, autocomplete: 'off' %></p>
|
||||
<p>
|
||||
<%= f.label :primary_phone, t(:label_primary_phone) %>
|
||||
<%= f.telephone_field :primary_phone, autocomplete: "off" %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= f.label :mobile_phone, t(:label_mobile_phone) %>
|
||||
<%= f.telephone_field :mobile_phone, autocomplete: "off" %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= f.label :email, t(:label_email) %>
|
||||
<%= f.email_field :email, autocomplete: "off" %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= f.label :notes, t(:field_notes) %>
|
||||
<%= f.text_area :notes,
|
||||
rows: 8,
|
||||
class: 'wiki-edit',
|
||||
style: 'width: 99%;',
|
||||
id: 'customer_notes' %>
|
||||
<%= 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 %>
|
||||
@@ -37,8 +24,7 @@
|
||||
</div>
|
||||
|
||||
<% unless local_assigns[:hide_submit] %>
|
||||
<p class="buttons">
|
||||
<%= submit_tag t(:button_save) %>
|
||||
</p>
|
||||
<%= 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 %>
|
||||
@@ -1,3 +1,5 @@
|
||||
<h1><%=t(:label_edit_customer)%></h1>
|
||||
<br/>
|
||||
<h2><%= link_to l(:label_customers), customers_path %> » <%= link_to @customer.to_s, customer_path(@customer) %></h2>
|
||||
|
||||
<%= render partial: 'customers/form' %>
|
||||
|
||||
<% html_title(l(:label_edit_customer)) -%>
|
||||
@@ -1,2 +1,5 @@
|
||||
<h2><%=t(:label_new_customer)%></h2>
|
||||
<h2><%= link_to l(:label_customers), customers_path %> » <%= l(:label_new_customer) %></h2>
|
||||
|
||||
<%= render partial: 'customers/form' %>
|
||||
|
||||
<% html_title(l(:label_new_customer)) -%>
|
||||
Reference in new issue
Block a user