Feature: Job Queues
Also UI style, theme and element changes
This commit is contained in:
@@ -6,19 +6,19 @@
|
||||
@using System.Web.Mvc
|
||||
@using System.Web.Mvc.Html;
|
||||
@using Disco.Services.Web;
|
||||
@helper FriendlyDate(DateTime d, string ElementId = null)
|
||||
{<span @(ElementId == null ? null : new HtmlString(string.Format("id=\"{0}\" ", ElementId)))title="@d.ToFullDateTime()" data-discodatetime="@d.ToSortable()" data-datetimeformatted="@d.ToJavaScript()" class="date nowrap">@d.FromNow()</span>}
|
||||
@helper FriendlyDate(DateTime? d, string NullValue = "n/a", string ElementId = null)
|
||||
{<span @(ElementId == null ? null : new HtmlString(string.Format("id=\"{0}\" ", ElementId)))title="@d.ToFullDateTime(NullValue)" data-discodatetime="@d.ToSortable()" data-datetimeformatted="@d.ToJavaScript()" class="date nowrap">@d.FromNow(NullValue)</span>}
|
||||
@helper FriendlyDate(DateTime d, string ElementId = null, bool WithoutSuffix = false)
|
||||
{<span @(ElementId == null ? null : new HtmlString(string.Format("id=\"{0}\" ", ElementId)))title="@d.ToFullDateTime()" data-discodatetime="@d.ToSortable()" data-datetimeformatted="@d.ToJavaScript()" class="date nowrap">@d.FromNow(WithoutSuffix)</span>}
|
||||
@helper FriendlyDate(DateTime? d, string NullValue = "n/a", string ElementId = null, bool WithoutSuffix = false)
|
||||
{<span @(ElementId == null ? null : new HtmlString(string.Format("id=\"{0}\" ", ElementId)))title="@d.ToFullDateTime(NullValue)" data-discodatetime="@d.ToSortable()" data-datetimeformatted="@d.ToJavaScript()" class="date nowrap">@d.FromNow(WithoutSuffix, NullValue)</span>}
|
||||
@helper RadioButtonList(string id, List<System.Web.Mvc.SelectListItem> items, int columns = 1)
|
||||
{
|
||||
@ItemList("radio", id, items, columns)
|
||||
}
|
||||
@helper CheckBoxList(string id, List<System.Web.Mvc.SelectListItem> items, int columns = 1, bool alignEven = true, int? forceUniqueIds = null)
|
||||
@helper CheckBoxList(string id, List<System.Web.Mvc.SelectListItem> items, int columns = 1, bool alignEven = true, int? forceUniqueIds = null, bool htmlEncodeText = true)
|
||||
{
|
||||
@ItemList("checkbox", id, items, columns, alignEven, forceUniqueIds)
|
||||
@ItemList("checkbox", id, items, columns, alignEven, forceUniqueIds, htmlEncodeText)
|
||||
}
|
||||
@helper ItemList(string inputType, string id, List<System.Web.Mvc.SelectListItem> items, int columns = 1, bool alignEven = true, int? forceUniqueIds = null)
|
||||
@helper ItemList(string inputType, string id, List<System.Web.Mvc.SelectListItem> items, int columns = 1, bool alignEven = true, int? forceUniqueIds = null, bool htmlEncodeText = true)
|
||||
{
|
||||
int itemsPerColumn = items.Count / columns;
|
||||
int columnWidth = (100 / columns);
|
||||
@@ -37,7 +37,10 @@
|
||||
itemNextId++;
|
||||
var itemId = forceUniqueIds.HasValue ? string.Format("{0}_{1}_{2}", id, item.Value, forceUniqueIds++) : string.Format("{0}_{1}", id, item.Value);
|
||||
<li>
|
||||
<input id="@itemId" name="@id" value="@item.Value" type="@inputType" @(item.Selected ? new HtmlString("checked=\"checked\" ") : null)/><label for="@itemId">@item.Text</label></li>
|
||||
<input id="@itemId" name="@id" value="@item.Value" type="@inputType" @(item.Selected ? new HtmlString("checked=\"checked\" ") : null)/><label for="@itemId">@if (htmlEncodeText)
|
||||
{ @item.Text }
|
||||
else
|
||||
{ @(new HtmlString(item.Text)) }</label></li>
|
||||
}
|
||||
}
|
||||
</ul>
|
||||
@@ -46,23 +49,23 @@
|
||||
</tr>
|
||||
</table>
|
||||
}
|
||||
@helper FriendlyDateAndUser(DateTime? d, User u, string DateNullValue = "n/a")
|
||||
@helper FriendlyDateAndUser(DateTime? d, User u, string DateNullValue = "n/a", bool WithoutSuffix = false)
|
||||
{
|
||||
@FriendlyDate(d, DateNullValue);
|
||||
@FriendlyUser(u, null, "by");
|
||||
@FriendlyDate(d, DateNullValue, WithoutSuffix: WithoutSuffix);
|
||||
@FriendlyUser(u, null, " by");
|
||||
}
|
||||
@helper FriendlyDateAndUser(DateTime d, User u)
|
||||
@helper FriendlyDateAndUser(DateTime d, User u, bool WithoutSuffix = false)
|
||||
{
|
||||
@FriendlyDate(d);
|
||||
@FriendlyUser(u, null, "by");
|
||||
@FriendlyDate(d, WithoutSuffix: WithoutSuffix);
|
||||
@FriendlyUser(u, null, " by");
|
||||
}
|
||||
@helper FriendlyDateAndTitleUser(DateTime? d, User u, string DateNullValue = "n/a")
|
||||
@helper FriendlyDateAndTitleUser(DateTime? d, User u, string DateNullValue = "n/a", bool WithoutSuffix = false)
|
||||
{
|
||||
<span title="@d.ToFullDateTime(DateNullValue) by @u" data-discodatetime="@d.ToSortable()" class="date nowrap">@d.FromNow(DateNullValue)</span>
|
||||
<span title="@d.ToFullDateTime(DateNullValue) by @u" data-discodatetime="@d.ToSortable()" class="date nowrap">@d.FromNow(WithoutSuffix, DateNullValue)</span>
|
||||
}
|
||||
@helper FriendlyDateAndTitleUser(DateTime d, User u)
|
||||
@helper FriendlyDateAndTitleUser(DateTime d, User u, bool WithoutSuffix = false)
|
||||
{
|
||||
<span title="@d.ToFullDateTime() by @u" data-discodatetime="@d.ToSortable()" class="date nowrap">@d.FromNow()</span>
|
||||
<span title="@d.ToFullDateTime() by @u" data-discodatetime="@d.ToSortable()" class="date nowrap">@d.FromNow(WithoutSuffix)</span>
|
||||
}
|
||||
@helper FriendlyUser(User u, string nullValue = null, string prepend = null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user