Commit 437adb30 authored by alexandre's avatar alexandre

Merge branch 'master' of gitlab.constantvzw.org:osp/work.w

parents c6350382 803ae8d1
# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-12-17 10:10
from __future__ import unicode_literals
from django.db import migrations, models
import taggit.managers
class Migration(migrations.Migration):
dependencies = [
('playground', '0021_auto_20180601_1320'),
]
operations = [
migrations.AddField(
model_name='attachment',
name='url',
field=models.URLField(blank=True),
),
migrations.AlterField(
model_name='attachment',
name='attachment',
field=models.FileField(blank=True, null=True, upload_to=''),
),
migrations.AlterField(
model_name='score',
name='tags',
field=taggit.managers.TaggableManager(blank=True, help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags'),
),
]
......@@ -5,7 +5,8 @@ from taggit.managers import TaggableManager
class Attachment(models.Model):
title = models.CharField(max_length=255)
attachment = models.FileField()
attachment = models.FileField(blank=True, null=True)
url = models.URLField(blank=True)
class Score(models.Model):
......
......@@ -1251,6 +1251,7 @@ li + li .alt-symbol { display: none; }
}
.attachment--view--vimeo .attachment--vimeo--full,
.attachment--view--pdf .attachment--pdf--full,
.attachment--view--image .attachment--image--full {
position: absolute;
......@@ -1260,6 +1261,7 @@ li + li .alt-symbol { display: none; }
z-index: 4;
}
.attachment--view--vimeo[data-opened="true"] .attachment--vimeo--full,
.attachment--view--pdf[data-opened="true"] .attachment--pdf--full,
.attachment--view--image[data-opened="true"] .attachment--image--full {
display: block;
......@@ -1275,6 +1277,13 @@ li + li .alt-symbol { display: none; }
height: 80vh;
}
.attachment--vimeo--full iframe {
width: 640px;
height: 360px;
}
.attachment--vimeo--full .btn--close,
.attachment--pdf--full .btn--close,
.attachment--image--full .btn--close {
position: absolute;
......
......@@ -96,7 +96,6 @@ window.W = window.W || {};
url: "",
title: "",
attachment: null,
type: "file"
},
urlRoot: '/api/attachments/',
......@@ -106,15 +105,6 @@ window.W = window.W || {};
var parsed_url = original_url + (original_url.charAt(original_url.length - 1) == '/' ? '' : '/');
return parsed_url;
},
})
W.VideoAttachmentModel = Backbone.RelationalModel.extend({
defaults: {
type: "vimeo",
title: "",
vimeoId: ""
}
})
......
This diff is collapsed.
......@@ -25,6 +25,10 @@
<script id="attachment-audio-template" type="text/template">
{% include "playground/underscore/node-attachment-audio.mtpl" %}
</script>
<script id="attachment-vimeo-template" type="text/template">
{% include "playground/underscore/node-attachment-vimeo.mtpl" %}
</script>
<script id="attachment-download-template" type="text/template">
{% include "playground/underscore/node-attachment-download.mtpl" %}
......@@ -61,6 +65,14 @@
<script id="field-attachment-template" type="text/template">
{% include "playground/underscore/field-attachment.mtpl" %}
</script>
<script id="field-attachment-upload-template" type="text/template">
{% include "playground/underscore/field-attachment-upload.mtpl" %}
</script>
<script id="field-attachment-url-template" type="text/template">
{% include "playground/underscore/field-attachment-url.mtpl" %}
</script>
<script id="field-boucle-template" type="text/template">
{% include "playground/underscore/field-boucle.mtpl" %}
......
<label><span class="label-text"><%- t('Titre') %></span><input type="text" name="title" ></label>
<label><span class="label-text"><%- t('Pièce-jointe') %></span><input type="file" name="file" ></label>
<label class="inline"><span class="label-text"><%- t('Pièce-jointe') %></span><input type="file" name="file" ></label>
<button class="inline">Switch to file link</button>
\ No newline at end of file
<label><span class="label-text"><%- t('Titre') %></span><input type="text" name="title" ></label>
<label><span class="label-text"><%- t('Vimeo URL') %></span><input type="text" name="url" ></label>
<label class="inline"><span class="label-text"><%- t('Pièce-jointe') %></span><input type="text" name="url" ></label>
<button class="inline">Switch to file upload</button>
<% if (hasModel) { %>
<label><span class="label-text"><%- t('Titre') %></span><input type="text" name="title" value="<%- title %>" /></label><a href="<%- attachment %>">Link</a><button>supprimer</delete>
<% } else { %>
<label><span class="label-text"><%- t('Titre') %></span><input type="text" name="title" ></label>
<label><span class="label-text"><%- t('Pièce-jointe') %></span><input type="file" name="file" ></label>
<% } %>
<label>
<span class="label-text"><%- t('Titre') %></span>
<input type="text" name="title" value="<%- title %>" />
</label>
<label class="inline">
<span class="label-text"><%- t('Pièce-jointe') %></span>
<a href="<%- attachment %>">Link</a>
</label>
<button class="inline">supprimer</delete>
\ No newline at end of file
......@@ -6,4 +6,4 @@
/
<span class="audio--timecode--duration">-</span>
</section>]
<audio src="<%= attachment %>" />
\ No newline at end of file
<audio src="<%= dataUrl %>" />
\ No newline at end of file
<a href="<%= attachment %>" data-external download>[<%= title %>]</a>
\ No newline at end of file
<a href="<%= dataUrl %>" data-external download>[<%= title %>]</a>
\ No newline at end of file
<a href="<%= attachment %>">[<%= title %>]</a>
<a href="<%= dataUrl %>">[<%= title %>]</a>
<div class="attachment--image--full">
<button class="btn--close">x</button>
<img src="<%= attachment %>" />
<img src="<%= dataUrl %>" />
</div>
\ No newline at end of file
<a href="<%= attachment %>">[<%= title %>]</a>
<div class="attachment--pdf--full">
<button class="btn--close">x</button>
<iframe src="<%= attachment.replace(/^https?\:/, '') %>"></iframe>
<iframe src="<%= dataUrl.replace(/^https?\:/, '') %>"></iframe>
</div>
\ No newline at end of file
<a href="<%= attachment %>">[<%= title %>]</a>
<div class="attachment--vimeo--full">
<button class="btn--close">x</button>
<img src="<%= attachment %>" />
<iframe src="https://player.vimeo.com/video/{{ vimeoId }}" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
<img src="<%= dataUrl %>" />
<iframe src="https://player.vimeo.com/video/<%= vimeoId %>" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
</div>
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment