]> git.mxchange.org Git - friendica.git/commitdiff
Clean up smarty templates.
authorDr. Tobias Quathamer <toddy@debian.org>
Sat, 6 Jan 2024 19:00:33 +0000 (20:00 +0100)
committerDr. Tobias Quathamer <toddy@debian.org>
Sun, 7 Jan 2024 20:40:01 +0000 (21:40 +0100)
This simplifies some logic in if-conditions, because
smarty just returns an empty string for undefined
variables.

Also, this commit removes unnecessary values from
HTML input attributes.

17 files changed:
view/templates/field_checkbox.tpl
view/templates/field_input.tpl
view/templates/field_intcheckbox.tpl
view/templates/field_openid.tpl
view/templates/field_password.tpl
view/templates/field_select.tpl
view/templates/field_textarea.tpl
view/templates/field_themeselect.tpl
view/theme/frio/templates/field_checkbox.tpl
view/theme/frio/templates/field_fileinput.tpl
view/theme/frio/templates/field_input.tpl
view/theme/frio/templates/field_intcheckbox.tpl
view/theme/frio/templates/field_openid.tpl
view/theme/frio/templates/field_password.tpl
view/theme/frio/templates/field_select.tpl
view/theme/frio/templates/field_textarea.tpl
view/theme/frio/templates/field_themeselect.tpl

index b1e6540d880511b2d59b93db3611796f05682a35..caf7a050cdc008f94a0445d6e886df76244d0eed 100644 (file)
@@ -1,7 +1,7 @@
        <div class="field checkbox" id="div_id_{{$field.0}}">
                <label id="id_{{$field.0}}_label" for="id_{{$field.0}}">{{$field.1}}</label>
                <input type="hidden" name="{{$field.0}}" value="0">
-               <input type="checkbox" name="{{$field.0}}" id="id_{{$field.0}}" aria-describedby="{{$field.0}}_tip" value="1" {{if $field.2}}checked="checked"{{/if}} {{if $field.4}}{{$field.4 nofilter}}{{/if}}>
+               <input type="checkbox" name="{{$field.0}}" id="id_{{$field.0}}" aria-describedby="{{$field.0}}_tip" value="1" {{if $field.2}}checked{{/if}} {{$field.4 nofilter}}>
                {{if $field.3}}
                <span class="field_help" role="tooltip" id="{{$field.0}}_tip">{{$field.3 nofilter}}</span>
                {{/if}}
index 3455891b9dc4020aec9c6b65e898c7640826c99d..d5c9c078db3d5b56b6fc84cd950494e3fdf2735f 100644 (file)
@@ -1,7 +1,7 @@
-       
+
        <div class="field input" id="wrapper_{{$field.0}}">
                <label for="id_{{$field.0}}">{{$field.1}}{{if $field.4}} <span class="required" title="{{$field.4}}">*</span>{{/if}}</label>
-               <input type="{{$field.6|default:'text'}}" name="{{$field.0}}" id="id_{{$field.0}}" value="{{$field.2}}"{{if $field.4}} required{{/if}}{{if $field.5 eq "autofocus"}} autofocus{{elseif $field.5}} {{$field.5 nofilter}}{{/if}} aria-describedby="{{$field.0}}_tip" dir="auto">
+               <input type="{{$field.6|default:'text'}}" name="{{$field.0}}" id="id_{{$field.0}}" value="{{$field.2}}"{{if $field.4}} required{{/if}} {{$field.5 nofilter}} aria-describedby="{{$field.0}}_tip" dir="auto">
        {{if $field.3}}
                <span class="field_help" role="tooltip" id="{{$field.0}}_tip">{{$field.3 nofilter}}</span>
        {{/if}}
index 0bb6ef2c544c75f942b8ca297b1f8be4b51173de..b039083301438f1cbc74980c09388b9d6f502ac7 100644 (file)
@@ -1,8 +1,8 @@
 
-       
+
        <div class='field checkbox'>
                <label for='id_{{$field.0}}'>{{$field.1}}</label>
