mailr/app/views/contacts/new.html.erb

74 lines
2.3 KiB
Plaintext

<h1><%=t(:edit_create_contact)%></h1>
<div id="header">
<ul id="primary">
<li><%=link_folders%></li>
<li><%=link_send_mail%></li>
<li><%=link_mail_prefs%></li>
<li><%=link_mail_filters%></li>
<li><span><%= t :contacts %></span>
<ul id="secondary">
<li><%=link_to t(:back_to_contacts), contacts_url%></li>
<% if ret = session["return_to"] %>
<li><%=link_to(t(:back_to_message), ret) %></li>
<% end %>
</ul>
</li>
</ul>
</div>
<div id="tab_main">
<div id="tab_content">
<% form_tag( contacts_path, 'method' => 'post', 'class' => 'two_columns') do %>
<%= form_input(:hidden_field, 'contact', 'id') %>
<%= form_input(:hidden_field, 'contact', 'customer_id') %>
<table>
<%= form_input(:text_field, 'contact', 'fname', t(:first_name), 'class'=>'two_columns') %>
<%= form_input(:text_field, 'contact', 'lname', t(:last_name), 'class'=>'two_columns') %>
<%= form_input((@contact.new_record? ? :text_field : :read_only_field), 'contact', 'email', t(:email), 'class'=>'two_columns')%>
</table>
<% for group in @contactgroups %>
<input id="groups[<%=group.id%>]" type="hidden" name="groups[<%=group.id%>]" value="<%=@groups[group.id]%>">
<% end %>
<% if not(@contactgroups.empty?) %>
<%=_('Contact belong to these groups')%>:
<table class="list">
<tr>
<%
end
col = 1
for group in @contactgroups %>
<th>
<input id="groups[<%=group.id%>]" type="checkbox" name="groups[<%=group.id%>]" value="<%=@groups[group.id]%>" onclick="toggleCheckbox(this)"
<%=@groups[group.id] == 1 ? " checked " : " " %> >
&nbsp;<%=group.name %>
</th>
<% if col%2 == 0 %>
</tr>
<tr>
<% end
col = col + 1 %>
<% end %>
<% if col%2 == 0 and not(@contactgroups.empty?) %>
<th>&nbsp;</th>
<% end %>
<% if not(@contactgroups.empty?) %>
</tr>
</table>
<% end %>
<table class="edit">
<tr>
<td colspan=2 class="buttonBar">
<input type="submit" name="paction" value="<%=t(:save)%>"/>
<input type="submit" name="paction" value="<%=t(:save_and_add_another)%>"/>
</td>
</tr>
</table>
<% end %>
</div>
</div>