Skip to content

Commit

Permalink
Merge pull request #753 from euphorie/scrum-2333-certificate-columns-2
Browse files Browse the repository at this point in the history
Certificates overview: set CSS class according to number of items
  • Loading branch information
ale-rt committed Jul 17, 2024
2 parents a62e29f + 0752957 commit d4a54e7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Changelog
- Fix the last modifier id for guest users that have been converted to registered users
[ale-rt]

- Adjusted column layout for certificates overview
[reinhardt]


16.2.0 (2024-06-12)
-------------------
Expand Down
3 changes: 3 additions & 0 deletions src/euphorie/client/browser/certificate.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,6 @@ def certificates(self):
year_certificates, key=lambda c: c["date"], reverse=True
)
return certificates.items()

def get_num_columns(self, num_items):
return 2 if num_items < 3 else 3
3 changes: 2 additions & 1 deletion src/euphorie/client/browser/templates/certificates.pt
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@
<tal:year tal:define="
year python:item[0];
sessions python:item[1];
num_columns python: view.get_num_columns(len(sessions));
">
<h2 class="separation-title">
${year}
</h2>
<div class="certificate-overview col-3">
<div class="certificate-overview col-${num_columns}">
<tal:session tal:repeat="info sessions">
<figure class="certificate-preview">
<a class="certificate pat-auto-scale pat-inject"
Expand Down

0 comments on commit d4a54e7

Please sign in to comment.