Merge branch 'wip-asset-obscure'
All asset templates now extend view_base, only overriding what's needed via jinja blocks. Yay for less duplicated code!
This commit is contained in:
commit
fc9c518c2a
@ -781,7 +781,7 @@ $node-preview-max-height-lg: 700px
|
||||
filter: none
|
||||
|
||||
|
||||
section.node-row
|
||||
.node-row
|
||||
display: flex
|
||||
width: 100%
|
||||
flex: row
|
||||
@ -799,19 +799,20 @@ section.node-row
|
||||
background-color: white
|
||||
position: relative
|
||||
|
||||
&:nth-child(even), &:last-child
|
||||
&:last-child,
|
||||
&:nth-child(even)
|
||||
border-right: none
|
||||
|
||||
&:last-child
|
||||
border-bottom: none
|
||||
|
||||
&.texture-info
|
||||
padding: 10px 20px
|
||||
color: $color-text-dark-secondary
|
||||
position: relative
|
||||
z-index: 1
|
||||
list-style-type: none
|
||||
margin: 0
|
||||
padding: 10px 20px
|
||||
|
||||
span
|
||||
li
|
||||
&:not(:first-child)
|
||||
padding-left: 15px
|
||||
|
||||
@ -820,6 +821,11 @@ section.node-row
|
||||
top: -1px
|
||||
right: 2px
|
||||
|
||||
&.status
|
||||
margin-left: auto
|
||||
|
||||
&.pending
|
||||
color: $color-danger
|
||||
|
||||
section.node-preview.texture
|
||||
overflow: hidden
|
||||
@ -935,28 +941,24 @@ section.node-row
|
||||
text-transform: uppercase
|
||||
|
||||
section.node-preview
|
||||
overflow: hidden
|
||||
|
||||
iframe
|
||||
width: 100%
|
||||
|
||||
&.image,
|
||||
&.file,
|
||||
min-height: 200px
|
||||
flex: 1
|
||||
max-height: 500px
|
||||
background-color: black
|
||||
display: flex
|
||||
justify-content: center
|
||||
align-items: center
|
||||
|
||||
cursor: zoom-in
|
||||
|
||||
+media-md
|
||||
max-height: $node-preview-max-height-md
|
||||
+media-lg
|
||||
max-height: $node-preview-max-height-lg
|
||||
|
||||
align-items: center
|
||||
background-color: black
|
||||
color: $color-text-light-primary
|
||||
display: flex
|
||||
flex: 1
|
||||
justify-content: center
|
||||
max-height: 500px
|
||||
min-height: 200px
|
||||
overflow: hidden
|
||||
|
||||
iframe
|
||||
width: 100%
|
||||
|
||||
img
|
||||
display: block
|
||||
max-height: $node-preview-max-height-lg
|
||||
@ -971,6 +973,9 @@ section.node-preview
|
||||
+media-lg
|
||||
max-height: $node-preview-max-height-lg
|
||||
|
||||
&.image
|
||||
cursor: zoom-in
|
||||
|
||||
&.video
|
||||
background-color: black
|
||||
position: relative
|
||||
@ -1040,6 +1045,45 @@ section.node-preview
|
||||
object-fit: cover
|
||||
width: 100%
|
||||
|
||||
section.node-preview-forbidden
|
||||
align-items: center
|
||||
background-color: $color-background-nav
|
||||
color: $color-text-light
|
||||
cursor: default
|
||||
display: flex
|
||||
justify-content: center
|
||||
min-height: 400px
|
||||
position: relative
|
||||
|
||||
img
|
||||
height: 130%
|
||||
left: -60px
|
||||
max-width: initial
|
||||
filter: blur(30px)
|
||||
object-fit: cover
|
||||
opacity: .5
|
||||
position: absolute
|
||||
top: -60px
|
||||
width: 130%
|
||||
z-index: 0
|
||||
|
||||
> div
|
||||
font-size: 1.4em
|
||||
position: relative
|
||||
z-index: 1
|
||||
|
||||
span
|
||||
display: block
|
||||
|
||||
a
|
||||
color: $color-text-light
|
||||
|
||||
&.btn
|
||||
border-color: white
|
||||
color: white
|
||||
|
||||
hr
|
||||
opacity: .5
|
||||
|
||||
section.node-details-container
|
||||
background-color: white
|
||||
@ -1071,35 +1115,8 @@ section.node-preview.group
|
||||
width: 100%
|
||||
max-width: 100%
|
||||
|
||||
.node-title-details
|
||||
margin-left: auto
|
||||
line-height: 1em
|
||||
|
||||
& .date
|
||||
display: inline-block
|
||||
margin-right: 10px
|
||||
color: $color-text-dark-secondary
|
||||
|
||||
& .status
|
||||
display: inline-block
|
||||
font-size: .9em
|
||||
text-transform: capitalize
|
||||
color: $color-text-dark-primary
|
||||
padding: 5px 15px
|
||||
border: thin solid $color-text-dark-hint
|
||||
border-radius: 3px
|
||||
cursor: default
|
||||
|
||||
&.group
|
||||
.node-details-meta.preview
|
||||
.node-details-meta-list
|
||||
display: inline-block
|
||||
|
||||
> li
|
||||
padding: 0 5px
|
||||
|
||||
.node-details-meta-actions
|
||||
display: inline-block
|
||||
margin-left: auto
|
||||
|
||||
.btn-browsetoggle
|
||||
+button(lighten($color-background-nav, 20%), 3px)
|
||||
@ -1115,171 +1132,6 @@ section.node-preview.group
|
||||
.node-details-title
|
||||
padding: 10px 20px 0 20px
|
||||
|
||||
ul.node-details-meta-list
|
||||
display: flex
|
||||
align-items: center
|
||||
|
||||
list-style-type: none
|
||||
margin: 0
|
||||
padding: 0
|
||||
|
||||
+media-xs
|
||||
font-size: .9em
|
||||
width: 100%
|
||||
max-width: 100%
|
||||
|
||||
> li
|
||||
margin: 0
|
||||
padding: 0
|
||||
line-height: 1em
|
||||
float: left
|
||||
|
||||
& a.btn
|
||||
padding: 4px 12px 5px 12px
|
||||
margin: 0
|
||||
|
||||
&.date
|
||||
color: $color-text-dark-secondary
|
||||
padding-left: 5px
|
||||
margin-left: 5px
|
||||
|
||||
&:before
|
||||
color: $color-text-dark-secondary
|
||||
position: relative
|
||||
content: '·'
|
||||
left: -10px
|
||||
font-weight: 500
|
||||
|
||||
span /* (updated x mins ago) */
|
||||
color: $color-text-dark-hint
|
||||
margin-left: 3px
|
||||
font-size: .9em
|
||||
text-transform: lowercase
|
||||
|
||||
&.author
|
||||
color: $color-text-dark-primary
|
||||
|
||||
&.status
|
||||
margin-right: 10px
|
||||
font-size: .9em
|
||||
text-transform: capitalize
|
||||
color: $color-text-dark-secondary
|
||||
font-weight: 300
|
||||
padding: 5px 15px
|
||||
border: thin solid $color-text-dark-hint
|
||||
border-radius: 3px
|
||||
cursor: default
|
||||
|
||||
&.access
|
||||
color: $color-text-dark-primary
|
||||
cursor: default
|
||||
opacity: .5
|
||||
white-space: nowrap
|
||||
|
||||
&:hover
|
||||
opacity: 1
|
||||
|
||||
&.public
|
||||
border-color: $color-success
|
||||
color: $color-success
|
||||
padding: 0
|
||||
i
|
||||
font-size: 1.2em
|
||||
position: relative
|
||||
top: 1px
|
||||
|
||||
span
|
||||
display: inline-block
|
||||
|
||||
|
||||
&.type
|
||||
text-transform: uppercase
|
||||
padding: 0 5px 0 15px
|
||||
cursor: default
|
||||
font-weight: 400
|
||||
color: $color-text-dark-hint
|
||||
|
||||
+media-xs
|
||||
display: none
|
||||
|
||||
/* .blend files are special snowflakes */
|
||||
span.blend
|
||||
display: inline-block
|
||||
padding: 0 35px 0 0
|
||||
font-size: 1.2em
|
||||
color: $color-text-dark-secondary
|
||||
|
||||
&.access+li.node-details-meta-list-item.video.download,
|
||||
&.access+.tooltip+li.node-details-meta-list-item.video.download
|
||||
margin-left: 10px
|
||||
|
||||
&.length
|
||||
padding: 0 5px 0 15px
|
||||
cursor: default
|
||||
font-weight: 400
|
||||
color: $color-text-dark-hint
|
||||
white-space: nowrap
|
||||
|
||||
&.license
|
||||
color: $color-text-dark-secondary
|
||||
|
||||
i
|
||||
color: $color-text-dark-primary
|
||||
font-size: 1.4em
|
||||
position: relative
|
||||
bottom: -2px
|
||||
left: -5px
|
||||
|
||||
/* Download button */
|
||||
&.download
|
||||
align-self: flex-end
|
||||
padding: 0 0 0 10px
|
||||
|
||||
/* Actual button */
|
||||
button
|
||||
+button($color-primary, 3px)
|
||||
position: relative
|
||||
|
||||
padding:
|
||||
left: 20px
|
||||
right: 20px
|
||||
|
||||
font-size: .9em
|
||||
|
||||
i
|
||||
margin-right: 0
|
||||
|
||||
/* Tweaks for specific icons */
|
||||
i.icon-dropdown-menu
|
||||
padding-left: 10px
|
||||
|
||||
&.disabled
|
||||
border-color: $color-text-dark-hint
|
||||
color: $color-text-dark-hint
|
||||
+stripes(rgba($color-text-dark-hint, .1), rgba($color-text-dark-hint, .2), -45deg, 28px)
|
||||
|
||||
/* Videos have dropdown caret, so paddit 5px less */
|
||||
&.video.download
|
||||
button
|
||||
padding-right: 10px
|
||||
|
||||
&.file.download
|
||||
button
|
||||
+button($color-primary, 3px, true)
|
||||
padding:
|
||||
left: 15px
|
||||
right: 15px
|
||||
|
||||
i
|
||||
margin-right: 0
|
||||
|
||||
&.texture.download
|
||||
width: 100%
|
||||
|
||||
&.open
|
||||
button
|
||||
box-shadow: none
|
||||
|
||||
.node-details-description
|
||||
+node-details-description
|
||||
padding-left: 20px
|
||||
|
@ -1,112 +0,0 @@
|
||||
.node-details-meta
|
||||
ul
|
||||
| {% if node.has_method('PUT') and (node.properties.status != 'published') %}
|
||||
li(class="status-{{ node.properties.status }}")
|
||||
| {{ node.properties.status | undertitle }}
|
||||
| {% endif %}
|
||||
|
||||
li(title="Author")
|
||||
| {{ node.user.full_name }}
|
||||
|
||||
li.dim(
|
||||
title="Created {{ node._created }} (updated {{ node._updated | pretty_date_time }})")
|
||||
| {{ node._created | pretty_date }}
|
||||
|
||||
| {% if node.short_link %}
|
||||
li.shared
|
||||
a(href="{{ node.short_link }}")
|
||||
i.pi-share
|
||||
| Shared
|
||||
| {% endif %}
|
||||
|
||||
li.left-side
|
||||
|
||||
| {% if node.file %}
|
||||
li.dim(title="File size")
|
||||
| {{ node.file.length | filesizeformat }}
|
||||
li.dim(title="File format")
|
||||
| {{ node.file.content_type }}
|
||||
| {% endif %}
|
||||
|
||||
| {% if node.permissions.world %}
|
||||
li.public(
|
||||
data-toggle="tooltip",
|
||||
data-placement="bottom",
|
||||
title="Anybody can download. Share it!")
|
||||
i.pi-lock-open
|
||||
span Public
|
||||
| {% endif %}
|
||||
|
||||
| {% if node.file and (current_user.has_cap('subscriber') or node.permissions.world) %}
|
||||
li.download
|
||||
| {% if node.properties.content_type == 'video' %}
|
||||
| {% if node.file_variations %}
|
||||
button.btn.btn-default.dropdown-toggle(
|
||||
type="button",
|
||||
data-toggle="dropdown",
|
||||
aria-haspopup="true",
|
||||
aria-expanded="false")
|
||||
i.pi-download
|
||||
| Download
|
||||
i.pi-angle-down.icon-dropdown-menu
|
||||
|
||||
ul.dropdown-menu
|
||||
| {% for variation in node.file_variations %}
|
||||
li
|
||||
a(href="{{ variation.link }}",
|
||||
title="Download this format",
|
||||
download)
|
||||
span.length {{ variation.length | filesizeformat }}
|
||||
|
||||
span.format {{ variation.format }}
|
||||
span.size {{ variation.size }}
|
||||
|
||||
| {% endfor %}
|
||||
| {% endif %}
|
||||
| {% else %}
|
||||
li.download
|
||||
a(
|
||||
title="Download {{ node.properties.content_type | undertitle }}",
|
||||
href="{{ node.file.link }}",
|
||||
download="{{ node.file.filename }}")
|
||||
button.btn(type="button")
|
||||
i.pi-download
|
||||
| Download
|
||||
| {% endif %}
|
||||
|
||||
| {% elif current_user.has_cap('can-renew-subscription') %}
|
||||
li.download
|
||||
a.btn.btn-success(
|
||||
title="Renew your subscription to download",
|
||||
target="_blank",
|
||||
href="/renew")
|
||||
i.pi-heart
|
||||
| Renew subscription to download
|
||||
|
||||
| {% elif current_user.is_authenticated %}
|
||||
li.download
|
||||
a.btn(
|
||||
title="Join Blender Cloud",
|
||||
href="{{ url_for('cloud.join') }}")
|
||||
i.pi-lock
|
||||
| Download
|
||||
| {% else %}
|
||||
li.download
|
||||
a.btn(
|
||||
title="Login to download {{ node.properties.content_type | undertitle }}",
|
||||
href="{{ url_for('users.login') }}")
|
||||
i.pi-lock
|
||||
| Download
|
||||
| {% endif %}
|
||||
|
||||
| {% if node.properties.license_type %}
|
||||
a.node-details-license(
|
||||
href="https://creativecommons.org/licenses/",
|
||||
target="_blank")
|
||||
span.type
|
||||
i(class="pi-license-{{ node.properties.license_type }}")
|
||||
| License <span>{{ node.properties.license_type }}</span>
|
||||
| {% if node.properties.license_notes %}
|
||||
| — {{ node.properties.license_notes }}
|
||||
| {% endif %}
|
||||
| {% endif %}
|
25
src/templates/nodes/custom/_node_preview_forbidden.pug
Normal file
25
src/templates/nodes/custom/_node_preview_forbidden.pug
Normal file
@ -0,0 +1,25 @@
|
||||
section.node-preview-forbidden
|
||||
| {% if node.picture %}
|
||||
img(src="{{ node.picture.thumbnail('t', api=api) }}")
|
||||
| {% endif %}
|
||||
|
||||
div
|
||||
p Available to Blender Cloud subscribers
|
||||
hr
|
||||
| {% if current_user.has_cap('can-renew-subscription') %}
|
||||
p
|
||||
small You have a subscription, it just needs to be renewed.
|
||||
a.btn(href="/renew")
|
||||
| #[i.pi-heart] Renew Subscription
|
||||
| {% else %}
|
||||
p
|
||||
small Support Blender and get awesome stuff!
|
||||
a.btn(href="{{ url_for('cloud.join') }}")
|
||||
| #[i.pi-heart] Get a Subscription
|
||||
| {% endif %}
|
||||
|
||||
| {% if current_user.is_anonymous %}
|
||||
p
|
||||
small Already a subscriber?
|
||||
a.btn(href="{{ url_for('users.login') }}") Log In
|
||||
| {% endif %}
|
@ -41,7 +41,7 @@ script(type="text/javascript").
|
||||
{% endif %}
|
||||
|
||||
|
||||
// If we are im preview mode, update the image source
|
||||
// If we are in preview mode, update the image source
|
||||
if (page_overlay.classList.contains('active')) {
|
||||
var node_preview = document.getElementById('node-preview');
|
||||
|
||||
@ -73,7 +73,7 @@ script(type="text/javascript").
|
||||
.html('<div class="nav-prev"></div><img src="' + src + '"/><div class="nav-next"></div>');
|
||||
}
|
||||
|
||||
$('#node-preview.image, #node-preview.file').click(function(e){
|
||||
$('.js-node-preview-image').click(function(e){
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
@ -138,3 +138,12 @@ script(type="text/javascript").
|
||||
}
|
||||
|
||||
{% endif %}
|
||||
|
||||
var $content_type = $(".js-type");
|
||||
var type_value = $content_type.text();
|
||||
var type_value_trimmed = type_value.substring(type_value.indexOf("/") + 1);
|
||||
$content_type.text(type_value_trimmed);
|
||||
|
||||
if (type_value_trimmed == 'x-blender' || type_value_trimmed == 'blend'){
|
||||
$content_type.html('<span class="blend"><i class="pi-blender-logo"></i></span>');
|
||||
};
|
||||
|
@ -1,54 +1 @@
|
||||
| {% block body %}
|
||||
|
||||
#node-container
|
||||
#node-overlay
|
||||
|
||||
| {% if node.picture %}
|
||||
section#node-preview.node-preview.file
|
||||
img.node-preview-thumbnail#node-preview-thumbnail(
|
||||
src="{{ node.picture.thumbnail('l', api=api) }}")
|
||||
| {% endif %}
|
||||
|
||||
|
||||
section.node-details-container.file
|
||||
|
||||
.node-details-header
|
||||
.node-title#node-title
|
||||
| {{node.name}}
|
||||
|
||||
| {% if node.description %}
|
||||
.node-details-description#node-description
|
||||
| {{ node | markdowned('description') }}
|
||||
| {% endif %}
|
||||
|
||||
include ../../_node_details
|
||||
|
||||
#comments-embed
|
||||
.comments-list-loading
|
||||
i.pi-spin
|
||||
|
||||
include ../../_scripts
|
||||
|
||||
| {% endblock %}
|
||||
|
||||
| {% block footer_scripts %}
|
||||
script.
|
||||
// Generate GA pageview
|
||||
ga('send', 'pageview', location.pathname);
|
||||
|
||||
var content_type = $("li.node-details-meta-list-item.type").text();
|
||||
var type_trimmed = content_type.substring(content_type.indexOf("/") + 1);
|
||||
|
||||
if (type_trimmed == 'x-blender' || type_trimmed == 'blend'){
|
||||
type_trimmed = '<span class="blend"><i class="pi-blender-logo"></i></span>';
|
||||
};
|
||||
|
||||
$("li.node-details-meta-list-item.type").html(type_trimmed);
|
||||
|
||||
$('.sorry').click(function() {
|
||||
$.get('/403', function(data) {
|
||||
$('#node-overlay').html(data).addClass('active');
|
||||
})
|
||||
});
|
||||
|
||||
| {% endblock %}
|
||||
| {% extends "nodes/view_base.html" %}
|
||||
|
@ -1,4 +0,0 @@
|
||||
| {% extends 'layout.html' %}
|
||||
|
||||
| {% block footer_scripts %}
|
||||
| {% endblock %}
|
@ -1,48 +1 @@
|
||||
| {% block body %}
|
||||
|
||||
#node-container
|
||||
#node-overlay
|
||||
|
||||
| {% if node.picture %}
|
||||
section#node-preview.node-preview.image
|
||||
img.node-preview-thumbnail#node-preview-thumbnail(
|
||||
src="{{ node.picture.thumbnail('l', api=api) }}")
|
||||
| {% endif %}
|
||||
|
||||
|
||||
section.node-details-container.image
|
||||
|
||||
.node-details-header
|
||||
.node-title#node-title
|
||||
| {{node.name}}
|
||||
|
||||
| {% if node.description %}
|
||||
.node-details-description#node-description
|
||||
| {{ node | markdowned('description') }}
|
||||
| {% endif %}
|
||||
|
||||
include ../../_node_details
|
||||
|
||||
#comments-embed
|
||||
.comments-list-loading
|
||||
i.pi-spin
|
||||
|
||||
include ../../_scripts
|
||||
|
||||
| {% endblock %}
|
||||
|
||||
| {% block footer_scripts %}
|
||||
script.
|
||||
// Generate GA pageview
|
||||
ga('send', 'pageview', location.pathname);
|
||||
|
||||
var content_type = $("li.node-details-meta-list-item.type").text();
|
||||
$("li.node-details-meta-list-item.type").text(content_type.substring(content_type.indexOf("/") + 1));
|
||||
|
||||
$('.sorry').click(function() {
|
||||
$.get('/403', function(data) {
|
||||
$('#node-overlay').html(data).addClass('active');
|
||||
})
|
||||
});
|
||||
|
||||
| {% endblock %}
|
||||
| {% extends "nodes/view_base.html" %}
|
||||
|
@ -1,6 +0,0 @@
|
||||
| {% extends 'layout.html' %}
|
||||
| {% from '_macros/_file_uploader_javascript.html' import render_file_uploader_javascript %}
|
||||
|
||||
| {% block footer_scripts %}
|
||||
| {{render_file_uploader_javascript()}}
|
||||
| {% endblock %}
|
@ -1,10 +1,8 @@
|
||||
| {% block body %}
|
||||
| {% extends "nodes/view_base.html" %}
|
||||
|
||||
#node-container
|
||||
#node-overlay
|
||||
|
||||
section.node-preview.video
|
||||
| {% if node.video_sources %}
|
||||
| {% block node_preview %}
|
||||
| {% if node.video_sources %}
|
||||
section.node-preview.video
|
||||
video#videoplayer.video-js(
|
||||
controls,
|
||||
data-setup="{}",
|
||||
@ -18,43 +16,38 @@
|
||||
p.vjs-no-js.
|
||||
To view this video please enable JavaScript, and consider upgrading to a web browser that
|
||||
<a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a>
|
||||
| {% else %}
|
||||
.video-dummy.sorry(
|
||||
style="{% if node.picture %}background-image: url({{ node.picture.thumbnail('l', api=api) }});{% endif %}")
|
||||
.video-dummy-content
|
||||
.video-dummy-content-text
|
||||
span Available to Blender Cloud subscribers
|
||||
span
|
||||
small Support Blender and get awesome stuff!
|
||||
hr
|
||||
| {% if current_user.has_cap('can-renew-subscription') %}
|
||||
a.subscribe(href="/renew") You have a subscription, it just needs to be renewed. <em>Renew your subscription now!</em>
|
||||
| {% else %}
|
||||
a.subscribe(href="{{ url_for('cloud.join') }}") <em>Subscribe to Blender Cloud.</em>
|
||||
| {% endif %}
|
||||
| {% if current_user.is_anonymous %}
|
||||
a(href="{{ url_for('users.login') }}") Already a subscriber? Log in
|
||||
| {% endif %}
|
||||
| {% endif %}
|
||||
| {% else %}
|
||||
| {% include 'nodes/custom/_node_preview_forbidden.html' %}
|
||||
| {% endif %}
|
||||
| {% endblock node_preview %}
|
||||
|
||||
| {% block node_download %}
|
||||
| {% if node.file_variations %}
|
||||
button.btn.btn-default.dropdown-toggle(
|
||||
type="button",
|
||||
data-toggle="dropdown",
|
||||
aria-haspopup="true",
|
||||
aria-expanded="false")
|
||||
i.pi-download
|
||||
| Download
|
||||
i.pi-angle-down.icon-dropdown-menu
|
||||
|
||||
ul.dropdown-menu
|
||||
| {% for variation in node.file_variations %}
|
||||
li
|
||||
a(href="{{ variation.link }}",
|
||||
title="Download this format",
|
||||
download)
|
||||
span.length {{ variation.length | filesizeformat }}
|
||||
|
||||
span.format {{ variation.format }}
|
||||
span.size {{ variation.size }}
|
||||
| {% endfor %}
|
||||
| {% endif %}
|
||||
| {% endblock node_download %}
|
||||
|
||||
|
||||
section.node-details-container.video
|
||||
|
||||
.node-details-header
|
||||
.node-title#node-title
|
||||
| {{node.name}}
|
||||
|
||||
| {% if node.description %}
|
||||
.node-details-description#node-description
|
||||
| {{ node | markdowned('description') }}
|
||||
| {% endif %}
|
||||
|
||||
include ../../_node_details
|
||||
|
||||
#comments-embed
|
||||
.comments-list-loading
|
||||
i.pi-spin
|
||||
|
||||
| {% block node_scripts %}
|
||||
script(type="text/javascript").
|
||||
{% if node.video_sources %}
|
||||
|
||||
@ -114,17 +107,6 @@ script(type="text/javascript").
|
||||
}
|
||||
};
|
||||
|
||||
{% endif %}
|
||||
{% endif %} // if node.video_sources
|
||||
|
||||
$(function(){
|
||||
// Generate GA pageview
|
||||
ga('send', 'pageview', location.pathname);
|
||||
|
||||
var content_type = $("li.node-details-meta-list-item.type").text();
|
||||
$("li.node-details-meta-list-item.type").text(content_type.substring(content_type.indexOf("/") + 1));
|
||||
|
||||
});
|
||||
|
||||
include ../../_scripts
|
||||
|
||||
| {% endblock %}
|
||||
| {% endblock node_scripts %}
|
||||
|
@ -55,9 +55,9 @@
|
||||
| Only project members can comment.
|
||||
| {% elif current_user.has_cap('can-renew-subscription') %}
|
||||
i.pi-heart
|
||||
a(href='/renew', target='_blank') Renew your subscription to join the conversation!
|
||||
| Join the conversation! #[a(href='/renew', target='_blank') Renew your subscription] to comment.
|
||||
| {% else %}
|
||||
| Join the conversations! <a href="https://store.blender.org/product/membership/">Subscribe to Blender Cloud</a> now.
|
||||
| Join the conversation! #[a(href="https://store.blender.org/product/membership/") Subscribe to Blender Cloud] to comment.
|
||||
| {% endif %}
|
||||
|
||||
| {% else %}
|
||||
|
@ -1,11 +1,11 @@
|
||||
| {% block body %}
|
||||
#node-container
|
||||
|
||||
section.node-preview.group
|
||||
section.node-details-container
|
||||
.node-details-header
|
||||
.node-title#node-title
|
||||
| {{node.name}}
|
||||
|
||||
.node-details-meta.preview
|
||||
.node-details-meta-actions
|
||||
.btn-browsetoggle(
|
||||
title="Toggle between list/grid view",
|
||||
@ -18,6 +18,7 @@
|
||||
| {{ node | markdowned('description') }}
|
||||
| {% endif %}
|
||||
|
||||
|
||||
section.node-children.group
|
||||
|
||||
| {% if children %}
|
||||
|
@ -4,11 +4,6 @@
|
||||
.texture-title#node-title
|
||||
| {{node.name}}
|
||||
|
||||
| {% if node.picture %}
|
||||
.texture-backdrop(
|
||||
style="background-image: url({{ node.picture.thumbnail('m', api=api) }})")
|
||||
| {% endif %}
|
||||
|
||||
| {% if node.description %}
|
||||
section.node-row
|
||||
.node-details-description
|
||||
|
@ -4,11 +4,6 @@
|
||||
.texture-title#node-title
|
||||
| {{node.name}}
|
||||
|
||||
| {% if node.picture %}
|
||||
.texture-backdrop(
|
||||
style="background-image: url({{ node.picture.thumbnail('m', api=api) }})")
|
||||
| {% endif %}
|
||||
|
||||
| {% if node.description %}
|
||||
section.node-row
|
||||
.node-details-description
|
||||
|
@ -1,144 +1,62 @@
|
||||
| {% block body %}
|
||||
| {% extends "nodes/view_base.html" %}
|
||||
|
||||
#node-container.texture
|
||||
#node-overlay
|
||||
section.node-preview
|
||||
| {% if node.picture %}
|
||||
iframe(
|
||||
id='vrview_window'
|
||||
width='100%',
|
||||
height='450px',
|
||||
scrolling='no',
|
||||
frameborder='0',
|
||||
allowfullscreen='',
|
||||
src="{{url_for('main.vrview', preview=node.picture.thumbnail('l', api=api), image=node.picture.thumbnail('h', api=api), default_yaw=(node.properties.default_yaw or 0))}}")
|
||||
| {% endif %}
|
||||
| {% block node_preview %}
|
||||
| {% if node.picture %}
|
||||
iframe(
|
||||
id='vrview_window'
|
||||
width='100%',
|
||||
height='450px',
|
||||
scrolling='no',
|
||||
frameborder='0',
|
||||
allowfullscreen='',
|
||||
src="{{url_for('main.vrview', preview=node.picture.thumbnail('l', api=api), image=node.picture.thumbnail('h', api=api), default_yaw=(node.properties.default_yaw or 0))}}")
|
||||
| {% else %}
|
||||
section.node-preview
|
||||
h3 Missing Preview
|
||||
| {% endif %}
|
||||
| {% endblock node_preview %}
|
||||
|
||||
section.node-details-container
|
||||
|
||||
.node-details-header
|
||||
.node-title#node-title
|
||||
| {{node.name}}
|
||||
|
||||
.node-details-meta.header
|
||||
ul.node-details-meta-list
|
||||
| {% if node.permissions.world %}
|
||||
li.node-details-meta-list-item.access.public(
|
||||
data-toggle="tooltip",
|
||||
data-placement="bottom",
|
||||
title="Anybody can download. Share it!")
|
||||
i.pi-lock-open
|
||||
span Public
|
||||
| {% endif %}
|
||||
|
||||
| {% if node.properties.license_type %}
|
||||
| {% if node.properties.license_notes %}
|
||||
li.node-details-meta-list-item.video.license(
|
||||
id="asset-license",
|
||||
data-toggle="popover",
|
||||
data-placement="left",
|
||||
data-trigger="hover",
|
||||
data-content="{{ node.properties.license_notes }}",
|
||||
title="{{ node.properties.license_type }}")
|
||||
|
||||
i(class="pi-license-{{ node.properties.license_type }}")
|
||||
| {% else %}
|
||||
li.node-details-meta-list-item.video.license(
|
||||
id="asset-license",
|
||||
data-toggle="tooltip",
|
||||
data-placement="bottom",
|
||||
title="{{ node.properties.license_type }}")
|
||||
i(class="pi-license-{{ node.properties.license_type }}")
|
||||
| {% endif %}
|
||||
| {% endif %}
|
||||
|
||||
| {% if write_access %}
|
||||
li.node-details-meta-list-item
|
||||
| {% block node_details_meta_extra %}
|
||||
| {% if write_access %}
|
||||
li.node-details-meta-list-item
|
||||
a.btn#copy_yaw(
|
||||
href='javascript:void(0);'
|
||||
title='Copies current yaw of panorama to the clipboard, so you can set it as default yaw.'
|
||||
) Copy yaw
|
||||
| {% endif %}
|
||||
| {% endif %}
|
||||
| {% endblock node_details_meta_extra %}
|
||||
|
||||
| {% if node.properties.files %}
|
||||
li.btn-group.node-details-meta-list-item.video.download(
|
||||
title="Download HDRI")
|
||||
button.btn.btn-default.dropdown-toggle(
|
||||
| {% block node_download %}
|
||||
| {% if node.properties.files %}
|
||||
button.btn.btn-default.dropdown-toggle(
|
||||
title="Download HDRI",
|
||||
type="button",
|
||||
data-toggle="dropdown",
|
||||
aria-haspopup="true",
|
||||
aria-expanded="false")
|
||||
i.pi-download
|
||||
| Download
|
||||
i.pi-angle-down.icon-dropdown-menu
|
||||
|
||||
ul.dropdown-menu
|
||||
ul.dropdown-menu
|
||||
| {% for var in node.properties.files %}
|
||||
li
|
||||
a(href="{{ var.file.link }}",
|
||||
title="Download this HDRi format",
|
||||
download)
|
||||
span.length {{ var.file.length | filesizeformat }}
|
||||
|
||||
span.format {{ var.file.format | hide_none }}
|
||||
span.size {{ var.resolution }}
|
||||
|
||||
| {% endfor %}
|
||||
| {% else %}
|
||||
li.btn-group.node-details-meta-list-item.video.download.disabled(
|
||||
title="Download HDRi")
|
||||
button.btn.btn-default.sorry(type="button")
|
||||
i.pi-lock
|
||||
i.pi-download
|
||||
| {% endif %}
|
||||
| {% endif %}
|
||||
| {% endblock node_download %}
|
||||
|
||||
| {% if node.description %}
|
||||
.node-details-description#node-description
|
||||
| {{ node | markdowned('description') }}
|
||||
| {% endif %}
|
||||
| {% block node_comments %}{% endblock %}
|
||||
|
||||
| {% if node.properties.license_notes %}
|
||||
.node-details-meta.license
|
||||
| {{ node.properties.license_notes }}
|
||||
| {% endif %}
|
||||
|
||||
.node-details-meta.footer
|
||||
ul.node-details-meta-list
|
||||
li.node-details-meta-list-item.status
|
||||
| {{ node.properties.status | undertitle }}
|
||||
|
||||
li.node-details-meta-list-item.author
|
||||
| {{ node.user.full_name }}
|
||||
|
||||
li.node-details-meta-list-item.date(title="Created {{ node._created }}")
|
||||
| {{ node._created | pretty_date }}
|
||||
| {% if (node._created | pretty_date) != (node._updated | pretty_date) %}
|
||||
span(title="Updated {{ node._updated }}") (updated {{ node._updated | pretty_date }})
|
||||
| {% endif %}
|
||||
|
||||
|
||||
include ../_scripts
|
||||
|
||||
| {% endblock %}
|
||||
|
||||
| {% block footer_scripts %}
|
||||
| {% block node_scripts %}
|
||||
script(src="{{ url_for('static_pillar', filename='assets/js/vendor/clipboard.min.js')}}")
|
||||
|
||||
script.
|
||||
$('#asset-license').popover();
|
||||
// Generate GA pageview
|
||||
ga('send', 'pageview', location.pathname);
|
||||
|
||||
|
||||
$('.sorry').click(function() {
|
||||
$.get('/403', function(data) {
|
||||
$('#node-overlay').html(data).show().addClass('active');
|
||||
})
|
||||
});
|
||||
|
||||
$('#node-overlay').click(function(){
|
||||
$(this).removeClass('active').hide().html();
|
||||
});
|
||||
|
||||
$().ready(function () {
|
||||
new Clipboard('#copy_yaw', {
|
||||
text: function(trigger) {
|
||||
@ -153,5 +71,4 @@ script.
|
||||
$(e.trigger).flashOnce();
|
||||
});
|
||||
});
|
||||
|
||||
| {% endblock %}
|
||||
| {% endblock node_scripts %}
|
||||
|
@ -1,53 +0,0 @@
|
||||
| {% block body %}
|
||||
|
||||
#node-container
|
||||
|
||||
section.node-details-container.storage
|
||||
|
||||
.node-details-header
|
||||
.node-title
|
||||
| {{node.name}}
|
||||
|
||||
|
||||
section.node-children.storage
|
||||
|
||||
| {% if node.children %}
|
||||
| {% for child in node.children %}
|
||||
|
||||
a(href="#", data-node_id="{{ node._id }}" data-path="{{ child['path'] }}", title="{{ child['name'] }}", class="item_icon")
|
||||
.list-node-children-item
|
||||
.list-node-children-item-thumbnail
|
||||
|
||||
.list-node-children-item-thumbnail-icon
|
||||
| {% if child['content_type'] == 'video' %}
|
||||
i.pi-film
|
||||
| {% elif child['content_type'] == 'image' %}
|
||||
i.pi-image
|
||||
| {% elif child['content_type'] == 'file' %}
|
||||
i.pi-document
|
||||
| {% elif child['content_type'] == 'binary' %}
|
||||
i.pi-file-archive
|
||||
| {% else %}
|
||||
i.pi-folder
|
||||
| {% endif %}
|
||||
|
||||
.list-node-children-item-name
|
||||
|
||||
span {{ child['name'] }}
|
||||
|
||||
| {% endfor %}
|
||||
| {% endif %}
|
||||
|
||||
script.
|
||||
$('a.item_icon').click(function(e){
|
||||
// When clicking on a node preview, we load its content
|
||||
e.preventDefault;
|
||||
var nodeId = $(this).data('node_id');
|
||||
var path = $(this).data('path');
|
||||
displayStorage(nodeId, path);
|
||||
// Update tree with current selection
|
||||
//$('#project_tree').jstree('select_node', 'n_' + nodeId);
|
||||
});
|
||||
|
||||
| {% endblock %}
|
||||
|
@ -1,33 +0,0 @@
|
||||
| {% block body %}
|
||||
|
||||
#node-container
|
||||
|
||||
section.node-details-container.storage
|
||||
|
||||
.node-details-header
|
||||
.node-title
|
||||
| {{node.name}}
|
||||
|
||||
//- .node-details-description
|
||||
//- | {{node.description}}
|
||||
|
||||
.node-details-meta
|
||||
|
||||
ul.node-details-meta-list
|
||||
li.node-details-meta-list-item.status
|
||||
| {{node.status}}
|
||||
|
||||
li.node-details-meta-list-item.date(title="Created {{ node._created | pretty_date }}")
|
||||
| {{ node._updated | pretty_date }}
|
||||
|
||||
li.node-details-meta-list-item.file.length
|
||||
| {{ node.length | filesizeformat }}
|
||||
|
||||
li.node-details-meta-list-item.file.download
|
||||
a(href="{% if node.has_method('GET') %}{{ node.download_link }}{% else %}{{ url_for('users.login') }}{% endif %}")
|
||||
button.btn.btn-default(type="button")
|
||||
| Download
|
||||
|
||||
|
||||
| {% endblock %}
|
||||
|
@ -33,24 +33,23 @@
|
||||
span Public
|
||||
| {% endif %}
|
||||
|
||||
section.node-row.texture-info
|
||||
ul.node-row.texture-info
|
||||
| {% if node.properties.files %}
|
||||
span.texture-info-files
|
||||
li
|
||||
i.pi-texture
|
||||
| {{ node.properties.files|length }} map{% if node.properties.files|length != 1 %}s{% endif %}
|
||||
| {% endif %}
|
||||
span.texture-info-seamless
|
||||
|
||||
li
|
||||
i.pi-puzzle
|
||||
| {% if not node.properties.is_tileable %}Not {% endif %}Seamless
|
||||
| {% if node.has_method('PUT') %}
|
||||
|
||||
| {# Display publishing status only to editors #}
|
||||
span.texture-info-status
|
||||
| {% if node.properties.status == 'published' %}
|
||||
i.pi-laugh
|
||||
| {% else %}
|
||||
i.pi-displeased
|
||||
| {% endif %}
|
||||
| {{ node.properties.status }}
|
||||
| {% if node.has_method('PUT') %}
|
||||
li.status(
|
||||
class="{{ node.properties.status }}",
|
||||
title="Status")
|
||||
| Status: #[strong {{ node.properties.status | undertitle }}]
|
||||
| {% endif %}
|
||||
|
||||
| {% for f in node.properties.files %}
|
||||
|
140
src/templates/nodes/view_base.pug
Normal file
140
src/templates/nodes/view_base.pug
Normal file
@ -0,0 +1,140 @@
|
||||
| {% block body %}
|
||||
#node-container
|
||||
#node-overlay
|
||||
|
||||
| {% block node_preview %}
|
||||
| {% if node.picture %}
|
||||
| {% if current_user.has_cap('subscriber') %}
|
||||
section#node-preview.node-preview.image.js-node-preview-image
|
||||
img.node-preview-thumbnail#node-preview-thumbnail(
|
||||
src="{{ node.picture.thumbnail('l', api=api) }}")
|
||||
| {% else %}
|
||||
| {% include 'nodes/custom/_node_preview_forbidden.html' %}
|
||||
| {% endif %}
|
||||
| {% endif %}
|
||||
| {% endblock node_preview %}
|
||||
|
||||
| {% block node_details %}
|
||||
section.node-details-container
|
||||
|
||||
| {# NAME #}
|
||||
.node-details-header
|
||||
.node-title#node-title
|
||||
| {{node.name}}
|
||||
|
||||
|
||||
| {# DESCRIPTION #}
|
||||
| {% if node.description %}
|
||||
.node-details-description#node-description
|
||||
| {{ node | markdowned('description') }}
|
||||
| {% endif %}
|
||||
|
||||
|
||||
| {# LICENSE #}
|
||||
| {% if node.properties.license_type %}
|
||||
a.node-details-license(
|
||||
href="https://creativecommons.org/licenses/",
|
||||
target="_blank")
|
||||
span.type
|
||||
i(class="pi-license-{{ node.properties.license_type }}")
|
||||
| License <span>{{ node.properties.license_type }}</span>
|
||||
| {% if node.properties.license_notes %}
|
||||
| — {{ node.properties.license_notes }}
|
||||
| {% endif %}
|
||||
| {% endif %}
|
||||
|
||||
|
||||
| {# DETAILS #}
|
||||
.node-details-meta
|
||||
ul
|
||||
| {% if node.has_method('PUT') and (node.properties.status != 'published') %}
|
||||
li(class="status-{{ node.properties.status }}")
|
||||
| {{ node.properties.status | undertitle }}
|
||||
| {% endif %}
|
||||
|
||||
li(title="Author")
|
||||
| {{ node.user.full_name }}
|
||||
|
||||
li.dim(
|
||||
title="Created {{ node._created }} (updated {{ node._updated | pretty_date_time }})")
|
||||
| {{ node._created | pretty_date }}
|
||||
|
||||
| {% if node.short_link %}
|
||||
li.shared
|
||||
a(href="{{ node.short_link }}")
|
||||
i.pi-share
|
||||
| Shared
|
||||
| {% endif %}
|
||||
|
||||
li.left-side
|
||||
|
||||
| {% if node.file %}
|
||||
li.dim(title="File size")
|
||||
| {{ node.file.length | filesizeformat }}
|
||||
li.dim.js-type(title="File format")
|
||||
| {{ node.file.content_type }}
|
||||
| {% endif %}
|
||||
|
||||
| {% if node.permissions.world %}
|
||||
li.public(
|
||||
data-toggle="tooltip",
|
||||
data-placement="bottom",
|
||||
title="Anybody can download. Share it!")
|
||||
i.pi-lock-open
|
||||
span Public
|
||||
| {% endif %}
|
||||
|
||||
| {% block node_details_meta_extra %}{% endblock %}
|
||||
|
||||
li.download
|
||||
| {% if (current_user.has_cap('subscriber') or node.permissions.world) and (node.file or node.properties.files) %}
|
||||
| {% block node_download %}
|
||||
a(
|
||||
title="Download {{ node.properties.content_type | undertitle }}",
|
||||
href="{{ node.file.link }}",
|
||||
download="{{ node.file.filename }}")
|
||||
button.btn(type="button")
|
||||
i.pi-download
|
||||
| Download
|
||||
| {% endblock node_download %}
|
||||
|
||||
| {% elif current_user.has_cap('can-renew-subscription') %}
|
||||
a.btn.btn-success(
|
||||
title="Renew your subscription to download",
|
||||
target="_blank",
|
||||
href="/renew")
|
||||
i.pi-heart
|
||||
| Renew Subscription
|
||||
|
||||
| {% elif current_user.is_authenticated %}
|
||||
.btn.disabled
|
||||
i.pi-lock
|
||||
| Download
|
||||
|
||||
| {% else %}
|
||||
a.btn(
|
||||
title="Login to download {{ node.properties.content_type | undertitle }}",
|
||||
href="{{ url_for('users.login') }}")
|
||||
i.pi-lock
|
||||
| Download
|
||||
| {% endif %}
|
||||
|
||||
| {% endblock node_details %}
|
||||
|
||||
| {% block node_comments %}
|
||||
#comments-embed
|
||||
.comments-list-loading
|
||||
i.pi-spin
|
||||
| {% endblock node_comments %}
|
||||
|
||||
| {% include 'nodes/custom/_scripts.html' %}
|
||||
|
||||
| {% endblock %}
|
||||
|
||||
|
||||
| {% block node_scripts %}{% endblock %}
|
||||
| {% block footer_scripts %}
|
||||
script.
|
||||
// Generate analytics pageview
|
||||
ga('send', 'pageview', location.pathname);
|
||||
| {% endblock %}
|
@ -22,17 +22,6 @@
|
||||
| {% endif %}
|
||||
|
||||
section.node-details-container.project
|
||||
|
||||
| {# Hide for now
|
||||
.node-details-header
|
||||
.node-title-details
|
||||
.date(title="Last updated {{ project._updated | pretty_date }}") {{ project._created | pretty_date }}
|
||||
|
||||
| {% if project.status %}
|
||||
.status {{project.status}}
|
||||
| {% endif %}
|
||||
| #}
|
||||
|
||||
.node-details-title
|
||||
h1
|
||||
a(href="{{ url_for( 'projects.view', project_url=project.url) }}") {{ project.name }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user