Show activities on shot page.
This commit is contained in:
@@ -352,6 +352,29 @@ function task_delete(task_id, task_etag, task_delete_url) {
|
||||
});
|
||||
}
|
||||
|
||||
function load_activities(url)
|
||||
{
|
||||
$.get(url)
|
||||
.done(function(data) {
|
||||
if(console) console.log('Activities loaded OK');
|
||||
$('#activities').html(data);
|
||||
})
|
||||
.fail(function(xhr) {
|
||||
if (console) {
|
||||
console.log('Error fetching activities');
|
||||
console.log('XHR:', xhr);
|
||||
}
|
||||
$('#status-bar').text('Opening activity log failed.');
|
||||
if (xhr.status) {
|
||||
$('#activities').html(xhr.responseText);
|
||||
} else {
|
||||
$('#activities').html('<p class="text-danger">Opening activity log failed. There possibly was ' +
|
||||
'an error connecting to the server. Please check your network connection and ' +
|
||||
'try again.</p>');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$("a.shot-link[data-shot-id]").click(function(e) {
|
||||
e.preventDefault();
|
||||
|
15
src/templates/attract/shots/view_activities_embed.jade
Normal file
15
src/templates/attract/shots/view_activities_embed.jade
Normal file
@@ -0,0 +1,15 @@
|
||||
.d-activity
|
||||
| {% if activities['_meta']['total'] %}
|
||||
h3 Activity
|
||||
|
||||
ul
|
||||
| {% for act in activities['_items'] %}
|
||||
li
|
||||
span.date {{ act._created | pretty_date_time }}:
|
||||
| {{ act['actor_user']['full_name'] }} {{ act.verb }}
|
||||
| {% endfor %}
|
||||
| {% else %}
|
||||
p.
|
||||
No activity detected, which is strange, as we also consider creation
|
||||
to be an activity.
|
||||
| {% endif %}
|
@@ -55,7 +55,10 @@
|
||||
| {{ shot.properties.trim_start_in_frames }} frames
|
||||
|
||||
#item-view-feed
|
||||
| Activity feed here.
|
||||
#activities
|
||||
|
||||
script.
|
||||
new Clipboard('.copy-to-clipboard');
|
||||
|
||||
var url = "{{ url_for('.activities', project_url=project.url, shot_id=shot['_id']) }}";
|
||||
load_activities(url); // from 10_tasks.js
|
||||
|
@@ -119,22 +119,4 @@ script.
|
||||
new Clipboard('.copy-to-clipboard');
|
||||
|
||||
var url = "{{ url_for('.activities', project_url=project.url, task_id=task['_id']) }}";
|
||||
$.get(url)
|
||||
.done(function(data) {
|
||||
if(console) console.log('Activities for task loaded OK');
|
||||
$('#activities').html(data);
|
||||
})
|
||||
.fail(function(xhr) {
|
||||
if (console) {
|
||||
console.log('Error fetching activities');
|
||||
console.log('XHR:', xhr);
|
||||
}
|
||||
$('#status-bar').text('Opening task activity log failed.');
|
||||
if (xhr.status) {
|
||||
$('#activities').html(xhr.responseText);
|
||||
} else {
|
||||
$('#activities').html('<p class="text-danger">Opening activity log failed. There possibly was ' +
|
||||
'an error connecting to the server. Please check your network connection and ' +
|
||||
'try again.</p>');
|
||||
}
|
||||
});
|
||||
load_activities(url); // from 10_tasks.js
|
||||
|
Reference in New Issue
Block a user