Skip to content

Commit

Permalink
prep work for Tweeki v5.39
Browse files Browse the repository at this point in the history
  • Loading branch information
thaider committed Jul 2, 2024
1 parent 1355aa5 commit 5a05029
Show file tree
Hide file tree
Showing 12 changed files with 77 additions and 66 deletions.
48 changes: 29 additions & 19 deletions SemanticOrganization.hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ static function onParserFirstCallInit( &$parser ) {
static function renderCollapse( &$parser, $target, $tooltip = null ) {
$linktext = '<span class="fa fa-chevron-down"';
if( !is_null( $tooltip ) ) {
$linktext .= 'data-toggle="tooltip" title="' . $tooltip . '"';
$linktext .= 'data-bs-toggle="tooltip" title="' . $tooltip . '"';
}
$linktext .= '>';
$collapse = '<a class="semorg-collapse" data-toggle="collapse" href="#' . $target . '" role="button" aria-expanded="false" aria-controls="' . $target . '">' . $linktext . '</a>';
$collapse = '<a class="semorg-collapse" data-bs-toggle="collapse" href="#' . $target . '" role="button" aria-expanded="false" aria-controls="' . $target . '">' . $linktext . '</a>';
return [ $collapse, 'noparse' => true, 'isHTML' => true ];
}

Expand Down Expand Up @@ -767,7 +767,7 @@ static function getTabLinks( $template, $taboptions, $class ) {
foreach( $taboptions as $id => $content ) {
if( substr( $id, 0, 1 ) === '?' ) {
$id = substr( $id, 1 );
$tabbtn = '<btn data-toggle="tab" class="nav-link' . ($first ? ' active' : '') . '" role="tab" id="' . $id . '-label" aria-controls="' . $id . '" aria-selected="' . ($first ? 'true' : 'false') . '">#' . $id . '|' . wfMessage( 'semorg-tab-' . $template . '-' . $id ) . '</btn>';
$tabbtn = '<btn data-bs-toggle="tab" class="nav-link' . ($first ? ' active' : '') . '" role="tab" id="' . $id . '-label" aria-controls="' . $id . '" aria-selected="' . ($first ? 'true' : 'false') . '">#' . $id . '|' . wfMessage( 'semorg-tab-' . $template . '-' . $id ) . '</btn>';
$tablinks .= '<li class="nav-item">' . $tabbtn . '</li>';
$first = false;
}
Expand Down Expand Up @@ -1272,7 +1272,7 @@ static function renderList( &$parser ) {
}

// Header
if( isset( $listoptions['title'] ) || isset( $listoptions['formlink'] ) ) {
if( isset( $listoptions['title'] ) || isset( $listoptions['formlink'] ) || isset( $listoptions['forminput'] ) ) {
$list_header = '';

// Title
Expand All @@ -1285,8 +1285,12 @@ static function renderList( &$parser ) {
$list_header .= '</div>';
}

// Forminput
if( isset( $listoptions['forminput'] ) ) {
$list_header .= '<div class="semorg-list-forminput navigation-not-searchable">' . $listoptions['forminput'] . '</div>';

// Formlink
if( isset( $listoptions['formlink'] ) ) {
} else if( isset( $listoptions['formlink'] ) ) {
$list_header .= '<div class="semorg-list-formlink navigation-not-searchable">' . $listoptions['formlink'] . '</div>';
}

Expand All @@ -1307,7 +1311,7 @@ static function renderList( &$parser ) {
}
}
if( $help_page != '' ) {
$help_link = '<btn class="semorg-detail-help-link navigation-not-searchable" wrapper="" title="' . $help_page . '" data-toggle="tooltip">' . $help_page . '|<i class="far fa-question-circle"></i></btn>';
$help_link = '<btn class="semorg-detail-help-link navigation-not-searchable" wrapper="" title="' . $help_page . '" data-bs-toggle="tooltip">' . $help_page . '|<i class="far fa-question-circle"></i></btn>';
}
$heading = '<div class="semorg-detail-heading">' . $listoptions['heading'] . $help_link . '</div>';

Expand Down Expand Up @@ -1369,6 +1373,11 @@ static function renderOverview( &$parser ) {
return wfMessage( 'semorg-error-missing-parameter', 'semorg-overview', 'feature' );
}

$parent_feature = false;
if( wfMessage( 'semorg-overview-' . $feature . '-parent-feature' )->exists() ) {
$parent_feature .= wfMessage( 'semorg-overview-' . $feature . '-parent-feature' )->parse();
}

$parameters = [];
$request = $parser->getUserIdentity()->getRequest();

Expand All @@ -1378,6 +1387,7 @@ static function renderOverview( &$parser ) {
'links-title',
'links',
'formlink',
'forminput',
'query',
'sort',
'order',
Expand Down Expand Up @@ -1411,11 +1421,16 @@ static function renderOverview( &$parser ) {
$parameters[str_replace( '-', ' ', $parameter )] = wfMessage( 'semorg-overview-' . $feature . '-' . $parameter )->plain();
}
}

// for backwards compatibility – @todo: all link templates should be replaced by messages
if( !isset( $parameters['link'] ) && $parent_feature && wfMessage( 'semorg-overview-' . $parent_feature . '-links' )->exists() ) {
$parameters['links'] = wfMessage( 'semorg-overview-' . $parent_feature . '-links' )->plain();
}
if( !isset( $parameters['links'] ) ) {
$parameters['links'] = '{{#ifexist:Template:semorg-' . $feature . '-custom-links|{{semorg-' . $feature . '-custom-links}}|{{#ifexist:Template:semorg-' . $feature . '-links|{{semorg-' . $feature . '-links}}}}}}';
} else {
$links = '';
$links .= '<span class="semorg-list-links-title">' . ( $parameters['links-title'] ?? '{{int:semorg-' . $feature . '-page-name}}' ) . ':</span> ';
$links .= '<span class="semorg-list-links-title">' . ( $parameters['links-title'] ?? '{{int:semorg-' . ( $parent_feature ?: $feature ) . '-page-name}}' ) . ':</span> ';
$link_array = [];
foreach( explode( ',', $parameters['links'] ) as $link ) {
list($target,$title) = explode( '|', $link );
Expand All @@ -1438,12 +1453,7 @@ static function renderOverview( &$parser ) {
unset( $parameters['formlink'] );
}

$overview = '{{#semorg-list:';
if( wfMessage( 'semorg-overview-' . $feature . '-parent-feature' )->exists() ) {
$overview .= wfMessage( 'semorg-overview-' . $feature . '-parent-feature' )->parse();
} else {
$overview .= $feature;
}
$overview = '{{#semorg-list:' . ( $parent_feature ?: $feature );
if( isset( $parameters['extra-fields'] ) ) {
$overview .= $parameters['extra-fields'];
unset( $parameters['extra-fields'] );
Expand Down Expand Up @@ -1844,7 +1854,7 @@ static function getFieldRow( &$parser, $template, $element ) {
} else {
$help = wfMessage($fullelement . '-help')->text();
}
$help = '<small class="form-text text-muted semorg-help">' . $help . '</small>';
$help = '<div class="form-text semorg-help">' . $help . '</div>';

/* get inline help message if it exists */
} elseif( !wfMessage($fullelement . '-help-inline')->isDisabled() ) {
Expand Down Expand Up @@ -2414,7 +2424,7 @@ static function renderStakeholderMilestones( &$parser ) {
}
foreach( $milestones as $milestone ) {
if( $milestone[3] == $scj_milestone[2] && $milestone[4] == $scj_milestone[3] ) {
$viz .= '<div class="col px-0 text-center"><div class="semorg-stakeholder-milestone" data-toggle="tooltip" title="' . $milestone[5] . '">[[' . $scj_milestone[0] . '|' . $scj_milestone[2] . '.' . $scj_milestone[3] . ']]</div></div>';
$viz .= '<div class="col px-0 text-center"><div class="semorg-stakeholder-milestone" data-bs-toggle="tooltip" title="' . $milestone[5] . '">[[' . $scj_milestone[0] . '|' . $scj_milestone[2] . '.' . $scj_milestone[3] . ']]</div></div>';
$old_plot = $scj_milestone[2];
continue 2;
}
Expand Down Expand Up @@ -2472,7 +2482,7 @@ static function renderMsg( &$parser, $msg ) {

$msg_html = '<span class="semorg-msg">' . $msg_content . '<small class="semorg-msg-edit d-print-none"> {{#formlink:form=semorg-message
|returnto={{FULLPAGENAME}}
|link text=<span data-toggle="tooltip" title="' . $msg_tooltip . '" class="fa fa-' . $msg_icon . '"></span>
|link text=<span data-bs-toggle="tooltip" title="' . $msg_tooltip . '" class="fa fa-' . $msg_icon . '"></span>
|target=MediaWiki:semorg-' . $msg . '
|preload=' . $msg_preload . '
}}</small></span>';
Expand Down Expand Up @@ -2575,7 +2585,7 @@ static function getFilterbox( $parser, $filter_links_values, $applied_filters, $
} else {
$drop_filter_url = self::getFilterURL( $parser, array_diff_key( $applied_filters, [ $filter_property => $value ] ) );
}
$drop_filter_link = '<span title="' . wfMessage('semorg-filterbox-drop-filter')->plain() . '" data-toggle="tooltip">[' . $drop_filter_url . ' &times;]</span>';
$drop_filter_link = '<span title="' . wfMessage('semorg-filterbox-drop-filter')->plain() . '" data-bs-toggle="tooltip">[' . $drop_filter_url . ' &times;]</span>';
$value = '<span class="semorg-filterbox-filter-value semorg-filterbox-filter-value-applied">' . $value . ' ' . $drop_filter_link . '</span>';
} else {
$filter_url = self::getFilterURL( $parser, array_merge( $applied_filters, [ $filter_property => $value ] ) );
Expand All @@ -2586,7 +2596,7 @@ static function getFilterbox( $parser, $filter_links_values, $applied_filters, $
// if there are no results it might be because of default value - needs to be dropable
if( isset( $filter_defaults[$filter_property] ) ) {
$drop_filter_url = self::getFilterURL( $parser, array_merge( array_diff_key( $applied_filters, [ $filter_property => $value ] ), [ $filter_property => '' ] ) );
$drop_filter_link = '<span title="' . wfMessage('semorg-filterbox-drop-filter')->plain() . '" data-toggle="tooltip">[' . $drop_filter_url . ' &times;]</span>';
$drop_filter_link = '<span title="' . wfMessage('semorg-filterbox-drop-filter')->plain() . '" data-bs-toggle="tooltip">[' . $drop_filter_url . ' &times;]</span>';
$value = '<span class="semorg-filterbox-filter-value semorg-filterbox-filter-value-applied">' . $applied_filters[$filter_property] . ' ' . $drop_filter_link . '</span>';
}
}
Expand Down Expand Up @@ -2916,7 +2926,7 @@ static function renderRoleLink( &$parser ) {
} else {
$newlink_tooltip = wfMessage('semorg-formlink-generic-link-text')->params( wfMessage('semorg-role-entity-name')->text() )->text();
}
return [ '<a href="' . $newlink . '" class="new" data-toggle="tooltip" title="' . $newlink_tooltip . '">' . htmlentities( $parameter ) . '</a>', 'noparse' => true, 'isHTML' => true ];
return [ '<a href="' . $newlink . '" class="new" data-bs-toggle="tooltip" title="' . $newlink_tooltip . '">' . htmlentities( $parameter ) . '</a>', 'noparse' => true, 'isHTML' => true ];
}
}
}
Expand Down
9 changes: 5 additions & 4 deletions i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"semorg-timespan-since-until": "von {{#time:j.n.y|$1}} bis {{#time:j.n.y|$2}}",

"semorg-dashboard-title": "Meine $1",
"semorg-dashboard-link-all": "<i class=\"fa fa-list\" data-toggle=\"tooltip\" title=\"alle anzeigen\"></i>",
"semorg-dashboard-link-create": "<i class=\"fa fa-plus\" data-toggle=\"tooltip\" title=\"neu erstellen\"></i>",
"semorg-dashboard-link-all": "<i class=\"fa fa-list\" data-bs-toggle=\"tooltip\" title=\"alle anzeigen\"></i>",
"semorg-dashboard-link-create": "<i class=\"fa fa-plus\" data-bs-toggle=\"tooltip\" title=\"neu erstellen\"></i>",

"semorg-formlink-generic-link-text": "$1 erstellen",
"semorg-forminput-generic-button-text": "$1 erstellen",
Expand Down Expand Up @@ -293,10 +293,10 @@
"semorg-user-create-link-text": "Benutzeraccount \"$1\" anlegen",

"semorg-person-user-feature-name": "Mitgliederverwaltung",
"semorg-person-user-feature-description": "*Benutzer*in verwalten",
"semorg-person-user-feature-description": "*Benutzer*innen verwalten",
"semorg-person-user-personnel-feature-name": "Personalverwaltung",
"semorg-person-user-personnel-feature-description": "*Daten, Verträge und Gehaltsänderungen für Personal verwalten",
"semorg-person-user-page-name": "Benutzer*in",
"semorg-person-user-page-name": "Benutzer*innen",
"semorg-person-user-entity-name": "Benutzer*in",
"semorg-form-person-user-create-title": "Benutzer*in erstellen",
"semorg-form-person-user-edit-title": "Benutzer*in bearbeiten",
Expand Down Expand Up @@ -825,6 +825,7 @@
"semorg-vacation-dashboard-title": "nächste Abwesenheiten",
"semorg-form-vacation-create-title": "Abwesenheit erstellen",
"semorg-form-vacation-edit-title": "Abwesenheit bearbeiten",
"semorg-form-vacation-page-name": "Abwesenheiten",
"semorg-field-vacation-person-name": "Name",
"semorg-field-vacation-start-date-name": "von",
"semorg-field-vacation-end-date-name": "bis",
Expand Down
14 changes: 12 additions & 2 deletions i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
"semorg-timespan-since-until": "from {{#time:y/m/d|$1}} until {{#time:y/m/d|$2}}",

"semorg-dashboard-title": "My $1",
"semorg-dashboard-link-all": "<i class=\"fa fa-list\" data-toggle=\"tooltip\" title=\"show all\"></i>",
"semorg-dashboard-link-create": "<i class=\"fa fa-plus\" data-toggle=\"tooltip\" title=\"create new\"></i>",
"semorg-dashboard-link-all": "<i class=\"fa fa-list\" data-bs-toggle=\"tooltip\" title=\"show all\"></i>",
"semorg-dashboard-link-create": "<i class=\"fa fa-plus\" data-bs-toggle=\"tooltip\" title=\"create new\"></i>",

"semorg-formlink-generic-link-text": "Create $1",
"semorg-forminput-generic-button-text": "Create $1",
Expand Down Expand Up @@ -406,6 +406,7 @@
"semorg-overview-person-user-parent-feature": "person",
"semorg-overview-person-user-category": "semorg-person-user",
"semorg-overview-person-user-row-template": "person-user",
"semorg-overview-person-user-forminput": "{{#semorg-forminput:person-user}}",
"semorg-tab-person-user-details": "User Details",
"semorg-tab-person-user-contact": "Contact History",
"semorg-tab-person-user-roles": "Roles",
Expand Down Expand Up @@ -1346,6 +1347,12 @@
"semorg-list-invoice-list-link-text": "show single invoices",
"semorg-list-invoice-amount-net-sum-template": "semorg-currency",
"semorg-list-invoice-amount-gross-sum-template": "semorg-currency",
"semorg-overview-invoice-formlink": "{{#semorg-formlink:invoice|returnto={{FULLPAGENAME}}}}",
"semorg-overview-invoice-sort": "semorg-invoice-number",
"semorg-overview-invoice-order": "desc",
"semorg-overview-invoice-filter-links": "invoice-year,invoice-issuer.semorg-account-account-name",
"semorg-overview-invoice-filters": "invoice-recipient",
"semorg-overview-invoice-links": "invoice-page-name|list-invoice-all-link-text,invoice-open-page-name|list-invoice-open-link-text,invoice-due-page-name|list-invoice-due-link-text,invoice-template-page-name|list-invoice-template-link-text",
"semorg-field-invoice-invoice-name": "Invoice",
"semorg-field-invoice-recipient-name": "Recipient",
"semorg-field-invoice-recipient-parameters": "input type=combobox|values from property=semorg-invoice-recipient",
Expand Down Expand Up @@ -1419,6 +1426,9 @@
"semorg-list-invoice-template-headers": "invoice-template-name,invoice-recipient,invoice-amount-net-short",
"semorg-list-invoice-template-link-text": "Templates",
"semorg-list-invoice-template-sums": "",
"semorg-overview-invoice-template-parent-feature": "invoice",
"semorg-overview-invoice-template-category": "semorg-invoice-template",
"semorg-overview-invoice-template-row-template": "invoice-template",

"semorg-invoice-item-template": "semorg-invoice-item",
"semorg-form-invoice-item-add-button-text": "Add Item",
Expand Down
7 changes: 3 additions & 4 deletions modules/default/css/semorg.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
"production": "mix --production"
},
"devDependencies": {
"bootstrap": "^4.4.1",
"bootstrap": "^5.3.2",
"browser-sync": "^2.27.5",
"browser-sync-webpack-plugin": "^2.3.0",
"jquery": "^3.6.0",
"laravel-mix": "^6.0.31",
"popper.js": "^1.16.1",
"@popperjs/core": "^2.11.8",
"resolve-url-loader": "^4.0.0",
"sass": "1.32.13",
"sass-loader": "^12.1.0"
Expand Down
1 change: 1 addition & 0 deletions resources/default/styles/semorg.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "semorg/variables";
@import "../../../../../skins/Tweeki/resources/styles/tweeki/variables";

@import "~bootstrap/scss/bootstrap";

Expand Down
2 changes: 1 addition & 1 deletion resources/default/styles/semorg/_content.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#maincontentwrapper {
width:100%;
//width:100%; // doesn't work with BS 5. what was it needed for?
}

#bodyContent {
Expand Down
2 changes: 1 addition & 1 deletion resources/default/styles/semorg/_dashboard.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.semorg-dashboard {
@extend .card-columns;
//@extend .card-columns;

@include media-breakpoint-up(sm) {
column-count: 1;
Expand Down
30 changes: 3 additions & 27 deletions resources/default/styles/semorg/_forms.scss
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
// datepicker
.pfPickerWrapper {
display: inline-block;
}
.pfDatePicker.oo-ui-textInputWidget {
width:200px;
}

.oo-ui-checkboxInputWidget + t {
margin-left:8px;
}

// ugly hack: without it, checkboxes are only partly clickable
.oo-ui-checkboxInputWidget {
width: 1.42857143em;
}
#maincontentwrapper #pfForm select,
#maincontentwrapper #pfForm input[type="checkbox"] {
width: 100% !important;
}

.semorg-row-name {
margin-bottom:10px;
}
Expand Down Expand Up @@ -56,7 +35,7 @@

.semorg-row {
@extend .row;
@extend .no-gutters;
@extend .g-0;
}
.semorg-row-name {
@extend .col-md-3;
Expand All @@ -74,9 +53,6 @@
padding-right:0;
}
}
.multipleTemplateInstance {
background-color:$light !important;
}

#maincontentwrapper #pfForm .semorg-form-single-field {
> span {
Expand Down Expand Up @@ -154,10 +130,10 @@

input,
textarea,
select {
select {
color: $primary !important;
border-color: $primary !important;
background-color: theme-color-level( primary, -12 ) !important;
background-color: tint-color( $primary, 90% ) !important;
}
}

Expand Down
8 changes: 6 additions & 2 deletions resources/default/styles/semorg/_list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@
color:#666;
}

.semorg-sums td {
border-color:transparent !important;
.semorg-sums {
border:none;

td {
border-color:transparent !important;
}
}

&-header {
Expand Down
16 changes: 13 additions & 3 deletions resources/default/styles/semorg/_semorg.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ a.new:hover {
text-decoration:none;
}

#content {
.mw-parser-output a.external, .link-mailto, .link-ftp, .link-irc, .link-audio, .link-video, .link-document {
background: none;
padding-right: 0;
}
}

/* SIGNATURES */

.semorg-signatures {
Expand Down Expand Up @@ -189,12 +196,16 @@ a.new:hover {
left:0;
height:80%;
width:100%;
background-color:theme-color-level(primary, -8);
background-color:tint-color($primary, 80%);
padding:0 5px;
border-radius:2px;

a:hover {
text-decoration:none !important;
}
}
.semorg-timeline:hover {
background-color:theme-color-level(primary, -4);
background-color:tint-color($primary, 50%);
}
.semorg-timeline small {
vertical-align:top;
Expand Down Expand Up @@ -822,4 +833,3 @@ body input[type="button"].multipleTemplateAdder {
color:#333;
}
}

2 changes: 1 addition & 1 deletion resources/default/styles/semorg/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
$font-family-path: "../fonts";
$font-family-sans-serif: "OpenSans", "Roboto", "Helvetica Neue", Arial, "Noto Sans", sans-serif;
$font-family-base: $font-family-sans-serif;
$font-family-base: $font-family-sans-serif;

0 comments on commit 5a05029

Please sign in to comment.