Skip to content

Commit

Permalink
Shorten a bunch of html lines. (#800)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnewhall authored Aug 4, 2024
2 parents 1eef9b9 + b027994 commit 8bdf294
Show file tree
Hide file tree
Showing 22 changed files with 755 additions and 301 deletions.
58 changes: 43 additions & 15 deletions pkg/bindata/templates/downloaders/deluge.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@
<div style="float: left;"><img src="{{files}}/images/logo/deluge.png" style="height:50px;">
</div><h2 class="mb-3" style="margin-bottom:-45px">Deluge</h2>
<div style="float: right;">
<button id="download-Deluge-addbutton" onclick="addInstance('download', 'Deluge')" data-prefix="Apps" data-sslname="ValidSSL" data-names='["Name","","Config.URL","Config.Password","Interval","Timeout"]' type="button" title="Add another instance of Deluge." class="add-new-item-button btn btn-primary"><i class="fa fa-plus"></i></button>
<button id="download-Deluge-addbutton" onclick="addInstance('download', 'Deluge')" data-prefix="Apps" data-sslname="ValidSSL" type="button"
data-names='["Name","","Config.URL","Config.Password","Interval","Timeout"]' title="Add another instance of Deluge." class="add-new-item-button btn btn-primary">
<i class="fa fa-plus"></i>
</button>
</div>
</td>
<td colspan="7" class="tablet-hide desktop-hide">
<button onclick="addInstance('download', 'Deluge')" data-prefix="Apps" type="button" title="Add another instance of Deluge." class="add-new-item-button btn btn-primary"><i class="fa fa-plus"></i></button>
<button onclick="addInstance('download', 'Deluge')" data-prefix="Apps" type="button" title="Add another instance of Deluge." class="add-new-item-button btn btn-primary">
<i class="fa fa-plus"></i>
</button>
<h2 class="mb-3" style="margin-left:5px;display:inline;">Deluge</h2>
<div style="float:right;"><img src="{{files}}/images/logo/deluge.png" style="height:50px;"></div>
</td>
Expand All @@ -24,13 +29,16 @@ <h2 class="mb-3" style="margin-left:5px;display:inline;">Deluge</h2>
<span class="dialogTitle">Actions</span>
</td>
<td>
<div style="display:none;" class="dialogText">Name is optional, but required to be unique if you wish to enable service checks on the instance. Otherwise, it's used to identify the instance easier.</div>
<div style="display:none;" class="dialogText">
Name is optional, but required to be unique if you wish to enable service checks on the instance.
Otherwise, it's used to identify the instance easier.
</div>
<a onClick="dialog($(this), 'left')" class="help-icon far fa-question-circle"></a>
<span class="dialogTitle">Name</span>
</td>
<td colspan="2">
<div style="display:none;" class="dialogText">
http:// or https:// URL for the application instance. Providing an https:// URL reveals a checkbox.
http:// or https:// URL for the application instance. Providing an https:// URL reveals a checkbox.
Checking this box enables SSL certificate validation; invalid certificates generate an error.
</div>
<a onClick="dialog($(this), 'right')" class="help-icon far fa-question-circle"></a>
Expand All @@ -43,21 +51,29 @@ <h2 class="mb-3" style="margin-left:5px;display:inline;">Deluge</h2>
<span class="dialogTitle">Interval</span>
</td>
<td>
<div style="display:none;" class="dialogText">This controls the maximum duration a request to this application may elapse. Selecting <b>No Timeout</b> can be dangerous. Selecting <b>Disabled</b> completely disables the instance.</div>
<div style="display:none;" class="dialogText">
This controls the maximum duration a request to this application may elapse.
Selecting <b>No Timeout</b> can be dangerous. Selecting <b>Disabled</b> completely disables the instance.
</div>
<a onClick="dialog($(this), 'right')" class="help-icon far fa-question-circle"></a>
<span class="dialogTitle">Timeout</span>
</td>
</tr>
</thead>
<tbody id="download-Deluge-container">
{{- range $index, $app := .Config.Apps.Deluge}}
<input disabled style="display: none;" class="client-parameter download-Deluge{{$index}}-deleted" data-group="download" data-label="Deluge {{instance $index}} Deleted" data-original="false" value="false">
<input disabled style="display: none;" class="client-parameter download-Deluge{{$index}}-deleted" data-group="download"
data-label="Deluge {{instance $index}} Deleted" data-original="false" value="false">
<tr class="download-Deluge {{if (lt $app.Timeout.Seconds (add 0 0))}}bk-danger{{end}}" id="download-Deluge-{{$index}}">
<td style="white-space:nowrap;">
<div class="btn-group" role="group" style="display:flex;">
<button onclick="removeInstance('download-Deluge', {{$index}})" type="button" class="delete-item-button btn btn-danger btn-sm" style="font-size:18px;width:35px;"><i class="fa fa-minus"></i></button>
<button onclick="removeInstance('download-Deluge', {{$index}})" type="button" class="delete-item-button btn btn-danger btn-sm" style="font-size:18px;width:35px;">
<i class="fa fa-minus"></i>
</button>
<button id="DelugeIndexLabel{{$index}}" class="btn btn-sm" style="font-size:18px;width:35px;pointer-events:none;">{{instance $index}}</button>
<button onClick="testInstance($(this), 'Deluge', '{{$index}}')" type="button" class="btn btn-success btn-sm checkInstanceBtn" style="font-size:18px;"><i class="fas fa-check-double"></i></button>
<button onClick="testInstance($(this), 'Deluge', '{{$index}}')" type="button" class="btn btn-success btn-sm checkInstanceBtn" style="font-size:18px;">
<i class="fas fa-check-double"></i>
</button>
</div>
</td>
<td>
Expand All @@ -73,7 +89,9 @@ <h2 class="mb-3" style="margin-left:5px;display:inline;">Deluge</h2>
<span class="dialogTitle" style="display:none;">Variable: {{printf "%s_DELUGE_%d_NAME" $.Flags.EnvPrefix $index}}</span>
</div>
{{- end}}
<input type="text" id="Apps.Deluge.{{$index}}.Name" name="Apps.Deluge.{{$index}}.Name" data-index="{{$index}}" data-app="Deluge" class="client-parameter form-control input-sm" data-group="download" data-label="Deluge {{instance $index}} Name" data-original="{{$app.Name}}" value="{{$app.Name}}">
<input type="text" id="Apps.Deluge.{{$index}}.Name" name="Apps.Deluge.{{$index}}.Name" data-index="{{$index}}" data-app="Deluge"
class="client-parameter form-control input-sm" data-group="download" data-label="Deluge {{instance $index}} Name"
data-original="{{$app.Name}}" value="{{$app.Name}}">
</div>
</div>
</form>
Expand All @@ -91,9 +109,12 @@ <h2 class="mb-3" style="margin-left:5px;display:inline;">Deluge</h2>
<span class="dialogTitle" style="display:none;">Variable: {{printf "%s_DELUGE_%d_URL" $.Flags.EnvPrefix $index}}</span>
</div>
{{- end}}
<input type="text" id="Apps.Deluge.{{$index}}.Config.URL" onChange="showhttps($(this).val(), '#Deluge{{$index}}SSL');" name="Apps.Deluge.{{$index}}.Config.URL" data-index="{{$index}}" data-app="Deluge" class="client-parameter form-control input-sm" data-group="download" data-label="Deluge {{instance $index}} URL" data-original="{{$app.URL}}" value="{{$app.URL}}">
<input type="text" id="Apps.Deluge.{{$index}}.Config.URL" onChange="showhttps($(this).val(), '#Deluge{{$index}}SSL');" name="Apps.Deluge.{{$index}}.Config.URL"
data-index="{{$index}}" data-app="Deluge" class="client-parameter form-control input-sm" data-group="download" data-label="Deluge {{instance $index}} URL"
data-original="{{$app.URL}}" value="{{$app.URL}}">
<div style="width:30px; max-width:30px;{{if not (contains $app.URL "https://")}}display:none;{{end}}" id="Deluge{{$index}}SSL" class="input-group-addon input-sm">
<input type="checkbox" id="Apps.Deluge.{{$index}}.ValidSSL" name="Apps.Deluge.{{$index}}.ValidSSL" data-index="{{$index}}" data-app="Deluge" class="client-parameter" data-group="download" data-label="Deluge {{instance $index}} SSL" data-original="{{$app.ValidSSL}}" {{if $app.ValidSSL}}checked {{end}}value="true">
<input type="checkbox" id="Apps.Deluge.{{$index}}.ValidSSL" name="Apps.Deluge.{{$index}}.ValidSSL" data-index="{{$index}}" data-app="Deluge" class="client-parameter"
data-group="download" data-label="Deluge {{instance $index}} SSL" data-original="{{$app.ValidSSL}}" {{if $app.ValidSSL}}checked {{end}}value="true">
</div>
</div>
</div>
Expand All @@ -112,8 +133,12 @@ <h2 class="mb-3" style="margin-left:5px;display:inline;">Deluge</h2>
<span class="dialogTitle" style="display:none;">Variable: {{printf "%s_DELUGE_%d_PASSWORD" $.Flags.EnvPrefix $index}}</span>
</div>
{{- end}}
<input type="password" autocomplete="off" id="Apps.Deluge.{{$index}}.Config.Password" name="Apps.Deluge.{{$index}}.Config.Password" data-index="{{$index}}" data-app="Deluge" class="client-parameter form-control input-sm" data-group="download" data-label="Deluge {{instance $index}} Password" data-original="{{$app.Password}}" value="{{$app.Password}}">
<div style="width:35px; max-width:35px;" class="input-group-addon input-sm" onClick="togglePassword('Apps.Deluge.{{$index}}.Config.Password', $(this).find('i'));"><i class="fas fa-low-vision secret-input"></i></div>
<input type="password" autocomplete="off" id="Apps.Deluge.{{$index}}.Config.Password" name="Apps.Deluge.{{$index}}.Config.Password"
data-index="{{$index}}" data-app="Deluge" class="client-parameter form-control input-sm" data-group="download" data-label="Deluge {{instance $index}} Password"
data-original="{{$app.Password}}" value="{{$app.Password}}">
<div style="width:35px; max-width:35px;" class="input-group-addon input-sm" onClick="togglePassword('Apps.Deluge.{{$index}}.Config.Password', $(this).find('i'));">
<i class="fas fa-low-vision secret-input"></i>
</div>
</div>
</div>
</form>
Expand All @@ -131,7 +156,9 @@ <h2 class="mb-3" style="margin-left:5px;display:inline;">Deluge</h2>
<span class="dialogTitle" style="display:none;">Variable: {{printf "%s_DELUGE_%d_INTERVAL" $.Flags.EnvPrefix $index}}</span>
</div>
{{- end}}
<select type="select" id="Apps.Deluge.{{$index}}.Interval" name="Apps.Deluge.{{$index}}.Interval" data-index="{{$index}}" data-app="Deluge" class="client-parameter form-control input-sm" data-group="download" data-label="Deluge {{instance $index}} Interval" data-original="{{$app.Interval}}" value="{{$app.Interval}}">
<select type="select" id="Apps.Deluge.{{$index}}.Interval" name="Apps.Deluge.{{$index}}.Interval" data-index="{{$index}}"
data-app="Deluge" class="client-parameter form-control input-sm" data-group="download" data-label="Deluge {{instance $index}} Interval"
data-original="{{$app.Interval}}" value="{{$app.Interval}}">
{{template "includes/intervaloptions.html" $app.Interval}}
</select>
</div>
Expand All @@ -151,7 +178,8 @@ <h2 class="mb-3" style="margin-left:5px;display:inline;">Deluge</h2>
<span class="dialogTitle" style="display:none;">Variable: {{printf "%s_DELUGE_%d_TIMEOUT" $.Flags.EnvPrefix $index}}</span>
</div>
{{- end}}
<select type="select" id="Apps.Deluge.{{$index}}.Timeout" name="Apps.Deluge.{{$index}}.Timeout" data-index="{{$index}}" data-app="Deluge" class="client-parameter form-control input-sm" data-group="download" data-label="Deluge {{instance $index}} Timeout" data-original="{{$app.Timeout}}">
<select type="select" id="Apps.Deluge.{{$index}}.Timeout" name="Apps.Deluge.{{$index}}.Timeout" data-index="{{$index}}" data-app="Deluge"
class="client-parameter form-control input-sm" data-group="download" data-label="Deluge {{instance $index}} Timeout" data-original="{{$app.Timeout}}">
<option value="-1s" {{if eq $app.Timeout.Seconds (add 0 -1)}}selected {{end}}>Disabled</option>
<option value="0s" {{if eq $app.Timeout.Seconds (add 0 0)}}selected {{end}}>No Timeout</option>
{{- range $i := one259 }}
Expand Down
Loading

0 comments on commit 8bdf294

Please sign in to comment.