This repository has been archived by the owner on Oct 12, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
_form.html.erb
51 lines (45 loc) · 2.1 KB
/
_form.html.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
48
49
50
51
<% if flash[:notice].present? %>
<p class="flash-notice"><%= flash[:notice] %></p>
<% end %>
<div id="panopticon" class="ui-widget-content">
<%= semantic_form_for(artefact, :html => { :class => 'artefact' }) do |f| %>
<%= f.inputs :name => "Basic information" do %>
<%= f.input :name %>
<%= f.input :slug %>
<%= f.input :section, :as => :select, :collection => Artefact.sections.map {|s| [s.gsub(':', ' > '), s] } %>
<% end %>
<%= f.inputs "Related items", :class => "related" do %>
<%= f.semantic_fields_for :related_items, related_items_for(artefact) do |related_item| %>
<%= related_item.input :artefact, :as => :select, :collection => Artefact.in_alphabetical_order, :label => false %>
<%= related_item.input :sort_key, :as => :hidden %>
<% end %>
<%= f.input :relatedness_done %>
<% end %>
<%= f.inputs do %>
<li>
<%= f.label :need_id %>
<%= f.number_field :need_id, disabled: true %>
<span>
<%= link_to "View in Need-O-Tron", need_url(f.object), :rel => 'external' %> |
<%= link_to "View on site", published_url(f.object), :rel => 'external' %>
</span>
</li>
<%= f.input :department, :label => "Writing team", :input_html => { :disabled => true } %>
<%= f.input :fact_checkers, :input_html => { :disabled => true } %>
<%= f.input :contact, :collection => Contact.in_alphabetical_order %>
<% if artefact.new_record? %>
<%= f.input :kind, :collection => Artefact::FORMATS, :as => :select %>
<% end %>
<% end %>
<% if artefact.new_record? %>
<%= f.input :owning_app, :as => :hidden, :value => "publisher" %>
<% end %>
<%= f.inputs :tags %>
<% if f.object.persisted? %>
<%= f.submit :value => "Save and continue editing", :class => "button" %>
<% end %>
<%= f.submit :value => "Save and go to item", :class => "button" %>
<% end %>
</div>
<%= content_for :extra_javascript, javascript_include_tag('libs/jquery/plugins/chosen.jquery.min.js', 'artefacts') %>
<% content_for :extra_headers, stylesheet_link_tag('libs/jquery/plugins/chosen') %>