resolved conflicts
This commit is contained in:
commit
503d7cf171
|
@ -133,13 +133,15 @@ class File(models.Model):
|
||||||
except:
|
except:
|
||||||
url = ''
|
url = ''
|
||||||
thumbnail = ''
|
thumbnail = ''
|
||||||
|
studies = [{'id': s.id, 'name': s.name} for s in self.categories.all()]
|
||||||
return {
|
return {
|
||||||
'id': self.id,
|
'id': self.id,
|
||||||
'url': url,
|
'url': url,
|
||||||
'thumbnail': thumbnail,
|
'thumbnail': thumbnail,
|
||||||
'title': self.title,
|
'title': self.title,
|
||||||
'description': self.description,
|
'description': self.description,
|
||||||
'type': self.type
|
'type': self.type,
|
||||||
|
'studies': studies
|
||||||
}
|
}
|
||||||
|
|
||||||
def save_chunk(self, chunk, name='data.bin'):
|
def save_chunk(self, chunk, name='data.bin'):
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
$(function() {
|
$(function() {
|
||||||
|
// alert("hi");
|
||||||
$('#filterForm').submit(function(e) {
|
$('#filterForm').submit(function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var formData = $(this).serializeArray();
|
var formData = $(this).serializeArray();
|
||||||
|
@ -40,7 +41,8 @@ $(function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
function getJQ(f) {
|
function getJQ(f) {
|
||||||
var jq = $("<div />").data("data", f).addClass("fileItem").text(f.type + ": " + f.title);
|
var jq = getListElement(f);
|
||||||
|
// var jq = $("<div />").data("data", f).addClass("fileItem").text(f.type + ": " + f.title);
|
||||||
jq.click(function() {
|
jq.click(function() {
|
||||||
var $this = $(this);
|
var $this = $(this);
|
||||||
$('.selectedItem').removeClass("selectedItem");
|
$('.selectedItem').removeClass("selectedItem");
|
||||||
|
@ -54,10 +56,10 @@ function getJQ(f) {
|
||||||
html += "<img width='400' src='" + d.thumbnail + "' />";
|
html += "<img width='400' src='" + d.thumbnail + "' />";
|
||||||
break;
|
break;
|
||||||
case "video":
|
case "video":
|
||||||
html += "<video width='400' src='" + d.url + "' />";
|
html += "<video controls='controls' width='400' src='" + d.url + "' />";
|
||||||
break;
|
break;
|
||||||
case "audio":
|
case "audio":
|
||||||
html += "<audio width='400' src='" + d.url + "' />";
|
html += "<audio controls='controls' width='400' src='" + d.url + "' />";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
html += "";
|
html += "";
|
||||||
|
@ -81,3 +83,13 @@ function getItemForm(f) {
|
||||||
var $submit = $('<input />').addClass("submitItem").attr("type", "submit").val("Submit").appendTo($form);
|
var $submit = $('<input />').addClass("submitItem").attr("type", "submit").val("Submit").appendTo($form);
|
||||||
return $form;
|
return $form;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getListElement(f) {
|
||||||
|
// console.log(f);
|
||||||
|
var $item = $('<div />').addClass("fileItem").data("data", f);
|
||||||
|
var $icon = $('<img />').addClass("fileIcon").attr("src", "/static/images/icons2/" + f.type.toLowerCase() + ".jpg").appendTo($item);
|
||||||
|
var $title = $('<span />').addClass("fileTitle").text(f.title).appendTo($item);
|
||||||
|
var $study = $('<span />').addClass("fileStudy").text(" " + f.studies[0].name).appendTo($item);
|
||||||
|
var $checkbox = $('<input />').attr("type", "checkbox").addClass("fileCheckbox").appendTo($item);
|
||||||
|
return $item;
|
||||||
|
}
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
</div>
|
</div>
|
||||||
<div id="prevBtn"><<</div>
|
<div id="prevBtn"><<</div>
|
||||||
<div id="nextBtn">>></div>
|
<div id="nextBtn">>></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div id="previewPane">
|
<div id="previewPane">
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user