Improve profile link helper for buefy themes

This commit is contained in:
Lance Edgar 2022-01-29 08:57:03 -06:00
parent cdcb106f2d
commit 1575cad447

View file

@ -2,20 +2,43 @@
<%def name="view_profile_button(person)"> <%def name="view_profile_button(person)">
<div class="buttons"> <div class="buttons">
${h.link_to(person, url('people.view_profile', uuid=person.uuid), class_='button is-primary')} % if use_buefy:
<b-button type="is-primary"
tag="a" href="${url('people.view_profile', uuid=person.uuid)}"
icon-pack="fas"
icon-left="user">
${person}
</b-button>
% else:
${h.link_to(person, url('people.view_profile', uuid=person.uuid), class_='button is-primary')}
% endif
</div> </div>
</%def> </%def>
<%def name="view_profiles_helper(people)"> <%def name="view_profiles_helper(people)">
% if request.has_perm('people.view_profile'): % if request.has_perm('people.view_profile'):
<div class="object-helper"> % if use_buefy:
<h3>Profiles</h3> <nav class="panel">
<div class="object-helper-content"> <p class="panel-heading">Profiles</p>
<p>View full profile for:</p> <div class="panel-block">
% for person in people: <div style="display: flex; flex-direction: column;">
${view_profile_button(person)} <p class="block">View full profile for:</p>
% endfor % for person in people:
</div> ${view_profile_button(person)}
</div> % endfor
</div>
</div>
</nav>
% else:
<div class="object-helper">
<h3>Profiles</h3>
<div class="object-helper-content">
<p>View full profile for:</p>
% for person in people:
${view_profile_button(person)}
% endfor
</div>
</div>
% endif
% endif % endif
</%def> </%def>