Commit cb503afe authored by gijs's avatar gijs

Attempt to simplify the attachments, video attachments

parent 7c54d96e
......@@ -1373,6 +1373,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;
......@@ -1382,6 +1383,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;
......@@ -1397,6 +1399,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