Skip to content

Fixes styling for civi sepa dashboard - #820

Open
knottheory wants to merge 3 commits into
Project60:masterfrom
knottheory:master
Open

Fixes styling for civi sepa dashboard#820
knottheory wants to merge 3 commits into
Project60:masterfrom
knottheory:master

Conversation

@knottheory

Copy link
Copy Markdown

Added a stylesheet to overwrite the background colour of the civi sepa dashboard. The colour now use the colour danger, warning, info and success colours by the theme and use the original colours as a fallback if no walbrook theme is installed.

Changed the buttons to use the civicrm template from civicrm to align their styling with the rest of Civi. Added styling for the order of those buttons. Added icons to those buttons.

Those changes fix issue #816.

@jensschuppe jensschuppe linked an issue Aug 6, 2026 that may be closed by this pull request

@jensschuppe jensschuppe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please have a look at the PHPStan and PHP_CodeSniffer issues related to the files affected in this PR.

Comment thread css/sepa.css
@@ -0,0 +1,24 @@
.sepa_dashboard str.submit_missed td {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo, should be tr.submit_missed.

Comment thread css/sepa.css
}

.sepa_dashboard .sepa_actions {
display: flex;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the table cell have to be display: flex;? - this actually causes the buttons to grow in height and shouldn't be necessary.

The buttons are inline-block so text-align: right; should be enough.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adresses the table cell containing the buttons. Setting the display property to flex aligns the buttons horizontally instead of vertical. The overall screen space the buttons take up is reduced.
Nonetheless the selector could be more descriptive.

Comment thread css/sepa.css
background-color: var(--crm-layer2-bg-color, #00830033);
}

.sepa_dashboard .sepa_actions {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use BEM conventions for selectors, making this .sepa-dashboard__sepa-actions.

Comment on lines +76 to +82
<th class="sorting" aria-controls="sepa-option">{ts domain="org.project60.sepa"}Group Name{/ts}</th>
<th class="sorting" aria-controls="sepa-option">{ts domain="org.project60.sepa"}Status{/ts}</th>
<th class="sorting" aria-controls="sepa-option">{ts domain="org.project60.sepa"}Type{/ts}</th>
<th class="sorting" aria-controls="sepa-option">{ts domain="org.project60.sepa"}Submission{/ts}</th>
<th class="sorting" aria-controls="sepa-option">{ts domain="org.project60.sepa"}Collection{/ts}</th>
<th class="sorting" aria-controls="sepa-option">{ts domain="org.project60.sepa"}Transactions{/ts}</th>
<th class="sorting" aria-controls="sepa-option">{ts domain="org.project60.sepa"}Total{/ts}</th>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's take the chance getting rid of the domain attribute for translations by wrapping the entire template in {crmScope extensionKey='org.project60.sepa'}…{/crmScope} tags (applies to all occurences of {ts} in this template).

<td>
<a href="{crmURL p="civicrm/sepa/listgroup" q="group_id=$group_id"}" class="button button_view">{ts domain="org.project60.sepa"}Contributions{/ts}</a>
<td class="sepa_actions">
{crmButton href="{crmURL p="civicrm/sepa/listgroup" q="group_id=$group_id"}" class="button_view" title="test" icon="fa-info"}{ts domain="org.project60.sepa"}Contributions{/ts}{/crmButton}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{crmButton} doesn't need the {crmURL} tag, it has its own p attribute for a CiviCRM path.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing it out I have updated the buttons accordingly.

<td>
<a href="{crmURL p="civicrm/sepa/listgroup" q="group_id=$group_id"}" class="button button_view">{ts domain="org.project60.sepa"}Contributions{/ts}</a>
<td class="sepa_actions">
{crmButton href="{crmURL p="civicrm/sepa/listgroup" q="group_id=$group_id"}" class="button_view" title="test" icon="fa-info"}{ts domain="org.project60.sepa"}Contributions{/ts}{/crmButton}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The title attribute seems off.

{if $can_batch}
{if $group.submit == 'missed'}
<a href="{crmURL p="civicrm/sepa/closegroup" q="group_id=$group_id&status=missed"}" class="button button_close">
{crmButton href="{crmURL p="civicrm/sepa/closegroup" q="group_id=$group_id&status=missed"}" class="button_close" title="{ts domain="org.project60.sepa"}Close and Submit{/ts}" icon="fa-paper-plane"}{ts domain="org.project60.sepa"}Close and Submit{/ts}{/crmButton}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Translations within HTML attributes need the escape="htmlattributes" parameter.

Comment thread sepa.php
}
}

function sepa_civicrm_coreResourceList(&$list, $region) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add type hints and the conventional docblock to make PHPStan happy.

@dontub dontub added the status:needs work There is code, but it needs additional work before it should be reviewed label Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:needs work There is code, but it needs additional work before it should be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dashboard Colours not working on Walbrook

3 participants