Skip to content

Commit

Permalink
Merge branch 'master' into #317-section-breadcrumb-order
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaboesch authored Nov 24, 2023
2 parents 85b7852 + e88da8d commit f00b855
Show file tree
Hide file tree
Showing 7 changed files with 495 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: 'For support request please visit our forum:'
about: https://moodle.org/mod/forum/discuss.php?d=452129
title: ''
labels: ''
assignees: ''

---

For further help, please have a look at our "Boost Union questions" thread in the "Themes" forum on moodle.org:
https://moodle.org/mod/forum/discuss.php?d=452129

Please do not generate a new issue for support questions.
17 changes: 1 addition & 16 deletions .github/ISSUE_TEMPLATE/issue.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
---
name: Issue
about: Suggest an idea for this project
about: Open a blank issue for anything else
title: ''
labels: new
assignees: ''

---

**Is your issue related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
Add your user story - a clear and concise description of what you want to happen.
e.g.:

- As a teacher I would like ...
- As a student I would like ...


**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the issue here.
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Changes
-------

### Unreleased

* 2023-11-23 - Bugfix: Correct order for in-course breadcrumb when sections exist in it (First categories then sections), solves #317.
* 2023-11-23 - Bugfix: Add background color to OAuth2 login button, solves #473.

### v4.3-r2

Expand Down
3 changes: 2 additions & 1 deletion db/caches.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
$definitions = [
// This cache stores the flavours which apply to a particular user in his user session.
// It is there to avoid that the flavour which applies has to be calculated on every page load.
// The cache key is the page category ID (and 0 for all non-category pages).
// The cache key is the page's course category ID
// (and 0 for all pages which are not placed within a course category).
// The cache value is the full flavour object.
//
// This is a session cache by purpose. It isn't an application cache as it contains user-specific data.
Expand Down
4 changes: 2 additions & 2 deletions lang/en/theme_boost_union.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@
$string['additionalresourcessetting_desc'] = 'With this setting you can upload additional resources to the theme. The advantage of uploading files to this file area is that those files can be delivered without a check if the user is logged in. This is also why you should only add files that are uncritical and everyone should be allowed to access and don\'t need be protected with a valid login. As soon as you have uploaded at least one file to this filearea and have stored the settings, a list will appear underneath which will give you the URL which you can use to reference a particular file.';
// ... ... Information: Additional resources list.
$string['additionalresourceslistsetting'] = 'Additional resources list';
$string['additionalresourceslistsetting_desc'] = 'This is the list of files which you have uploaded to the additional resources filearea. The given URLs can be used to link to these files from within your custom CSS, from the footnote or whereever you need to use uploaded files but can\'t upload files in place.';
$string['additionalresourceslistsetting_desc'] = 'This is the list of files which you have uploaded to the additional resources filearea. The given URLs can be used to link to these files from within your custom CSS, from the footnote or wherever you need to use uploaded files but can\'t upload files in place.';
$string['additionalresourcesfileurlpersistent'] = 'URL (persistent)';
$string['additionalresourcesfileurlrevisioned'] = 'URL (revisioned)';
// ... Section: Custom fonts.
Expand Down Expand Up @@ -979,7 +979,7 @@
$string['boost_union:editregionoffcanvascenter'] = 'To be able to edit the Off-canvas (center) block region';

// Caches.
$string['cachedef_flavours'] = 'Flavours which apply to a given page category ID for the current user';
$string['cachedef_flavours'] = 'Flavours which apply to a given page\'s category ID for the current user';
$string['cachedef_smartmenus'] = 'Smart menus';
$string['cachedef_smartmenu_items'] = 'Smart menu items';

Expand Down
241 changes: 241 additions & 0 deletions templates/core/loginform.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,241 @@
{{!
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 core/loginform
Moodle template for the login page.
Context variables required for this template:
* autofocusform: Auto focus on form ?,
* canloginasguest - Is guest login allowed?,
* canloginbyemail - Is login by email allowed?,
* cansignup - Signup allowed?,
* cookieshelpicon - cookies help icon details
* error - Any errors in the form?,
* info - Info notification to display,
* forgotpasswordurl - Forgot password url,
* hasidentityproviders - Flag, set to true to hide identity providers,
* hasinstructions - Flag, set to true to show instructions,
* identityproviders - List of identiy providers,
* instructions - Instructions,
* instructionsformat - Format of instructions,
* loginurl - Login url,
* signupurl - Signup url,
* errorformatted - Formatted error,
* logourl - Flag, logo url,
* sitename - Name of site.,
* logintoken - Random token to protect login request.,
* maintenance - Maintenance message
Example context (json):
{
"autofocusform": false,
"canloginasguest": "1",
"canloginbyemail": false,
"cansignup": true,
"cookieshelpicon": {
"heading": "Cookies must be enabled in your browser",
"text": "<div class=\"no-overflow\">Two cookies are used on this site. Both died..</div>",
"icon": {
"attributes": [
{
"name": "class",
"value": "iconhelp"
},
{
"name": "alt",
"value": "Help with Cookies must be enabled in your browser"
},
{
"name": "title",
"value": "Help with Cookies must be enabled in your browser"
},
{
"name": "src",
"value": "http://localhost/stable_master/theme/image.php?theme=boost&component=core&image=help"
}
]
},
"linktext": null,
"title": "Help with Cookies must be enabled in your browser",
"url": "http://localhost/stable_master/help.php?component=core&identifier=cookiesenabled&lang=en",
"ltr": true
},
"error": "",
"info": "",
"forgotpasswordurl": "http://localhost/stable_master/login/forgot_password.php",
"hasidentityproviders": false,
"hasinstructions": true,
"identityproviders": [],
"instructions": "For full access to this site, you first need to create an account.",
"instructionsformat": "1",
"loginurl": "http://localhost/stable_master/login/index.php",
"signupurl": "http://localhost/stable_master/login/signup.php",
"cookieshelpiconformatted": "",
"errorformatted": "",
"logourl": false,
"sitename": "Beer & Chips",
"logintoken": "randomstring",
"maintenance": "For full access to this site, you need to login in as an admin.",
"languagemenu": "Choose language"
}
}}
{{!
This template is a modified version of core/loginform
Modifications compared to the original template:
* Add btn-secondary class to identityprovider login buttons.
}}

<div class="loginform">
{{#logourl}}
<div id="loginlogo" class="login-logo">
<img id="logoimage" src="{{logourl}}" class="img-fluid" alt="{{sitename}}"/>
<h1 class="login-heading sr-only">{{#str}} loginto, core, {{sitename}} {{/str}}</h1>
</div>
{{/logourl}}
{{^logourl}}
<h1 class="login-heading mb-4">{{#str}} loginto, core, {{sitename}} {{/str}}</h1>
{{/logourl}}
{{#maintenance}}
<div class="alert alert-danger login-maintenance">
{{{maintenance}}}
</div>
{{/maintenance}}
{{#error}}
<a href="#" id="loginerrormessage" class="sr-only">{{error}}</a>
<div class="alert alert-danger" role="alert">{{error}}</div>
{{/error}}
{{#info}}
<a href="#" id="logininfomessage" class="sr-only">{{info}}</a>
<div class="alert alert-info" role="alert">{{info}}</div>
{{/info}}
{{#cansignup}}
<a href="{{signupurl}}" class="sr-only">{{#str}} tocreatenewaccount {{/str}}</a>
{{/cansignup}}
<form class="login-form" action="{{loginurl}}" method="post" id="login">
<input id="anchor" type="hidden" name="anchor" value="">
<script>document.getElementById('anchor').value = location.hash;</script>
<input type="hidden" name="logintoken" value="{{logintoken}}">
<div class="login-form-username form-group">
<label for="username" class="sr-only">
{{^canloginbyemail}}
{{#str}} username {{/str}}
{{/canloginbyemail}}
{{#canloginbyemail}}
{{#str}} usernameemail {{/str}}
{{/canloginbyemail}}
</label>
<input type="text" name="username" id="username" {{!
!}}class="form-control form-control-lg" {{!
!}}value="{{username}}" {{!
!}}placeholder="{{^canloginbyemail}}{{#cleanstr}}username{{/cleanstr}}{{/canloginbyemail}}{{!
!}}{{#canloginbyemail}}{{#cleanstr}}usernameemail{{/cleanstr}}{{/canloginbyemail}}" {{!
!}}autocomplete="username">
</div>
<div class="login-form-password form-group">
<label for="password" class="sr-only">{{#str}} password {{/str}}</label>
<input type="password" name="password" id="password" value="" {{!
!}}class="form-control form-control-lg" {{!
!}}placeholder="{{#cleanstr}}password{{/cleanstr}}" {{!
!}}autocomplete="current-password">
</div>
{{#recaptcha}}
<div class="login-form-recaptcha form-group">
{{{recaptcha}}}
</div>
{{/recaptcha}}
<div class="login-form-submit form-group">
<button class="btn btn-primary btn-lg" type="submit" id="loginbtn">{{#str}}login{{/str}}</button>
</div>
<div class="login-form-forgotpassword form-group">
<a href="{{forgotpasswordurl}}">{{#str}}forgotaccount{{/str}}</a>
</div>
</form>
{{#hasidentityproviders}}
<div class="login-divider"></div>
<div class="login-identityproviders">
<h2 class="login-heading">{{#str}} potentialidps, auth {{/str}}</h2>
{{#identityproviders}}
<a class="btn login-identityprovider-btn btn-block btn-secondary" href="{{url}}">
{{#iconurl}}
<img src="{{iconurl}}" alt="" width="24" height="24"/>
{{/iconurl}}
{{name}}
</a>
{{/identityproviders}}
</div>
{{/hasidentityproviders}}
{{#hasinstructions}}
<div class="login-divider"></div>
<div class="login-instructions {{#cansignup}}mb-3{{/cansignup}}">
<h2 class="login-heading">{{#str}}firsttime{{/str}}</h2>
{{{instructions}}}
</div>
{{/hasinstructions}}
{{#cansignup}}
<div class="login-signup">
<a class="btn btn-secondary" href="{{signupurl}}">{{#str}}startsignup{{/str}}</a>
</div>
{{/cansignup}}
{{#canloginasguest}}
<div class="login-divider"></div>
<h2 class="login-heading">{{#str}}someallowguest{{/str}}</h2>
<form action="{{loginurl}}" method="post" id="guestlogin">
<input type="hidden" name="logintoken" value="{{logintoken}}">
<input type="hidden" name="username" value="guest" />
<input type="hidden" name="password" value="guest" />
<button class="btn btn-secondary" type="submit" id="loginguestbtn">{{#str}}loginguest{{/str}}</button>
</form>
{{/canloginasguest}}
<div class="login-divider"></div>
<div class="d-flex">
{{#languagemenu}}
<div class="login-languagemenu">
{{>core/action_menu}}
</div>
<div class="divider border-left align-self-center mx-3"></div>
{{/languagemenu}}
<button type="button" class="btn btn-secondary" {{!
}} data-modal="alert"{{!
}} data-modal-title-str='["cookiesenabled", "core"]' {{!
}} data-modal-content-str='["cookiesenabled_help_html", "core"]'{{!
}}>{{#str}}cookiesnotice{{/str}}</button>
</div>
</div>

{{#js}}
{{^error}}
{{#autofocusform}}
var userNameField = document.getElementById('username');
if (userNameField.value.length == 0) {
userNameField.focus();
} else {
document.getElementById('password').focus();
}
{{/autofocusform}}
{{/error}}
{{#error}}
document.getElementById('loginerrormessage').focus();
{{/error}}
require(['core_form/submit'], function(Submit) {
Submit.init("loginbtn");
{{#canloginasguest}}
Submit.init("loginguestbtn");
{{/canloginasguest}}
});
{{/js}}
Loading

0 comments on commit f00b855

Please sign in to comment.