diff --git a/src/styles/_homepage.sass b/src/styles/_homepage.sass index 0376603..72d1d5b 100644 --- a/src/styles/_homepage.sass +++ b/src/styles/_homepage.sass @@ -251,29 +251,6 @@ section.stream padding: 1px 5px margin-right: 5px -section.comments - padding: 0 15px 5px - - ul - padding: 0 - - > ul - list-style-type: none - margin: 10px 0 0 - - > li - +text-overflow-ellipsis - border-top: thin solid $color-background-dark - padding: 10px 0 - - &:first-child - border: none - - > a - +text-overflow-ellipsis - color: $color-text - display: block - padding-bottom: 5px section.random-asset border-bottom: thin solid $color-background-dark diff --git a/src/templates/homepage.pug b/src/templates/homepage.pug index 8ebf7e0..8f14ef6 100644 --- a/src/templates/homepage.pug +++ b/src/templates/homepage.pug @@ -51,147 +51,145 @@ meta(name="twitter:image", content="{% if main_project.picture_header %}{{ main_ | RSS Feed .col-md-3.col-xl-2 - .dashboard-sidebar - section.pt-3 - h6.title-underline In Production - a(href="/p/spring/") - img(src="{{ url_for('static', filename='assets/img/projects/spring_450x150.jpg')}}") + section.pt-3 + h6.title-underline In Production + a(href="/p/spring/") + img(src="{{ url_for('static', filename='assets/img/projects/spring_450x150.jpg')}}") - p.text-muted.pt-2. - A poetic short film about a mountain spirit and her wise little dog. #[a(href="/p/spring/") Check it out]. + p.text-muted.pt-2. + A poetic short film about a mountain spirit and her wise little dog. #[a(href="/p/spring/") Check it out]. - section.stream.py-3 - h6.title-underline Latest Assets + section.stream.py-3 + h6.title-underline Latest Assets - | {% if activity_stream %} - .card-padless.p-2 - | {% for child in activity_stream %} - | {% if child.node_type not in ['comment'] %} - | {{ asset_list_item(child, current_user) }} - | {% endif %} - | {% endfor %} - | {% else %} - .card - .card-body - h6.card-title - | No assets. + | {% if activity_stream %} + .card-padless.p-2 + | {% for child in activity_stream %} + | {% if child.node_type not in ['comment'] %} + | {{ asset_list_item(child, current_user) }} | {% endif %} + | {% endfor %} + | {% else %} + .card + .card-body + h6.card-title + | No assets. + | {% endif %} - section.random-asset.py-3 - h6.title-underline - a(href="/search") Explore the Cloud - .pb-3.text-muted Random selection of the best assets & tutorials + section.random-asset.py-3 + h6.title-underline + a.text-muted(href="{{ url_for('main.nodes_search_index') }}") Explore the Cloud + .pb-3.text-muted Random selection of the best assets & tutorials - ul.random-asset__list.list-unstyled - | {% for n in random_featured %} - | {% if n.picture and loop.first %} - li.random-asset__list-item.project - | {% if n.project.picture_square %} - a.random-asset__list-thumbnail( - href="{{ n.project.url }}") - img.image(src="{{ n.project.picture_square.thumbnail('s', api=api) }}") + ul.random-asset__list.list-unstyled + | {% for n in random_featured %} + | {% if n.picture and loop.first %} + li.random-asset__list-item.project + | {% if n.project.picture_square %} + a.random-asset__list-thumbnail( + href="{{ n.project.url }}") + img.image(src="{{ n.project.picture_square.thumbnail('s', api=api) }}") + | {% endif %} + .random-asset__list-details + a.title(href="{{ n.project.url }}") {{ n.project.name }} + | {% if n.project.summary %} + ul.list-unstyled.d-flex.text-muted + li.what + a(href="{{ n.project.url }}") {{ n.project.summary }} | {% endif %} - .random-asset__list-details - a.title(href="{{ n.project.url }}") {{ n.project.name }} - | {% if n.project.summary %} - ul.list-unstyled.d-flex.text-muted - li.what - a(href="{{ n.project.url }}") {{ n.project.summary }} - | {% endif %} - li.random-asset__list-item.featured - | {% if n.permissions.world %} - .ribbon - span FREE + li.random-asset__list-item.featured + | {% if n.permissions.world %} + .ribbon + span FREE + | {% endif %} + a.random-asset__thumbnail( + href="{{ n.url }}", + class="{{ n.properties.content_type }}") + | {% if n.picture %} + img(src="{{ n.picture.thumbnail('l', api=api) }}") + + | {% if n.properties.content_type == 'video' %} + i.pi-play | {% endif %} - a.random-asset__thumbnail( - href="{{ n.url }}", - class="{{ n.properties.content_type }}") - | {% if n.picture %} - img(src="{{ n.picture.thumbnail('l', api=api) }}") - | {% if n.properties.content_type == 'video' %} - i.pi-play - | {% endif %} + | {% endif %} - | {% endif %} + a.title(href="{{ n.url }}") + | {{ n.name }} + ul.list-unstyled.d-flex.text-muted + li.what + a(href="{{ n.url }}") + | {% if n.properties.content_type %}{{ n.properties.content_type | undertitle }}{% else %}Folder{% endif %} + li.where + a(href="{{ n.project.url }}") + | {{ n.project.name }} + | {% else %} - a.title(href="{{ n.url }}") - | {{ n.name }} + li + | {% if n.permissions.world %} + .ribbon + span FREE + | {% endif %} + a.random-asset__list-thumbnail( + href="{{ n.url }}", + class="{{ n.properties.content_type }}") + | {% if n.picture %} + img.image(src="{{ n.picture.thumbnail('s', api=api) }}") + | {% else %} + | {% if n.properties.content_type == 'video' %} + i.pi-film-thick + | {% elif n.properties.content_type == 'image' %} + i.pi-picture + | {% elif n.properties.content_type == 'file' %} + i.pi-file-archive + | {% else %} + i.pi-folder + | {% endif %} + | {% endif %} + .random-asset__list-details + a.title(href="{{ n.url }}") {{ n.name }} ul.list-unstyled.d-flex.text-muted li.what a(href="{{ n.url }}") - | {% if n.properties.content_type %}{{ n.properties.content_type | undertitle }}{% else %}Folder{% endif %} + | {% if n.properties.content_type %}{{ n.properties.content_type }}{% else %}Folder{% endif %} li.where - a(href="{{ n.project.url }}") - | {{ n.project.name }} - | {% else %} + a(href="{{ n.project.url }}") {{ n.project.name }} - li - | {% if n.permissions.world %} - .ribbon - span FREE - | {% endif %} - a.random-asset__list-thumbnail( - href="{{ n.url }}", - class="{{ n.properties.content_type }}") - | {% if n.picture %} - img.image(src="{{ n.picture.thumbnail('s', api=api) }}") - | {% else %} - | {% if n.properties.content_type == 'video' %} - i.pi-film-thick - | {% elif n.properties.content_type == 'image' %} - i.pi-picture - | {% elif n.properties.content_type == 'file' %} - i.pi-file-archive - | {% else %} - i.pi-folder - | {% endif %} - | {% endif %} - .random-asset__list-details - a.title(href="{{ n.url }}") {{ n.name }} - ul.list-unstyled.d-flex.text-muted - li.what - a(href="{{ n.url }}") - | {% if n.properties.content_type %}{{ n.properties.content_type }}{% else %}Folder{% endif %} - li.where - a(href="{{ n.project.url }}") {{ n.project.name }} + | {% endif %} + | {% endfor %} + + section.py-3 + h6.title-underline Latest Comments + + ul.list-unstyled + | {% if latest_comments %} + | {% for n in latest_comments %} + li.pb-2.mb-2.border-bottom.text-truncate + + a.js-comment-content.text-muted(href="{{ n.url }}") + | {{ n.properties.content | striptags | truncate(200) }} + + | {% if n.attached_to %} + .d-flex.align-items-baseline + a.text-muted.text-truncate(href="{{ n.attached_to.url }}") + small.pr-2.font-weight-bold {{ n.project.name }} + small {{ n.attached_to.name }} | {% endif %} - | {% endfor %} + .d-flex.align-items-baseline + small.pr-2.font-weight-bold {{ n.user.full_name }} - section.comments.py-3 - h6.title-underline Latest Comments + a.text-muted(href="{{ n.url }}", title="{{ n._created }}") + small {{ n._created | pretty_date }} + | {% endfor %} - ul.list-unstyled - | {% if latest_comments %} - | {% for n in latest_comments %} - li( - class="{{ n.node_type }}", - data-url="{{ n.url }}") + | {% else %} + span + | No comments... yet! - a.comment-content(href="{{ n.url }}") - | {{ n.properties.content | striptags | truncate(200) }} - - ul.list-unstyled.d-flex.text-muted - li.who {{ n.user.full_name }} - | {% if n.attached_to %} - - li.where-parent - a(href="{{ n.attached_to.url }}") {{ n.attached_to.name }} - | {% endif %} - - li.when - a(href="{{ n.url }}", title="{{ n._created }}") - | {{ n._created | pretty_date_time }} - | {% endfor %} - - | {% else %} - li.activity-stream__list-item.empty#activity-stream__empty - | No comments... yet! - - | {% endif %} + | {% endif %} | {% endblock %} @@ -201,16 +199,10 @@ script. $(function () { /* cleanup mentions in comments */ - $('.comment-content').each(function(){ + $('.js-comment-content').each(function(){ $(this).text($(this).text().replace(/\*|\@|\<(.*?)\>/g, '')); }); - /* Click on the whole asset/comment row to go */ - $('.activity-stream__list li, .comments ul li').click(function(e){ - window.location.href = $(this).data('url'); - $(this).addClass('active'); - }); - hopToTop(); // Display jump to top button }); | {% endblock %}