-               <input type="checkbox" name='{{$field.0}}' id='id_{{$field.0}}' value="{{$field.3}}" {{if $field.2}}checked="true"{{/if}} aria-describedby='{{$field.0}}_tip'>
+               <input type="checkbox" name='{{$field.0}}' id='id_{{$field.0}}' value="{{$field.3}}" {{if $field.2}}checked{{/if}} aria-describedby='{{$field.0}}_tip'>
                {{if $field.4}}
                <span class='field_help' role='tooltip' id='{{$field.0}}_tip'>{{$field.4 nofilter}}</span>
                {{/if}}
index 033a1f8e5029c543ccfbd00b4e5c5ff8b7115fa3..4a30d9e780f284178851023660ed505d7e4d8bf4 100644 (file)
@@ -1,6 +1,6 @@
        <div class='field input openid' id='wrapper_{{$field.0}}'>
                <label for='id_{{$field.0}}'>{{$field.1}}</label>
-               <input name='{{$field.0}}' id='id_{{$field.0}}' type="text" value="{{$field.2}}" {{if $field.4}} readonly="readonly" {{/if}} aria-describedby='{{$field.0}}_tip'>
+               <input name='{{$field.0}}' id='id_{{$field.0}}' type="text" value="{{$field.2}}" {{if $field.4}}readonly{{/if}} aria-describedby='{{$field.0}}_tip'>
                {{if $field.3}}
                <span class="field_help" role="tooltip" id="{{$field.0}}_tip">{{$field.3 nofilter}}</span>
                {{/if}}
index a0ac6a735fbdceade0ca13d2ea10a1a1c851642e..9831c79b87116d8ea3db776d63a5c3d627b7a8d1 100644 (file)
@@ -1,6 +1,6 @@
        <div class="field password" id="wrapper_{{$field.0}}">
                <label for="id_{{$field.0}}">{{$field.1}}{{if $field.4}} <span class="required" title="{{$field.4}}">*</span>{{/if}}</label>
-               <input type="password" name="{{$field.0}}" id="id_{{$field.0}}" value="{{$field.2}}"{{if $field.4}} required{{/if}}{{if $field.5 eq "autofocus"}} autofocus{{elseif $field.5}} {{$field.5 nofilter}}{{/if}}{{if $field.6}} pattern="(($field.6}}"{{/if}} aria-describedby="{{$field.0}}_tip">
+               <input type="password" name="{{$field.0}}" id="id_{{$field.0}}" value="{{$field.2}}" {{if $field.4}}required{{/if}} {{$field.5 nofilter}} {{if $field.6}}pattern="(($field.6}}"{{/if}} aria-describedby="{{$field.0}}_tip">
                {{if $field.3}}
                <span class="field_help" role="tooltip" id="{{$field.0}}_tip">{{$field.3 nofilter}}</span>
                {{/if}}
index f02110628eaf8262d0bdf10d7ef55fd6179b6d59..fff54424f07155ab02a6d9d9ea4789dab0c4967c 100644 (file)
@@ -4,9 +4,9 @@
                <select name="{{$field.0}}" id="id_{{$field.0}}" aria-describedby="{{$field.0}}_tip" {{$field.5 nofilter}}>
        {{foreach $field.4 as $opt => $val}}
                {{if $field.5 == 'multiple'}}
-                       <option value="{{$opt}}" dir="auto"{{if in_array($opt, $field.2)}} selected="selected"{{/if}}>{{$val}}</option>
+                       <option value="{{$opt}}" dir="auto" {{if in_array($opt, $field.2)}}selected{{/if}}>{{$val}}</option>
                {{else}}
-                       <option value="{{$opt}}" dir="auto"{{if $opt == $field.2}} selected="selected"{{/if}}>{{$val}}</option>
+                       <option value="{{$opt}}" dir="auto" {{if $opt == $field.2}}selected{{/if}}>{{$val}}</option>
                {{/if}}
        {{/foreach}}
                </select>
