Skip to content

Commit

Permalink
Add Creator as Snippet header to be shown in the details popup
Browse files Browse the repository at this point in the history
  • Loading branch information
abias committed Sep 18, 2024
1 parent 4761b0f commit aca5a30
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion amd/build/snippetsdetailsmodal.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion amd/build/snippetsdetailsmodal.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions amd/src/snippetsdetailsmodal.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const buildModal = async(element) => {
source: element.getAttribute('data-source'),
goal: element.getAttribute('data-goal'),
scope: element.getAttribute('data-scope'),
creator: element.getAttribute('data-creator'),
};

await ModalCancel.create({
Expand Down
2 changes: 2 additions & 0 deletions classes/snippets.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class snippets {
'Goal',
'Description',
'Scope',
'Creator'
];

/**
Expand Down Expand Up @@ -217,6 +218,7 @@ public static function get_snippet_meta($path, $source): stdClass|null {
$snippet->description = $headers['Description'];
$snippet->scope = $headers['Scope'];
$snippet->goal = $headers['Goal'];
$snippet->creator = $headers['Creator'];
$snippet->source = $source;
$snippet->image = $image;

Expand Down
1 change: 1 addition & 0 deletions classes/table/snippets_overview.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ public function col_actions($data) {
'data-goal' => $this->pick_and_build_badge('snippetsgoal'.$data->goal),
'data-scope' => $this->pick_and_build_badge('snippetsscope'.$data->scope),
'data-description' => $data->description,
'data-creator' => $data->creator,
'data-image' => $data->image,
],
];
Expand Down
1 change: 1 addition & 0 deletions lang/en/theme_boost_union.php
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,7 @@

// Settings: CSS snippets page.
$string['configtitlesnippets'] = 'CSS snippets';
$string['snippetscreator'] = 'Creator';
$string['snippetsdescription'] = 'Description';
$string['snippetsdetails'] = 'Details';
$string['snippetsdetailspreview'] = 'Preview';
Expand Down
1 change: 1 addition & 0 deletions snippets/builtin/accessibility_snippet.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Scope: global
* Goal: accessibility
* Description: Darken the background color of secondary menu items while hovering to show more contrast agains other unselected menu items.
* Creator: Heba Amer
*
* @package theme_boost_union
* @copyright 2024 The American University in Cairo
Expand Down
1 change: 1 addition & 0 deletions snippets/builtin/collection_fixing_visual_flaws.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Scope: global
* Goal: bugfix
* Description: Collection of fixes for visual flaws in Boost theme<br><ul><li>Fix for visually cropped right border of secondary menu item</li></ul>
* Creator: Luther Blissett
*
* @package theme_boost_union
* @copyright Luther Blissett
Expand Down
1 change: 1 addition & 0 deletions snippets/builtin/cookies_popup_enhancement.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Scope: global
* Goal: easeofuse
* Description: Enhance the popup cookies dialog when first visiting a moodle website
* Creator: Heba Amer
*
* @package theme_boost_union
* @copyright 2024 The American University in Cairo
Expand Down
1 change: 1 addition & 0 deletions snippets/builtin/international_day_against_homophobia.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Scope: global
* Goal: eyecandy
* Description: 17 May is a special day for the queer community - the International Day against Homophobia, Biphobia and Transphobia. This CSS changes the background of the primary navbar to rainbow colors to commemorate and support the special day.<br /><em>Please note: To make this CSS snippet work, you have to set the 'theme_boost_union | navbarcolor' setting to 'Dark navbar with light font color' as well.</em>
* Creator: Nils Promer and Alexander Brehm
*
* @package theme_boost_union
* @copyright 2024 University of Applied Science Hamburg
Expand Down
1 change: 1 addition & 0 deletions snippets/builtin/visual-depth.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Scope: global
* Goal: eyecandy
* Description: A less flat design than is intended in the Boost theme. Realised by box-shadows on a number of page elements and a colour gradient on the page background.
* Creator: Nils Promer
*
* @package theme_boost_union
* @copyright 2024 University of Applied Science Hamburg
Expand Down
6 changes: 6 additions & 0 deletions templates/snippetsdetailsmodal.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@
<h6>{{#str}}snippetsdetails, theme_boost_union{{/str}}</h6>
<table class="table table-striped">
<tbody>
{{#creator}}
<tr>
<th scope="row">{{#str}}snippetscreator, theme_boost_union{{/str}}</th>
<td>{{{creator}}}</td>
</tr>
{{/creator}}
{{#source}}
<tr>
<th scope="row">{{#str}}snippetssource, theme_boost_union{{/str}}</th>
Expand Down

0 comments on commit aca5a30

Please sign in to comment.