-
Notifications
You must be signed in to change notification settings - Fork 16
/
_form.erb
47 lines (46 loc) · 2.5 KB
/
_form.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<td class='icon'>
<%= unless @site.new_record?
link_to_remote _('btn_x'), :url => site_path(@site), :method => :get
else
link_to_function _('btn_x'), "['add_site', 'add_site_form'].each(Element.toggle)"
end %>
</td>
<td class='add' colspan='9'>
<div id='site_errors'><%= error_messages_for(:site, :object => @site) %></div>
<% unless @site.new_record? %>
<%= form_remote_tag(:url => site_path(@site), :method => :put ) %>
<% else %>
<%= form_remote_tag(:url => sites_path ) %>
<% end %>
<table cellspacing='0' class='edit_site'>
<tr><td class='label'><%= _('host') %></td><td><%= @site[:host] %></td></tr>
<tr><td class='label'><%= _('home') %></td><td><%= text_field('site', :home_zip, :size=>15, :value => @site.home_zip) %></td></tr>
<tr><td class='label'><%= _('skin') %></td><td><%= text_field('site', :skin_zip, :size=>15, :value => @site.skin_zip) %></td></tr>
<% Site.attributes_for_form(@site.is_alias?)[:text].each do |name| -%>
<tr><td class='label'><%= _(name) %></td><td><%= text_field('site', name, :size=>nil) %></td></tr>
<% end -%>
<% if !@site.is_alias? %>
<tr><td class='label'><%= _('redit_time') %></td><td><%= text_field('site', :redit_time, :size=>15, :value => @site.redit_time) %></td></tr>
<tr><td class='label'><%= _('public group') %></td><td><%= @site.public_group.name %></td></tr>
<tr><td class='label'><%= _('site group') %></td><td><%= @site.site_group.name %></td></tr>
<tr><td class='label'><%= _('API group') %></td><td><%= select('site', 'api_group_id', visitor.all_groups.map{|g| [g.name, g.id]}, {:include_blank => true, :selected => @site.api_group_id} ) %></td></tr>
<% end %>
<tr><td class='label'><%= _('options') %></td><td>
<% Site.attributes_for_form(@site.is_alias?)[:bool].each do |sym| -%>
<input type='hidden' name='site[<%= sym %>]' value=''/>
<input type='checkbox' name='site[<%= sym %>]' value='1'<%= @site.send(sym) ? " checked='checked'" : '' %>/> <%= _(sym.to_s) %><br/>
<% end -%>
</td></tr>
<% if !@site.new_record? && !@site.is_alias? %>
<tr><td class='label'><%= _('action') %></td><td id='messages<%= @site[:id] %>'>
<ul>
<% Site::ACTIONS.each do |action| %>
<li><%= link_to_remote _(action), :url => action_site_path(@site, :do => action), :method => 'put' %></li>
<% end %>
</ul>
</td></tr>
<% end %>
<tr><td colspan='2'><p class='btn_validate'><input type='submit' value='<%= _('validate') %>'/></p></td></tr>
</table>
</form>
</td>