Skip to content

Commit

Permalink
Limit badge usage to suspended state only
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis committed Nov 15, 2021
1 parent 2c3735d commit bf744e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
13 changes: 2 additions & 11 deletions app/resources/locales/en_US/default.po
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,13 @@ msgstr "{0,plural,=1{Pending Request} other{Pending Requests}}"
msgid "match.en.ConfidenceModeEnum.C"
msgstr "Canonical"

msgid "match.en.ConfidenceModeEnum.C.warn.level"
msgstr "Light"

msgid "match.en.ConfidenceModeEnum.P"
msgstr "Potential"

msgid "match.en.ConfidenceModeEnum.P.warn.level"
msgstr "Light"

msgid "match.en.ConfidenceModeEnum.S"
msgstr "Suspended"

msgid "match.en.ConfidenceModeEnum.S.warn.level"
msgid "match.en.ConfidenceModeEnum.S.badge"
msgstr "Danger"

msgid "match.en.PermissionEnum.A"
Expand Down Expand Up @@ -206,13 +200,10 @@ msgstr "Substring"
msgid "match.en.StatusEnum.A"
msgstr "Active"

msgid "match.en.StatusEnum.A.warn.level"
msgstr "Light"

msgid "match.en.StatusEnum.S"
msgstr "Suspended"

msgid "match.en.StatusEnum.S.warn.level"
msgid "match.en.StatusEnum.S.badge"
msgstr "Danger"

### Error Messages
Expand Down
6 changes: 3 additions & 3 deletions app/templates/Standard/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,11 @@ function _column_key($modelsName, $c, $tz=null) {
break;
case 'enum':
if($entity->$col) {
$warning_level = __('match.en.'.$cfg['class'].'.'.$entity->$col . '.warn.level');
$badge_color_class = __('match.en.'.$cfg['class'].'.'.$entity->$col . '.badge');
$title = __('match.en.'.$cfg['class'].'.'.$entity->$col);

if(!empty($warning_level) && strpos($warning_level, '.warn.level') === false) {
print $this->Badge->badgeIt($title, $this->Badge->getBadgeColor($warning_level));
if(!empty($badge_color_class) && strpos($badge_color_class, '.badge') === false) {
print $this->Badge->badgeIt($title, $this->Badge->getBadgeColor($badge_color_class));
} else {
print $title;
}
Expand Down

0 comments on commit bf744e6

Please sign in to comment.