Homepage: Style comments

This commit is contained in:
2018-09-17 12:16:52 +02:00
parent bb2c351460
commit 0556c5ae9a
2 changed files with 117 additions and 148 deletions

View File

@@ -251,29 +251,6 @@ section.stream
padding: 1px 5px padding: 1px 5px
margin-right: 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 section.random-asset
border-bottom: thin solid $color-background-dark border-bottom: thin solid $color-background-dark

View File

@@ -51,147 +51,145 @@ meta(name="twitter:image", content="{% if main_project.picture_header %}{{ main_
| RSS Feed | RSS Feed
.col-md-3.col-xl-2 .col-md-3.col-xl-2
.dashboard-sidebar section.pt-3
section.pt-3 h6.title-underline In Production
h6.title-underline In Production a(href="/p/spring/")
a(href="/p/spring/") img(src="{{ url_for('static', filename='assets/img/projects/spring_450x150.jpg')}}")
img(src="{{ url_for('static', filename='assets/img/projects/spring_450x150.jpg')}}")
p.text-muted.pt-2. 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]. A poetic short film about a mountain spirit and her wise little dog. #[a(href="/p/spring/") Check it out].
section.stream.py-3 section.stream.py-3
h6.title-underline Latest Assets h6.title-underline Latest Assets
| {% if activity_stream %} | {% if activity_stream %}
.card-padless.p-2 .card-padless.p-2
| {% for child in activity_stream %} | {% for child in activity_stream %}
| {% if child.node_type not in ['comment'] %} | {% if child.node_type not in ['comment'] %}
| {{ asset_list_item(child, current_user) }} | {{ asset_list_item(child, current_user) }}
| {% endif %}
| {% endfor %}
| {% else %}
.card
.card-body
h6.card-title
| No assets.
| {% endif %} | {% endif %}
| {% endfor %}
| {% else %}
.card
.card-body
h6.card-title
| No assets.
| {% endif %}
section.random-asset.py-3 section.random-asset.py-3
h6.title-underline h6.title-underline
a(href="/search") Explore the Cloud a.text-muted(href="{{ url_for('main.nodes_search_index') }}") Explore the Cloud
.pb-3.text-muted Random selection of the best assets & tutorials .pb-3.text-muted Random selection of the best assets & tutorials
ul.random-asset__list.list-unstyled ul.random-asset__list.list-unstyled
| {% for n in random_featured %} | {% for n in random_featured %}
| {% if n.picture and loop.first %} | {% if n.picture and loop.first %}
li.random-asset__list-item.project li.random-asset__list-item.project
| {% if n.project.picture_square %} | {% if n.project.picture_square %}
a.random-asset__list-thumbnail( a.random-asset__list-thumbnail(
href="{{ n.project.url }}") href="{{ n.project.url }}")
img.image(src="{{ n.project.picture_square.thumbnail('s', api=api) }}") 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 %} | {% 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 li.random-asset__list-item.featured
| {% if n.permissions.world %} | {% if n.permissions.world %}
.ribbon .ribbon
span FREE 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 %} | {% 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' %} | {% endif %}
i.pi-play
| {% 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 }}") li
| {{ n.name }} | {% 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 ul.list-unstyled.d-flex.text-muted
li.what li.what
a(href="{{ n.url }}") 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 li.where
a(href="{{ n.project.url }}") a(href="{{ n.project.url }}") {{ n.project.name }}
| {{ n.project.name }}
| {% else %}
li | {% endif %}
| {% if n.permissions.world %} | {% endfor %}
.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 }}
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 %} | {% endif %}
| {% endfor %}
.d-flex.align-items-baseline
small.pr-2.font-weight-bold {{ n.user.full_name }}
section.comments.py-3 a.text-muted(href="{{ n.url }}", title="{{ n._created }}")
h6.title-underline Latest Comments small {{ n._created | pretty_date }}
| {% endfor %}
ul.list-unstyled | {% else %}
| {% if latest_comments %} span
| {% for n in latest_comments %} | No comments... yet!
li(
class="{{ n.node_type }}",
data-url="{{ n.url }}")
a.comment-content(href="{{ n.url }}") | {% endif %}
| {{ 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 %}
| {% endblock %} | {% endblock %}
@@ -201,16 +199,10 @@ script.
$(function () { $(function () {
/* cleanup mentions in comments */ /* cleanup mentions in comments */
$('.comment-content').each(function(){ $('.js-comment-content').each(function(){
$(this).text($(this).text().replace(/\*|\@|\<(.*?)\>/g, '')); $(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 hopToTop(); // Display jump to top button
}); });
| {% endblock %} | {% endblock %}