Skip to content
Snippets Groups Projects
Commit bf7b134e authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

return to template-based profiles definitions

This make adding new profiles easier. In addition, CSV output is now
generated through a template, making Text::CSV usage obsolete.
parent 067ca53a
No related branches found
No related tags found
No related merge requests found
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
<div class="accounts row"> <div class="accounts row">
[% FOREACH account IN accounts %] [% FOREACH account IN accounts %]
[% template = account.profile() _ '.tt2' %]
[% PROCESS $template scope=account.scope() id=account.id() | trim %]
<div class="small-12 medium-6 large-4 columns"> <div class="small-12 medium-6 large-4 columns">
<div class="account"> <div class="account">
<table> <table>
...@@ -31,7 +33,7 @@ ...@@ -31,7 +33,7 @@
<tr> <tr>
<td colspan="2"> <td colspan="2">
<strong>[% lh.maketext("comment:") %]</strong> <strong>[% lh.maketext("comment:") %]</strong>
<div class="comment">[% lh.maketext(account.comment()) %]</div> <div class="comment">[% lh.maketext(description) %]</div>
</td> </td>
</tr> </tr>
<tr> <tr>
...@@ -56,12 +58,12 @@ ...@@ -56,12 +58,12 @@
<caption>[% lh.maketext("List of user attributes") %]</caption> <caption>[% lh.maketext("List of user attributes") %]</caption>
[% FOREACH attribute IN [ 'cn', 'displayName', 'givenName', 'sn', 'mail', 'schacHomeOrganization', 'schacHomeOrganizationType', 'eduPersonPrincipalName' ] %] [% FOREACH attribute IN [ 'cn', 'displayName', 'givenName', 'sn', 'mail', 'schacHomeOrganization', 'schacHomeOrganizationType', 'eduPersonPrincipalName' ] %]
<tr> <tr>
<th>[% attribute %]</th><td>[% account.$attribute() %]</td> <th>[% attribute %]</th><td>[% attributes.$attribute %]</td>
</tr> </tr>
[% END %] [% END %]
[% FOREACH attribute IN [ 'eduPersonAffiliation', 'eduPersonScopedAffiliation' ] %] [% FOREACH attribute IN [ 'eduPersonAffiliation', 'eduPersonScopedAffiliation' ] %]
<tr> <tr>
<th>[% attribute %]</th><td>[% account.$attribute().join(', ') %]</td> <th>[% attribute %]</th><td>[% attributes.$attribute.join(', ') %]</td>
</tr> </tr>
[% END %] [% END %]
<tr> <tr>
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
<div class="accounts row"> <div class="accounts row">
[% FOREACH account IN accounts %] [% FOREACH account IN accounts %]
[% template = account.profile() _ '.tt2' %]
[% PROCESS $template scope=account.scope() id=account.id() | trim %]
<div class="small-12 medium-6 large-4 columns"> <div class="small-12 medium-6 large-4 columns">
<div class="account"> <div class="account">
<table> <table>
...@@ -33,7 +35,7 @@ ...@@ -33,7 +35,7 @@
<tr> <tr>
<td colspan="2"> <td colspan="2">
<strong>[% lh.maketext("comment:") %]</strong> <strong>[% lh.maketext("comment:") %]</strong>
<div class="comment">[% lh.maketext(account.comment()) %]</div> <div class="comment">[% lh.maketext(description) %]</div>
</td> </td>
</tr> </tr>
<tr> <tr>
...@@ -58,12 +60,12 @@ ...@@ -58,12 +60,12 @@
<caption>[% lh.maketext("List of user attributes") %]</caption> <caption>[% lh.maketext("List of user attributes") %]</caption>
[% FOREACH attribute IN [ 'cn', 'displayName', 'givenName', 'sn', 'mail', 'schacHomeOrganization', 'schacHomeOrganizationType', 'eduPersonPrincipalName' ] %] [% FOREACH attribute IN [ 'cn', 'displayName', 'givenName', 'sn', 'mail', 'schacHomeOrganization', 'schacHomeOrganizationType', 'eduPersonPrincipalName' ] %]
<tr> <tr>
<th>[% attribute %]</th><td>[% account.$attribute() %]</td> <th>[% attribute %]</th><td>[% attributes.$attribute %]</td>
</tr> </tr>
[% END %] [% END %]
[% FOREACH attribute IN [ 'eduPersonAffiliation', 'eduPersonScopedAffiliation' ] %] [% FOREACH attribute IN [ 'eduPersonAffiliation', 'eduPersonScopedAffiliation' ] %]
<tr> <tr>
<th>[% attribute %]</th><td>[% account.$attribute().join(', ') %]</td> <th>[% attribute %]</th><td>[% attributes.$attribute.join(', ') %]</td>
</tr> </tr>
[% END %] [% END %]
<tr> <tr>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment