forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'MDL-78204-master' of https://github.com/roland04/moodle
- Loading branch information
Showing
27 changed files
with
475 additions
and
83 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
admin/tool/componentlibrary/content/moodle/components/showmore.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
layout: docs | ||
title: "Show more" | ||
date: 2023-06-12T00:00:00+01:00 | ||
draft: false | ||
weight: 70 | ||
tags: | ||
- MDL-78204 | ||
- 4.3 | ||
--- | ||
|
||
## How to use | ||
|
||
The show more component is used to show and hide content. It is useful for showing a preview of content and then allowing the user to expand it to see more. | ||
|
||
The parameters for the template context are: | ||
* collapsedcontent: The content to show when collapsed. | ||
* expandedcontent: The content to show when expanded. | ||
* extraclasses: Any extra classes added to the showmore outer container. | ||
* buttonextraclasses: Any extra classes added to the button. | ||
* collapsedextraclasses: Any extra classes added to the collapsed content container. | ||
* expandedextraclasses: Any extra classes added to the expanded content container. | ||
|
||
## Example | ||
|
||
{{< mustache template="core/showmore" >}} | ||
{ | ||
"collapsedcontent": "Hello...", | ||
"expandedcontent": "Hello<br>Is it me you're looking for? I can see it in your eyes", | ||
"extraclasses": "rounded p-2 border", | ||
"buttonextraclasses": "font-weight-bold" | ||
} | ||
{{< /mustache >}} | ||
|
||
## Example used as a template block | ||
|
||
{{< mustache template="tool_componentlibrary/examples/showmore/example" >}} | ||
{ | ||
} | ||
{{< /mustache >}} |
37 changes: 37 additions & 0 deletions
37
admin/tool/componentlibrary/templates/examples/showmore/example.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{{! | ||
This file is part of Moodle - http://moodle.org/ | ||
Moodle is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
Moodle is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
}} | ||
{{! | ||
@template tool_componentlibrary/examples/showmore/example | ||
Template for showmore element used as a block example | ||
Example context (json): | ||
{ | ||
} | ||
}} | ||
<div id="showmore-example"> | ||
<h1>Show more block</h1> | ||
<p>This is a simple example using showmore template as a block.</p> | ||
{{< core/showmore }} | ||
{{$collapsedcontent}} Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem... {{/collapsedcontent}} | ||
{{$expandedcontent}} | ||
Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem suspendisse faucibus, nunc et pellentesque egestas, lacus ante convallis tellus, vitae iaculis lacus elit id tortor. | ||
Sed augue ipsum, egestas nec, vestibulum et, malesuada adipiscing, dui. Sed cursus turpis vitae tortor. Praesent turpis. Proin viverra, ligula sit amet ultrices semper, ligula arcu | ||
tristique sapien, a accumsan nisi mauris ac eros. Donec venenatis vulputate lorem. Vestibulum eu odio. Morbi nec metus. Vivamus euismod mauris. Vivamus elementum semper nisi. | ||
{{/expandedcontent}} | ||
{{/core/showmore }} | ||
</div> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.