MDL-68353 core: do not output empty labels
authorShamim Rezaie <shamim@moodle.com>
Tue, 7 Apr 2020 13:16:42 +0000 (23:16 +1000)
committerShamim Rezaie <shamim@moodle.com>
Fri, 29 May 2020 03:17:08 +0000 (13:17 +1000)
lib/form/templates/element-template.mustache

index bbf538d..d9528fa 100644 (file)
@@ -49,7 +49,7 @@
             {{#advanced}}<abbr class="initialism text-info" title="{{#str}}advanced{{/str}}">!</abbr>{{/advanced}}
             {{{helpbutton}}}
         </span>
-        {{$ label }}
+        {{# label}}{{$ label }}
             {{^element.staticlabel}}
                 <label class="col-form-label d-inline {{#element.hiddenlabel}}sr-only{{/element.hiddenlabel}}" for="{{element.id}}">
                     {{{label}}}
@@ -60,7 +60,7 @@
                     {{{label}}}
                 </span>
             {{/element.staticlabel}}
-        {{/ label }}
+        {{/ label }}{{/ label}}
     </div>
     <div class="col-md-9 form-inline felement" data-fieldtype="{{element.type}}">
         {{$ element }}