Add shot status indicator on the left

This commit is contained in:
2016-09-22 21:26:56 +02:00
parent b9ce421378
commit cb24b313d0
2 changed files with 12 additions and 5 deletions

View File

@@ -69,8 +69,8 @@ function shot_open(shot_id, project_url) {
$('#col_right .col_header span.header_text').text('Shot details'); $('#col_right .col_header span.header_text').text('Shot details');
$('#shot-list').find('a').removeClass('active'); $('[id^="shot-"]').removeClass('active');
$('#shot-link' + shot_id).addClass('active'); $('#shot-' + shot_id).addClass('active');
var shot_url = '/attract/' + project_url + '/shots/' + shot_id; var shot_url = '/attract/' + project_url + '/shots/' + shot_id;
console.log('shot_url is ' + shot_url); console.log('shot_url is ' + shot_url);

View File

@@ -11,6 +11,7 @@
.table#shot-list .table#shot-list
.table-head .table-head
.table-row .table-row
.table-cell.shot-status
.table-cell.shot-thumbnail .table-cell.shot-thumbnail
span.collapser Thumbnail span.collapser Thumbnail
.table-cell.shot-name .table-cell.shot-name
@@ -21,7 +22,10 @@
| {% endfor %} | {% endfor %}
.table-body .table-body
| {% for shot in shots %} | {% for shot in shots %}
.table-row(id="shot-{{ shot._id }}") .table-row(
id="shot-{{ shot._id }}",
class="status-{{ shot.properties.status }}")
.table-cell.shot-status
.table-cell.shot-thumbnail .table-cell.shot-thumbnail
a( a(
id="shot-link-{{ shot._id }}" id="shot-link-{{ shot._id }}"
@@ -41,10 +45,9 @@
id="task-{{ task._id }}", id="task-{{ task._id }}",
href="javascript:task_open('{{ task._id }}', '{{ project.url }}');", href="javascript:task_open('{{ task._id }}', '{{ project.url }}');",
class="status-{{ task.properties.status }}") class="status-{{ task.properties.status }}")
span(class="task-name-{{ task._id }}") {{ task.name }}
| {% endfor %} | {% endfor %}
| {% if not tasks_for_shots[shot._id][task_type] %} | {% if not tasks_for_shots[shot._id][task_type] %}
a( a.task-add(
href="javascript:task_create('{{ shot._id }}', '{{ project.url }}', '{{ task_type }}');") href="javascript:task_create('{{ shot._id }}', '{{ project.url }}', '{{ task_type }}');")
| + Task | + Task
| {% endif %} | {% endif %}
@@ -69,15 +72,19 @@ script.
$(function() { shot_open('{{ open_shot_id }}', '{{ project.url }}'); }); $(function() { shot_open('{{ open_shot_id }}', '{{ project.url }}'); });
{% endif %} {% endif %}
$('.table-head .table-cell span').on('click', function(e){ $('.table-head .table-cell span').on('click', function(e){
e.stopPropagation(); e.stopPropagation();
/* We need to find every cell matching the same classes */
var same_cells = '.' + $(this).parent().attr('class').split(' ').join('.'); var same_cells = '.' + $(this).parent().attr('class').split(' ').join('.');
$(same_cells).hide(); $(same_cells).hide();
/* Add the spacer which we later click to expand */
$('<div class="table-cell-spacer"></div>').insertAfter(same_cells); $('<div class="table-cell-spacer"></div>').insertAfter(same_cells);
}); });
$('body').on('click', '.table-cell-spacer', function(){ $('body').on('click', '.table-cell-spacer', function(){
/* We need to find every cell matching the same classes */
var same_cells = '.' + $(this).prev().attr('class').split(' ').join('.'); var same_cells = '.' + $(this).prev().attr('class').split(' ').join('.');
$(same_cells).show(); $(same_cells).show();
$(same_cells).next().remove(); $(same_cells).next().remove();