mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-30 19:50:15 -07:00
Moved source code under src folder - massive change
This commit is contained in:
parent
2fc8123d6b
commit
5bf0e197ec
1499 changed files with 1054 additions and 1444 deletions
21
src/UI/Form/CheckboxTemplate.html
Normal file
21
src/UI/Form/CheckboxTemplate.html
Normal file
|
@ -0,0 +1,21 @@
|
|||
<div class="control-group">
|
||||
<label class="control-label">{{label}}</label>
|
||||
|
||||
<div class="controls">
|
||||
<label class="checkbox toggle well">
|
||||
<input type="checkbox" name="fields.{{order}}.value"/>
|
||||
<p>
|
||||
<span>Yes</span>
|
||||
<span>No</span>
|
||||
</p>
|
||||
|
||||
<div class="btn btn-primary slide-button"/>
|
||||
</label>
|
||||
|
||||
{{#if helpText}}
|
||||
<span class="help-inline-checkbox">
|
||||
<i class="icon-question-sign" title="{{helpText}}"/>
|
||||
</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
55
src/UI/Form/FormBuilder.js
Normal file
55
src/UI/Form/FormBuilder.js
Normal file
|
@ -0,0 +1,55 @@
|
|||
'use strict';
|
||||
define(
|
||||
[
|
||||
'handlebars'
|
||||
], function (Handlebars) {
|
||||
|
||||
var _fieldBuilder = function (field) {
|
||||
if (!field.type) {
|
||||
return _templateRenderer.apply(field,
|
||||
[
|
||||
'Form/TextboxTemplate'
|
||||
]);
|
||||
}
|
||||
|
||||
if (field.type === 'password') {
|
||||
return _templateRenderer.apply(field,
|
||||
[
|
||||
'Form/PasswordTemplate'
|
||||
]);
|
||||
}
|
||||
|
||||
if (field.type === 'checkbox') {
|
||||
return _templateRenderer.apply(field,
|
||||
[
|
||||
'Form/CheckboxTemplate'
|
||||
]);
|
||||
}
|
||||
|
||||
if (field.type === 'select') {
|
||||
return _templateRenderer.apply(field,
|
||||
[
|
||||
'Form/SelectTemplate'
|
||||
]);
|
||||
}
|
||||
|
||||
return _templateRenderer.apply(field,
|
||||
[
|
||||
'Form/TextboxTemplate'
|
||||
]);
|
||||
};
|
||||
|
||||
var _templateRenderer = function (templateName) {
|
||||
var templateFunction = Marionette.TemplateCache.get(templateName);
|
||||
return new Handlebars.SafeString(templateFunction(this));
|
||||
};
|
||||
|
||||
Handlebars.registerHelper('formBuilder', function () {
|
||||
var ret = '';
|
||||
_.each(this.fields, function (field) {
|
||||
ret += _fieldBuilder(field);
|
||||
});
|
||||
|
||||
return new Handlebars.SafeString(ret);
|
||||
});
|
||||
});
|
11
src/UI/Form/FormHelpPartial.html
Normal file
11
src/UI/Form/FormHelpPartial.html
Normal file
|
@ -0,0 +1,11 @@
|
|||
{{#if helpText}}
|
||||
<span class="help-inline">
|
||||
<i class="icon-question-sign" title="{{helpText}}"/>
|
||||
</span>
|
||||
{{/if}}
|
||||
|
||||
{{#if helpLink}}
|
||||
<span class="help-inline">
|
||||
<a href="{{helpLink}}" class="help-link"><i class="icon-info-sign"/></a>
|
||||
</span>
|
||||
{{/if}}
|
12
src/UI/Form/PasswordTemplate.html
Normal file
12
src/UI/Form/PasswordTemplate.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
<div class="control-group">
|
||||
<label class="control-label">{{label}}</label>
|
||||
|
||||
<div class="controls">
|
||||
<input type="password" name="fields.{{order}}.value" validation-name="{{name}}"/>
|
||||
{{#if helpText}}
|
||||
<span class="help-inline">
|
||||
<i class="icon-question-sign" title="{{helpText}}"/>
|
||||
</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
16
src/UI/Form/SelectTemplate.html
Normal file
16
src/UI/Form/SelectTemplate.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
<div class="control-group">
|
||||
<label class="control-label">{{label}}</label>
|
||||
|
||||
<div class="controls">
|
||||
<select name="fields.{{order}}.value">
|
||||
{{#each selectOptions}}
|
||||
<option value="{{value}}">{{name}}</option>
|
||||
{{/each}}
|
||||
</select>
|
||||
{{#if helpText}}
|
||||
<span class="help-inline">
|
||||
<i class="icon-question-sign" title="{{helpText}}"/>
|
||||
</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
8
src/UI/Form/TextboxTemplate.html
Normal file
8
src/UI/Form/TextboxTemplate.html
Normal file
|
@ -0,0 +1,8 @@
|
|||
<div class="control-group">
|
||||
<label class="control-label">{{label}}</label>
|
||||
|
||||
<div class="controls">
|
||||
<input type="text" name="fields.{{order}}.value" validation-name="{{name}}" spellcheck="false"/>
|
||||
{{> FormHelpPartial}}
|
||||
</div>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue