scinote-web/app/views/repositories/_repository.html.erb

76 lines
3.2 KiB
Text
Raw Normal View History

2017-06-06 23:35:29 +08:00
<%= render partial: "repositories/delete_record_modal" %>
<%= render partial: "repositories/delete_column_modal" %>
<div id="alert-container"></div>
<div id="repository-toolbar">
<% if can_create_repository_records(repository) %>
<button type="button" class="btn btn-default editAdd" id="addRepositoryRecord" onclick="onClickAddRecord()">
<span class="glyphicon glyphicon-plus"></span>
<span class="hidden-xs"><%= t("repositories.add_new_record") %></span>
</button>
<% end %>
<div id="datatables-buttons" style="display: inline;">
<div id="repository-columns-dropdown" class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">
<%= t('repositories.columns') %>
<span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-menu-right smart-dropdown" id="repository-columns-list">
<% if can_create_columns_in_repository(repository) %>
<li class="add-new-column-form">
<div id="new-column-form" class="form-group" data-action="<%= repository_repository_columns_path(repository) %>">
<div class="input-group">
<input class="form-control" id="new-column-name" placeholder="<%= t("repositories.column_new_text") %>">
<span class="input-group-btn">
<a id="add-new-column-button" class="btn btn-primary">
<%= t("repositories.column_create") %>
</a>
</span>
</div>
</div>
</li>
<% end %>
</ul>
</div>
</div>
</div>
<div class="btn-group inline" id="saveCancel" data-toggle="buttons" style="display:none">
<button type="button" class="btn btn-primary" id="saveRecord" onclick="onClickSave()">
<span class="glyphicon glyphicon-save"></span>
<%= t("repositories.save_record") %>
</button>
<button type="button" class="btn btn-default" id="cancelSave" onclick="onClickCancel()">
<span class="glyphicon glyphicon-remove visible-xs-inline"></span>
<span class="hidden-xs"><%= t("repositories.cancel_save") %></span>
</button>
</div>
<!-- These buttons are appended to table in javascript, after table initialization. -->
<div class="toolbarButtons" style="display:none">
<button type="button" class="btn btn-default editAdd" id="editRepositoryRecord" onclick="onClickEdit()" disabled>
<span class="glyphicon glyphicon-pencil"></span>
<span class="hidden-xs-custom"><%= t("repositories.edit_record") %></span>
</button>
<% if can_delete_repository_records(repository) %>
<button type="button" class="btn btn-default"
id="deleteRepositoryRecordsButton" data-target="#deleteRepositoryRecord" data-toggle="modal" disabled>
<span class="glyphicon glyphicon-trash"></span>
<span class="hidden-xs-custom"><%= t'repositories.delete_record' %></span>
<%= submit_tag I18n.t('repositories.delete_record'), :class => "hidden
delete_repository_records_submit" %>
</button>
<% end %>
</div>
<%= render partial: "repository_table",
locals: {
repository: repository,
repository_index_link: repository_table_index_path(repository)
}
%>