Added fancy unit indicator to fields.

This commit is contained in:
Taloth Saldono 2018-05-03 23:07:48 +02:00
parent 6df61e305d
commit d86beb06f7
6 changed files with 19 additions and 3 deletions

View File

@ -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; }

View File

@ -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,

View File

@ -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
}
}
}

View File

@ -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; }
}
}

View File

@ -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 {

View File

@ -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>