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 string Name { get; set; }
public string Label { get; set; }
public string Unit { get; set; }
public string HelpText { get; set; }
public string HelpLink { get; set; }
public object Value { get; set; }

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

@ -12,6 +12,7 @@ namespace NzbDrone.Core.Annotations
public int Order { get; private set; }
public string Label { get; set; }
public string Unit { get; set; }
public string HelpText { get; set; }
public string HelpLink { get; set; }
public FieldType Type { get; set; }
@ -33,4 +34,4 @@ namespace NzbDrone.Core.Annotations
Url,
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)]
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; }
[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; }
}
}

@ -48,6 +48,18 @@
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 {

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

Loading…
Cancel
Save