diff --git a/core/config.class.inc.php b/core/config.class.inc.php index 71c9c3987..7df22d9bf 100644 --- a/core/config.class.inc.php +++ b/core/config.class.inc.php @@ -1213,6 +1213,14 @@ class Config 'source_of_value' => '', 'show_in_conf_sample' => false, ], + 'activity_panel.show_author_name_below_entries' => [ + 'type' => 'bool', + 'description' => 'Whether or not to show the author friendlyname next to the date on the last entry', + 'default' => false, + 'value' => '', + 'source_of_value' => '', + 'show_in_conf_sample' => true, + ], 'activity_panel.lock_watcher_period' => [ 'type' => 'integer', 'description' => 'Period (in second) between lock status update.', diff --git a/css/backoffice/layout/activity-panel/_activity-entry.scss b/css/backoffice/layout/activity-panel/_activity-entry.scss index 754b52998..e90f983cf 100644 --- a/css/backoffice/layout/activity-panel/_activity-entry.scss +++ b/css/backoffice/layout/activity-panel/_activity-entry.scss @@ -56,6 +56,8 @@ $ibo-activity-entry--sub-information--margin-top: 4px !default; $ibo-activity-entry--sub-information--margin-bottom: $ibo-activity-entry--sub-information--margin-top !default; $ibo-activity-entry--sub-information--text-color: $ibo-color-grey-700 !default; +$ibo-activity-entry--author-name--sibling-spacing: 0.2rem !default; + /* Entry group */ .ibo-activity-panel--entry-group{ &:not(:last-child){ @@ -64,7 +66,7 @@ $ibo-activity-entry--sub-information--text-color: $ibo-color-grey-700 !default; } /* Entry */ -.ibo-activity-entry{ +.ibo-activity-entry { display: flex; flex-direction: row; align-items: flex-end; @@ -207,13 +209,23 @@ $ibo-activity-entry--sub-information--text-color: $ibo-color-grey-700 !default; color: $ibo-activity-entry--main-information-icon--text-color; font-size: $ibo-activity-entry--main-information-icon--font-size; } -.ibo-activity-entry--main-information-content{ + +.ibo-activity-entry--main-information-content { } -.ibo-activity-entry--sub-information{ - margin-top: $ibo-activity-entry--sub-information--margin-top; - text-align: left; - color: $ibo-activity-entry--sub-information--text-color; - @extend %ibo-font-ral-nor-50; +.ibo-activity-entry--sub-information { + margin-top: $ibo-activity-entry--sub-information--margin-top; + text-align: left; + color: $ibo-activity-entry--sub-information--text-color; + + @extend %ibo-font-ral-nor-50; +} + +.ibo-activity-entry--author-name { + &:after { + content: "-"; + margin-left: $ibo-activity-entry--author-name--sibling-spacing; + margin-right: $ibo-activity-entry--author-name--sibling-spacing; + } } \ No newline at end of file diff --git a/js/layouts/activity-panel/activity-panel.js b/js/layouts/activity-panel/activity-panel.js index 664005ad1..3d5b196ec 100644 --- a/js/layouts/activity-panel/activity-panel.js +++ b/js/layouts/activity-panel/activity-panel.js @@ -72,6 +72,7 @@ $(function() entry: '[data-role="ibo-activity-entry"]', entry_medallion: '[data-role="ibo-activity-entry--medallion"]', entry_main_information: '[data-role="ibo-activity-entry--main-information"]', + entry_author_name: '[data-role="ibo-activity-entry--author-name"]', entry_datetime: '[data-role="ibo-activity-entry--datetime"]', edits_entry_long_description: '[data-role="ibo-edits-entry--long-description"]', edits_entry_long_description_toggler: '[data-role="ibo-edits-entry--long-description-toggler"]', @@ -1015,16 +1016,22 @@ $(function() aFilterOptions.push($(this).val()); }); - for(let sTargetEntryType of aTargetEntryTypes) - { + for (let sTargetEntryType of aTargetEntryTypes) { me[sCallbackMethod](sTargetEntryType, aFilterOptions); } }); // Show only the last visible entry's medallion of a group (cannot be done through CSS yet 😕) - this.element.find(this.js_selectors.entry_group).each(function(){ + this.element.find(this.js_selectors.entry_group).each(function () { + // Reset everything $(this).find(me.js_selectors.entry_medallion).removeClass(me.css_classes.is_visible); - $(this).find(me.js_selectors.entry + ':visible:last').find(me.js_selectors.entry_medallion).addClass(me.css_classes.is_visible); + $(this).find(me.js_selectors.entry_author_name).addClass(me.css_classes.is_hidden); + + // Then show only necessary + $(this).find(me.js_selectors.entry+':visible:last') + .find(me.js_selectors.entry_medallion).addClass(me.css_classes.is_visible) + .end() + .find(me.js_selectors.entry_author_name).removeClass(me.css_classes.is_hidden); }); this._UpdateEntryGroupsVisibility(); diff --git a/templates/base/layouts/activity-panel/activity-entry/layout.html.twig b/templates/base/layouts/activity-panel/activity-entry/layout.html.twig index a606581f0..10e805d3a 100644 --- a/templates/base/layouts/activity-panel/activity-entry/layout.html.twig +++ b/templates/base/layouts/activity-panel/activity-entry/layout.html.twig @@ -32,6 +32,11 @@