index 797556ea9fd8c9c7db7edc3eaa560c6fe584a79f..16feaaa7365f82e64c2b51eff351378511a6666d 100644 (file)
@@ -1,7 +1,7 @@
 
        <div class="field textarea">
                <label for="id_{{$field.0}}">{{$field.1}}{{if $field.4}} <span class="required" title="{{$field.4}}">*</span>{{/if}}</label>
-               <textarea class="form-control text-autosize" name="{{$field.0}}" id="id_{{$field.0}}" {{if $field.4}} required{{/if}}{{if $field.5}} {{$field.5 nofilter}}{{/if}} aria-describedby="{{$field.0}}_tip" dir="auto">{{$field.2}}</textarea>
+               <textarea class="form-control text-autosize" name="{{$field.0}}" id="id_{{$field.0}}" {{if $field.4}}required{{/if}} {{$field.5 nofilter}} aria-describedby="{{$field.0}}_tip" dir="auto">{{$field.2}}</textarea>
        {{if $field.3}}
                <span class="field_help" role="tooltip" id="{{$field.0}}_tip">{{$field.3 nofilter}}</span>
        {{/if}}
index 60676e5d1fc9ecb79bd28c7e984248ab036c2fa5..d8de748dc619d7414c9443481d264b15c7a53a64 100644 (file)
@@ -6,7 +6,7 @@
                <label for="id_{{$field.0}}">{{$field.1}}</label>
                <select name="{{$field.0}}" id="id_{{$field.0}}" {{if $field.5}}onchange="previewTheme(this);"{{/if}} aria-describedby="{{$field.0}}_tip">
        {{foreach $field.4 as $opt=>$val}}
-                       <option value="{{$opt}}" dir="auto"{{if $opt==$field.2}} selected="selected"{{/if}}>{{$val}}</option>
+                       <option value="{{$opt}}" dir="auto" {{if $opt==$field.2}}selected{{/if}}>{{$val}}</option>
        {{/foreach}}
                </select>
        {{if $field.3}}
index 2fd4641c33f9d3f58b46f2da30bb7b15119e0d63..448b2b8eeadb92d5e6196b5e5ed9de16a97aa314 100644 (file)
@@ -1,8 +1,8 @@
 
        <div class="field checkbox" id="div_id_{{$field.0}}">
                        <input type="hidden" name="{{$field.0}}" value="0">
-                       <input type="checkbox" name="{{$field.0}}" id="id_{{$field.0}}" value="1" {{if $field.2}}checked="checked"{{/if}} {{if $field.3}}aria-describedby="{{$field.0}}_tip"{{/if}} {{if $field.4}}{{$field.4 nofilter}}{{/if}}>
-                       <label for="id_{{$field.0}}">
+                       <input type="checkbox" name="{{$field.0}}" id="id_{{$field.0}}" value="1" {{if $field.2}}checked{{/if}} {{if $field.3}}aria-describedby="{{$field.0}}_tip"{{/if}} {{$field.4 nofilter}}>
+                       <label for="id_{{$field.0}}">01
                                {{$field.1}}
                                {{if $field.3}}
                                <span class="help-block" id="{{$field.0}}_tip" role="tooltip">{{$field.3 nofilter}}</span>
index 96ae45596e94b62647cc742ecb95532ef97bf0b9..51077f708160e800c95d12b10ec233945124b00c 100644 (file)
@@ -1,7 +1,7 @@
 <div class="form-group field input file">
        <label for="id_{{$field.0}}" id="label_{{$field.0}}">{{$field.1}}{{if $field.4}} <span class="required" title="{{$field.4}}">*</span>{{/if}}</label>
        <div class="input-group" id="{{$field.0}}">
-               <input class="form-control file" name="{{$field.0}}" id="id_{{$field.0}}" type="text" value="{{$field.2}}"{{if $field.4}} required{{/if}} aria-describedby="{{$field.0}}_tip">
+               <input class="form-control file" name="{{$field.0}}" id="id_{{$field.0}}" type="text" value="{{$field.2}}" {{if $field.4}}required{{/if}} aria-describedby="{{$field.0}}_tip">
                <span class="input-group-addon image-select"><i class="fa fa-picture-o"></i></span>
        </div>
        {{if $field.3}}
