Added fancy unit indicator to fields.

Taloth Saldono 6 years ago
parent 6df61e305d
commit d86beb06f7

@ -7,6 +7,7 @@ namespace NzbDrone.Api.ClientSchema
public int Order { get; set; } public int Order { get; set; }
public string Name { get; set; } public string Name { get; set; }
public string Label { get; set; } public string Label { get; set; }
public string Unit { get; set; }
public string HelpText { get; set; } public string HelpText { get; set; }
public string HelpLink { get; set; } public string HelpLink { get; set; }
public object Value { get; set; } public object Value { get; set; }

@ -95,6 +95,7 @@ namespace NzbDrone.Api.ClientSchema
{ {
Name = prefix + propertyInfo.Name, Name = prefix + propertyInfo.Name,
Label = fieldAttribute.Label, Label = fieldAttribute.Label,
Unit = fieldAttribute.Unit,
HelpText = fieldAttribute.HelpText, HelpText = fieldAttribute.HelpText,
HelpLink = fieldAttribute.HelpLink, HelpLink = fieldAttribute.HelpLink,
Order = fieldAttribute.Order, Order = fieldAttribute.Order,

@ -12,6 +12,7 @@ namespace NzbDrone.Core.Annotations
public int Order { get; private set; } public int Order { get; private set; }
public string Label { get; set; } public string Label { get; set; }
public string Unit { get; set; }
public string HelpText { get; set; } public string HelpText { get; set; }
public string HelpLink { get; set; } public string HelpLink { get; set; }
public FieldType Type { get; set; } public FieldType Type { get; set; }
@ -33,4 +34,4 @@ namespace NzbDrone.Core.Annotations
Url, Url,
Captcha Captcha
} }
} }

@ -25,10 +25,10 @@ namespace NzbDrone.Core.Indexers
[FieldDefinition(0, Type = FieldType.Textbox, Label = "Seed Ratio", HelpText = "The ratio a torrent should reach before stopping, empty is download client's default", Advanced = true)] [FieldDefinition(0, Type = FieldType.Textbox, Label = "Seed Ratio", HelpText = "The ratio a torrent should reach before stopping, empty is download client's default", Advanced = true)]
public double? SeedRatio { get; set; } public double? SeedRatio { get; set; }
[FieldDefinition(1, Type = FieldType.Textbox, Label = "Seed Time", HelpText = "The time a torrent should be seeded before stopping, empty is download client's default", Advanced = true)] [FieldDefinition(1, Type = FieldType.Textbox, Label = "Seed Time", Unit = "minutes", HelpText = "The time a torrent should be seeded before stopping, empty is download client's default", Advanced = true)]
public int? SeedTime { get; set; } public int? SeedTime { get; set; }
[FieldDefinition(2, Type = FieldType.Textbox, Label = "Season-Pack Seed Time", HelpText = "The time a torrent should be seeded before stopping, empty is download client's default", Advanced = true)] [FieldDefinition(2, Type = FieldType.Textbox, Label = "Season-Pack Seed Time", Unit = "minutes", HelpText = "The time a torrent should be seeded before stopping, empty is download client's default", Advanced = true)]
public int? SeasonPackSeedTime { get; set; } public int? SeasonPackSeedTime { get; set; }
} }
} }

@ -48,6 +48,18 @@
margin-left: 0px; margin-left: 0px;
} }
} }
.unit-inline {
width: 75px;
margin-left: -100px;
margin-top: 7px;
color: lightgray;
float: left;
position: relative;
text-align: right;
user-select: none;
pointer-events: none;
}
} }
.text-area-help { .text-area-help {

@ -4,5 +4,6 @@
<div class="col-sm-5"> <div class="col-sm-5">
<input type="text" name="fields.{{order}}.value" validation-name="{{name}}" spellcheck="false" class="form-control"/> <input type="text" name="fields.{{order}}.value" validation-name="{{name}}" spellcheck="false" class="form-control"/>
</div> </div>
{{#if unit}}<span class="unit-inline">{{unit}}</span>{{/if}}
{{> FormHelpPartial}} {{> FormHelpPartial}}
</div> </div>

Loading…
Cancel
Save