Asset list item: Don't show user.full_name in latest and random assets
This commit is contained in:
@@ -29,7 +29,6 @@ def latest_nodes(db_filter, projection, limit):
|
|||||||
proj = {
|
proj = {
|
||||||
'_created': 1,
|
'_created': 1,
|
||||||
'_updated': 1,
|
'_updated': 1,
|
||||||
'user.full_name': 1,
|
|
||||||
'project._id': 1,
|
'project._id': 1,
|
||||||
'project.url': 1,
|
'project.url': 1,
|
||||||
'project.name': 1,
|
'project.name': 1,
|
||||||
@@ -81,7 +80,7 @@ def latest_assets():
|
|||||||
def latest_comments():
|
def latest_comments():
|
||||||
latest = latest_nodes({'node_type': 'comment',
|
latest = latest_nodes({'node_type': 'comment',
|
||||||
'properties.status': 'published'},
|
'properties.status': 'published'},
|
||||||
{'parent': 1,
|
{'parent': 1, 'user.full_name': 1,
|
||||||
'properties.content': 1, 'node_type': 1,
|
'properties.content': 1, 'node_type': 1,
|
||||||
'properties.status': 1,
|
'properties.status': 1,
|
||||||
'properties.is_reply': 1},
|
'properties.is_reply': 1},
|
||||||
|
@@ -48,9 +48,17 @@ a.card.asset.card-image-fade.pr-0.mx-0.mb-2(
|
|||||||
| {{ asset.name | hide_none }}
|
| {{ asset.name | hide_none }}
|
||||||
|
|
||||||
ul.card-text.list-unstyled.d-flex.text-black-50.mt-auto.mb-0.text-truncate
|
ul.card-text.list-unstyled.d-flex.text-black-50.mt-auto.mb-0.text-truncate
|
||||||
li.pr-2.font-weight-bold {{ node_type | undertitle | hide_none }}
|
| {% if node_type %}
|
||||||
li.pr-2.text-truncate {{ asset.project.name | hide_none }}
|
li.pr-2.font-weight-bold {{ node_type | undertitle }}
|
||||||
li.pr-2.text-truncate {{ asset.user.full_name | hide_none }}
|
| {% endif %}
|
||||||
li.text-truncate {{ asset._created | pretty_date | hide_none }}
|
| {% if asset.project.name %}
|
||||||
|
li.pr-2.text-truncate {{ asset.project.name }}
|
||||||
|
| {% endif %}
|
||||||
|
| {% if asset.user.full_name %}
|
||||||
|
li.pr-2.text-truncate {{ asset.user.full_name }}
|
||||||
|
| {% endif %}
|
||||||
|
| {% if asset._created %}
|
||||||
|
li.text-truncate {{ asset._created | pretty_date }}
|
||||||
|
| {% endif %}
|
||||||
|
|
||||||
| {% endmacro %}
|
| {% endmacro %}
|
||||||
|
@@ -145,6 +145,7 @@ class LatestAssetsTest(AbstractPillarTest):
|
|||||||
asset = latest_assets[0]
|
asset = latest_assets[0]
|
||||||
self.assertEquals(str(ok_id), asset['_id'])
|
self.assertEquals(str(ok_id), asset['_id'])
|
||||||
self.assertEquals('Just a node name', asset['name'])
|
self.assertEquals('Just a node name', asset['name'])
|
||||||
|
self.assertNotIn('user', asset)
|
||||||
|
|
||||||
|
|
||||||
class LatestCommentsTest(AbstractPillarTest):
|
class LatestCommentsTest(AbstractPillarTest):
|
||||||
@@ -301,3 +302,4 @@ class LatestCommentsTest(AbstractPillarTest):
|
|||||||
self.assertEquals(str(ok_id), comment['_id'])
|
self.assertEquals(str(ok_id), comment['_id'])
|
||||||
self.assertEquals('Comment', comment['name'])
|
self.assertEquals('Comment', comment['name'])
|
||||||
self.assertEquals('एनिमेशन is animation in Hindi', comment['properties']['content'])
|
self.assertEquals('एनिमेशन is animation in Hindi', comment['properties']['content'])
|
||||||
|
self.assertEquals('คนรักของผัดไทย', comment['user']['full_name'])
|
||||||
|
Reference in New Issue
Block a user