index 3a9e54d06a67edaa70f591bbccd675f36c267046..1d085123802bbc24cce9c642ec28f6aa1426d90a 100644 (file)
@@ -3,7 +3,7 @@
        {{if !isset($label) || $label != false }}
                <label for="id_{{$field.0}}" id="label_{{$field.0}}">{{$field.1 nofilter}}{{if $field.4}} <span class="required" title="{{$field.4}}">*</span>{{/if}}</label>
        {{/if}}
-               <input class="form-control" name="{{$field.0}}" id="id_{{$field.0}}" type="{{$field.6|default:'text'}}" value="{{$field.2}}"{{if $field.4}} required{{/if}}{{if $field.5 eq "autofocus"}} autofocus{{elseif $field.5}} {{$field.5 nofilter}}{{/if}} aria-describedby="{{$field.0}}_tip">
+               <input class="form-control" name="{{$field.0}}" id="id_{{$field.0}}" type="{{$field.6|default:'text'}}" value="{{$field.2}}" {{if $field.4}}required{{/if}} {{$field.5 nofilter}} aria-describedby="{{$field.0}}_tip">
        {{if $field.3}}
                <span class="help-block" id="{{$field.0}}_tip" role="tooltip">{{$field.3 nofilter}}</span>
        {{/if}}
index 18a2ea6ca57b4413a957a565e278ac2ca8a20ade..c44a6f702a3ba3f08ae76d4b9f1b615ceccd9b19 100644 (file)
@@ -1,6 +1,6 @@
 
        <div class="form-group field checkbox">
-               <input type="checkbox" name="{{$field.0}}" id="id_{{$field.0}}" value="{{$field.3}}" {{if $field.2}}checked="checked"{{/if}} aria-checked="{{if $field.2}}true{{else}}false{{/if}}" aria-describedby="{{$field.0}}_tip">
+               <input type="checkbox" name="{{$field.0}}" id="id_{{$field.0}}" value="{{$field.3}}" {{if $field.2}}checked{{/if}} aria-checked="{{if $field.2}}true{{else}}false{{/if}}" aria-describedby="{{$field.0}}_tip">
                <label for="id_{{$field.0}}">{{$field.1}}</label>
                {{if $field.4}}
                <span class="help-block" id="{{$field.0}}_tip" role="tooltip">{{$field.4 nofilter}}</span>
index c36dbfabca1e740425cc2d985c7dfd8cc3d559bb..c863d8934e0a9d54467ddf71a6f59654da14b4c5 100644 (file)
@@ -1,6 +1,6 @@
 <div id="id_{{$field.0}}_wrapper" class="form-group field input openid">
        <label for="id_{{$field.0}}" id="label_{{$field.0}}">{{$field.1}}</label>
-       <input class="form-control" name="{{$field.0}}" id="id_{{$field.0}}" type="text" value="{{$field.2}}" {{if $field.4}} readonly="readonly" {{/if}} aria-describedby="{{$field.0}}_tip">
+       <input class="form-control" name="{{$field.0}}" id="id_{{$field.0}}" type="text" value="{{$field.2}}" {{if $field.4}}readonly{{/if}} aria-describedby="{{$field.0}}_tip">
        {{if $field.3}}
        <span class="help-block" id="{{$field.0}}_tip" role="tooltip">{{$field.3 nofilter}}</span>
        {{/if}}
index 28fa6a8c24fa4345601e555221bf5782d0e85e73..053164823877ca26e39ab6f2cb83613adca09f94 100644 (file)
@@ -1,6 +1,6 @@
 <div id="id_{{$field.0}}_wrapper" class="form-group field input password">
        <label for="id_{{$field.0}}" id="label_{{$field.0}}">{{$field.1}}{{if $field.4}} <span class="required" title="{{$field.4}}">*</span>{{/if}}</label>
