Set correct repository icon on reports and done some needed refactoring with this. [SCI-1378]

This commit is contained in:
Matej Zrimšek 2017-06-20 16:07:34 +02:00
parent 14429a270c
commit d49524a26f
16 changed files with 17 additions and 17 deletions

View file

@ -564,7 +564,7 @@ function initSidebarElement(reportEl) {
var type = reportEl.data("type");
var name = reportEl.data("name");
var scrollId = reportEl.data("scroll-id");
var iconClass = "glyphicon " + reportEl.data("icon-class");
var iconClass = reportEl.data("icon-class");
// Generate list element
var newLi = $(document.createElement("li"));

View file

@ -6,7 +6,7 @@
<div class="report-element-header">
<div class="row">
<div class="pull-left activity-icon">
<span class="glyphicon glyphicon glyphicon-equalizer"></span>
<span class="glyphicon glyphicon-equalizer"></span>
</div>
<div class="pull-left activity-name">
<%=t "projects.reports.elements.module_activity.name", my_module: my_module.name %>

View file

@ -1,7 +1,7 @@
<% if my_module.blank? and @my_module.present? then my_module = @my_module end %>
<% timestamp = my_module.created_at %>
<% name = my_module.name %>
<div class="report-element report-module-element" data-ts="<%= timestamp.to_i %>" data-type="my_module" data-id='{ "my_module_id": <%= my_module.id %> }' data-scroll-id="<%= my_module.id %>" data-modal-title="<%=t "projects.reports.elements.modals.module_contents.head_title", module: my_module.name %>" data-name="<%= name %>" data-icon-class="glyphicon-credit-card">
<div class="report-element report-module-element" data-ts="<%= timestamp.to_i %>" data-type="my_module" data-id='{ "my_module_id": <%= my_module.id %> }' data-scroll-id="<%= my_module.id %>" data-modal-title="<%=t "projects.reports.elements.modals.module_contents.head_title", module: my_module.name %>" data-name="<%= name %>" data-icon-class="glyphicon glyphicon-credit-card">
<div class="report-element-header">
<div class="row">
<div class="pull-left user-time">

View file

@ -4,11 +4,11 @@
<% if order.blank? and @order.present? then order = @order end %>
<% timestamp = Time.current + 1.year - 1.days %>
<% rows_json = my_module.repository_json_hot(repository.id, order) %>
<div class="report-element report-module-repository-element" data-sort-hot="1" data-ts="<%= timestamp.to_i %>" data-type="my_module_repository" data-id='{ "my_module_id": <%= my_module.id %>, "repository_id": <%= repository.id %> }' data-scroll-id="<%= "#{my_module.id}_#{repository.id}" %>" data-order="<%= order == :asc ? "asc" : "desc" %>" data-name="<%= repository.name %>" data-icon-class="glyphicon-oil">
<div class="report-element report-module-repository-element" data-sort-hot="1" data-ts="<%= timestamp.to_i %>" data-type="my_module_repository" data-id='{ "my_module_id": <%= my_module.id %>, "repository_id": <%= repository.id %> }' data-scroll-id="<%= "#{my_module.id}_#{repository.id}" %>" data-order="<%= order == :asc ? "asc" : "desc" %>" data-name="<%= repository.name %>" data-icon-class="fa fa-cubes">
<div class="report-element-header">
<div class="row">
<div class="pull-left repository-icon">
<span class="glyphicon glyphicon-oil"></span>
<span class="fa fa-cubes"></span>
</div>
<div class="pull-left repository-name">
<%=t "projects.reports.elements.module_repository.name", repository: repository.name, my_module: my_module.name %>

View file

@ -4,7 +4,7 @@
<% comments = result.result_comments %>
<% timestamp = asset.created_at %>
<% name = result.name %>
<% icon_class = is_image ? "glyphicon-picture" : "glyphicon-file" %>
<% icon_class = 'glyphicon ' + (is_image ? 'glyphicon-picture' : 'glyphicon-file') %>
<div class="report-element report-result-element report-result-asset-element" data-ts="<%= timestamp.to_i %>" data-type="result_asset" data-id='{ "result_id": <%= result.id %> }' data-scroll-id="<%= result.id %>" data-modal-title="<%=t "projects.reports.elements.modals.result_contents.head_title", result: result.name %>" data-name="<%= name %>" data-icon-class="<%= icon_class %>">
<div class="report-element-header">
<div class="row">

View file

@ -3,7 +3,7 @@
<% comments = result.result_comments %>
<% timestamp = table.created_at %>
<% name = result.name %>
<div class="report-element report-result-element report-result-table-element" data-ts="<%= timestamp.to_i %>" data-type="result_table" data-id='{ "result_id": <%= result.id %> }' data-scroll-id="<%= result.id %>" data-modal-title="<%=t "projects.reports.elements.modals.result_contents.head_title", result: result.name %>" data-name="<%= name %>" data-icon-class="glyphicon-th">
<div class="report-element report-result-element report-result-table-element" data-ts="<%= timestamp.to_i %>" data-type="result_table" data-id='{ "result_id": <%= result.id %> }' data-scroll-id="<%= result.id %>" data-modal-title="<%=t "projects.reports.elements.modals.result_contents.head_title", result: result.name %>" data-name="<%= name %>" data-icon-class="glyphicon glyphicon-th">
<div class="report-element-header">
<div class="row">
<div class="pull-left result-name-container">

View file

@ -3,7 +3,7 @@
<% comments = result.result_comments %>
<% timestamp = result.created_at %>
<% name = result.name %>
<div class="report-element report-result-element report-result-text-element" data-ts="<%= timestamp.to_i %>" data-type="result_text" data-id='{ "result_id": <%= result.id %> }' data-scroll-id="<%= result.id %>" data-modal-title="<%=t "projects.reports.elements.modals.result_contents.head_title", result: result.name %>" data-name="<%= name %>" data-icon-class="glyphicon-asterisk">
<div class="report-element report-result-element report-result-text-element" data-ts="<%= timestamp.to_i %>" data-type="result_text" data-id='{ "result_id": <%= result.id %> }' data-scroll-id="<%= result.id %>" data-modal-title="<%=t "projects.reports.elements.modals.result_contents.head_title", result: result.name %>" data-name="<%= name %>" data-icon-class="glyphicon glyphicon-asterisk">
<div class="report-element-header">
<div class="row">
<div class="pull-left result-icon">

View file

@ -2,7 +2,7 @@
<% if order.blank? and @order.present? then order = @order end %>
<% timestamp = Time.current + 1.year - 1.days %>
<% samples_json = my_module.samples_json_hot(order) %>
<div class="report-element report-module-samples-element" data-sort-hot="3" data-ts="<%= timestamp.to_i %>" data-type="my_module_samples" data-id='{ "my_module_id": <%= my_module.id %> }' data-scroll-id="<%= my_module.id %>" data-order="<%= order == :asc ? "asc" : "desc" %>" data-name="<%=t "projects.reports.elements.module_samples.sidebar_name" %>" data-icon-class="glyphicon-tint">
<div class="report-element report-module-samples-element" data-sort-hot="3" data-ts="<%= timestamp.to_i %>" data-type="my_module_samples" data-id='{ "my_module_id": <%= my_module.id %> }' data-scroll-id="<%= my_module.id %>" data-order="<%= order == :asc ? "asc" : "desc" %>" data-name="<%=t "projects.reports.elements.module_samples.sidebar_name" %>" data-icon-class="glyphicon glyphicon-tint">
<div class="report-element-header">
<div class="row">
<div class="pull-left samples-icon">

View file

@ -6,7 +6,7 @@
<% assets = step.assets %>
<% checklists = step.checklists %>
<% comments = step.step_comments %>
<div class="report-element report-step-element" data-ts="<%= timestamp.to_i %>" data-type="step" data-id='{ "step_id": <%= step.id %> }' data-scroll-id="<%= step.id %>" data-modal-title="<%=t "projects.reports.elements.modals.step_contents.head_title", step: step.name %>" data-name="<%=t "projects.reports.elements.step.sidebar_name", pos: (step.position + 1), name: step.name %>" data-icon-class="glyphicon-circle-arrow-right">
<div class="report-element report-step-element" data-ts="<%= timestamp.to_i %>" data-type="step" data-id='{ "step_id": <%= step.id %> }' data-scroll-id="<%= step.id %>" data-modal-title="<%=t "projects.reports.elements.modals.step_contents.head_title", step: step.name %>" data-name="<%=t "projects.reports.elements.step.sidebar_name", pos: (step.position + 1), name: step.name %>" data-icon-class="glyphicon glyphicon-circle-arrow-right">
<div class="report-element-header">
<div class="row">
<div class="pull-left user-time">

View file

@ -1,6 +1,6 @@
<% if project.blank? and @project.present? then project = @project end %>
<% name = t("projects.reports.elements.project_header.title", project: project.name) %>
<div class="report-element report-project-header-element" data-ts="ignore" data-type="project_header" data-id='{ "project_id": <%= project.id %> }' data-scroll-id="<%= project.id %>" data-name="<%= name %>" data-icon-class="glyphicon-header">
<div class="report-element report-project-header-element" data-ts="ignore" data-type="project_header" data-id='{ "project_id": <%= project.id %> }' data-scroll-id="<%= project.id %>" data-name="<%= name %>" data-icon-class="glyphicon glyphicon-header">
<div class="report-element-header">
<div class="row">
<div class="pull-left user-time">

View file

@ -2,7 +2,7 @@
<% if order.blank? and @order.present? then order = @order end %>
<% comments = result.result_comments.order(created_at: order) %>
<% timestamp = Time.current + 1.year %>
<div class="report-element report-comments-element report-result-comments-element" data-ts="<%= timestamp.to_i %>" data-order="<%= order == :asc ? "asc" : "desc" %>" data-type="result_comments" data-id='{ "result_id": <%= result.id %> }' data-scroll-id="<%= result.id %>" data-name="<%=t "projects.reports.elements.result_comments.sidebar_name" %>" data-icon-class="glyphicon-comment">
<div class="report-element report-comments-element report-result-comments-element" data-ts="<%= timestamp.to_i %>" data-order="<%= order == :asc ? "asc" : "desc" %>" data-type="result_comments" data-id='{ "result_id": <%= result.id %> }' data-scroll-id="<%= result.id %>" data-name="<%=t "projects.reports.elements.result_comments.sidebar_name" %>" data-icon-class="glyphicon glyphicon-comment">
<div class="report-element-header">
<div class="row">
<div class="pull-left comments-icon">

View file

@ -1,7 +1,7 @@
<% if asset.blank? and @asset.present? then asset = @asset end %>
<% is_image = asset.is_image? %>
<% timestamp = asset.created_at %>
<% icon_class = is_image ? 'glyphicon-picture' : 'glyphicon-file' %>
<% icon_class = 'glyphicon ' + (is_image ? 'glyphicon-picture' : 'glyphicon-file') %>
<div class="report-element report-step-attachment-element report-step-asset-element" data-ts="<%= timestamp.to_i %>" data-type="step_asset" data-id='{ "asset_id": <%= asset.id %> }' data-scroll-id="<%= asset.id %>" data-name="<%=t "projects.reports.elements.step_asset.sidebar_name", file: asset.file_file_name %>" data-icon-class="<%= icon_class %>">
<div class="report-element-header">
<div class="row">

View file

@ -1,7 +1,7 @@
<% if checklist.blank? and @checklist.present? then checklist = @checklist end %>
<% items = checklist.checklist_items %>
<% timestamp = checklist.created_at %>
<div class="report-element report-step-attachment-element report-step-checklist-element" data-ts="<%= timestamp.to_i %>" data-type="step_checklist" data-id='{ "checklist_id": <%= checklist.id %> }' data-scroll-id="<%= checklist.id %>" data-name="<%= checklist.name %>" data-icon-class="glyphicon-list">
<div class="report-element report-step-attachment-element report-step-checklist-element" data-ts="<%= timestamp.to_i %>" data-type="step_checklist" data-id='{ "checklist_id": <%= checklist.id %> }' data-scroll-id="<%= checklist.id %>" data-name="<%= checklist.name %>" data-icon-class="glyphicon glyphicon-list">
<div class="report-element-header">
<div class="row">
<div class="pull-left attachment-icon">

View file

@ -2,7 +2,7 @@
<% if order.blank? and @order.present? then order = @order end %>
<% comments = step.step_comments.order(created_at: order) %>
<% timestamp = Time.current + 1.year %>
<div class="report-element report-comments-element report-step-comments-element" data-ts="<%= timestamp.to_i %>" data-order="asc" data-type="step_comments" data-id='{ "step_id": <%= step.id %> }' data-scroll-id="<%= step.id %>" data-name="<%=t "projects.reports.elements.step_comments.sidebar_name" %>" data-icon-class="glyphicon-comment">
<div class="report-element report-comments-element report-step-comments-element" data-ts="<%= timestamp.to_i %>" data-order="asc" data-type="step_comments" data-id='{ "step_id": <%= step.id %> }' data-scroll-id="<%= step.id %>" data-name="<%=t "projects.reports.elements.step_comments.sidebar_name" %>" data-icon-class="glyphicon glyphicon-comment">
<div class="report-element-header">
<div class="row">
<div class="pull-left comments-icon">

View file

@ -1,6 +1,6 @@
<% if table.blank? and @table.present? then table = @table end %>
<% timestamp = table.created_at %>
<div class="report-element report-step-attachment-element report-step-table-element" data-ts="<%= timestamp.to_i %>" data-type="step_table" data-id='{ "table_id": <%= table.id %> }' data-scroll-id="<%= table.id %>" data-name="<%= table.name %>" data-icon-class="glyphicon-th">
<div class="report-element report-step-attachment-element report-step-table-element" data-ts="<%= timestamp.to_i %>" data-type="step_table" data-id='{ "table_id": <%= table.id %> }' data-scroll-id="<%= table.id %>" data-name="<%= table.name %>" data-icon-class="glyphicon glyphicon-th">
<div class="report-element-header">
<div class="row">
<div class="pull-left attachment-icon">

View file

@ -59,7 +59,7 @@
</li>
<li class="disabled">
<a id="repositories-link" href="#">
<span class="glyphicon glyphicon-oil"></span>
<span class="fa fa-cubes"></span>
<span class="visible-xs-inline visible-sm-inline"><%= t('nav.label.repositories') %></span>
</a>
</li>