scinote-web/app/views/repository_columns/_manage_column_modal.html.erb

65 lines
3.4 KiB
Text
Raw Normal View History

<div class="modal fade"
id="manageRepositoryColumn"
tabindex="-1"
role="dialog"
aria-labelledby="manangeRepositoryColumnLabel"
data-edit-type="<%= @repository_column.data_type unless @repository_column.new_record? %>">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">
<% if @repository_column.new_record? %>
<%= t("libraries.manange_modal_column.new.title") %>
<% else %>
<%= t("libraries.manange_modal_column.edit.title", name: @repository_column.name) %>
<% end %>
</h4>
</div>
<div class="modal-body">
<%= bootstrap_form_for @repository_column,
url: form_url(@repository, @repository_column),
remote: true,
data: { role: "manage-repository-column-form" } do |f| %>
<%= hidden_field_tag :list_items %>
<%= f.text_field :name %>
2018-03-26 17:28:14 +08:00
<%= f.form_group :data_type, label: { text: t('libraries.manange_modal_column.colum_type') } do %>
<br />
<span id="repository-column-types-list">
<%= f.radio_button :data_type,
'RepositoryTextValue'.freeze,
label: t('libraries.manange_modal_column.labels.text'),
inline: true,
checked: checked?(@repository_column, 'RepositoryTextValue'.freeze),
disabled: disabled?(@repository_column, 'RepositoryTextValue'.freeze) %>
<%= f.radio_button :data_type,
'RepositoryAssetValue'.freeze,
label: t('libraries.manange_modal_column.labels.file'),
inline: true,
checked: checked?(@repository_column, 'RepositoryAssetValue'.freeze),
disabled: disabled?(@repository_column, 'RepositoryAssetValue'.freeze) %>
<%= f.radio_button :data_type,
'RepositoryListValue'.freeze,
label: t('libraries.manange_modal_column.labels.dropdown'),
inline: true,
checked: checked?(@repository_column, 'RepositoryListValue'.freeze),
disabled: disabled?(@repository_column, 'RepositoryListValue'.freeze) %>
</span>
<% end %>
<input class="form-control"
data-role="tagsinput"
style="display: none"
data-value="<%= @repository_column.repository_list_items.pluck(:data) %>"
/>
2018-03-26 17:28:14 +08:00
<br />
<span style="display: none" data-role="tagsimput-label"><%=t 'libraries.manange_modal_column.dropdown_item_descirption' %></span>
<% end %>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal"><%= t("general.cancel")%></button>
<button type="button" class="btn btn-success" data-action="save"><%= t("general.save") %></button>
</div>
</div>
</div>
2018-03-26 17:28:14 +08:00
</div>