-       <input class="form-control" name="{{$field.0}}" id="id_{{$field.0}}" type="password" value="{{$field.2}}" {{if $field.4}} required{{/if}}{{if $field.5 eq "autofocus"}} autofocus{{elseif $field.5}} {{$field.5 nofilter}}{{/if}}{{if $field.6}} pattern="{{$field.6}}"{{/if}} aria-describedby="{{$field.0}}_tip">
+       <input class="form-control" name="{{$field.0}}" id="id_{{$field.0}}" type="password" value="{{$field.2}}" {{if $field.4}}required{{/if}} {{$field.5 nofilter}} {{if $field.6}}pattern="{{$field.6}}"{{/if}} aria-describedby="{{$field.0}}_tip">
        {{if $field.3}}
        <span class="help-block" id="{{$field.0}}_tip" role="tooltip">{{$field.3 nofilter}}</span>
        {{/if}}
index 4699ec47dfa5694e3c0d54d7382c78b73719314b..7ab135129a0c13f4751d3dc9d4f22445e4fbf40c 100644 (file)
@@ -4,9 +4,9 @@
                <select name="{{$field.0}}" id="id_{{$field.0}}" class="form-control" aria-describedby="{{$field.0}}_tip" {{$field.5 nofilter}}>
        {{foreach $field.4 as $opt => $val}}
                {{if $field.5 == 'multiple'}}
-                       <option value="{{$opt}}" {{if in_array($opt, $field.2)}}selected="selected"{{/if}}>{{$val}}</option>
+                       <option value="{{$opt}}" {{if in_array($opt, $field.2)}}selected{{/if}}>{{$val}}</option>
                {{else}}
-                       <option value="{{$opt}}" {{if $opt == $field.2}}selected="selected"{{/if}}>{{$val}}</option>
+                       <option value="{{$opt}}" {{if $opt == $field.2}}selected{{/if}}>{{$val}}</option>
                {{/if}}
        {{/foreach}}
                </select>
index 1398b47b93489e4452692935961d1d50e36a595e..336ad674b7069d5026875a582924a66a2ee33974 100644 (file)
@@ -2,7 +2,7 @@
        {{if $field.1}}
                <label for="id_{{$field.0}}">{{$field.1}}{{if $field.4}} <span class="required" title="{{$field.4}}">*</span>{{/if}}</label>
        {{/if}}
-               <textarea class="form-control text-autosize" name="{{$field.0}}" id="id_{{$field.0}}"{{if $field.4}} required{{/if}}{{if $field.5}} {{$field.5 nofilter}}{{/if}} aria-describedby="{{$field.0}}_tip">{{$field.2}}</textarea>
+               <textarea class="form-control text-autosize" name="{{$field.0}}" id="id_{{$field.0}}" {{if $field.4}}required{{/if}} {{$field.5 nofilter}} aria-describedby="{{$field.0}}_tip">{{$field.2}}</textarea>
        {{if $field.3}}
                <span class="help-block" id="{{$field.0}}_tip" role="tooltip">{{$field.3 nofilter}}</span>
        {{/if}}
index ddebc787118336e9f5cf7535c9341795c5b769c7..75170d786180c849d8a43a7578786cfb7fc4f2c1 100644 (file)
@@ -6,7 +6,7 @@
                <label for="id_{{$field.0}}">{{$field.1}}</label>
                <select class="form-control" name="{{$field.0}}" id="id_{{$field.0}}" {{if $field.5=="preview"}}onchange="previewTheme(this);"{{/if}} aria-describedby="{{$field.0}}_tip">
        {{foreach $field.4 as $opt=>$val}}
-                       <option value="{{$opt}}" {{if $opt==$field.2}}selected="selected"{{/if}}>{{$val}}</option>
+                       <option value="{{$opt}}" {{if $opt==$field.2}}selected{{/if}}>{{$val}}</option>
        {{/foreach}}
                </select>
        {{if $field.3}}