-
Notifications
You must be signed in to change notification settings - Fork 47
Fixes styling for civi sepa dashboard #820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 3 commits
8c12559
136bea9
3a8c018
65ea84c
846e140
bc2385f
c22eb21
70994fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| .sepa_dashboard str.submit_missed td { | ||
| background-color: var(--crm-danger-light-color, #EE0000AA); | ||
| } | ||
|
|
||
| .sepa_dashboard tr.submit_urgently td { | ||
| background-color: var(--crm-warning-light-color, #AC6700AA); | ||
| } | ||
|
|
||
| .sepa_dashboard tr.submit_soon td { | ||
| background-color: var(--crm-info-light-color, #0165FFAA); | ||
| } | ||
|
|
||
| .sepa_dashboard tr.submit_later td { | ||
| background-color: var(--crm-success-light-color, #008300AA); | ||
| } | ||
|
|
||
| .sepa_dashboard tr.submit_closed td { | ||
| background-color: var(--crm-layer2-bg-color, #00830033); | ||
| } | ||
|
|
||
| .sepa_dashboard .sepa_actions { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's use BEM conventions for selectors, making this
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have updated the class name following BEM conventions and renamed it to sepa_dashboard__button_group to make more descriptive. |
||
| display: flex; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does the table cell have to be The buttons are
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| justify-content: end; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -599,3 +599,10 @@ function sepa_civicrm_xmlMenu(array &$files): void { | |
| $files[] = $file; | ||
| } | ||
| } | ||
|
|
||
| function sepa_civicrm_coreResourceList(&$list, $region) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The type hints have been added. |
||
| if ($region === 'html-header') { | ||
| Civi::resources()->addStyleFile('org.project60.sepa', 'css/sepa.css'); | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,17 +70,19 @@ | |
| </div> | ||
| {/if} | ||
|
|
||
| <table> | ||
| <tr> | ||
| <th>{ts domain="org.project60.sepa"}Group Name{/ts}</th> | ||
| <th>{ts domain="org.project60.sepa"}Status{/ts}</th> | ||
| <th>{ts domain="org.project60.sepa"}Type{/ts}</th> | ||
| <th>{ts domain="org.project60.sepa"}Submission{/ts}</th> | ||
| <th>{ts domain="org.project60.sepa"}Collection{/ts}</th> | ||
| <th>{ts domain="org.project60.sepa"}Transactions{/ts}</th> | ||
| <th>{ts domain="org.project60.sepa"}Total{/ts}</th> | ||
| <th></th> | ||
| </tr> | ||
| <table class="sepa_dashboard" id="options"> | ||
| <thead> | ||
| <tr role="row"> | ||
| <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> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's take the chance getting rid of the
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have added the crmScpoe tag and removed domain attributes from translation tags. |
||
| <th></th> | ||
| </tr> | ||
| </thead> | ||
| {foreach from=$groups item=group} | ||
| {assign var='file_id' value=$group.file_id} | ||
| {assign var='group_id' value=$group.id} | ||
|
|
@@ -105,27 +107,26 @@ | |
| {$group.nb_contrib} | ||
| </td> | ||
| <td style="white-space:nowrap;">{$group.total|crmMoney:$group.currency}</td> | ||
| <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} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for pointing it out I have updated the buttons accordingly.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I fixed the title attribute. |
||
| {if $group.status == 'open'} | ||
| {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} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Translations within HTML attributes need the |
||
| {else} | ||
| <a href="{crmURL p="civicrm/sepa/closegroup" q="group_id=$group_id"}" class="button button_close"> | ||
| {crmButton href="{crmURL p="civicrm/sepa/closegroup" q="group_id=$group_id"}" 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} | ||
| {/if} | ||
| {ts domain="org.project60.sepa"}Close and Submit{/ts}</a> | ||
| {/if} | ||
| {else} | ||
| <a href="{crmURL p="civicrm/sepa/xml" q="id=$file_id"}" download="{$group.file}" class="button button_export">{ts domain="org.project60.sepa"}Download Again{/ts}</a> | ||
| {crmButton href="{crmURL p="civicrm/sepa/xml" q="id=$file_id"}" class="button_export" title="{ts domain="org.project60.sepa"}Download Again{/ts}" icon=""}{ts domain="org.project60.sepa"}Download Again{/ts}{/crmButton} | ||
| {if $closed_status_id eq $group.status_id} | ||
| {if not $group.collection_date_in_future} | ||
| <a href="{crmURL p="civicrm/sepa/mark_received" q="group_id=$group_id"}" class="button button_received">{ts domain="org.project60.sepa"}Mark Received{/ts}</a> | ||
| {crmButton href="{crmURL p="civicrm/sepa/mark_received" q="group_id=$group_id"}" class="button_received" title="{ts domain="org.project60.sepa"}Mark Received{/ts}" icon=""}{ts domain="org.project60.sepa"}Mark Received{/ts}{/crmButton} | ||
| {/if} | ||
| {/if} | ||
| {/if} | ||
| {if $can_delete} | ||
| <a href="{crmURL p="civicrm/sepa/deletegroup" q="group_id=$group_id"}" class="button button_view">{ts domain="org.project60.sepa"}Delete{/ts}</a> | ||
| {crmButton href="{crmURL p="civicrm/sepa/deletegroup" q="group_id=$group_id"}" class="button_view" title="{ts domain="org.project60.sepa"}Delete{/ts}" icon="fa-trash-can"}{ts domain="org.project60.sepa"}Delete{/ts}{/crmButton} | ||
| {/if} | ||
| </td> | ||
| </tr> | ||
|
|
@@ -134,7 +135,7 @@ | |
|
|
||
| {* legend by @scardinius *} | ||
| <br/> | ||
| <table> | ||
| <table class="sepa_dashboard"> | ||
| <caption>{ts domain="org.project60.sepa"}Legend{/ts}</caption> | ||
| <tr> | ||
| <th>{ts domain="org.project60.sepa"}Status{/ts}</th> | ||
|
|
@@ -162,16 +163,6 @@ | |
| </tr> | ||
| </table> | ||
|
|
||
| {literal} | ||
| <style> | ||
| tr.submit_missed {background-color: #EE0000AA;} | ||
| tr.submit_urgently {background-color: #AC6700AA;} | ||
| tr.submit_soon {background-color: #0165FFAA;} | ||
| tr.submit_later {background-color: #008300AA;} | ||
| tr.submit_closed {background-color: #00830033;} | ||
| </style> | ||
| {/literal} | ||
|
|
||
| <script type="text/javascript"> | ||
| let received_confirmation_message = `{ts domain="org.project60.sepa"}Do you really want to mark this groups as 'payment received'?{/ts}`; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
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.