This repository has been archived by the owner on Mar 18, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
COM-20065: Implement card view for bundle list
- Loading branch information
Showing
5 changed files
with
117 additions
and
109 deletions.
There are no files selected for viewing
67 changes: 21 additions & 46 deletions
67
app/Resources/views/themes/ezplatform/line/bundle_card.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,29 @@ | ||
<div class="bundle-card-line-container{% if extra.page is defined %} page-{{ extra.page }}{% endif %}"> | ||
<div class="bundle-card-line"> | ||
<div class="bundle-card-line-data"> | ||
<div class="bundle-card-line-information"> | ||
<h2> | ||
{{ ez_render_field(content, 'bundle_id') }} | ||
</h2> | ||
<div class="bundle-card-line-description"> | ||
{{ ez_render_field(content, 'description') }} | ||
</div> | ||
</div> | ||
<div class="bundle-card-line-counters"> | ||
<ul> | ||
<li class="downloads"><i class="fa fa-cloud-download" aria-hidden="true"></i> {{ ez_field_value(content, 'downloads') }}</li> | ||
<li class="stars"><i class="fa fa-star" aria-hidden="true"></i> {{ ez_field_value(content, 'stars') }}</li> | ||
<li class="forks"><i class="fa fa-code-fork" aria-hidden="true"></i> {{ ez_field_value(content, 'forks') }}</li> | ||
<li class="updated"><i class="fa fa-clock-o" aria-hidden="true"></i> {{ ez_field_value(content, 'updated')|date("d/m/Y") }}</li> | ||
</ul> | ||
</div> | ||
<div class="bundle-card-line-authors"> | ||
<div class="bundle-card-line-owner"> | ||
{% if packageDetails.authorAvatarUrl is defined and packageDetails.author[0] is defined and packageDetails.author[0].name is defined %} | ||
<span>Owner:</span> | ||
<a href="{{ ez_field_value(content, 'packagist_url') }}" title="See on Packagist.org"> | ||
<div class="bundle-card-line"> | ||
<div class="bundle-card-line-data"> | ||
<div class="bundle-card-line-authors"> | ||
<div class="bundle-card-line-owner"> | ||
{% if packageDetails.authorAvatarUrl is defined and packageDetails.author is defined and packageDetails.author.name is defined %} | ||
<div class="bundle-card-line-owner-photo"> | ||
<img src="{{ packageDetails.authorAvatarUrl }}?s=100" alt="{{ packageDetails.author[0].name }}" /> | ||
<img src="{{ packageDetails.authorAvatarUrl }}?s=100" alt="{{ packageDetails.author.name }}" /> | ||
</div> | ||
<div class="bundle-card-line-owner-name">{{ packageDetails.author[0].name|truncate(20, true) }}</div> | ||
{% endif %} | ||
</div> | ||
{% if packageDetails.maintainers is defined %} | ||
<div class="bundle-card-line-maintainers"> | ||
<span>Maintainers:</span> | ||
{% for maintainer in packageDetails.maintainers|slice(0, 3) %} | ||
<div class="bundle-card-line-maintainer"> | ||
<div class="bundle-card-line-maintainer-photo"> | ||
<img src="{{ maintainer.avatarUrl }}&s=40" /> | ||
<div class="bundle-card-line-owner-name"> | ||
<span class="bundle-card-line-owner-label">Made by:</span> | ||
<span class="bundle-card-line-owner-author">{{ packageDetails.author.name|truncate(20, true) }}</span> | ||
</div> | ||
<div class="bundle-card-line-maintainer-username">{{ maintainer.name }}</div> | ||
</div> | ||
{% endfor %} | ||
{% if packageDetails.maintainers|length > 3 %} | ||
<div class="bundle-card-line-contributors-more"> | ||
<a href="{{ ez_field_value(content, 'packagist_url') }}" title="See on Packagist.org">+{{ packageDetails.maintainers|length - 3 }} more</a> | ||
</div> | ||
{% endif %} | ||
{% endif %} | ||
</div> | ||
</div> | ||
<div class="bundle-card-line-information"> | ||
<h2> | ||
{{ ez_render_field(content, 'bundle_id') }} | ||
</h2> | ||
<div class="bundle-card-line-description"> | ||
{{ ez_render_field(content, 'description') }} | ||
</div> | ||
</div> | ||
{% endif %} | ||
</div> | ||
</div> | ||
<div class="bundle-card-line-href"> | ||
<a href="{{ ez_field_value(content, 'packagist_url') }}" title="See on Packagist.org"><i class="fa fa-angle-right fa-3" aria-hidden="true"></i></a> | ||
</div> | ||
</div> | ||
</a> | ||
</div> |
54 changes: 54 additions & 0 deletions
54
app/Resources/views/themes/ezplatform/line/bundle_card_old.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<div class="bundle-card-line-container{% if extra.page is defined %} page-{{ extra.page }}{% endif %}"> | ||
<div class="bundle-card-line"> | ||
<div class="bundle-card-line-data"> | ||
<div class="bundle-card-line-information"> | ||
<h2> | ||
{{ ez_render_field(content, 'bundle_id') }} | ||
</h2> | ||
<div class="bundle-card-line-description"> | ||
{{ ez_render_field(content, 'description') }} | ||
</div> | ||
</div> | ||
<div class="bundle-card-line-counters"> | ||
<ul> | ||
<li class="downloads"><i class="fa fa-cloud-download" aria-hidden="true"></i> {{ ez_field_value(content, 'downloads') }}</li> | ||
<li class="stars"><i class="fa fa-star" aria-hidden="true"></i> {{ ez_field_value(content, 'stars') }}</li> | ||
<li class="forks"><i class="fa fa-code-fork" aria-hidden="true"></i> {{ ez_field_value(content, 'forks') }}</li> | ||
<li class="updated"><i class="fa fa-clock-o" aria-hidden="true"></i> {{ ez_field_value(content, 'updated')|date("d/m/Y") }}</li> | ||
</ul> | ||
</div> | ||
<div class="bundle-card-line-authors"> | ||
<div class="bundle-card-line-owner"> | ||
{% if packageDetails.authorAvatarUrl is defined and packageDetails.author[0] is defined and packageDetails.author[0].name is defined %} | ||
<span>Owner:</span> | ||
<div class="bundle-card-line-owner-photo"> | ||
<img src="{{ packageDetails.authorAvatarUrl }}?s=100" alt="{{ packageDetails.author[0].name }}" /> | ||
</div> | ||
<div class="bundle-card-line-owner-name">{{ packageDetails.author[0].name|truncate(20, true) }}</div> | ||
{% endif %} | ||
</div> | ||
{% if packageDetails.maintainers is defined %} | ||
<div class="bundle-card-line-maintainers"> | ||
<span>Maintainers:</span> | ||
{% for maintainer in packageDetails.maintainers|slice(0, 3) %} | ||
<div class="bundle-card-line-maintainer"> | ||
<div class="bundle-card-line-maintainer-photo"> | ||
<img src="{{ maintainer.avatarUrl }}&s=40" /> | ||
</div> | ||
<div class="bundle-card-line-maintainer-username">{{ maintainer.name }}</div> | ||
</div> | ||
{% endfor %} | ||
{% if packageDetails.maintainers|length > 3 %} | ||
<div class="bundle-card-line-contributors-more"> | ||
<a href="{{ ez_field_value(content, 'packagist_url') }}" title="See on Packagist.org">+{{ packageDetails.maintainers|length - 3 }} more</a> | ||
</div> | ||
{% endif %} | ||
</div> | ||
{% endif %} | ||
</div> | ||
</div> | ||
<div class="bundle-card-line-href"> | ||
<a href="{{ ez_field_value(content, 'packagist_url') }}" title="See on Packagist.org"><i class="fa fa-angle-right fa-3" aria-hidden="true"></i></a> | ||
</div> | ||
</div> | ||
</div> |
24 changes: 14 additions & 10 deletions
24
app/Resources/views/themes/ezplatform/parts/bundle_list/list.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
{% set extraParams = extraParams is defined ? extraParams %} | ||
{% if items|length %} | ||
{% for card in items %} | ||
{{ render(controller('ez_content:viewAction', { | ||
'locationId': card.bundle.valueObject.versionInfo.contentInfo.mainLocationId, | ||
'viewType': viewType, | ||
'params': { | ||
'extra': extraParams, | ||
'packageDetails': card.packageDetails | ||
} | ||
})) }} | ||
{% endfor %} | ||
<div class="row"> | ||
{% for card in items %} | ||
<div class="col-md-4 col-xs-12"> | ||
{{ render(controller('ez_content:viewAction', { | ||
'locationId': card.bundle.valueObject.versionInfo.contentInfo.mainLocationId, | ||
'viewType': viewType, | ||
'params': { | ||
'extra': extraParams, | ||
'packageDetails': card.packageDetails | ||
} | ||
})) }} | ||
</div> | ||
{% endfor %} | ||
</div> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters