MDL-65144 output: Add img-fluid to logo
authorDamyon Wiese <damyon@moodle.com>
Fri, 22 Mar 2019 01:06:56 +0000 (09:06 +0800)
committerDamyon Wiese <damyon@moodle.com>
Mon, 1 Apr 2019 07:49:29 +0000 (15:49 +0800)
Extra wide logos do not scale to the screen size - this change adds the bootstrap class
img-fluid to logos on the loginpage, signupform and in the context header.

Thanks to Maksud R for working on this.

lib/outputrenderers.php
lib/templates/loginform.mustache
lib/templates/signup_form_layout.mustache
theme/clean/style/custom.css

index 28597f8..ba27a7f 100644 (file)
@@ -4053,7 +4053,7 @@ EOD;
         if ($this->should_display_main_logo($headinglevel)) {
             $sitename = format_string($SITE->fullname, true, array('context' => context_course::instance(SITEID)));
             return html_writer::div(html_writer::empty_tag('img', [
-                    'src' => $this->get_logo_url(null, 150), 'alt' => $sitename]), 'logo');
+                    'src' => $this->get_logo_url(null, 150), 'alt' => $sitename, 'class' => 'img-fluid']), 'logo');
         }
 
         // Make sure to use the heading if it has been set.
index b0cdaa0..5f80666 100644 (file)
@@ -99,7 +99,7 @@
 <div class="card">
     <div class="card-block">
         {{#logourl}}
-            <h2 class="card-header text-center" ><img src="{{logourl}}" title="{{sitename}}" alt="{{sitename}}"/></h2>
+            <h2 class="card-header text-center" ><img src="{{logourl}}" class="img-fluid" title="{{sitename}}" alt="{{sitename}}"/></h2>
         {{/logourl}}
         {{^logourl}}
             <h2 class="card-header text-center">{{sitename}}</h2>
index 86dfa91..13ec495 100644 (file)
@@ -15,7 +15,7 @@
                 <div class="card-body">
                     <div class="card-title text-xs-center">
                         {{#logourl}}
-                            <h2><img src="{{logourl}}" title="{{sitename}}" alt="{{sitename}}"/></h2>
+                            <h2><img class="img-fluid" src="{{logourl}}" title="{{sitename}}" alt="{{sitename}}"/></h2>
                         {{/logourl}}
                         {{^logourl}}
                             <h2>{{sitename}}</h2>
index 090e45b..22be8bd 100644 (file)
@@ -2,6 +2,7 @@
 -------------------------*/
 div.logo {
     background: url([[setting:logo]]) 0 0 no-repeat;
+    background-size: contain;
     display: block;
     float: left;
     height: 75px;