rename variables

This commit is contained in:
zmagod 2018-03-02 14:14:27 +01:00
parent 29a1073a50
commit 2b55cd7090
4 changed files with 22 additions and 22 deletions

View file

@ -13,11 +13,11 @@
backdrop: true,
keyboard: false
}).on('hidden.bs.modal', function() {
$(this).find('.modal-body #record-info-table').DataTable().destroy();
$(this).find('.modal-body #repository_row-info-table').DataTable().destroy();
$(this).remove();
});
$('#record-info-table').DataTable({
$('#repository_row-info-table').DataTable({
dom: 'RBltpi',
stateSave: false,
buttons: [],

View file

@ -218,13 +218,13 @@ class RepositoryRowsController < ApplicationController
private
def load_info_modal_vars
@record = RepositoryRow.eager_load(:created_by, repository: [:team])
@repository_row = RepositoryRow.eager_load(:created_by, repository: [:team])
.find_by_id(params[:id])
@assigned_modules = MyModuleRepositoryRow.eager_load(my_module:
[{ experiment: :project }])
.where(repository_row: @record)
render_404 and return unless @record
render_403 unless can_read_team?(@record.repository.team)
@assigned_modules = MyModuleRepositoryRow.eager_load(
my_module: [{ experiment: :project }]
).where(repository_row: @repository_row)
render_404 and return unless @repository_row
render_403 unless can_read_team?(@repository_row.repository.team)
end
def load_vars

View file

@ -3,35 +3,35 @@
<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"><%= t('records.modal_info.head_title', record: @record.name) %></h4>
<h4 class="modal-title"><%= t('repository_row.modal_info.head_title', repository_row: @repository_row.name) %></h4>
</div>
<div class="modal-body">
<p>
<span>
<%= t "records.modal_info.added_on" %>
<%= l @record.created_at, format: :full %>
<%= t "repository_row.modal_info.added_on" %>
<%= l @repository_row.created_at, format: :full %>
</span>
<br>
<span>
<%= t "records.modal_info.added_by" %>
<%= @record.created_by.full_name %>
<%= t "repository_row.modal_info.added_by" %>
<%= @repository_row.created_by.full_name %>
</span>
<% @record.repository_cells.each do |record_custom_field| %>
<% @repository_row.repository_cells.each do |repository_cell| %>
<br>
<span>
<%= t "records.modal_info.custom_field", cf: record_custom_field.repository_column.name %>
<%= custom_auto_link(record_custom_field.value.formatted, simple_format: false, team: current_team) %>
<%= t "repository_row.modal_info.custom_field", cf: repository_cell.repository_column.name %>
<%= custom_auto_link(repository_cell.value.formatted, simple_format: false, team: current_team) %>
</span>
<% end %>
</p>
<% if @assigned_modules.count > 0 %>
<div>
<%= t("records.modal_info.title", nr: @assigned_modules.count) %>
<%= t("repository_row.modal_info.title", nr: @assigned_modules.count) %>
</div>
<div class="linked-children-datatable">
<table id="record-info-table" class="table dataTable no-footer" role="grid">
<table id="repository_row-info-table" class="table dataTable no-footer" role="grid">
<tbody>
<% @assigned_modules.each_with_index do |element, i| %>
<tr role="row">
@ -49,7 +49,7 @@
<%= render partial: 'search/results/partials/my_module_text.html.erb',
locals: { my_module: element.my_module,
link_to_page: :repositories,
repository: @record.repository } %>
repository: @repository_row.repository } %>
</li>
</ol>
</td>
@ -64,7 +64,7 @@
</table>
</div>
<% else %>
<em><%=t "records.modal_info.no_tasks" %></em>
<em><%=t "repository_row.modal_info.no_tasks" %></em>
<% end %>
</div>

View file

@ -969,9 +969,9 @@ en:
no_records_unassigned_flash: "No items were unassigned from task"
default_column: 'Name'
records:
repository_row:
modal_info:
head_title: "Information for record '%{record}'"
head_title: "Information for record '%{repository_row}'"
added_on: "Added on"
added_by: "Added by"
custom_field: "%{cf}: "