Feature #26: User Flags
Flags can be associated with Users. Includes minor updates to Job Queues and improved visibility of user information.
This commit is contained in:
@@ -4,10 +4,7 @@ using Disco.Services.Authorization;
|
||||
using Disco.Services.Jobs.JobQueues;
|
||||
using Disco.Services.Users;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.BI.Extensions
|
||||
{
|
||||
@@ -146,7 +143,7 @@ namespace Disco.BI.Extensions
|
||||
public static void OnRemove(this JobQueueJob jqj, User Technician, string Comment)
|
||||
{
|
||||
if (!jqj.CanRemove())
|
||||
throw new InvalidOperationException("Removing job from queue is Denied");
|
||||
throw new InvalidOperationException("Removing job from queue is denied");
|
||||
|
||||
jqj.RemovedDate = DateTime.Now;
|
||||
jqj.RemovedUserId = Technician.UserId;
|
||||
@@ -173,7 +170,7 @@ namespace Disco.BI.Extensions
|
||||
return false;
|
||||
|
||||
// Already in Queue?
|
||||
if (j.JobQueues.Count(jjq => !jjq.RemovedDate.HasValue && jjq.JobQueueId == jq.Id) > 0)
|
||||
if (j.JobQueues.Any(jjq => !jjq.RemovedDate.HasValue && jjq.JobQueueId == jq.Id))
|
||||
return false;
|
||||
|
||||
// Can add ANY queue
|
||||
@@ -191,7 +188,7 @@ namespace Disco.BI.Extensions
|
||||
public static JobQueueJob OnAddQueue(this Job j, DiscoDataContext Database, JobQueue jq, User Technician, string Comment, DateTime? SLAExpires, JobQueuePriority Priority)
|
||||
{
|
||||
if (!j.CanAddQueue(jq))
|
||||
throw new InvalidOperationException("Adding job to queue is Denied");
|
||||
throw new InvalidOperationException("Adding job to queue is denied");
|
||||
|
||||
if (SLAExpires.HasValue && SLAExpires.Value < DateTime.Now)
|
||||
throw new ArgumentException("The SLA Date must be greater than the current time", "SLAExpires");
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Users;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.BI.Extensions
|
||||
{
|
||||
public static class UserFlagActionExtensions
|
||||
{
|
||||
|
||||
#region Edit Comments
|
||||
public static bool CanEditComments(this UserFlagAssignment fa)
|
||||
{
|
||||
return UserService.CurrentAuthorization.Has(Claims.User.Actions.EditFlags);
|
||||
}
|
||||
public static void OnEditComments(this UserFlagAssignment fa, string Comments)
|
||||
{
|
||||
if (!fa.CanEditComments())
|
||||
throw new InvalidOperationException("Editing comments for user flags is denied");
|
||||
|
||||
fa.Comments = string.IsNullOrWhiteSpace(Comments) ? null : Comments.Trim();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Remove
|
||||
public static bool CanRemove(this UserFlagAssignment fa)
|
||||
{
|
||||
if (fa.RemovedDate.HasValue)
|
||||
return false;
|
||||
|
||||
return UserService.CurrentAuthorization.Has(Claims.User.Actions.RemoveFlags);
|
||||
}
|
||||
public static void OnRemove(this UserFlagAssignment fa, User Technician)
|
||||
{
|
||||
if (!fa.CanRemove())
|
||||
throw new InvalidOperationException("Removing user flags is denied");
|
||||
|
||||
fa.RemovedDate = DateTime.Now;
|
||||
fa.RemovedUserId = Technician.UserId;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Add
|
||||
public static bool CanAddUserFlags(this User u)
|
||||
{
|
||||
return UserService.CurrentAuthorization.Has(Claims.User.Actions.AddFlags);
|
||||
}
|
||||
public static bool CanAddUserFlag(this User u, UserFlag flag)
|
||||
{
|
||||
// Shortcut
|
||||
if (!u.CanAddUserFlags())
|
||||
return false;
|
||||
|
||||
// Already has User Flag?
|
||||
if (u.UserFlagAssignments.Any(fa => !fa.RemovedDate.HasValue && fa.UserFlagId == flag.Id))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
public static UserFlagAssignment OnAddUserFlag(this User u, DiscoDataContext Database, UserFlag flag, User Technician, string Comments)
|
||||
{
|
||||
if (!u.CanAddUserFlag(flag))
|
||||
throw new InvalidOperationException("Adding user flag is denied");
|
||||
|
||||
var fa = new UserFlagAssignment()
|
||||
{
|
||||
UserFlagId = flag.Id,
|
||||
UserId = u.UserId,
|
||||
AddedDate = DateTime.Now,
|
||||
AddedUserId = Technician.UserId,
|
||||
Comments = string.IsNullOrWhiteSpace(Comments) ? null : Comments.Trim()
|
||||
};
|
||||
|
||||
Database.UserFlagAssignments.Add(fa);
|
||||
return fa;
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -112,6 +112,7 @@
|
||||
<Compile Include="BI\Extensions\AttachmentExtensions.cs" />
|
||||
<Compile Include="BI\Extensions\AuthorizationRoleExtensions.cs" />
|
||||
<Compile Include="BI\Extensions\ClientServicesExtensions.cs" />
|
||||
<Compile Include="BI\Extensions\UserFlagActionExtensions.cs" />
|
||||
<Compile Include="BI\Extensions\DeviceActionExtensions.cs" />
|
||||
<Compile Include="BI\Extensions\DeviceBatchExtensions.cs" />
|
||||
<Compile Include="BI\Extensions\DeviceCertificateExtensions.cs" />
|
||||
@@ -203,7 +204,7 @@
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<UserProperties BuildVersion_UpdateFileVersion="True" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="False" BuildVersion_BuildAction="Both" BuildVersion_StartDate="2011/7/1" />
|
||||
<UserProperties BuildVersion_StartDate="2011/7/1" BuildVersion_BuildAction="Both" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_UpdateFileVersion="True" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
|
||||
@@ -139,6 +139,10 @@
|
||||
<Compile Include="Migrations\201404080227546_DBv13.Designer.cs">
|
||||
<DependentUpon>201404080227546_DBv13.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\201406090652547_DBv14.cs" />
|
||||
<Compile Include="Migrations\201406090652547_DBv14.Designer.cs">
|
||||
<DependentUpon>201406090652547_DBv14.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\Configuration.cs" />
|
||||
<Compile Include="Migrations\DiscoDataMigrator.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
@@ -193,6 +197,9 @@
|
||||
<EmbeddedResource Include="Migrations\201404080227546_DBv13.resx">
|
||||
<DependentUpon>201404080227546_DBv13.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Migrations\201406090652547_DBv14.resx">
|
||||
<DependentUpon>201406090652547_DBv14.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
@@ -206,7 +213,7 @@
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<UserProperties BuildVersion_UpdateFileVersion="True" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_StartDate="2011/7/1" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildAction="Both" />
|
||||
<UserProperties BuildVersion_BuildAction="Both" BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="False" BuildVersion_StartDate="2011/7/1" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_UpdateFileVersion="True" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
// <auto-generated />
|
||||
namespace Disco.Data.Migrations
|
||||
{
|
||||
using System.Data.Entity.Migrations;
|
||||
using System.Data.Entity.Migrations.Infrastructure;
|
||||
using System.Resources;
|
||||
|
||||
public sealed partial class DBv14 : IMigrationMetadata
|
||||
{
|
||||
private readonly ResourceManager Resources = new ResourceManager(typeof(DBv14));
|
||||
|
||||
string IMigrationMetadata.Id
|
||||
{
|
||||
get { return "201406090652547_DBv14"; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Source
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Target
|
||||
{
|
||||
get { return Resources.GetString("Target"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
namespace Disco.Data.Migrations
|
||||
{
|
||||
using System;
|
||||
using System.Data.Entity.Migrations;
|
||||
|
||||
public partial class DBv14 : DbMigration
|
||||
{
|
||||
public override void Up()
|
||||
{
|
||||
CreateTable(
|
||||
"dbo.UserFlagAssignments",
|
||||
c => new
|
||||
{
|
||||
Id = c.Int(nullable: false, identity: true),
|
||||
UserFlagId = c.Int(nullable: false),
|
||||
UserId = c.String(nullable: false, maxLength: 50),
|
||||
AddedDate = c.DateTime(nullable: false),
|
||||
AddedUserId = c.String(nullable: false, maxLength: 50),
|
||||
RemovedDate = c.DateTime(),
|
||||
RemovedUserId = c.String(maxLength: 50),
|
||||
Comments = c.String(),
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.ForeignKey("dbo.UserFlags", t => t.UserFlagId)
|
||||
.ForeignKey("dbo.Users", t => t.UserId)
|
||||
.ForeignKey("dbo.Users", t => t.AddedUserId)
|
||||
.ForeignKey("dbo.Users", t => t.RemovedUserId)
|
||||
.Index(t => t.UserFlagId)
|
||||
.Index(t => t.UserId)
|
||||
.Index(t => t.AddedUserId)
|
||||
.Index(t => t.RemovedUserId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.UserFlags",
|
||||
c => new
|
||||
{
|
||||
Id = c.Int(nullable: false, identity: true),
|
||||
Name = c.String(nullable: false, maxLength: 100),
|
||||
Description = c.String(maxLength: 500),
|
||||
Icon = c.String(nullable: false, maxLength: 25),
|
||||
IconColour = c.String(nullable: false, maxLength: 10),
|
||||
})
|
||||
.PrimaryKey(t => t.Id);
|
||||
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
DropIndex("dbo.UserFlagAssignments", new[] { "RemovedUserId" });
|
||||
DropIndex("dbo.UserFlagAssignments", new[] { "AddedUserId" });
|
||||
DropIndex("dbo.UserFlagAssignments", new[] { "UserId" });
|
||||
DropIndex("dbo.UserFlagAssignments", new[] { "UserFlagId" });
|
||||
DropForeignKey("dbo.UserFlagAssignments", "RemovedUserId", "dbo.Users");
|
||||
DropForeignKey("dbo.UserFlagAssignments", "AddedUserId", "dbo.Users");
|
||||
DropForeignKey("dbo.UserFlagAssignments", "UserId", "dbo.Users");
|
||||
DropForeignKey("dbo.UserFlagAssignments", "UserFlagId", "dbo.UserFlags");
|
||||
DropTable("dbo.UserFlags");
|
||||
DropTable("dbo.UserFlagAssignments");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -23,6 +23,8 @@ namespace Disco.Data.Repository
|
||||
|
||||
public virtual DbSet<User> Users { get; set; }
|
||||
public virtual DbSet<UserAttachment> UserAttachments { get; set; }
|
||||
public virtual DbSet<UserFlag> UserFlags { get; set; }
|
||||
public virtual DbSet<UserFlagAssignment> UserFlagAssignments { get; set; }
|
||||
public virtual DbSet<AuthorizationRole> AuthorizationRoles { get; set; }
|
||||
|
||||
public virtual DbSet<DeviceUserAssignment> DeviceUserAssignments { get; set; }
|
||||
|
||||
@@ -177,6 +177,11 @@ namespace Disco.Data.Repository.Monitor
|
||||
{
|
||||
key["UserId"] = ((UserAttachment)entryState.Entity).UserId;
|
||||
}
|
||||
if (entryState.Entity is UserFlagAssignment)
|
||||
{
|
||||
key["UserFlagId"] = ((UserFlagAssignment)entryState.Entity).UserFlagId;
|
||||
key["UserId"] = ((UserFlagAssignment)entryState.Entity).UserId;
|
||||
}
|
||||
|
||||
return key;
|
||||
}
|
||||
|
||||
@@ -47,6 +47,8 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="BI\Job\LocationModes.cs" />
|
||||
<Compile Include="Repository\Device\DeviceDecommissionReasons.cs" />
|
||||
<Compile Include="Repository\User\Flag\UserFlag.cs" />
|
||||
<Compile Include="Repository\User\Flag\UserFlagAssignment.cs" />
|
||||
<Compile Include="Services\Authorization\IAuthorizationToken.cs" />
|
||||
<Compile Include="Services\Authorization\IClaimNavigatorItem.cs" />
|
||||
<Compile Include="Services\Authorization\IRoleToken.cs" />
|
||||
@@ -154,6 +156,9 @@
|
||||
<Compile Include="UI\Config\Logging\ConfigLoggingIndexModel.cs" />
|
||||
<Compile Include="UI\Config\Shared\ConfigSharedTaskStatusModel.cs" />
|
||||
<Compile Include="UI\Config\Organisation\ConfigOrganisationIndexModel.cs" />
|
||||
<Compile Include="UI\Config\UserFlag\ConfigUserFlagCreateModel.cs" />
|
||||
<Compile Include="UI\Config\UserFlag\ConfigUserFlagIndexModel.cs" />
|
||||
<Compile Include="UI\Config\UserFlag\ConfigUserFlagShowModel.cs" />
|
||||
<Compile Include="UI\Device\DeviceAddOfflineModel.cs" />
|
||||
<Compile Include="UI\Device\DeviceExportModel.cs" />
|
||||
<Compile Include="UI\Device\DeviceImportHeadersModel.cs" />
|
||||
@@ -176,7 +181,7 @@
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<UserProperties BuildVersion_UpdateFileVersion="True" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_StartDate="2011/7/1" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildAction="Both" />
|
||||
<UserProperties BuildVersion_BuildAction="Both" BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="False" BuildVersion_StartDate="2011/7/1" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_UpdateFileVersion="True" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Disco.Models.Repository
|
||||
{
|
||||
public class UserFlag
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required, StringLength(100)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[StringLength(500), DataType(DataType.MultilineText)]
|
||||
public string Description { get; set; }
|
||||
|
||||
[Required, StringLength(25)]
|
||||
public string Icon { get; set; }
|
||||
[Required, StringLength(10)]
|
||||
public string IconColour { get; set; }
|
||||
|
||||
public virtual IList<UserFlagAssignment> UserFlagAssignments { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return this.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Disco.Models.Repository
|
||||
{
|
||||
public class UserFlagAssignment
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
[Required]
|
||||
public int UserFlagId { get; set; }
|
||||
[Required]
|
||||
public string UserId { get; set; }
|
||||
|
||||
[Required]
|
||||
public DateTime AddedDate { get; set; }
|
||||
[Required]
|
||||
public string AddedUserId { get; set; }
|
||||
public DateTime? RemovedDate { get; set; }
|
||||
public string RemovedUserId { get; set; }
|
||||
|
||||
public string Comments { get; set; }
|
||||
|
||||
[ForeignKey("UserFlagId"), InverseProperty("UserFlagAssignments")]
|
||||
public virtual UserFlag UserFlag { get; set; }
|
||||
|
||||
[ForeignKey("UserId"), InverseProperty("UserFlagAssignments")]
|
||||
public virtual User User { get; set; }
|
||||
|
||||
[ForeignKey("AddedUserId")]
|
||||
public virtual User AddedUser { get; set; }
|
||||
[ForeignKey("RemovedUserId")]
|
||||
public virtual User RemovedUser { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@ namespace Disco.Models.Repository
|
||||
public virtual IList<DeviceUserAssignment> DeviceUserAssignments { get; set; }
|
||||
[InverseProperty("UserId")]
|
||||
public virtual IList<Job> Jobs { get; set; }
|
||||
public virtual IList<UserFlagAssignment> UserFlagAssignments { get; set; }
|
||||
|
||||
[NotMapped, Obsolete("Should be using Combined Domain\\User format - UserId")]
|
||||
public string Id
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Disco.Models.Repository;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -17,16 +18,22 @@ namespace Disco.Models.Services.Searching
|
||||
}
|
||||
|
||||
public string Id { get; set; }
|
||||
public string FriendlyId { get; set; }
|
||||
public string Type { get { return type; } }
|
||||
public string Description { get { return string.Format("{0} ({1})", this.DisplayName, this.Id); } }
|
||||
public string[] ScoreValues { get { return LazyScoreValue.Value; } }
|
||||
|
||||
public int AssignedDevicesCount { get; set; }
|
||||
public string DisplayName { get; set; }
|
||||
public string GivenName { get; set; }
|
||||
public int JobCount { get; set; }
|
||||
public string Surname { get; set; }
|
||||
|
||||
public int AssignedDevicesCount { get; set; }
|
||||
|
||||
public int JobCount { get; set; }
|
||||
public int JobCountOpen { get; set; }
|
||||
|
||||
public IList<UserFlagAssignment> UserFlagAssignments { get; set; }
|
||||
|
||||
private string[] BuildScoreValues()
|
||||
{
|
||||
return new string[] {
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
using Disco.Models.Services.Jobs.JobQueues;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Models.UI.Config.JobQueue
|
||||
{
|
||||
@@ -14,6 +10,9 @@ namespace Disco.Models.UI.Config.JobQueue
|
||||
int OpenJobCount { get; set; }
|
||||
int TotalJobCount { get; set; }
|
||||
|
||||
IEnumerable<KeyValuePair<string, string>> Icons { get; set; }
|
||||
IEnumerable<KeyValuePair<string, string>> ThemeColours { get; set; }
|
||||
|
||||
List<Disco.Models.Repository.JobType> JobTypes { get; set; }
|
||||
|
||||
bool CanDelete { get; set; }
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Disco.Models.UI.Config.UserFlag
|
||||
{
|
||||
public interface ConfigUserFlagCreateModel : BaseUIModel
|
||||
{
|
||||
Repository.UserFlag UserFlag { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Disco.Models.UI.Config.UserFlag
|
||||
{
|
||||
public interface ConfigUserFlagIndexModel : BaseUIModel
|
||||
{
|
||||
List<Repository.UserFlag> UserFlags { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Disco.Models.UI.Config.UserFlag
|
||||
{
|
||||
public interface ConfigUserFlagShowModel : BaseUIModel
|
||||
{
|
||||
Repository.UserFlag UserFlag { get; set; }
|
||||
|
||||
int CurrentAssignmentCount { get; set; }
|
||||
int TotalAssignmentCount { get; set; }
|
||||
|
||||
IEnumerable<KeyValuePair<string, string>> Icons { get; set; }
|
||||
IEnumerable<KeyValuePair<string, string>> ThemeColours { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using Disco.Models.Services.Authorization;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Models.Services.Authorization;
|
||||
using Disco.Models.Services.Jobs.JobLists;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -8,7 +9,10 @@ namespace Disco.Models.UI.User
|
||||
{
|
||||
Disco.Models.Repository.User User { get; set; }
|
||||
JobTableModel Jobs { get; set; }
|
||||
List<Disco.Models.Repository.DocumentTemplate> DocumentTemplates { get; set; }
|
||||
List<DocumentTemplate> DocumentTemplates { get; set; }
|
||||
|
||||
List<UserFlag> AvailableUserFlags { get; set; }
|
||||
|
||||
IAuthorizationToken AuthorizationToken { get; set; }
|
||||
IClaimNavigatorItem ClaimNavigator { get; set; }
|
||||
}
|
||||
|
||||
@@ -73,6 +73,10 @@ namespace Disco.Services.Authorization
|
||||
{ "Config.JobQueue.Create", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Config.JobQueue.Create, (c, v) => c.Config.JobQueue.Create = v, "Create Job Queues", "Can create job queues", false) },
|
||||
{ "Config.JobQueue.Delete", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Config.JobQueue.Delete, (c, v) => c.Config.JobQueue.Delete = v, "Delete Job Queues", "Can delete job queues", false) },
|
||||
{ "Config.JobQueue.Show", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Config.JobQueue.Show, (c, v) => c.Config.JobQueue.Show = v, "Show Job Queues", "Can show job queues", false) },
|
||||
{ "Config.UserFlag.Configure", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Config.UserFlag.Configure, (c, v) => c.Config.UserFlag.Configure = v, "Configure User Flags", "Can configure user flags", false) },
|
||||
{ "Config.UserFlag.Create", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Config.UserFlag.Create, (c, v) => c.Config.UserFlag.Create = v, "Create User Flags", "Can create user flags", false) },
|
||||
{ "Config.UserFlag.Delete", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Config.UserFlag.Delete, (c, v) => c.Config.UserFlag.Delete = v, "Delete User Flags", "Can delete user flags", false) },
|
||||
{ "Config.UserFlag.Show", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Config.UserFlag.Show, (c, v) => c.Config.UserFlag.Show = v, "Show User Flags", "Can show user flags", false) },
|
||||
{ "Config.Show", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Config.Show, (c, v) => c.Config.Show = v, "Show Configuration", "Can show the configuration menu", false) },
|
||||
{ "Job.Lists.AllOpen", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Lists.AllOpen, (c, v) => c.Job.Lists.AllOpen = v, "All Open List", "Can show list", false) },
|
||||
{ "Job.Lists.AwaitingFinanceAgreementBreach", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Lists.AwaitingFinanceAgreementBreach, (c, v) => c.Job.Lists.AwaitingFinanceAgreementBreach = v, "Awaiting Finance Agreement Breach List", "Can show list (NOTE: Requires Awaiting Finance List)", false) },
|
||||
@@ -198,9 +202,12 @@ namespace Disco.Services.Authorization
|
||||
{ "Device.Show", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Device.Show, (c, v) => c.Device.Show = v, "Show Devices", "Can show devices", false) },
|
||||
{ "Device.ShowJobs", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Device.ShowJobs, (c, v) => c.Device.ShowJobs = v, "Show Devices Jobs", "Can show jobs associated with devices", false) },
|
||||
{ "User.Actions.AddAttachments", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.User.Actions.AddAttachments, (c, v) => c.User.Actions.AddAttachments = v, "Add Attachments", "Can add attachments to users", false) },
|
||||
{ "User.Actions.AddFlags", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.User.Actions.AddFlags, (c, v) => c.User.Actions.AddFlags = v, "Add User Flags", "Can add user flags", false) },
|
||||
{ "User.Actions.EditFlags", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.User.Actions.EditFlags, (c, v) => c.User.Actions.EditFlags = v, "Edit User Flags", "Can edit user flags", false) },
|
||||
{ "User.Actions.GenerateDocuments", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.User.Actions.GenerateDocuments, (c, v) => c.User.Actions.GenerateDocuments = v, "Generate Documents", "Can generate documents for users", false) },
|
||||
{ "User.Actions.RemoveAnyAttachments", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.User.Actions.RemoveAnyAttachments, (c, v) => c.User.Actions.RemoveAnyAttachments = v, "Remove Any Attachments", "Can remove any attachments from users", false) },
|
||||
{ "User.Actions.RemoveOwnAttachments", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.User.Actions.RemoveOwnAttachments, (c, v) => c.User.Actions.RemoveOwnAttachments = v, "Remove Own Attachments", "Can remove own attachments from users", false) },
|
||||
{ "User.Actions.RemoveFlags", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.User.Actions.RemoveFlags, (c, v) => c.User.Actions.RemoveFlags = v, "Remove User Flags", "Can remove user flags", false) },
|
||||
{ "User.Search", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.User.Search, (c, v) => c.User.Search = v, "Search Users", "Can search users", false) },
|
||||
{ "User.ShowAttachments", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.User.ShowAttachments, (c, v) => c.User.ShowAttachments = v, "Show Attachments", "Can show user attachments", false) },
|
||||
{ "User.ShowAssignmentHistory", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.User.ShowAssignmentHistory, (c, v) => c.User.ShowAssignmentHistory = v, "Show Device Assignment History", "Can show the device assignment history for users", false) },
|
||||
@@ -208,6 +215,7 @@ namespace Disco.Services.Authorization
|
||||
{ "User.Show", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.User.Show, (c, v) => c.User.Show = v, "Show Users", "Can show users", false) },
|
||||
{ "User.ShowAuthorization", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.User.ShowAuthorization, (c, v) => c.User.ShowAuthorization = v, "Show Users Authorization", "Can show authorization permissions associated with users", false) },
|
||||
{ "User.ShowDetails", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.User.ShowDetails, (c, v) => c.User.ShowDetails = v, "Show Users Details", "Can show users contact and personal details", false) },
|
||||
{ "User.ShowFlagAssignments", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.User.ShowFlagAssignments, (c, v) => c.User.ShowFlagAssignments = v, "Show Users Flag Assignments", "Can show flags associated with users", false) },
|
||||
{ "User.ShowJobs", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.User.ShowJobs, (c, v) => c.User.ShowJobs = v, "Show Users Jobs", "Can show jobs associated with users", false) },
|
||||
{ "ComputerAccount", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.ComputerAccount, (c, v) => c.ComputerAccount = v, "Computer Account", "Represents a computer account", true) },
|
||||
{ "DiscoAdminAccount", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.DiscoAdminAccount, (c, v) => c.DiscoAdminAccount = v, "Disco Administrator Account", "Represents a Disco Administrator account", true) }
|
||||
@@ -291,6 +299,12 @@ namespace Disco.Services.Authorization
|
||||
new ClaimNavigatorItem("Config.System.ConfigureProxy", false),
|
||||
new ClaimNavigatorItem("Config.System.Show", false)
|
||||
}),
|
||||
new ClaimNavigatorItem("Config.UserFlag", "User Flags", "Permissions related to User Flags", false, new List<IClaimNavigatorItem>() {
|
||||
new ClaimNavigatorItem("Config.UserFlag.Configure", false),
|
||||
new ClaimNavigatorItem("Config.UserFlag.Create", false),
|
||||
new ClaimNavigatorItem("Config.UserFlag.Delete", false),
|
||||
new ClaimNavigatorItem("Config.UserFlag.Show", false)
|
||||
}),
|
||||
new ClaimNavigatorItem("Config.Show", false)
|
||||
}),
|
||||
new ClaimNavigatorItem("Job", "Job", "Permissions related to Jobs", false, new List<IClaimNavigatorItem>() {
|
||||
@@ -441,9 +455,12 @@ namespace Disco.Services.Authorization
|
||||
new ClaimNavigatorItem("User", "User", "Permissions related to Users", false, new List<IClaimNavigatorItem>() {
|
||||
new ClaimNavigatorItem("User.Actions", "Actions", "Permissions related to User Actions", false, new List<IClaimNavigatorItem>() {
|
||||
new ClaimNavigatorItem("User.Actions.AddAttachments", false),
|
||||
new ClaimNavigatorItem("User.Actions.AddFlags", false),
|
||||
new ClaimNavigatorItem("User.Actions.EditFlags", false),
|
||||
new ClaimNavigatorItem("User.Actions.GenerateDocuments", false),
|
||||
new ClaimNavigatorItem("User.Actions.RemoveAnyAttachments", false),
|
||||
new ClaimNavigatorItem("User.Actions.RemoveOwnAttachments", false)
|
||||
new ClaimNavigatorItem("User.Actions.RemoveOwnAttachments", false),
|
||||
new ClaimNavigatorItem("User.Actions.RemoveFlags", false)
|
||||
}),
|
||||
new ClaimNavigatorItem("User.Search", false),
|
||||
new ClaimNavigatorItem("User.ShowAttachments", false),
|
||||
@@ -452,6 +469,7 @@ namespace Disco.Services.Authorization
|
||||
new ClaimNavigatorItem("User.Show", false),
|
||||
new ClaimNavigatorItem("User.ShowAuthorization", false),
|
||||
new ClaimNavigatorItem("User.ShowDetails", false),
|
||||
new ClaimNavigatorItem("User.ShowFlagAssignments", false),
|
||||
new ClaimNavigatorItem("User.ShowJobs", false)
|
||||
}),
|
||||
new ClaimNavigatorItem("ComputerAccount", true),
|
||||
@@ -567,6 +585,10 @@ namespace Disco.Services.Authorization
|
||||
c.Config.JobQueue.Create = true;
|
||||
c.Config.JobQueue.Delete = true;
|
||||
c.Config.JobQueue.Show = true;
|
||||
c.Config.UserFlag.Configure = true;
|
||||
c.Config.UserFlag.Create = true;
|
||||
c.Config.UserFlag.Delete = true;
|
||||
c.Config.UserFlag.Show = true;
|
||||
c.Config.Show = true;
|
||||
c.Job.Lists.AllOpen = true;
|
||||
c.Job.Lists.AwaitingFinanceAgreementBreach = true;
|
||||
@@ -692,9 +714,12 @@ namespace Disco.Services.Authorization
|
||||
c.Device.Show = true;
|
||||
c.Device.ShowJobs = true;
|
||||
c.User.Actions.AddAttachments = true;
|
||||
c.User.Actions.AddFlags = true;
|
||||
c.User.Actions.EditFlags = true;
|
||||
c.User.Actions.GenerateDocuments = true;
|
||||
c.User.Actions.RemoveAnyAttachments = true;
|
||||
c.User.Actions.RemoveOwnAttachments = true;
|
||||
c.User.Actions.RemoveFlags = true;
|
||||
c.User.Search = true;
|
||||
c.User.ShowAttachments = true;
|
||||
c.User.ShowAssignmentHistory = true;
|
||||
@@ -702,6 +727,7 @@ namespace Disco.Services.Authorization
|
||||
c.User.Show = true;
|
||||
c.User.ShowAuthorization = true;
|
||||
c.User.ShowDetails = true;
|
||||
c.User.ShowFlagAssignments = true;
|
||||
c.User.ShowJobs = true;
|
||||
c.DiscoAdminAccount = true;
|
||||
#endregion
|
||||
@@ -1051,6 +1077,33 @@ namespace Disco.Services.Authorization
|
||||
public const string Show = "Config.JobQueue.Show";
|
||||
}
|
||||
|
||||
/// <summary>User Flags
|
||||
/// <para>Permissions related to User Flags</para>
|
||||
/// </summary>
|
||||
public static class UserFlag
|
||||
{
|
||||
|
||||
/// <summary>Configure User Flags
|
||||
/// <para>Can configure user flags</para>
|
||||
/// </summary>
|
||||
public const string Configure = "Config.UserFlag.Configure";
|
||||
|
||||
/// <summary>Create User Flags
|
||||
/// <para>Can create user flags</para>
|
||||
/// </summary>
|
||||
public const string Create = "Config.UserFlag.Create";
|
||||
|
||||
/// <summary>Delete User Flags
|
||||
/// <para>Can delete user flags</para>
|
||||
/// </summary>
|
||||
public const string Delete = "Config.UserFlag.Delete";
|
||||
|
||||
/// <summary>Show User Flags
|
||||
/// <para>Can show user flags</para>
|
||||
/// </summary>
|
||||
public const string Show = "Config.UserFlag.Show";
|
||||
}
|
||||
|
||||
/// <summary>Show Configuration
|
||||
/// <para>Can show the configuration menu</para>
|
||||
/// </summary>
|
||||
@@ -1766,6 +1819,16 @@ namespace Disco.Services.Authorization
|
||||
/// </summary>
|
||||
public const string AddAttachments = "User.Actions.AddAttachments";
|
||||
|
||||
/// <summary>Add User Flags
|
||||
/// <para>Can add user flags</para>
|
||||
/// </summary>
|
||||
public const string AddFlags = "User.Actions.AddFlags";
|
||||
|
||||
/// <summary>Edit User Flags
|
||||
/// <para>Can edit user flags</para>
|
||||
/// </summary>
|
||||
public const string EditFlags = "User.Actions.EditFlags";
|
||||
|
||||
/// <summary>Generate Documents
|
||||
/// <para>Can generate documents for users</para>
|
||||
/// </summary>
|
||||
@@ -1780,6 +1843,11 @@ namespace Disco.Services.Authorization
|
||||
/// <para>Can remove own attachments from users</para>
|
||||
/// </summary>
|
||||
public const string RemoveOwnAttachments = "User.Actions.RemoveOwnAttachments";
|
||||
|
||||
/// <summary>Remove User Flags
|
||||
/// <para>Can remove user flags</para>
|
||||
/// </summary>
|
||||
public const string RemoveFlags = "User.Actions.RemoveFlags";
|
||||
}
|
||||
|
||||
/// <summary>Search Users
|
||||
@@ -1817,6 +1885,11 @@ namespace Disco.Services.Authorization
|
||||
/// </summary>
|
||||
public const string ShowDetails = "User.ShowDetails";
|
||||
|
||||
/// <summary>Show Users Flag Assignments
|
||||
/// <para>Can show flags associated with users</para>
|
||||
/// </summary>
|
||||
public const string ShowFlagAssignments = "User.ShowFlagAssignments";
|
||||
|
||||
/// <summary>Show Users Jobs
|
||||
/// <para>Can show jobs associated with users</para>
|
||||
/// </summary>
|
||||
|
||||
@@ -10,6 +10,7 @@ using Disco.Services.Authorization.Roles.ClaimGroups.Configuration.Logging;
|
||||
using Disco.Services.Authorization.Roles.ClaimGroups.Configuration.Origanisation;
|
||||
using Disco.Services.Authorization.Roles.ClaimGroups.Configuration.Plugin;
|
||||
using Disco.Services.Authorization.Roles.ClaimGroups.Configuration.System;
|
||||
using Disco.Services.Authorization.Roles.ClaimGroups.Configuration.UserFlag;
|
||||
|
||||
namespace Disco.Services.Authorization.Roles.ClaimGroups.Configuration
|
||||
{
|
||||
@@ -30,6 +31,7 @@ namespace Disco.Services.Authorization.Roles.ClaimGroups.Configuration
|
||||
this.Organisation = new OrganisationClaims();
|
||||
this.JobPreferences = new JobPreferencesClaims();
|
||||
this.JobQueue = new JobQueueClaims();
|
||||
this.UserFlag = new UserFlagClaims();
|
||||
}
|
||||
|
||||
[ClaimDetails("Show Configuration", "Can show the configuration menu")]
|
||||
@@ -58,5 +60,7 @@ namespace Disco.Services.Authorization.Roles.ClaimGroups.Configuration
|
||||
public JobPreferencesClaims JobPreferences { get; set; }
|
||||
|
||||
public JobQueueClaims JobQueue { get; set; }
|
||||
|
||||
public UserFlagClaims UserFlag { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
namespace Disco.Services.Authorization.Roles.ClaimGroups.Configuration.UserFlag
|
||||
{
|
||||
[ClaimDetails("User Flags", "Permissions related to User Flags")]
|
||||
public class UserFlagClaims : BaseRoleClaimGroup
|
||||
{
|
||||
[ClaimDetails("Configure User Flags", "Can configure user flags")]
|
||||
public bool Configure { get; set; }
|
||||
|
||||
[ClaimDetails("Create User Flags", "Can create user flags")]
|
||||
public bool Create { get; set; }
|
||||
|
||||
[ClaimDetails("Delete User Flags", "Can delete user flags")]
|
||||
public bool Delete { get; set; }
|
||||
|
||||
[ClaimDetails("Show User Flags", "Can show user flags")]
|
||||
public bool Show { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Services.Authorization.Roles.ClaimGroups.User
|
||||
namespace Disco.Services.Authorization.Roles.ClaimGroups.User
|
||||
{
|
||||
[ClaimDetails("Actions", "Permissions related to User Actions")]
|
||||
public class UserActionsClaims : BaseRoleClaimGroup
|
||||
@@ -18,5 +12,12 @@ namespace Disco.Services.Authorization.Roles.ClaimGroups.User
|
||||
|
||||
[ClaimDetails("Generate Documents", "Can generate documents for users")]
|
||||
public bool GenerateDocuments { get; set; }
|
||||
|
||||
[ClaimDetails("Add User Flags", "Can add user flags")]
|
||||
public bool AddFlags { get; set; }
|
||||
[ClaimDetails("Remove User Flags", "Can remove user flags")]
|
||||
public bool RemoveFlags { get; set; }
|
||||
[ClaimDetails("Edit User Flags", "Can edit user flags")]
|
||||
public bool EditFlags { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,9 @@ namespace Disco.Services.Authorization.Roles.ClaimGroups.User
|
||||
[ClaimDetails("Show Users Jobs", "Can show jobs associated with users")]
|
||||
public bool ShowJobs { get; set; }
|
||||
|
||||
[ClaimDetails("Show Users Flag Assignments", "Can show flags associated with users")]
|
||||
public bool ShowFlagAssignments { get; set; }
|
||||
|
||||
[ClaimDetails("Show Users Authorization", "Can show authorization permissions associated with users")]
|
||||
public bool ShowAuthorization { get; set; }
|
||||
|
||||
|
||||
@@ -154,6 +154,7 @@
|
||||
<Compile Include="Authorization\Roles\ClaimGroups\Configuration\Origanisation\OrganisationClaims.cs" />
|
||||
<Compile Include="Authorization\Roles\ClaimGroups\Configuration\Plugin\PluginClaims.cs" />
|
||||
<Compile Include="Authorization\Roles\ClaimGroups\Configuration\System\SystemClaims.cs" />
|
||||
<Compile Include="Authorization\Roles\ClaimGroups\Configuration\UserFlag\UserFlagClaims.cs" />
|
||||
<Compile Include="Authorization\Roles\ClaimGroups\Device\DeviceActionsClaims.cs" />
|
||||
<Compile Include="Authorization\Roles\ClaimGroups\Device\DeviceClaims.cs" />
|
||||
<Compile Include="Authorization\Roles\ClaimGroups\Device\DevicePropertiesClaims.cs" />
|
||||
@@ -206,6 +207,7 @@
|
||||
<Compile Include="Extensions\DateTimeExtensions.cs" />
|
||||
<Compile Include="Extensions\RxExtensions.cs" />
|
||||
<Compile Include="Extensions\StringExtensions.cs" />
|
||||
<Compile Include="Extensions\UIHelpers.cs" />
|
||||
<Compile Include="Interop\ActiveDirectory\ActiveDirectory.cs" />
|
||||
<Compile Include="Interop\ActiveDirectory\ActiveDirectoryContext.cs" />
|
||||
<Compile Include="Interop\ActiveDirectory\ActiveDirectoryExtensions.cs" />
|
||||
@@ -297,6 +299,9 @@
|
||||
<Compile Include="Users\Cache.cs" />
|
||||
<Compile Include="Users\CacheCleanTask.cs" />
|
||||
<Compile Include="Users\UserExtensions.cs" />
|
||||
<Compile Include="Users\UserFlags\Cache.cs" />
|
||||
<Compile Include="Users\UserFlags\UserFlagsDeleteTask.cs" />
|
||||
<Compile Include="Users\UserFlags\UserFlagService.cs" />
|
||||
<Compile Include="Users\UserService.cs" />
|
||||
<Compile Include="Users\UserUpdatesHub.cs" />
|
||||
<Compile Include="Web\AuthorizedController.cs" />
|
||||
@@ -343,7 +348,7 @@
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<UserProperties BuildVersion_UpdateFileVersion="True" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_StartDate="2011/7/1" BuildVersion_BuildAction="Both" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="False" />
|
||||
<UserProperties BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="False" BuildVersion_BuildAction="Both" BuildVersion_StartDate="2011/7/1" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_UpdateFileVersion="True" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -0,0 +1,226 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Services.Extensions
|
||||
{
|
||||
public static class UIHelpers
|
||||
{
|
||||
/// <summary>
|
||||
/// FontAwesome Category Icons
|
||||
/// </summary>
|
||||
public static ReadOnlyCollection<KeyValuePair<string, string>> Icons { get; private set; }
|
||||
/// <summary>
|
||||
/// User-selectable Colour Themes
|
||||
/// </summary>
|
||||
public static ReadOnlyCollection<KeyValuePair<string, string>> ThemeColours { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a randomly selected Icon using <see cref="System.Random"/>.
|
||||
/// </summary>
|
||||
public static string RandomIcon()
|
||||
{
|
||||
return RandomIcon(null);
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns a randomly selected Icon using <see cref="System.Random"/>.
|
||||
/// </summary>
|
||||
/// <param name="Except">A list of Icons which will be ignored (if all are excluded, a random one will be returned)</param>
|
||||
public static string RandomIcon(IEnumerable<string> Except)
|
||||
{
|
||||
var rnd = new Random();
|
||||
if (Except != null)
|
||||
{
|
||||
var availableIcons = UIHelpers.Icons.Select(i => i.Key).Except(Except).ToList();
|
||||
if (availableIcons.Count > 0)
|
||||
return availableIcons[rnd.Next(availableIcons.Count - 1)];
|
||||
}
|
||||
return UIHelpers.Icons[rnd.Next(UIHelpers.Icons.Count - 1)].Key;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a randomly selected Theme Colour using <see cref="System.Random"/>.
|
||||
/// </summary>
|
||||
public static string RandomThemeColour()
|
||||
{
|
||||
return RandomThemeColour(null);
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns a randomly selected Theme Colour using <see cref="System.Random"/>.
|
||||
/// </summary>
|
||||
/// <param name="Except">A list of Theme Colours which will be ignored (if all are excluded, a random one will be returned)</param>
|
||||
public static string RandomThemeColour(IEnumerable<string> Except)
|
||||
{
|
||||
var rnd = new Random();
|
||||
if (Except != null)
|
||||
{
|
||||
var availableColours = UIHelpers.ThemeColours.Select(i => i.Key).Except(Except).ToList();
|
||||
if (availableColours.Count > 0)
|
||||
return availableColours[rnd.Next(availableColours.Count - 1)];
|
||||
}
|
||||
return UIHelpers.ThemeColours[rnd.Next(UIHelpers.ThemeColours.Count - 1)].Key;
|
||||
}
|
||||
|
||||
static UIHelpers()
|
||||
{
|
||||
// Icons
|
||||
Icons = new List<KeyValuePair<string, string>>(){
|
||||
new KeyValuePair<string, string>("ambulance" , "Ambulance"),
|
||||
new KeyValuePair<string, string>("anchor" , "Anchor"),
|
||||
new KeyValuePair<string, string>("android" , "Android"),
|
||||
new KeyValuePair<string, string>("apple" , "Apple"),
|
||||
new KeyValuePair<string, string>("archive" , "Archive"),
|
||||
new KeyValuePair<string, string>("arrow-circle-down" , "Arrow Circle Down"),
|
||||
new KeyValuePair<string, string>("arrow-circle-left" , "Arrow Circle Left"),
|
||||
new KeyValuePair<string, string>("arrow-circle-right" , "Arrow Circle Right"),
|
||||
new KeyValuePair<string, string>("arrow-circle-up" , "Arrow Circle Up"),
|
||||
new KeyValuePair<string, string>("asterisk" , "Asterisk"),
|
||||
new KeyValuePair<string, string>("ban" , "Ban"),
|
||||
new KeyValuePair<string, string>("beer" , "Beer"),
|
||||
new KeyValuePair<string, string>("bell" , "Bell"),
|
||||
new KeyValuePair<string, string>("bolt" , "Bolt"),
|
||||
new KeyValuePair<string, string>("bomb" , "Bomb"),
|
||||
new KeyValuePair<string, string>("book" , "Book"),
|
||||
new KeyValuePair<string, string>("bookmark" , "Bookmark"),
|
||||
new KeyValuePair<string, string>("briefcase" , "Briefcase"),
|
||||
new KeyValuePair<string, string>("bug" , "Bug"),
|
||||
new KeyValuePair<string, string>("building-o" , "Building"),
|
||||
new KeyValuePair<string, string>("bullhorn" , "Bullhorn"),
|
||||
new KeyValuePair<string, string>("bullseye" , "Bullseye"),
|
||||
new KeyValuePair<string, string>("cab" , "Cab"),
|
||||
new KeyValuePair<string, string>("calendar" , "Calendar"),
|
||||
new KeyValuePair<string, string>("calendar-o" , "Calendar"),
|
||||
new KeyValuePair<string, string>("car" , "Car"),
|
||||
new KeyValuePair<string, string>("check-circle" , "Check Circle"),
|
||||
new KeyValuePair<string, string>("child" , "Child"),
|
||||
new KeyValuePair<string, string>("clock-o" , "Clock"),
|
||||
new KeyValuePair<string, string>("cloud" , "Cloud"),
|
||||
new KeyValuePair<string, string>("coffee" , "Coffee"),
|
||||
new KeyValuePair<string, string>("comments" , "Comments"),
|
||||
new KeyValuePair<string, string>("compass" , "Compass"),
|
||||
new KeyValuePair<string, string>("credit-card" , "Credit Card"),
|
||||
new KeyValuePair<string, string>("crosshairs" , "Crosshairs"),
|
||||
new KeyValuePair<string, string>("cube" , "Cube"),
|
||||
new KeyValuePair<string, string>("cubes" , "Cubes"),
|
||||
new KeyValuePair<string, string>("desktop" , "Desktop"),
|
||||
new KeyValuePair<string, string>("dollar" , "Dollar"),
|
||||
new KeyValuePair<string, string>("dot-circle-o" , "Dot Circle"),
|
||||
new KeyValuePair<string, string>("envelope" , "Envelope"),
|
||||
new KeyValuePair<string, string>("exclamation" , "Exclamation"),
|
||||
new KeyValuePair<string, string>("eye" , "Eye"),
|
||||
new KeyValuePair<string, string>("fax" , "Fax"),
|
||||
new KeyValuePair<string, string>("female" , "Female"),
|
||||
new KeyValuePair<string, string>("fighter-jet" , "Fighter Jet"),
|
||||
new KeyValuePair<string, string>("film" , "Film"),
|
||||
new KeyValuePair<string, string>("filter" , "Filter"),
|
||||
new KeyValuePair<string, string>("fire" , "Fire"),
|
||||
new KeyValuePair<string, string>("fire-extinguisher" , "Fire Extinguisher"),
|
||||
new KeyValuePair<string, string>("flask" , "Flask"),
|
||||
new KeyValuePair<string, string>("frown-o" , "Frown"),
|
||||
new KeyValuePair<string, string>("gamepad" , "Gamepad"),
|
||||
new KeyValuePair<string, string>("gift" , "Gift"),
|
||||
new KeyValuePair<string, string>("glass" , "Glass"),
|
||||
new KeyValuePair<string, string>("globe" , "Globe"),
|
||||
new KeyValuePair<string, string>("graduation-cap" , "Graduation Cap"),
|
||||
new KeyValuePair<string, string>("hand-o-down" , "Hand Down"),
|
||||
new KeyValuePair<string, string>("hand-o-left" , "Hand Left"),
|
||||
new KeyValuePair<string, string>("hand-o-right" , "Hand Right"),
|
||||
new KeyValuePair<string, string>("hand-o-up" , "Hand Up"),
|
||||
new KeyValuePair<string, string>("hdd-o" , "Hdd"),
|
||||
new KeyValuePair<string, string>("heart" , "Heart"),
|
||||
new KeyValuePair<string, string>("history" , "History"),
|
||||
new KeyValuePair<string, string>("home" , "Home"),
|
||||
new KeyValuePair<string, string>("info" , "Info"),
|
||||
new KeyValuePair<string, string>("key" , "Key"),
|
||||
new KeyValuePair<string, string>("keyboard-o" , "Keyboard"),
|
||||
new KeyValuePair<string, string>("language" , "Language"),
|
||||
new KeyValuePair<string, string>("laptop" , "Laptop"),
|
||||
new KeyValuePair<string, string>("leaf" , "Leaf"),
|
||||
new KeyValuePair<string, string>("legal" , "Legal"),
|
||||
new KeyValuePair<string, string>("life-ring" , "Life Ring"),
|
||||
new KeyValuePair<string, string>("lightbulb-o" , "Lightbulb"),
|
||||
new KeyValuePair<string, string>("linux" , "Linux"),
|
||||
new KeyValuePair<string, string>("location-arrow" , "Location Arrow"),
|
||||
new KeyValuePair<string, string>("magnet" , "Magnet"),
|
||||
new KeyValuePair<string, string>("male" , "Male"),
|
||||
new KeyValuePair<string, string>("map-marker" , "Map Marker"),
|
||||
new KeyValuePair<string, string>("medkit" , "Medkit"),
|
||||
new KeyValuePair<string, string>("meh-o" , "Meh"),
|
||||
new KeyValuePair<string, string>("microphone" , "Microphone"),
|
||||
new KeyValuePair<string, string>("microphone-slash" , "Microphone Slash"),
|
||||
new KeyValuePair<string, string>("minus-circle" , "Minus Circle"),
|
||||
new KeyValuePair<string, string>("mobile" , "Mobile"),
|
||||
new KeyValuePair<string, string>("money" , "Money"),
|
||||
new KeyValuePair<string, string>("moon-o" , "Moon"),
|
||||
new KeyValuePair<string, string>("music" , "Music"),
|
||||
new KeyValuePair<string, string>("paper-plane" , "Paper Plane"),
|
||||
new KeyValuePair<string, string>("paperclip" , "Paperclip"),
|
||||
new KeyValuePair<string, string>("paw" , "Paw"),
|
||||
new KeyValuePair<string, string>("pencil" , "Pencil"),
|
||||
new KeyValuePair<string, string>("phone" , "Phone"),
|
||||
new KeyValuePair<string, string>("picture-o" , "Picture"),
|
||||
new KeyValuePair<string, string>("plane" , "Plane"),
|
||||
new KeyValuePair<string, string>("power-off" , "Power Off"),
|
||||
new KeyValuePair<string, string>("print" , "Print"),
|
||||
new KeyValuePair<string, string>("puzzle-piece" , "Puzzle Piece"),
|
||||
new KeyValuePair<string, string>("question" , "Question"),
|
||||
new KeyValuePair<string, string>("question-circle" , "Question Circle"),
|
||||
new KeyValuePair<string, string>("random" , "Random"),
|
||||
new KeyValuePair<string, string>("recycle" , "Recycle"),
|
||||
new KeyValuePair<string, string>("retweet" , "Retweet"),
|
||||
new KeyValuePair<string, string>("road" , "Road"),
|
||||
new KeyValuePair<string, string>("rocket" , "Rocket"),
|
||||
new KeyValuePair<string, string>("shield" , "Shield"),
|
||||
new KeyValuePair<string, string>("shopping-cart" , "Shopping Cart"),
|
||||
new KeyValuePair<string, string>("smile-o" , "Smile"),
|
||||
new KeyValuePair<string, string>("space-shuttle" , "Space Shuttle"),
|
||||
new KeyValuePair<string, string>("star" , "Star"),
|
||||
new KeyValuePair<string, string>("suitcase" , "Suitcase"),
|
||||
new KeyValuePair<string, string>("sun-o" , "Sun"),
|
||||
new KeyValuePair<string, string>("tablet" , "Tablet"),
|
||||
new KeyValuePair<string, string>("tachometer" , "Tachometer"),
|
||||
new KeyValuePair<string, string>("tasks" , "Tasks"),
|
||||
new KeyValuePair<string, string>("thumbs-down" , "Thumbs Down"),
|
||||
new KeyValuePair<string, string>("thumbs-o-down" , "Thumbs Down"),
|
||||
new KeyValuePair<string, string>("thumbs-o-up" , "Thumbs Up"),
|
||||
new KeyValuePair<string, string>("thumbs-up" , "Thumbs Up"),
|
||||
new KeyValuePair<string, string>("thumb-tack" , "Thumb Tack"),
|
||||
new KeyValuePair<string, string>("trash-o" , "Trash"),
|
||||
new KeyValuePair<string, string>("trophy" , "Trophy"),
|
||||
new KeyValuePair<string, string>("truck" , "Truck"),
|
||||
new KeyValuePair<string, string>("umbrella" , "Umbrella"),
|
||||
new KeyValuePair<string, string>("university" , "University"),
|
||||
new KeyValuePair<string, string>("wheelchair" , "Wheelchair"),
|
||||
new KeyValuePair<string, string>("windows" , "Windows"),
|
||||
new KeyValuePair<string, string>("wrench" , "Wrench")
|
||||
}.AsReadOnly();
|
||||
|
||||
// Icon Colours
|
||||
ThemeColours = new List<KeyValuePair<string, string>>(){
|
||||
new KeyValuePair<string, string>("lime" , "Lime"),
|
||||
new KeyValuePair<string, string>("green" , "Green"),
|
||||
new KeyValuePair<string, string>("emerald" , "Emerald"),
|
||||
new KeyValuePair<string, string>("teal" , "Teal"),
|
||||
new KeyValuePair<string, string>("cyan" , "Cyan"),
|
||||
new KeyValuePair<string, string>("cobalt" , "Cobalt"),
|
||||
new KeyValuePair<string, string>("indigo" , "Indigo"),
|
||||
new KeyValuePair<string, string>("violet" , "Violet"),
|
||||
new KeyValuePair<string, string>("pink" , "Pink"),
|
||||
new KeyValuePair<string, string>("magenta" , "Magenta"),
|
||||
new KeyValuePair<string, string>("crimson" , "Crimson"),
|
||||
new KeyValuePair<string, string>("red" , "Red"),
|
||||
new KeyValuePair<string, string>("orange" , "Orange"),
|
||||
new KeyValuePair<string, string>("amber" , "Amber"),
|
||||
new KeyValuePair<string, string>("yellow" , "Yellow"),
|
||||
new KeyValuePair<string, string>("brown" , "Brown"),
|
||||
new KeyValuePair<string, string>("olive" , "Olive"),
|
||||
new KeyValuePair<string, string>("steel" , "Steel"),
|
||||
new KeyValuePair<string, string>("mauve" , "Mauve"),
|
||||
new KeyValuePair<string, string>("sienna" , "Sienna")
|
||||
}.AsReadOnly();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,8 +15,6 @@ namespace Disco.Services.Jobs.JobQueues
|
||||
private ConcurrentDictionary<int, JobQueueToken> _Cache;
|
||||
private Dictionary<string, List<JobQueueToken>> _SubjectCache;
|
||||
|
||||
private ReadOnlyCollection<KeyValuePair<string, string>> _Icons;
|
||||
private ReadOnlyCollection<KeyValuePair<string, string>> _IconColourCache;
|
||||
private ReadOnlyCollection<KeyValuePair<int, string>> _SlaOptions;
|
||||
|
||||
public Cache(DiscoDataContext Database)
|
||||
@@ -29,20 +27,6 @@ namespace Disco.Services.Jobs.JobQueues
|
||||
// Queues from Database
|
||||
var queues = Database.JobQueues.ToList();
|
||||
|
||||
// Default System Queue
|
||||
//var defaultQueue = new JobQueue()
|
||||
//{
|
||||
// Id = 0,
|
||||
// Name = "Default Queue",
|
||||
// Description = "Default system queue for orphaned jobs",
|
||||
// Icon = "question-circle",
|
||||
// IconColour = "F0A30A",
|
||||
// DefaultSLAExpiry = null,
|
||||
// Priority = JobQueuePriority.Normal,
|
||||
// SubjectIds = null
|
||||
//};
|
||||
//queues.Add(defaultQueue);
|
||||
|
||||
// Add Queues to In-Memory Cache
|
||||
this._Cache = new ConcurrentDictionary<int, JobQueueToken>(queues.Select(q => new KeyValuePair<int, JobQueueToken>(q.Id, JobQueueToken.FromJobQueue(q))));
|
||||
|
||||
@@ -50,168 +34,6 @@ namespace Disco.Services.Jobs.JobQueues
|
||||
CalculateSubjectCache();
|
||||
|
||||
#region Predefined Options
|
||||
// Icons
|
||||
if (this._Icons == null)
|
||||
{
|
||||
this._Icons = new List<KeyValuePair<string, string>>(){
|
||||
new KeyValuePair<string, string>("ambulance" , "Ambulance"),
|
||||
new KeyValuePair<string, string>("anchor" , "Anchor"),
|
||||
new KeyValuePair<string, string>("android" , "Android"),
|
||||
new KeyValuePair<string, string>("apple" , "Apple"),
|
||||
new KeyValuePair<string, string>("archive" , "Archive"),
|
||||
new KeyValuePair<string, string>("arrow-circle-down" , "Arrow Circle Down"),
|
||||
new KeyValuePair<string, string>("arrow-circle-left" , "Arrow Circle Left"),
|
||||
new KeyValuePair<string, string>("arrow-circle-right" , "Arrow Circle Right"),
|
||||
new KeyValuePair<string, string>("arrow-circle-up" , "Arrow Circle Up"),
|
||||
new KeyValuePair<string, string>("asterisk" , "Asterisk"),
|
||||
new KeyValuePair<string, string>("ban" , "Ban"),
|
||||
new KeyValuePair<string, string>("beer" , "Beer"),
|
||||
new KeyValuePair<string, string>("bell" , "Bell"),
|
||||
new KeyValuePair<string, string>("bolt" , "Bolt"),
|
||||
new KeyValuePair<string, string>("bomb" , "Bomb"),
|
||||
new KeyValuePair<string, string>("book" , "Book"),
|
||||
new KeyValuePair<string, string>("bookmark" , "Bookmark"),
|
||||
new KeyValuePair<string, string>("briefcase" , "Briefcase"),
|
||||
new KeyValuePair<string, string>("bug" , "Bug"),
|
||||
new KeyValuePair<string, string>("building-o" , "Building"),
|
||||
new KeyValuePair<string, string>("bullhorn" , "Bullhorn"),
|
||||
new KeyValuePair<string, string>("bullseye" , "Bullseye"),
|
||||
new KeyValuePair<string, string>("cab" , "Cab"),
|
||||
new KeyValuePair<string, string>("calendar" , "Calendar"),
|
||||
new KeyValuePair<string, string>("calendar-o" , "Calendar"),
|
||||
new KeyValuePair<string, string>("car" , "Car"),
|
||||
new KeyValuePair<string, string>("check-circle" , "Check Circle"),
|
||||
new KeyValuePair<string, string>("child" , "Child"),
|
||||
new KeyValuePair<string, string>("clock-o" , "Clock"),
|
||||
new KeyValuePair<string, string>("cloud" , "Cloud"),
|
||||
new KeyValuePair<string, string>("coffee" , "Coffee"),
|
||||
new KeyValuePair<string, string>("comments" , "Comments"),
|
||||
new KeyValuePair<string, string>("compass" , "Compass"),
|
||||
new KeyValuePair<string, string>("credit-card" , "Credit Card"),
|
||||
new KeyValuePair<string, string>("crosshairs" , "Crosshairs"),
|
||||
new KeyValuePair<string, string>("cube" , "Cube"),
|
||||
new KeyValuePair<string, string>("cubes" , "Cubes"),
|
||||
new KeyValuePair<string, string>("desktop" , "Desktop"),
|
||||
new KeyValuePair<string, string>("dollar" , "Dollar"),
|
||||
new KeyValuePair<string, string>("dot-circle-o" , "Dot Circle"),
|
||||
new KeyValuePair<string, string>("envelope" , "Envelope"),
|
||||
new KeyValuePair<string, string>("exclamation" , "Exclamation"),
|
||||
new KeyValuePair<string, string>("eye" , "Eye"),
|
||||
new KeyValuePair<string, string>("fax" , "Fax"),
|
||||
new KeyValuePair<string, string>("female" , "Female"),
|
||||
new KeyValuePair<string, string>("fighter-jet" , "Fighter Jet"),
|
||||
new KeyValuePair<string, string>("film" , "Film"),
|
||||
new KeyValuePair<string, string>("filter" , "Filter"),
|
||||
new KeyValuePair<string, string>("fire" , "Fire"),
|
||||
new KeyValuePair<string, string>("fire-extinguisher" , "Fire Extinguisher"),
|
||||
new KeyValuePair<string, string>("flask" , "Flask"),
|
||||
new KeyValuePair<string, string>("frown-o" , "Frown"),
|
||||
new KeyValuePair<string, string>("gamepad" , "Gamepad"),
|
||||
new KeyValuePair<string, string>("gift" , "Gift"),
|
||||
new KeyValuePair<string, string>("glass" , "Glass"),
|
||||
new KeyValuePair<string, string>("globe" , "Globe"),
|
||||
new KeyValuePair<string, string>("graduation-cap" , "Graduation Cap"),
|
||||
new KeyValuePair<string, string>("hand-o-down" , "Hand Down"),
|
||||
new KeyValuePair<string, string>("hand-o-left" , "Hand Left"),
|
||||
new KeyValuePair<string, string>("hand-o-right" , "Hand Right"),
|
||||
new KeyValuePair<string, string>("hand-o-up" , "Hand Up"),
|
||||
new KeyValuePair<string, string>("hdd-o" , "Hdd"),
|
||||
new KeyValuePair<string, string>("heart" , "Heart"),
|
||||
new KeyValuePair<string, string>("history" , "History"),
|
||||
new KeyValuePair<string, string>("home" , "Home"),
|
||||
new KeyValuePair<string, string>("info" , "Info"),
|
||||
new KeyValuePair<string, string>("key" , "Key"),
|
||||
new KeyValuePair<string, string>("keyboard-o" , "Keyboard"),
|
||||
new KeyValuePair<string, string>("language" , "Language"),
|
||||
new KeyValuePair<string, string>("laptop" , "Laptop"),
|
||||
new KeyValuePair<string, string>("leaf" , "Leaf"),
|
||||
new KeyValuePair<string, string>("legal" , "Legal"),
|
||||
new KeyValuePair<string, string>("life-ring" , "Life Ring"),
|
||||
new KeyValuePair<string, string>("lightbulb-o" , "Lightbulb"),
|
||||
new KeyValuePair<string, string>("linux" , "Linux"),
|
||||
new KeyValuePair<string, string>("location-arrow" , "Location Arrow"),
|
||||
new KeyValuePair<string, string>("magnet" , "Magnet"),
|
||||
new KeyValuePair<string, string>("male" , "Male"),
|
||||
new KeyValuePair<string, string>("map-marker" , "Map Marker"),
|
||||
new KeyValuePair<string, string>("medkit" , "Medkit"),
|
||||
new KeyValuePair<string, string>("meh-o" , "Meh"),
|
||||
new KeyValuePair<string, string>("microphone" , "Microphone"),
|
||||
new KeyValuePair<string, string>("microphone-slash" , "Microphone Slash"),
|
||||
new KeyValuePair<string, string>("minus-circle" , "Minus Circle"),
|
||||
new KeyValuePair<string, string>("mobile" , "Mobile"),
|
||||
new KeyValuePair<string, string>("money" , "Money"),
|
||||
new KeyValuePair<string, string>("moon-o" , "Moon"),
|
||||
new KeyValuePair<string, string>("music" , "Music"),
|
||||
new KeyValuePair<string, string>("paper-plane" , "Paper Plane"),
|
||||
new KeyValuePair<string, string>("paperclip" , "Paperclip"),
|
||||
new KeyValuePair<string, string>("paw" , "Paw"),
|
||||
new KeyValuePair<string, string>("pencil" , "Pencil"),
|
||||
new KeyValuePair<string, string>("phone" , "Phone"),
|
||||
new KeyValuePair<string, string>("picture-o" , "Picture"),
|
||||
new KeyValuePair<string, string>("plane" , "Plane"),
|
||||
new KeyValuePair<string, string>("power-off" , "Power Off"),
|
||||
new KeyValuePair<string, string>("print" , "Print"),
|
||||
new KeyValuePair<string, string>("puzzle-piece" , "Puzzle Piece"),
|
||||
new KeyValuePair<string, string>("question" , "Question"),
|
||||
new KeyValuePair<string, string>("question-circle" , "Question Circle"),
|
||||
new KeyValuePair<string, string>("random" , "Random"),
|
||||
new KeyValuePair<string, string>("recycle" , "Recycle"),
|
||||
new KeyValuePair<string, string>("retweet" , "Retweet"),
|
||||
new KeyValuePair<string, string>("road" , "Road"),
|
||||
new KeyValuePair<string, string>("rocket" , "Rocket"),
|
||||
new KeyValuePair<string, string>("shield" , "Shield"),
|
||||
new KeyValuePair<string, string>("shopping-cart" , "Shopping Cart"),
|
||||
new KeyValuePair<string, string>("smile-o" , "Smile"),
|
||||
new KeyValuePair<string, string>("space-shuttle" , "Space Shuttle"),
|
||||
new KeyValuePair<string, string>("star" , "Star"),
|
||||
new KeyValuePair<string, string>("suitcase" , "Suitcase"),
|
||||
new KeyValuePair<string, string>("sun-o" , "Sun"),
|
||||
new KeyValuePair<string, string>("tablet" , "Tablet"),
|
||||
new KeyValuePair<string, string>("tachometer" , "Tachometer"),
|
||||
new KeyValuePair<string, string>("tasks" , "Tasks"),
|
||||
new KeyValuePair<string, string>("thumbs-down" , "Thumbs Down"),
|
||||
new KeyValuePair<string, string>("thumbs-o-down" , "Thumbs Down"),
|
||||
new KeyValuePair<string, string>("thumbs-o-up" , "Thumbs Up"),
|
||||
new KeyValuePair<string, string>("thumbs-up" , "Thumbs Up"),
|
||||
new KeyValuePair<string, string>("thumb-tack" , "Thumb Tack"),
|
||||
new KeyValuePair<string, string>("trash-o" , "Trash"),
|
||||
new KeyValuePair<string, string>("trophy" , "Trophy"),
|
||||
new KeyValuePair<string, string>("truck" , "Truck"),
|
||||
new KeyValuePair<string, string>("umbrella" , "Umbrella"),
|
||||
new KeyValuePair<string, string>("university" , "University"),
|
||||
new KeyValuePair<string, string>("wheelchair" , "Wheelchair"),
|
||||
new KeyValuePair<string, string>("windows" , "Windows"),
|
||||
new KeyValuePair<string, string>("wrench" , "Wrench")
|
||||
}.AsReadOnly();
|
||||
}
|
||||
|
||||
// Icon Colours
|
||||
if (this._IconColourCache == null)
|
||||
{
|
||||
this._IconColourCache = new List<KeyValuePair<string, string>>(){
|
||||
new KeyValuePair<string, string>("lime" , "Lime"),
|
||||
new KeyValuePair<string, string>("green" , "Green"),
|
||||
new KeyValuePair<string, string>("emerald" , "Emerald"),
|
||||
new KeyValuePair<string, string>("teal" , "Teal"),
|
||||
new KeyValuePair<string, string>("cyan" , "Cyan"),
|
||||
new KeyValuePair<string, string>("cobalt" , "Cobalt"),
|
||||
new KeyValuePair<string, string>("indigo" , "Indigo"),
|
||||
new KeyValuePair<string, string>("violet" , "Violet"),
|
||||
new KeyValuePair<string, string>("pink" , "Pink"),
|
||||
new KeyValuePair<string, string>("magenta" , "Magenta"),
|
||||
new KeyValuePair<string, string>("crimson" , "Crimson"),
|
||||
new KeyValuePair<string, string>("red" , "Red"),
|
||||
new KeyValuePair<string, string>("orange" , "Orange"),
|
||||
new KeyValuePair<string, string>("amber" , "Amber"),
|
||||
new KeyValuePair<string, string>("yellow" , "Yellow"),
|
||||
new KeyValuePair<string, string>("brown" , "Brown"),
|
||||
new KeyValuePair<string, string>("olive" , "Olive"),
|
||||
new KeyValuePair<string, string>("steel" , "Steel"),
|
||||
new KeyValuePair<string, string>("mauve" , "Mauve"),
|
||||
new KeyValuePair<string, string>("sienna" , "Sienna")
|
||||
}.AsReadOnly();
|
||||
}
|
||||
|
||||
// SLA Options
|
||||
if (this._SlaOptions == null)
|
||||
{
|
||||
@@ -251,8 +73,6 @@ namespace Disco.Services.Jobs.JobQueues
|
||||
select subjectId).ToDictionary(g => g.Key.ToLower(), g => g.ToList());
|
||||
}
|
||||
|
||||
public ReadOnlyCollection<KeyValuePair<string, string>> Icons { get { return this._Icons; } }
|
||||
public ReadOnlyCollection<KeyValuePair<string, string>> IconColours { get { return this._IconColourCache; } }
|
||||
public ReadOnlyCollection<KeyValuePair<int, string>> SlaOptions { get { return this._SlaOptions; } }
|
||||
|
||||
public JobQueueToken UpdateQueue(JobQueue JobQueue)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Extensions;
|
||||
using Disco.Services.Tasks;
|
||||
using Disco.Services.Users;
|
||||
using System;
|
||||
@@ -23,8 +24,6 @@ namespace Disco.Services.Jobs.JobQueues
|
||||
_cache = new Cache(Database);
|
||||
}
|
||||
|
||||
public static ReadOnlyCollection<KeyValuePair<string, string>> IconColours { get { return _cache.IconColours; } }
|
||||
public static ReadOnlyCollection<KeyValuePair<string, string>> Icons { get { return _cache.Icons; } }
|
||||
public static ReadOnlyCollection<KeyValuePair<int, string>> SlaOptions { get { return _cache.SlaOptions; } }
|
||||
|
||||
public static ReadOnlyCollection<JobQueueToken> GetQueues() { return _cache.GetQueues(); }
|
||||
@@ -38,7 +37,7 @@ namespace Disco.Services.Jobs.JobQueues
|
||||
throw new ArgumentException("The Job Queue Name is required");
|
||||
|
||||
// Name Unique
|
||||
if (_cache.GetQueues().Count(q => q.JobQueue.Name == JobQueue.Name) > 0)
|
||||
if (_cache.GetQueues().Any(q => q.JobQueue.Name == JobQueue.Name))
|
||||
throw new ArgumentException("Another Job Queue already exists with that name", "JobQueue");
|
||||
|
||||
// Clone to break reference
|
||||
@@ -65,7 +64,7 @@ namespace Disco.Services.Jobs.JobQueues
|
||||
throw new ArgumentException("The Job Queue Name is required");
|
||||
|
||||
// Name Unique
|
||||
if (_cache.GetQueues().Count(q => q.JobQueue.Id != JobQueue.Id && q.JobQueue.Name == JobQueue.Name) > 0)
|
||||
if (_cache.GetQueues().Any(q => q.JobQueue.Id != JobQueue.Id && q.JobQueue.Name == JobQueue.Name))
|
||||
throw new ArgumentException("Another Job Queue already exists with that name", "JobQueue");
|
||||
|
||||
Database.SaveChanges();
|
||||
@@ -77,8 +76,8 @@ namespace Disco.Services.Jobs.JobQueues
|
||||
JobQueue queue = Database.JobQueues.Find(JobQueueId);
|
||||
|
||||
// Validate: Current Jobs?
|
||||
int currentJobCount = Database.JobQueueJobs.Count(jqj => jqj.JobQueueId == queue.Id && !jqj.RemovedDate.HasValue);
|
||||
if (currentJobCount > 0)
|
||||
var currentJobs = Database.JobQueueJobs.Any(jqj => jqj.JobQueueId == queue.Id && !jqj.RemovedDate.HasValue);
|
||||
if (currentJobs)
|
||||
throw new InvalidOperationException("The Job Queue cannot be deleted because it contains jobs");
|
||||
|
||||
// Delete History
|
||||
@@ -161,23 +160,13 @@ namespace Disco.Services.Jobs.JobQueues
|
||||
return tokens;
|
||||
}
|
||||
|
||||
public static string RandomIcon()
|
||||
public static string RandomUnusedIcon()
|
||||
{
|
||||
var rnd = new Random();
|
||||
var unusedIcons = _cache.Icons.Select(i => i.Key).Except(_cache.GetQueues().Select(q => q.JobQueue.Icon)).ToList();
|
||||
if (unusedIcons.Count > 0)
|
||||
return unusedIcons[rnd.Next(unusedIcons.Count - 1)];
|
||||
else
|
||||
return _cache.Icons[rnd.Next(_cache.Icons.Count - 1)].Key;
|
||||
return UIHelpers.RandomIcon(_cache.GetQueues().Select(q => q.JobQueue.Icon));
|
||||
}
|
||||
public static string RandomIconColour()
|
||||
public static string RandomUnusedThemeColour()
|
||||
{
|
||||
var rnd = new Random();
|
||||
var unusedColours = _cache.IconColours.Select(i => i.Key).Except(_cache.GetQueues().Select(q => q.JobQueue.IconColour)).ToList();
|
||||
if (unusedColours.Count > 0)
|
||||
return unusedColours[rnd.Next(unusedColours.Count - 1)];
|
||||
else
|
||||
return _cache.IconColours[rnd.Next(_cache.IconColours.Count - 1)].Key;
|
||||
return UIHelpers.RandomThemeColour(_cache.GetQueues().Select(q => q.JobQueue.IconColour));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,11 +145,14 @@ namespace Disco.Services.Searching
|
||||
return UserService.SearchUsers(Database, Term, PersistResults, LimitCount).Select(u => new UserSearchResultItem()
|
||||
{
|
||||
Id = u.UserId,
|
||||
FriendlyId = u.FriendlyId(),
|
||||
Surname = u.Surname,
|
||||
GivenName = u.GivenName,
|
||||
DisplayName = u.DisplayName,
|
||||
AssignedDevicesCount = 0,
|
||||
JobCount = 0
|
||||
JobCount = 0,
|
||||
JobCountOpen = 0,
|
||||
UserFlagAssignments = null
|
||||
}).OrderByDescending(i => i.ScoreValues.Score(Term)).ToList();
|
||||
}
|
||||
|
||||
@@ -166,17 +169,9 @@ namespace Disco.Services.Searching
|
||||
u.UserId.Contains(Term) ||
|
||||
u.Surname.Contains(Term) ||
|
||||
u.GivenName.Contains(Term) ||
|
||||
u.DisplayName.Contains(Term)
|
||||
).Select(u => new UserSearchResultItem()
|
||||
{
|
||||
Id = u.UserId,
|
||||
Surname = u.Surname,
|
||||
GivenName = u.GivenName,
|
||||
DisplayName = u.DisplayName,
|
||||
AssignedDevicesCount = u.DeviceUserAssignments.Where(dua => !dua.UnassignedDate.HasValue).Count(),
|
||||
JobCount = u.Jobs.Count()
|
||||
}).ToList();
|
||||
|
||||
u.DisplayName.Contains(Term))
|
||||
.ToUserSearchResultItems(null)
|
||||
.ToList();
|
||||
|
||||
IEnumerable<UserSearchResultItem> results;
|
||||
if (PersistResults)
|
||||
@@ -215,6 +210,35 @@ namespace Disco.Services.Searching
|
||||
|
||||
return results.ToList();
|
||||
}
|
||||
public static List<UserSearchResultItem> SearchUserFlag(DiscoDataContext Database, int UserFlagId)
|
||||
{
|
||||
return Database.UserFlagAssignments
|
||||
.Where(a => a.UserFlagId == UserFlagId && !a.RemovedDate.HasValue)
|
||||
.Select(a => a.User)
|
||||
.ToUserSearchResultItems(null);
|
||||
}
|
||||
|
||||
private static List<UserSearchResultItem> ToUserSearchResultItems(this IQueryable<User> Query, int? LimitCount = ActiveDirectory.DefaultSearchResultLimit)
|
||||
{
|
||||
if (LimitCount.HasValue)
|
||||
Query = Query.Take(LimitCount.Value);
|
||||
|
||||
var results = Query.Select(u => new UserSearchResultItem()
|
||||
{
|
||||
Id = u.UserId,
|
||||
Surname = u.Surname,
|
||||
GivenName = u.GivenName,
|
||||
DisplayName = u.DisplayName,
|
||||
AssignedDevicesCount = u.DeviceUserAssignments.Where(dua => !dua.UnassignedDate.HasValue).Count(),
|
||||
JobCount = u.Jobs.Count(),
|
||||
JobCountOpen = u.Jobs.Count(j => !j.ClosedDate.HasValue),
|
||||
UserFlagAssignments = u.UserFlagAssignments
|
||||
}).ToList();
|
||||
|
||||
results.ForEach(u => u.FriendlyId = UserExtensions.FriendlyUserId(u.Id));
|
||||
|
||||
return results;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Devices
|
||||
@@ -251,17 +275,17 @@ namespace Disco.Services.Searching
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public static List<DeviceSearchResultItem> SearchDeviceModel(DiscoDataContext Database, int DeviceModelId, int? LimitCount = ActiveDirectory.DefaultSearchResultLimit)
|
||||
public static List<DeviceSearchResultItem> SearchDeviceModel(DiscoDataContext Database, int DeviceModelId)
|
||||
{
|
||||
return Database.Devices.Where(d => d.DeviceModelId == DeviceModelId).ToDeviceSearchResultItems(LimitCount);
|
||||
return Database.Devices.Where(d => d.DeviceModelId == DeviceModelId).ToDeviceSearchResultItems(null);
|
||||
}
|
||||
public static List<DeviceSearchResultItem> SearchDeviceProfile(DiscoDataContext Database, int DeviceProfileId, int? LimitCount = ActiveDirectory.DefaultSearchResultLimit)
|
||||
public static List<DeviceSearchResultItem> SearchDeviceProfile(DiscoDataContext Database, int DeviceProfileId)
|
||||
{
|
||||
return Database.Devices.Where(d => d.DeviceProfileId == DeviceProfileId).ToDeviceSearchResultItems(LimitCount);
|
||||
return Database.Devices.Where(d => d.DeviceProfileId == DeviceProfileId).ToDeviceSearchResultItems(null);
|
||||
}
|
||||
public static List<DeviceSearchResultItem> SearchDeviceBatch(DiscoDataContext Database, int DeviceBatchId, int? LimitCount = ActiveDirectory.DefaultSearchResultLimit)
|
||||
public static List<DeviceSearchResultItem> SearchDeviceBatch(DiscoDataContext Database, int DeviceBatchId)
|
||||
{
|
||||
return Database.Devices.Where(d => d.DeviceBatchId == DeviceBatchId).ToDeviceSearchResultItems(LimitCount);
|
||||
return Database.Devices.Where(d => d.DeviceBatchId == DeviceBatchId).ToDeviceSearchResultItems(null);
|
||||
}
|
||||
|
||||
private static List<DeviceSearchResultItem> ToDeviceSearchResultItems(this IQueryable<Device> Query, int? LimitCount = ActiveDirectory.DefaultSearchResultLimit)
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Models.Repository;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Disco.Services.Users.UserFlags
|
||||
{
|
||||
internal class Cache
|
||||
{
|
||||
private ConcurrentDictionary<int, UserFlag> _Cache;
|
||||
|
||||
public Cache(DiscoDataContext Database)
|
||||
{
|
||||
Initialize(Database);
|
||||
}
|
||||
|
||||
public void ReInitialize(DiscoDataContext Database)
|
||||
{
|
||||
Initialize(Database);
|
||||
}
|
||||
|
||||
private void Initialize(DiscoDataContext Database)
|
||||
{
|
||||
// Queues from Database
|
||||
var flags = Database.UserFlags.ToList();
|
||||
|
||||
// Add Queues to In-Memory Cache
|
||||
this._Cache = new ConcurrentDictionary<int, UserFlag>(flags.Select(f => new KeyValuePair<int, UserFlag>(f.Id, f)));
|
||||
}
|
||||
|
||||
public UserFlag GetUserFlag(int UserFlagId)
|
||||
{
|
||||
UserFlag item;
|
||||
if (_Cache.TryGetValue(UserFlagId, out item))
|
||||
return item;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
public List<UserFlag> GetUserFlags()
|
||||
{
|
||||
return _Cache.Values.ToList();
|
||||
}
|
||||
|
||||
public UserFlag Update(UserFlag UserFlag)
|
||||
{
|
||||
UserFlag existingItem;
|
||||
|
||||
if (_Cache.TryGetValue(UserFlag.Id, out existingItem))
|
||||
{
|
||||
if (_Cache.TryUpdate(UserFlag.Id, UserFlag, existingItem))
|
||||
{
|
||||
return UserFlag;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_Cache.TryAdd(UserFlag.Id, UserFlag))
|
||||
{
|
||||
return UserFlag;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public UserFlag Remove(int UserFlagId)
|
||||
{
|
||||
UserFlag item;
|
||||
if (_Cache.TryRemove(UserFlagId, out item))
|
||||
return item;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
public UserFlag Remove(UserFlag UserFlag)
|
||||
{
|
||||
return Remove(UserFlag.Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services.Extensions;
|
||||
using Disco.Services.Tasks;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Services.Users.UserFlags
|
||||
{
|
||||
public static class UserFlagService
|
||||
{
|
||||
private static Cache _cache;
|
||||
|
||||
public static void Initialize(DiscoDataContext Database)
|
||||
{
|
||||
_cache = new Cache(Database);
|
||||
}
|
||||
|
||||
public static List<UserFlag> GetUserFlags() { return _cache.GetUserFlags(); }
|
||||
public static UserFlag GetUserFlag(int UserFlagId) { return _cache.GetUserFlag(UserFlagId); }
|
||||
|
||||
#region User Flag Maintenance
|
||||
public static UserFlag CreateUserFlag(DiscoDataContext Database, UserFlag UserFlag)
|
||||
{
|
||||
// Verify
|
||||
if (string.IsNullOrWhiteSpace(UserFlag.Name))
|
||||
throw new ArgumentException("The User Flag Name is required");
|
||||
|
||||
// Name Unique
|
||||
if (_cache.GetUserFlags().Any(f => f.Name == UserFlag.Name))
|
||||
throw new ArgumentException("Another User Flag already exists with that name", "UserFlag");
|
||||
|
||||
// Clone to break reference
|
||||
var flag = new UserFlag()
|
||||
{
|
||||
Name = UserFlag.Name,
|
||||
Description = UserFlag.Description,
|
||||
Icon = UserFlag.Icon,
|
||||
IconColour = UserFlag.IconColour
|
||||
};
|
||||
|
||||
Database.UserFlags.Add(flag);
|
||||
Database.SaveChanges();
|
||||
|
||||
return _cache.Update(flag);
|
||||
}
|
||||
public static UserFlag Update(DiscoDataContext Database, UserFlag UserFlag)
|
||||
{
|
||||
// Verify
|
||||
if (string.IsNullOrWhiteSpace(UserFlag.Name))
|
||||
throw new ArgumentException("The User Flag Name is required");
|
||||
|
||||
// Name Unique
|
||||
if (_cache.GetUserFlags().Any(f => f.Id != UserFlag.Id && f.Name == UserFlag.Name))
|
||||
throw new ArgumentException("Another User Flag already exists with that name", "UserFlag");
|
||||
|
||||
Database.SaveChanges();
|
||||
|
||||
return _cache.Update(UserFlag);
|
||||
}
|
||||
public static void DeleteUserFlag(DiscoDataContext Database, int UserFlagId, IScheduledTaskStatus Status)
|
||||
{
|
||||
UserFlag flag = Database.UserFlags.Find(UserFlagId);
|
||||
|
||||
// Delete Assignments
|
||||
Status.UpdateStatus(0, string.Format("Removing '{0}' [{1}] User Flag", flag.Name, flag.Id), "Starting");
|
||||
List<UserFlagAssignment> flagAssignments = Database.UserFlagAssignments.Where(fa => fa.UserFlagId == flag.Id).ToList();
|
||||
if (flagAssignments.Count > 0)
|
||||
{
|
||||
Status.UpdateStatus(20, "Removing flag from users");
|
||||
flagAssignments.ForEach(flagAssignment => Database.UserFlagAssignments.Remove(flagAssignment));
|
||||
Database.SaveChanges();
|
||||
}
|
||||
|
||||
// Delete Flag
|
||||
Status.UpdateStatus(90, "Deleting User Flag");
|
||||
Database.UserFlags.Remove(flag);
|
||||
Database.SaveChanges();
|
||||
|
||||
// Remove from Cache
|
||||
_cache.Remove(UserFlagId);
|
||||
|
||||
Status.Finished(string.Format("Successfully Deleted User Flag: '{0}' [{1}]", flag.Name, flag.Id));
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static string RandomUnusedIcon()
|
||||
{
|
||||
return UIHelpers.RandomIcon(_cache.GetUserFlags().Select(f => f.Icon));
|
||||
}
|
||||
public static string RandomUnusedThemeColour()
|
||||
{
|
||||
return UIHelpers.RandomThemeColour(_cache.GetUserFlags().Select(f => f.IconColour));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Services.Tasks;
|
||||
using Quartz;
|
||||
|
||||
namespace Disco.Services.Users.UserFlags
|
||||
{
|
||||
public class UserFlagDeleteTask : ScheduledTask
|
||||
{
|
||||
public override string TaskName { get { return "User Flags - Delete Flag"; } }
|
||||
|
||||
public override bool SingleInstanceTask { get { return false; }}
|
||||
public override bool CancelInitiallySupported { get { return false; } }
|
||||
public override bool LogExceptionsOnly { get { return true; } }
|
||||
|
||||
protected override void ExecuteTask()
|
||||
{
|
||||
int UserFlagId = (int)this.ExecutionContext.JobDetail.JobDataMap["UserFlagId"];
|
||||
|
||||
using (DiscoDataContext Database = new DiscoDataContext())
|
||||
{
|
||||
UserFlagService.DeleteUserFlag(Database, UserFlagId, this.Status);
|
||||
}
|
||||
}
|
||||
|
||||
public static ScheduledTaskStatus ScheduleNow(int UserFlagId)
|
||||
{
|
||||
JobDataMap taskData = new JobDataMap() { { "UserFlagId", UserFlagId } };
|
||||
|
||||
var instance = new UserFlagDeleteTask();
|
||||
|
||||
return instance.ScheduleTask(taskData);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,16 @@
|
||||
@FriendlyDate(d, WithoutSuffix: WithoutSuffix);
|
||||
@FriendlyUser(u, null, " by");
|
||||
}
|
||||
@helper FriendlyDateAndUser(DateTime? d, string UserId, string DateNullValue = "n/a", bool WithoutSuffix = false)
|
||||
{
|
||||
@FriendlyDate(d, DateNullValue, WithoutSuffix: WithoutSuffix);
|
||||
@FriendlyUser(UserId, null, " by");
|
||||
}
|
||||
@helper FriendlyDateAndUser(DateTime d, string UserId, bool WithoutSuffix = false)
|
||||
{
|
||||
@FriendlyDate(d, WithoutSuffix: WithoutSuffix);
|
||||
@FriendlyUser(UserId, null, " by");
|
||||
}
|
||||
@helper FriendlyDateAndTitleUser(DateTime? d, User u, string DateNullValue = "n/a", bool WithoutSuffix = false)
|
||||
{
|
||||
<span title="@d.ToFullDateTime(DateNullValue) by @u" data-livestamp="@d.ToUnixEpoc()" class="date nowrap@(WithoutSuffix ? " noMomentSuffix" : null)">@d.ToFullDateTime(DateNullValue)</span>
|
||||
@@ -41,6 +51,17 @@
|
||||
<span>@nullValue</span>
|
||||
}
|
||||
}
|
||||
@helper FriendlyUser(string UserId, string nullValue = null, string prepend = null)
|
||||
{
|
||||
if (UserId != null)
|
||||
{
|
||||
@prepend <span>@Disco.Services.UserExtensions.FriendlyUserId(UserId)</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>@nullValue</span>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@helper RadioButtonList(string id, List<System.Web.Mvc.SelectListItem> items, int columns = 1)
|
||||
|
||||
@@ -326,7 +326,7 @@ WriteTo(@__razor_helper_writer, FriendlyUser(u, null, " by"));
|
||||
}
|
||||
|
||||
|
||||
public static System.Web.WebPages.HelperResult FriendlyDateAndTitleUser(DateTime? d, User u, string DateNullValue = "n/a", bool WithoutSuffix = false)
|
||||
public static System.Web.WebPages.HelperResult FriendlyDateAndUser(DateTime? d, string UserId, string DateNullValue = "n/a", bool WithoutSuffix = false)
|
||||
{
|
||||
return new System.Web.WebPages.HelperResult(__razor_helper_writer => {
|
||||
|
||||
@@ -335,6 +335,96 @@ return new System.Web.WebPages.HelperResult(__razor_helper_writer => {
|
||||
#line 26 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 27 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, FriendlyDate(d, DateNullValue, WithoutSuffix: WithoutSuffix));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 27 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 28 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, FriendlyUser(UserId, null, " by"));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 28 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static System.Web.WebPages.HelperResult FriendlyDateAndUser(DateTime d, string UserId, bool WithoutSuffix = false)
|
||||
{
|
||||
return new System.Web.WebPages.HelperResult(__razor_helper_writer => {
|
||||
|
||||
|
||||
|
||||
#line 31 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 32 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, FriendlyDate(d, WithoutSuffix: WithoutSuffix));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 32 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 33 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, FriendlyUser(UserId, null, " by"));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 33 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static System.Web.WebPages.HelperResult FriendlyDateAndTitleUser(DateTime? d, User u, string DateNullValue = "n/a", bool WithoutSuffix = false)
|
||||
{
|
||||
return new System.Web.WebPages.HelperResult(__razor_helper_writer => {
|
||||
|
||||
|
||||
|
||||
#line 36 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
@@ -342,7 +432,7 @@ WriteLiteralTo(@__razor_helper_writer, " <span title=\"");
|
||||
|
||||
|
||||
|
||||
#line 27 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 37 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, d.ToFullDateTime(DateNullValue));
|
||||
|
||||
#line default
|
||||
@@ -352,7 +442,7 @@ WriteLiteralTo(@__razor_helper_writer, " by ");
|
||||
|
||||
|
||||
|
||||
#line 27 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 37 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, u);
|
||||
|
||||
#line default
|
||||
@@ -362,7 +452,7 @@ WriteLiteralTo(@__razor_helper_writer, "\" data-livestamp=\"");
|
||||
|
||||
|
||||
|
||||
#line 27 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 37 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, d.ToUnixEpoc());
|
||||
|
||||
#line default
|
||||
@@ -372,7 +462,7 @@ WriteLiteralTo(@__razor_helper_writer, "\" class=\"date nowrap");
|
||||
|
||||
|
||||
|
||||
#line 27 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 37 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, WithoutSuffix ? " noMomentSuffix" : null);
|
||||
|
||||
#line default
|
||||
@@ -382,7 +472,7 @@ WriteLiteralTo(@__razor_helper_writer, "\">");
|
||||
|
||||
|
||||
|
||||
#line 27 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 37 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, d.ToFullDateTime(DateNullValue));
|
||||
|
||||
#line default
|
||||
@@ -392,7 +482,7 @@ WriteLiteralTo(@__razor_helper_writer, "</span>\r\n");
|
||||
|
||||
|
||||
|
||||
#line 28 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 38 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
@@ -408,7 +498,7 @@ return new System.Web.WebPages.HelperResult(__razor_helper_writer => {
|
||||
|
||||
|
||||
|
||||
#line 30 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 40 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
@@ -418,7 +508,7 @@ WriteLiteralTo(@__razor_helper_writer, " <span title=\"");
|
||||
|
||||
|
||||
|
||||
#line 31 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 41 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, d.ToFullDateTime());
|
||||
|
||||
#line default
|
||||
@@ -428,7 +518,7 @@ WriteLiteralTo(@__razor_helper_writer, " by ");
|
||||
|
||||
|
||||
|
||||
#line 31 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 41 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, u);
|
||||
|
||||
#line default
|
||||
@@ -438,7 +528,7 @@ WriteLiteralTo(@__razor_helper_writer, "\" data-livestamp=\"");
|
||||
|
||||
|
||||
|
||||
#line 31 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 41 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, d.ToUnixEpoc());
|
||||
|
||||
#line default
|
||||
@@ -448,7 +538,7 @@ WriteLiteralTo(@__razor_helper_writer, "\" class=\"date nowrap");
|
||||
|
||||
|
||||
|
||||
#line 31 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 41 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, WithoutSuffix ? " noMomentSuffix" : null);
|
||||
|
||||
#line default
|
||||
@@ -458,7 +548,7 @@ WriteLiteralTo(@__razor_helper_writer, "\">");
|
||||
|
||||
|
||||
|
||||
#line 31 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 41 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, d.ToFullDateTime());
|
||||
|
||||
#line default
|
||||
@@ -468,7 +558,7 @@ WriteLiteralTo(@__razor_helper_writer, "</span>\r\n");
|
||||
|
||||
|
||||
|
||||
#line 32 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 42 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
@@ -484,7 +574,7 @@ return new System.Web.WebPages.HelperResult(__razor_helper_writer => {
|
||||
|
||||
|
||||
|
||||
#line 34 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 44 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
|
||||
if (u != null)
|
||||
{
|
||||
@@ -493,7 +583,7 @@ return new System.Web.WebPages.HelperResult(__razor_helper_writer => {
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 37 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 47 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, prepend);
|
||||
|
||||
#line default
|
||||
@@ -504,7 +594,7 @@ WriteLiteralTo(@__razor_helper_writer, " <span title=\"");
|
||||
|
||||
|
||||
|
||||
#line 37 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 47 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, u);
|
||||
|
||||
#line default
|
||||
@@ -514,7 +604,7 @@ WriteLiteralTo(@__razor_helper_writer, "\">");
|
||||
|
||||
|
||||
|
||||
#line 37 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 47 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, u.FriendlyId());
|
||||
|
||||
#line default
|
||||
@@ -524,7 +614,7 @@ WriteLiteralTo(@__razor_helper_writer, "</span>\r\n");
|
||||
|
||||
|
||||
|
||||
#line 38 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 48 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -536,7 +626,7 @@ WriteLiteralTo(@__razor_helper_writer, " <span>");
|
||||
|
||||
|
||||
|
||||
#line 41 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 51 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, nullValue);
|
||||
|
||||
#line default
|
||||
@@ -546,7 +636,76 @@ WriteLiteralTo(@__razor_helper_writer, "</span>\r\n");
|
||||
|
||||
|
||||
|
||||
#line 42 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 52 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static System.Web.WebPages.HelperResult FriendlyUser(string UserId, string nullValue = null, string prepend = null)
|
||||
{
|
||||
return new System.Web.WebPages.HelperResult(__razor_helper_writer => {
|
||||
|
||||
|
||||
|
||||
#line 55 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
|
||||
if (UserId != null)
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 58 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, prepend);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
WriteLiteralTo(@__razor_helper_writer, " <span>");
|
||||
|
||||
|
||||
|
||||
#line 58 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, Disco.Services.UserExtensions.FriendlyUserId(UserId));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
WriteLiteralTo(@__razor_helper_writer, "</span>\r\n");
|
||||
|
||||
|
||||
|
||||
#line 59 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
WriteLiteralTo(@__razor_helper_writer, " <span>");
|
||||
|
||||
|
||||
|
||||
#line 62 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, nullValue);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
WriteLiteralTo(@__razor_helper_writer, "</span>\r\n");
|
||||
|
||||
|
||||
|
||||
#line 63 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
@@ -563,21 +722,21 @@ return new System.Web.WebPages.HelperResult(__razor_helper_writer => {
|
||||
|
||||
|
||||
|
||||
#line 47 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 68 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 48 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 69 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, ItemList("radio", id, items, columns));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 48 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 69 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
@@ -594,21 +753,21 @@ return new System.Web.WebPages.HelperResult(__razor_helper_writer => {
|
||||
|
||||
|
||||
|
||||
#line 51 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 72 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 52 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 73 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, ItemList("checkbox", id, items, columns, alignEven, forceUniqueIds, htmlEncodeText));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 52 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 73 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
@@ -625,7 +784,7 @@ return new System.Web.WebPages.HelperResult(__razor_helper_writer => {
|
||||
|
||||
|
||||
|
||||
#line 55 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 76 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
Html.GetPageHelper().BundleDeferred("~/ClientScripts/Modules/Disco-jQueryExtensions");
|
||||
|
||||
#line default
|
||||
@@ -635,7 +794,7 @@ WriteLiteralTo(@__razor_helper_writer, " <span id=\"");
|
||||
|
||||
|
||||
|
||||
#line 56 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 77 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, BulkSelectContainerId);
|
||||
|
||||
#line default
|
||||
@@ -645,7 +804,7 @@ WriteLiteralTo(@__razor_helper_writer, "\" class=\"checkboxBulkSelectContainer\"
|
||||
|
||||
|
||||
|
||||
#line 57 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 78 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
if (string.IsNullOrWhiteSpace(ParentJQuerySelector))
|
||||
{
|
||||
|
||||
@@ -656,7 +815,7 @@ WriteLiteralTo(@__razor_helper_writer, " <script type=\"text/javascri
|
||||
|
||||
|
||||
|
||||
#line 59 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 80 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, BulkSelectContainerId);
|
||||
|
||||
#line default
|
||||
@@ -666,7 +825,7 @@ WriteLiteralTo(@__razor_helper_writer, "\').checkboxBulkSelect(); });</script>\r
|
||||
|
||||
|
||||
|
||||
#line 60 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 81 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -678,7 +837,7 @@ WriteLiteralTo(@__razor_helper_writer, " <script type=\"text/javascri
|
||||
|
||||
|
||||
|
||||
#line 63 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 84 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, BulkSelectContainerId);
|
||||
|
||||
#line default
|
||||
@@ -688,7 +847,7 @@ WriteLiteralTo(@__razor_helper_writer, "\').checkboxBulkSelect({ parentSelector:
|
||||
|
||||
|
||||
|
||||
#line 63 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 84 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, ParentJQuerySelector);
|
||||
|
||||
#line default
|
||||
@@ -698,7 +857,7 @@ WriteLiteralTo(@__razor_helper_writer, "\' }); });</script>\r\n");
|
||||
|
||||
|
||||
|
||||
#line 64 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 85 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
@@ -708,7 +867,7 @@ WriteLiteralTo(@__razor_helper_writer, " </span>\r\n");
|
||||
|
||||
|
||||
|
||||
#line 66 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 87 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
@@ -724,7 +883,7 @@ return new System.Web.WebPages.HelperResult(__razor_helper_writer => {
|
||||
|
||||
|
||||
|
||||
#line 68 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 89 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
|
||||
int itemsPerColumn = items.Count / columns;
|
||||
int columnWidth = (100 / columns);
|
||||
@@ -737,7 +896,7 @@ WriteLiteralTo(@__razor_helper_writer, " <table class=\"none\">\r\n <t
|
||||
|
||||
|
||||
|
||||
#line 74 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 95 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
for (int i = 0; i < columns; i++)
|
||||
{
|
||||
|
||||
@@ -748,7 +907,7 @@ WriteLiteralTo(@__razor_helper_writer, " <td");
|
||||
|
||||
|
||||
|
||||
#line 76 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 97 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, alignEven ? new HtmlString(string.Format(" style=\"width: {0}%\"", columnWidth)) : new HtmlString(string.Empty));
|
||||
|
||||
#line default
|
||||
@@ -758,7 +917,7 @@ WriteLiteralTo(@__razor_helper_writer, ">\r\n <ul class=\"non
|
||||
|
||||
|
||||
|
||||
#line 78 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 99 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
|
||||
int itemsForThisColumn = itemsPerColumn + (items.Count % columns > i ? 1 : 0);
|
||||
for (int i2 = 0; i2 < itemsForThisColumn && itemNextId < items.Count; i2++)
|
||||
@@ -774,7 +933,7 @@ WriteLiteralTo(@__razor_helper_writer, " <li>\r\n
|
||||
|
||||
|
||||
|
||||
#line 86 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 107 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, itemId);
|
||||
|
||||
#line default
|
||||
@@ -784,7 +943,7 @@ WriteLiteralTo(@__razor_helper_writer, "\" name=\"");
|
||||
|
||||
|
||||
|
||||
#line 86 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 107 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, id);
|
||||
|
||||
#line default
|
||||
@@ -794,7 +953,7 @@ WriteLiteralTo(@__razor_helper_writer, "\" value=\"");
|
||||
|
||||
|
||||
|
||||
#line 86 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 107 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, item.Value);
|
||||
|
||||
#line default
|
||||
@@ -804,7 +963,7 @@ WriteLiteralTo(@__razor_helper_writer, "\" type=\"");
|
||||
|
||||
|
||||
|
||||
#line 86 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 107 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, inputType);
|
||||
|
||||
#line default
|
||||
@@ -814,7 +973,7 @@ WriteLiteralTo(@__razor_helper_writer, "\" ");
|
||||
|
||||
|
||||
|
||||
#line 86 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 107 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, item.Selected ? new HtmlString("checked=\"checked\" ") : null);
|
||||
|
||||
#line default
|
||||
@@ -824,7 +983,7 @@ WriteLiteralTo(@__razor_helper_writer, "/><label for=\"");
|
||||
|
||||
|
||||
|
||||
#line 86 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 107 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, itemId);
|
||||
|
||||
#line default
|
||||
@@ -832,28 +991,28 @@ WriteLiteralTo(@__razor_helper_writer, "/><label for=\"");
|
||||
|
||||
|
||||
|
||||
#line 86 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 107 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteLiteralTo(@__razor_helper_writer, "\">");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 86 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 107 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
if (htmlEncodeText)
|
||||
{
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 87 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 108 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, item.Text);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 87 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 108 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -861,14 +1020,14 @@ WriteLiteralTo(@__razor_helper_writer, "/><label for=\"");
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 89 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 110 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, new HtmlString(item.Text));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 89 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 110 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
}
|
||||
#line default
|
||||
#line hidden
|
||||
@@ -877,7 +1036,7 @@ WriteLiteralTo(@__razor_helper_writer, "</label></li>\r\n");
|
||||
|
||||
|
||||
|
||||
#line 90 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 111 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -888,7 +1047,7 @@ WriteLiteralTo(@__razor_helper_writer, " </ul>\r\n
|
||||
|
||||
|
||||
|
||||
#line 94 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 115 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
@@ -898,7 +1057,7 @@ WriteLiteralTo(@__razor_helper_writer, " </tr>\r\n </table>\r\n");
|
||||
|
||||
|
||||
|
||||
#line 97 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 118 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
@@ -914,7 +1073,7 @@ return new System.Web.WebPages.HelperResult(__razor_helper_writer => {
|
||||
|
||||
|
||||
|
||||
#line 101 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 122 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
|
||||
for (int index = 0; index < BreadCrumbs.Count; index++)
|
||||
{
|
||||
@@ -929,7 +1088,7 @@ WriteLiteralTo(@__razor_helper_writer, " <span>></span>\r\n");
|
||||
|
||||
|
||||
|
||||
#line 108 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 129 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
}
|
||||
if (breadCrumb.Item2 == null)
|
||||
{
|
||||
@@ -938,14 +1097,14 @@ WriteLiteralTo(@__razor_helper_writer, " <span>></span>\r\n");
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 111 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 132 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, breadCrumb.Item1);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 111 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 132 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
|
||||
}
|
||||
else
|
||||
@@ -955,14 +1114,14 @@ WriteTo(@__razor_helper_writer, breadCrumb.Item1);
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 115 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 136 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, Html.GetPageHelper().ActionLink(breadCrumb.Item1, breadCrumb.Item2));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 115 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 136 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
|
||||
}
|
||||
}
|
||||
@@ -981,21 +1140,21 @@ return new System.Web.WebPages.HelperResult(__razor_helper_writer => {
|
||||
|
||||
|
||||
|
||||
#line 120 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 141 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 121 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 142 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, Title);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 121 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 142 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
@@ -1012,7 +1171,7 @@ return new System.Web.WebPages.HelperResult(__razor_helper_writer => {
|
||||
|
||||
|
||||
|
||||
#line 124 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 145 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
|
||||
for (int index = 0; index < BreadCrumbs.Count; index++)
|
||||
{
|
||||
@@ -1024,14 +1183,14 @@ return new System.Web.WebPages.HelperResult(__razor_helper_writer => {
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 130 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 151 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, new HtmlString(" > "));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 130 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 151 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
|
||||
}
|
||||
|
||||
@@ -1039,14 +1198,14 @@ WriteTo(@__razor_helper_writer, new HtmlString(" > "));
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 132 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 153 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, breadCrumb.Item1);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 132 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 153 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
|
||||
}
|
||||
|
||||
@@ -1064,21 +1223,21 @@ return new System.Web.WebPages.HelperResult(__razor_helper_writer => {
|
||||
|
||||
|
||||
|
||||
#line 136 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 157 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 137 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 158 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, Title);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
|
||||
#line 137 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
#line 158 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
|
||||
@@ -56,6 +56,9 @@ namespace Disco.Web
|
||||
// Initialize Job Queues
|
||||
Disco.Services.Jobs.JobQueues.JobQueueService.Initialize(Database);
|
||||
|
||||
// Initialize User Flags
|
||||
Disco.Services.Users.UserFlags.UserFlagService.Initialize(Database);
|
||||
|
||||
// Initialize Plugins
|
||||
Disco.Services.Plugins.Plugins.InitalizePlugins(Database);
|
||||
|
||||
@@ -74,9 +77,6 @@ namespace Disco.Web
|
||||
|
||||
DiscoApplication.DocumentDropBoxMonitor.StartWatching();
|
||||
DiscoApplication.DocumentDropBoxMonitor.ScheduleCurrentFiles(10);
|
||||
|
||||
// Enable SignalR-based Repository Notifications
|
||||
//Disco.BI.Interop.SignalRHandlers.RepositoryMonitorNotifications.Initialize();
|
||||
}
|
||||
|
||||
public static void InitializeUpdateEnvironment(DiscoDataContext Database, Version PreviousVersion)
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Users.UserFlags;
|
||||
using Disco.Services.Web;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
public partial class UserFlagAssignmentController : AuthorizedDatabaseController
|
||||
{
|
||||
const string pComments = "comments";
|
||||
|
||||
public virtual ActionResult Update(int id, string key, string value = null, Nullable<bool> redirect = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (id < 0)
|
||||
throw new ArgumentOutOfRangeException("id");
|
||||
if (string.IsNullOrEmpty(key))
|
||||
throw new ArgumentNullException("key");
|
||||
var userFlagAssignment = Database.UserFlagAssignments.FirstOrDefault(a => a.Id == id);
|
||||
if (userFlagAssignment != null)
|
||||
{
|
||||
switch (key.ToLower())
|
||||
{
|
||||
case pComments:
|
||||
UpdateComments(userFlagAssignment, value);
|
||||
break;
|
||||
default:
|
||||
throw new Exception("Invalid Update Key");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("Invalid User Flag Assignment Id");
|
||||
}
|
||||
if (redirect.HasValue && redirect.Value)
|
||||
return Redirect(string.Format("{0}#UserDetailTab-Flags", Url.Action(MVC.User.Show(userFlagAssignment.UserId))));
|
||||
else
|
||||
return Json("OK", JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (redirect.HasValue && redirect.Value)
|
||||
throw;
|
||||
else
|
||||
return Json(string.Format("Error: {0}", ex.Message), JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
}
|
||||
|
||||
#region Update Shortcut Methods
|
||||
[DiscoAuthorizeAny(Claims.User.Actions.EditFlags)]
|
||||
public virtual ActionResult UpdateComments(int id, string Comments = null, Nullable<bool> redirect = null)
|
||||
{
|
||||
return Update(id, pComments, Comments, redirect);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Update Properties
|
||||
private void UpdateComments(UserFlagAssignment userFlagAssignment, string Comments)
|
||||
{
|
||||
if (!userFlagAssignment.CanEditComments())
|
||||
throw new InvalidOperationException("Editing comments for user flags is denied");
|
||||
|
||||
userFlagAssignment.OnEditComments(Comments);
|
||||
Database.SaveChanges();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Actions
|
||||
|
||||
[DiscoAuthorizeAny(Claims.User.Actions.AddFlags)]
|
||||
public virtual ActionResult AddUser(int id, string UserId, string Comments)
|
||||
{
|
||||
var userFlag = UserFlagService.GetUserFlag(id);
|
||||
if (userFlag == null)
|
||||
throw new ArgumentException("Invalid User Flag Id", "id");
|
||||
|
||||
var user = Database.Users.Include("UserFlagAssignments").FirstOrDefault(u => u.UserId == UserId);
|
||||
if (user == null)
|
||||
throw new ArgumentException("Invalid User Id", "UserId");
|
||||
|
||||
if (!user.CanAddUserFlag(userFlag))
|
||||
throw new InvalidOperationException("Adding user flag is denied");
|
||||
|
||||
var userFlagAssignment = user.OnAddUserFlag(Database, userFlag, CurrentUser, Comments);
|
||||
Database.SaveChanges();
|
||||
|
||||
return Redirect(string.Format("{0}#UserDetailTab-Flags", Url.Action(MVC.User.Show(user.UserId))));
|
||||
}
|
||||
|
||||
[DiscoAuthorizeAny(Claims.User.Actions.RemoveFlags)]
|
||||
public virtual ActionResult RemoveUser(int id)
|
||||
{
|
||||
var userFlagAssignment = Database.UserFlagAssignments.FirstOrDefault(a => a.Id == id);
|
||||
if (userFlagAssignment == null)
|
||||
throw new ArgumentException("Invalid User Flag Assignment Id", "id");
|
||||
|
||||
if (!userFlagAssignment.CanRemove())
|
||||
throw new InvalidOperationException("Removing user flag assignment is denied");
|
||||
|
||||
userFlagAssignment.OnRemove(CurrentUser);
|
||||
Database.SaveChanges();
|
||||
|
||||
return Redirect(string.Format("{0}#UserDetailTab-Flags", Url.Action(MVC.User.Show(userFlagAssignment.UserId))));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,196 @@
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Users.UserFlags;
|
||||
using Disco.Services.Web;
|
||||
using System;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
public partial class UserFlagController : AuthorizedDatabaseController
|
||||
{
|
||||
const string pName = "name";
|
||||
const string pDescription = "description";
|
||||
const string pIcon = "icon";
|
||||
const string pIconColour = "iconcolour";
|
||||
|
||||
[DiscoAuthorize(Claims.Config.UserFlag.Configure)]
|
||||
public virtual ActionResult Update(int id, string key, string value = null, Nullable<bool> redirect = null)
|
||||
{
|
||||
Authorization.Require(Claims.Config.UserFlag.Configure);
|
||||
|
||||
try
|
||||
{
|
||||
if (id < 0)
|
||||
throw new ArgumentOutOfRangeException("id");
|
||||
if (string.IsNullOrEmpty(key))
|
||||
throw new ArgumentNullException("key");
|
||||
var flag = Database.UserFlags.Find(id);
|
||||
if (flag != null)
|
||||
{
|
||||
switch (key.ToLower())
|
||||
{
|
||||
case pName:
|
||||
UpdateName(flag, value);
|
||||
break;
|
||||
case pDescription:
|
||||
UpdateDescription(flag, value);
|
||||
break;
|
||||
case pIcon:
|
||||
UpdateIcon(flag, value);
|
||||
break;
|
||||
case pIconColour:
|
||||
UpdateIconColour(flag, value);
|
||||
break;
|
||||
default:
|
||||
throw new Exception("Invalid Update Key");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("Invalid User Flag Id");
|
||||
}
|
||||
if (redirect.HasValue && redirect.Value)
|
||||
return RedirectToAction(MVC.Config.UserFlag.Index(flag.Id));
|
||||
else
|
||||
return Json("OK", JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (redirect.HasValue && redirect.Value)
|
||||
throw;
|
||||
else
|
||||
return Json(string.Format("Error: {0}", ex.Message), JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
}
|
||||
|
||||
#region Update Shortcut Methods
|
||||
[DiscoAuthorize(Claims.Config.UserFlag.Configure)]
|
||||
public virtual ActionResult UpdateName(int id, string FlagName = null, Nullable<bool> redirect = null)
|
||||
{
|
||||
return Update(id, pName, FlagName, redirect);
|
||||
}
|
||||
|
||||
[DiscoAuthorize(Claims.Config.UserFlag.Configure)]
|
||||
public virtual ActionResult UpdateDescription(int id, string Description = null, Nullable<bool> redirect = null)
|
||||
{
|
||||
return Update(id, pDescription, Description, redirect);
|
||||
}
|
||||
|
||||
[DiscoAuthorize(Claims.Config.UserFlag.Configure)]
|
||||
public virtual ActionResult UpdateIcon(int id, string Icon = null, Nullable<bool> redirect = null)
|
||||
{
|
||||
return Update(id, pIcon, Icon, redirect);
|
||||
}
|
||||
|
||||
[DiscoAuthorize(Claims.Config.UserFlag.Configure)]
|
||||
public virtual ActionResult UpdateIconColour(int id, string IconColour = null, Nullable<bool> redirect = null)
|
||||
{
|
||||
return Update(id, pIconColour, IconColour, redirect);
|
||||
}
|
||||
|
||||
[DiscoAuthorize(Claims.Config.UserFlag.Configure)]
|
||||
public virtual ActionResult UpdateIconAndColour(int id, string Icon = null, string IconColour = null, bool redirect = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (id < 0)
|
||||
throw new ArgumentOutOfRangeException("id");
|
||||
|
||||
var UserFlag = Database.UserFlags.Find(id);
|
||||
if (UserFlag != null)
|
||||
{
|
||||
UpdateIconAndColour(UserFlag, Icon, IconColour);
|
||||
}
|
||||
else
|
||||
{
|
||||
return Json("Invalid User Flag Id", JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
if (redirect)
|
||||
return RedirectToAction(MVC.Config.UserFlag.Index(UserFlag.Id));
|
||||
else
|
||||
return Json("OK", JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (redirect)
|
||||
throw;
|
||||
else
|
||||
return Json(string.Format("Error: {0}", ex.Message), JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Update Properties
|
||||
private void UpdateIconAndColour(UserFlag UserFlag, string Icon, string IconColour)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(Icon))
|
||||
throw new ArgumentNullException("Icon");
|
||||
if (string.IsNullOrWhiteSpace(IconColour))
|
||||
throw new ArgumentNullException("IconColour");
|
||||
|
||||
UserFlag.Icon = Icon;
|
||||
UserFlag.IconColour = IconColour;
|
||||
UserFlagService.Update(Database, UserFlag);
|
||||
}
|
||||
private void UpdateIcon(UserFlag UserFlag, string Icon)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(Icon))
|
||||
throw new ArgumentNullException("Icon");
|
||||
|
||||
UserFlag.Icon = Icon;
|
||||
UserFlagService.Update(Database, UserFlag);
|
||||
}
|
||||
private void UpdateIconColour(UserFlag UserFlag, string IconColour)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(IconColour))
|
||||
throw new ArgumentNullException("IconColour");
|
||||
|
||||
UserFlag.IconColour = IconColour;
|
||||
UserFlagService.Update(Database, UserFlag);
|
||||
}
|
||||
|
||||
private void UpdateName(UserFlag UserFlag, string Name)
|
||||
{
|
||||
UserFlag.Name = Name;
|
||||
UserFlagService.Update(Database, UserFlag);
|
||||
}
|
||||
|
||||
private void UpdateDescription(UserFlag UserFlag, string Description)
|
||||
{
|
||||
UserFlag.Description = Description;
|
||||
UserFlagService.Update(Database, UserFlag);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Actions
|
||||
[DiscoAuthorize(Claims.Config.UserFlag.Delete)]
|
||||
public virtual ActionResult Delete(int id, Nullable<bool> redirect = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
var jq = Database.UserFlags.Find(id);
|
||||
if (jq != null)
|
||||
{
|
||||
|
||||
var status = UserFlagDeleteTask.ScheduleNow(id);
|
||||
status.SetFinishedUrl(Url.Action(MVC.Config.UserFlag.Index(null)));
|
||||
|
||||
if (redirect.HasValue && redirect.Value)
|
||||
return RedirectToAction(MVC.Config.Logging.TaskStatus(status.SessionId));
|
||||
else
|
||||
return Json("OK", JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
throw new Exception("Invalid User Flag Id");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (redirect.HasValue && redirect.Value)
|
||||
throw;
|
||||
else
|
||||
return Json(string.Format("Error: {0}", ex.Message), JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ namespace Disco.Web.Areas.API.Models.Job
|
||||
public string Author { get; set; }
|
||||
public DateTime Timestamp { get; set; }
|
||||
public string Comments { get; set; }
|
||||
public string HtmlComments { get; set; }
|
||||
public long TimestampUnixEpoc { get { return this.Timestamp.ToUnixEpoc(); } }
|
||||
public string TimestampFull { get { return Timestamp.ToFullDateTime(); } }
|
||||
|
||||
@@ -27,7 +28,8 @@ namespace Disco.Web.Areas.API.Models.Job
|
||||
AuthorId = jl.TechUserId,
|
||||
Author = jl.TechUser.ToString(),
|
||||
Timestamp = jl.Timestamp,
|
||||
Comments = jl.Comments
|
||||
Comments = jl.Comments,
|
||||
HtmlComments = jl.Comments.ToHtmlComment().ToString()
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -114,6 +114,16 @@ namespace Disco.Web.Areas.Config
|
||||
"Config/JobQueue/{id}",
|
||||
new { controller = "JobQueue", action = "Index", id = UrlParameter.Optional }
|
||||
);
|
||||
context.MapRoute(
|
||||
"Config_UserFlag_Create",
|
||||
"Config/UserFlag/Create",
|
||||
new { controller = "UserFlag", action = "Create", id = UrlParameter.Optional }
|
||||
);
|
||||
context.MapRoute(
|
||||
"Config_UserFlag",
|
||||
"Config/UserFlag/{id}",
|
||||
new { controller = "UserFlag", action = "Index", id = UrlParameter.Optional }
|
||||
);
|
||||
|
||||
context.MapRoute(
|
||||
"Config_Plugins",
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Disco.Models.Services.Jobs.JobQueues;
|
||||
using Disco.Models.UI.Config.JobQueue;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Extensions;
|
||||
using Disco.Services.Interop.ActiveDirectory;
|
||||
using Disco.Services.Jobs.JobQueues;
|
||||
using Disco.Services.Plugins.Features.UIExtension;
|
||||
@@ -50,6 +51,8 @@ namespace Disco.Web.Areas.Config.Controllers
|
||||
if (Authorization.Has(Claims.Config.JobQueue.Configure))
|
||||
{
|
||||
m.JobTypes = Database.JobTypes.Include("JobSubTypes").ToList();
|
||||
m.Icons = UIHelpers.Icons;
|
||||
m.ThemeColours = UIHelpers.ThemeColours;
|
||||
}
|
||||
|
||||
// UI Extensions
|
||||
@@ -83,8 +86,8 @@ namespace Disco.Web.Areas.Config.Controllers
|
||||
{
|
||||
JobQueue = new Disco.Models.Repository.JobQueue()
|
||||
{
|
||||
Icon = JobQueueService.RandomIcon(),
|
||||
IconColour = JobQueueService.RandomIconColour(),
|
||||
Icon = JobQueueService.RandomUnusedIcon(),
|
||||
IconColour = JobQueueService.RandomUnusedThemeColour(),
|
||||
Priority = JobQueuePriority.Normal
|
||||
}
|
||||
};
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Models.UI.Config.UserFlag;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Extensions;
|
||||
using Disco.Services.Plugins.Features.UIExtension;
|
||||
using Disco.Services.Users.UserFlags;
|
||||
using Disco.Services.Web;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Controllers
|
||||
{
|
||||
public partial class UserFlagController : AuthorizedDatabaseController
|
||||
{
|
||||
[DiscoAuthorize(Claims.Config.UserFlag.Show)]
|
||||
public virtual ActionResult Index(int? id)
|
||||
{
|
||||
if (id.HasValue)
|
||||
{
|
||||
// Show
|
||||
var m = Database.UserFlags.Where(f => f.Id == id.Value).Select(f =>
|
||||
new Models.UserFlag.ShowModel()
|
||||
{
|
||||
UserFlag = f,
|
||||
CurrentAssignmentCount = f.UserFlagAssignments.Count(a => !a.RemovedDate.HasValue),
|
||||
TotalAssignmentCount = f.UserFlagAssignments.Count()
|
||||
}).FirstOrDefault();
|
||||
|
||||
if (m == null)
|
||||
throw new ArgumentException("Invalid User Flag Id");
|
||||
|
||||
if (Authorization.Has(Claims.Config.UserFlag.Configure))
|
||||
{
|
||||
m.Icons = UIHelpers.Icons;
|
||||
m.ThemeColours = UIHelpers.ThemeColours;
|
||||
}
|
||||
|
||||
// UI Extensions
|
||||
UIExtensions.ExecuteExtensions<ConfigUserFlagShowModel>(this.ControllerContext, m);
|
||||
|
||||
return View(MVC.Config.UserFlag.Views.Show, m);
|
||||
}
|
||||
else
|
||||
{
|
||||
// List Index
|
||||
var m = new Models.UserFlag.IndexModel()
|
||||
{
|
||||
UserFlags = Database.UserFlags.OrderBy(f => f.Name).ToList()
|
||||
};
|
||||
|
||||
// UI Extensions
|
||||
UIExtensions.ExecuteExtensions<ConfigUserFlagIndexModel>(this.ControllerContext, m);
|
||||
|
||||
return View(m);
|
||||
}
|
||||
}
|
||||
|
||||
[DiscoAuthorizeAll(Claims.Config.UserFlag.Create, Claims.Config.UserFlag.Configure)]
|
||||
public virtual ActionResult Create()
|
||||
{
|
||||
// Default Queue
|
||||
var m = new Models.UserFlag.CreateModel()
|
||||
{
|
||||
UserFlag = new UserFlag()
|
||||
{
|
||||
Icon = UserFlagService.RandomUnusedIcon(),
|
||||
IconColour = UserFlagService.RandomUnusedThemeColour()
|
||||
}
|
||||
};
|
||||
|
||||
// UI Extensions
|
||||
UIExtensions.ExecuteExtensions<ConfigUserFlagCreateModel>(this.ControllerContext, m);
|
||||
|
||||
return View(m);
|
||||
}
|
||||
|
||||
[DiscoAuthorizeAll(Claims.Config.UserFlag.Create, Claims.Config.UserFlag.Configure), HttpPost]
|
||||
public virtual ActionResult Create(Models.UserFlag.CreateModel model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
// Check for Existing
|
||||
var existing = Database.UserFlags.Where(m => m.Name == model.UserFlag.Name).FirstOrDefault();
|
||||
if (existing == null)
|
||||
{
|
||||
var flag = UserFlagService.CreateUserFlag(Database, model.UserFlag);
|
||||
|
||||
return RedirectToAction(MVC.Config.UserFlag.Index(flag.Id));
|
||||
}
|
||||
else
|
||||
{
|
||||
ModelState.AddModelError("Name", "A User Flag with this name already exists.");
|
||||
}
|
||||
}
|
||||
|
||||
// UI Extensions
|
||||
UIExtensions.ExecuteExtensions<ConfigUserFlagCreateModel>(this.ControllerContext, model);
|
||||
|
||||
return View(model);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,9 @@ namespace Disco.Web.Areas.Config.Models.JobQueue
|
||||
public int OpenJobCount { get; set; }
|
||||
public int TotalJobCount { get; set; }
|
||||
|
||||
public IEnumerable<KeyValuePair<string, string>> Icons { get; set; }
|
||||
public IEnumerable<KeyValuePair<string, string>> ThemeColours { get; set; }
|
||||
|
||||
public List<Disco.Models.Repository.JobType> JobTypes { get; set; }
|
||||
|
||||
public bool CanDelete { get; set; }
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
using Disco.Models.UI.Config.UserFlag;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.UserFlag
|
||||
{
|
||||
public class CreateModel : ConfigUserFlagCreateModel
|
||||
{
|
||||
public Disco.Models.Repository.UserFlag UserFlag { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using Disco.Models.UI.Config.UserFlag;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.UserFlag
|
||||
{
|
||||
public class IndexModel : ConfigUserFlagIndexModel
|
||||
{
|
||||
public List<Disco.Models.Repository.UserFlag> UserFlags { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using Disco.Models.UI.Config.UserFlag;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.UserFlag
|
||||
{
|
||||
public class ShowModel : ConfigUserFlagShowModel
|
||||
{
|
||||
public Disco.Models.Repository.UserFlag UserFlag { get; set; }
|
||||
|
||||
public int CurrentAssignmentCount { get; set; }
|
||||
public int TotalAssignmentCount { get; set; }
|
||||
|
||||
public IEnumerable<KeyValuePair<string, string>> Icons { get; set; }
|
||||
public IEnumerable<KeyValuePair<string, string>> ThemeColours { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -5,9 +5,9 @@
|
||||
}
|
||||
<table id="pageMenu">
|
||||
<tr>
|
||||
@if (Authorization.HasAny(Claims.Config.System.Show, Claims.Config.Organisation.Show, Claims.DiscoAdminAccount, Claims.Config.Logging.Show))
|
||||
{
|
||||
<td>
|
||||
<td>
|
||||
@if (Authorization.HasAny(Claims.Config.System.Show, Claims.Config.Organisation.Show, Claims.DiscoAdminAccount, Claims.Config.Logging.Show, Claims.Config.Plugin.Show))
|
||||
{
|
||||
<div class="pageMenuArea">
|
||||
<h2>Hosting</h2>
|
||||
@if (Authorization.Has(Claims.Config.System.Show))
|
||||
@@ -24,6 +24,13 @@
|
||||
Update the Organisation Name, Logo and Addresses associated with this organisation.
|
||||
</div>
|
||||
}
|
||||
@if (Authorization.Has(Claims.Config.Plugin.Show))
|
||||
{
|
||||
<i class="fa fa-cog"></i>@Html.ActionLinkClass("Plugins", MVC.Config.Plugins.Index(), "config")
|
||||
<div class="pageMenuBlurb">
|
||||
Manage extensions to the Disco platform.
|
||||
</div>
|
||||
}
|
||||
@if (Authorization.Has(Claims.DiscoAdminAccount))
|
||||
{
|
||||
<i class="fa fa-cog"></i>@Html.ActionLinkClass("Authorization Roles", MVC.Config.AuthorizationRole.Index(), "config")
|
||||
@@ -39,8 +46,8 @@
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</td>
|
||||
}
|
||||
}
|
||||
</td>
|
||||
@if (Authorization.HasAny(Claims.Config.DeviceModel.Show, Claims.Config.DeviceBatch.Show, Claims.Config.DeviceProfile.Show, Claims.Config.Enrolment.Show))
|
||||
{
|
||||
<td>
|
||||
@@ -78,7 +85,7 @@
|
||||
</div>
|
||||
</td>
|
||||
}
|
||||
@if (Authorization.HasAny(Claims.Config.JobPreferences.Show, Claims.Config.JobQueue.Show, Claims.Config.DocumentTemplate.Show, Claims.Config.Plugin.Show))
|
||||
@if (Authorization.HasAny(Claims.Config.JobPreferences.Show, Claims.Config.JobQueue.Show, Claims.Config.UserFlag.Show, Claims.Config.DocumentTemplate.Show))
|
||||
{
|
||||
<td>
|
||||
@if (Authorization.HasAny(Claims.Config.JobPreferences.Show, Claims.Config.JobQueue.Show))
|
||||
@@ -101,10 +108,22 @@
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (Authorization.HasAny(Claims.Config.DocumentTemplate.Show, Claims.Config.Plugin.Show))
|
||||
@if (Authorization.HasAny(Claims.Config.UserFlag.Show))
|
||||
{
|
||||
<div class="pageMenuArea">
|
||||
<div class="pageMenuArea noSeperator">
|
||||
<h2>Users</h2>
|
||||
@if (Authorization.Has(Claims.Config.UserFlag.Show))
|
||||
{
|
||||
<i class="fa fa-cog"></i>@Html.ActionLinkClass("User Flags", MVC.Config.UserFlag.Index(), "config")
|
||||
<div class="pageMenuBlurb">
|
||||
Create and manage user flags.
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
@if (Authorization.HasAny(Claims.Config.DocumentTemplate.Show))
|
||||
{
|
||||
<div class="pageMenuArea noSeperator">
|
||||
<h2>Features</h2>
|
||||
@if (Authorization.Has(Claims.Config.DocumentTemplate.Show))
|
||||
{
|
||||
@@ -114,13 +133,6 @@
|
||||
and Users.
|
||||
</div>
|
||||
}
|
||||
@if (Authorization.Has(Claims.Config.Plugin.Show))
|
||||
{
|
||||
<i class="fa fa-cog"></i>@Html.ActionLinkClass("Plugins", MVC.Config.Plugins.Index(), "config")
|
||||
<div class="pageMenuBlurb">
|
||||
Manage extensions to the Disco platform.
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</td>
|
||||
|
||||
@@ -57,23 +57,23 @@ WriteLiteral("\r\n<table");
|
||||
|
||||
WriteLiteral(" id=\"pageMenu\"");
|
||||
|
||||
WriteLiteral(">\r\n <tr>\r\n");
|
||||
WriteLiteral(">\r\n <tr>\r\n <td>\r\n");
|
||||
|
||||
|
||||
#line 8 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 9 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 8 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
if (Authorization.HasAny(Claims.Config.System.Show, Claims.Config.Organisation.Show, Claims.DiscoAdminAccount, Claims.Config.Logging.Show))
|
||||
{
|
||||
#line 9 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
if (Authorization.HasAny(Claims.Config.System.Show, Claims.Config.Organisation.Show, Claims.DiscoAdminAccount, Claims.Config.Logging.Show, Claims.Config.Plugin.Show))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <td>\r\n <div");
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"pageMenuArea\"");
|
||||
|
||||
@@ -187,6 +187,56 @@ WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 27 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
if (Authorization.Has(Claims.Config.Plugin.Show))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-cog\"");
|
||||
|
||||
WriteLiteral("></i>");
|
||||
|
||||
|
||||
#line 29 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 29 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
Write(Html.ActionLinkClass("Plugins", MVC.Config.Plugins.Index(), "config"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 29 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"pageMenuBlurb\"");
|
||||
|
||||
WriteLiteral(">\r\n Manage extensions to the Disco platform.\r\n " +
|
||||
" </div>\r\n");
|
||||
|
||||
|
||||
#line 33 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 34 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
if (Authorization.Has(Claims.DiscoAdminAccount))
|
||||
{
|
||||
|
||||
@@ -200,20 +250,20 @@ WriteLiteral(" class=\"fa fa-cog\"");
|
||||
WriteLiteral("></i>");
|
||||
|
||||
|
||||
#line 29 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 36 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 29 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 36 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
Write(Html.ActionLinkClass("Authorization Roles", MVC.Config.AuthorizationRole.Index(), "config"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 29 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 36 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
|
||||
@@ -227,7 +277,7 @@ WriteLiteral(">\r\n Configure roles and permissions f
|
||||
" </div>\r\n");
|
||||
|
||||
|
||||
#line 33 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 40 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -236,7 +286,7 @@ WriteLiteral(">\r\n Configure roles and permissions f
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 34 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 41 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
if (Authorization.Has(Claims.Config.Logging.Show))
|
||||
{
|
||||
|
||||
@@ -250,20 +300,20 @@ WriteLiteral(" class=\"fa fa-cog\"");
|
||||
WriteLiteral("></i>");
|
||||
|
||||
|
||||
#line 36 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 43 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 36 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 43 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
Write(Html.ActionLinkClass("Logging", MVC.Config.Logging.Index(), "config"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 36 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 43 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
|
||||
@@ -277,25 +327,31 @@ WriteLiteral(">\r\n Export Log files from various Dis
|
||||
"ew Live Logging.\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 40 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 47 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n </td>\r\n");
|
||||
WriteLiteral(" </div>\r\n");
|
||||
|
||||
|
||||
#line 43 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
}
|
||||
#line 49 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
WriteLiteral(" </td>\r\n");
|
||||
|
||||
|
||||
#line 44 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 51 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 51 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
if (Authorization.HasAny(Claims.Config.DeviceModel.Show, Claims.Config.DeviceBatch.Show, Claims.Config.DeviceProfile.Show, Claims.Config.Enrolment.Show))
|
||||
{
|
||||
|
||||
@@ -309,13 +365,13 @@ WriteLiteral(" class=\"pageMenuArea\"");
|
||||
WriteLiteral(">\r\n <h2>Devices</h2>\r\n");
|
||||
|
||||
|
||||
#line 49 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 56 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 49 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 56 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
if (Authorization.Has(Claims.Config.DeviceModel.Show))
|
||||
{
|
||||
|
||||
@@ -329,20 +385,20 @@ WriteLiteral(" class=\"fa fa-cog\"");
|
||||
WriteLiteral("></i>");
|
||||
|
||||
|
||||
#line 51 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 58 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 51 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 58 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
Write(Html.ActionLinkClass("Models", MVC.Config.DeviceModel.Index(), "config"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 51 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 58 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
|
||||
@@ -356,7 +412,7 @@ WriteLiteral(">\r\n Configure Components, Product Ima
|
||||
"ettings for Device Models.\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 55 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 62 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -365,7 +421,7 @@ WriteLiteral(">\r\n Configure Components, Product Ima
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 56 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 63 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
if (Authorization.Has(Claims.Config.DeviceBatch.Show))
|
||||
{
|
||||
|
||||
@@ -379,20 +435,20 @@ WriteLiteral(" class=\"fa fa-cog\"");
|
||||
WriteLiteral("></i>");
|
||||
|
||||
|
||||
#line 58 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 65 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 58 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 65 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
Write(Html.ActionLinkClass("Batches", MVC.Config.DeviceBatch.Index(), "config"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 58 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 65 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
|
||||
@@ -406,7 +462,7 @@ WriteLiteral(">\r\n Create and Configure Device Batch
|
||||
" </div>\r\n");
|
||||
|
||||
|
||||
#line 62 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 69 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -415,7 +471,7 @@ WriteLiteral(">\r\n Create and Configure Device Batch
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 63 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 70 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
if (Authorization.Has(Claims.Config.DeviceProfile.Show))
|
||||
{
|
||||
|
||||
@@ -429,20 +485,20 @@ WriteLiteral(" class=\"fa fa-cog\"");
|
||||
WriteLiteral("></i>");
|
||||
|
||||
|
||||
#line 65 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 72 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 65 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 72 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
Write(Html.ActionLinkClass("Profiles", MVC.Config.DeviceProfile.Index(), "config"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 65 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 72 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
|
||||
@@ -457,7 +513,7 @@ WriteLiteral(">\r\n Configure Device Profiles includi
|
||||
" </div>\r\n");
|
||||
|
||||
|
||||
#line 70 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 77 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -466,7 +522,7 @@ WriteLiteral(">\r\n Configure Device Profiles includi
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 71 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 78 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
if (Authorization.Has(Claims.Config.Enrolment.Show))
|
||||
{
|
||||
|
||||
@@ -480,20 +536,20 @@ WriteLiteral(" class=\"fa fa-cog\"");
|
||||
WriteLiteral("></i>");
|
||||
|
||||
|
||||
#line 73 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 80 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 73 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 80 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
Write(Html.ActionLinkClass("Enrolment", MVC.Config.Enrolment.Index(), "config"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 73 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 80 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
|
||||
@@ -507,7 +563,7 @@ WriteLiteral(">\r\n Configure Enrolment settings incl
|
||||
"entials.\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 77 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 84 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -516,7 +572,7 @@ WriteLiteral(">\r\n Configure Enrolment settings incl
|
||||
WriteLiteral(" </div>\r\n </td>\r\n");
|
||||
|
||||
|
||||
#line 80 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 87 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -525,8 +581,8 @@ WriteLiteral(" </div>\r\n </td>\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 81 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
if (Authorization.HasAny(Claims.Config.JobPreferences.Show, Claims.Config.JobQueue.Show, Claims.Config.DocumentTemplate.Show, Claims.Config.Plugin.Show))
|
||||
#line 88 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
if (Authorization.HasAny(Claims.Config.JobPreferences.Show, Claims.Config.JobQueue.Show, Claims.Config.UserFlag.Show, Claims.Config.DocumentTemplate.Show))
|
||||
{
|
||||
|
||||
|
||||
@@ -535,13 +591,13 @@ WriteLiteral(" ");
|
||||
WriteLiteral(" <td>\r\n");
|
||||
|
||||
|
||||
#line 84 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 91 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 84 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 91 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
if (Authorization.HasAny(Claims.Config.JobPreferences.Show, Claims.Config.JobQueue.Show))
|
||||
{
|
||||
|
||||
@@ -555,13 +611,13 @@ WriteLiteral(" class=\"pageMenuArea noSeperator\"");
|
||||
WriteLiteral(">\r\n <h2>Jobs</h2>\r\n");
|
||||
|
||||
|
||||
#line 88 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 95 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 88 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 95 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
if (Authorization.Has(Claims.Config.JobPreferences.Show))
|
||||
{
|
||||
|
||||
@@ -575,20 +631,20 @@ WriteLiteral(" class=\"fa fa-cog\"");
|
||||
WriteLiteral("></i>");
|
||||
|
||||
|
||||
#line 90 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 97 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 90 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 97 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
Write(Html.ActionLinkClass("General Preferences", MVC.Config.JobPreferences.Index(), "config"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 90 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 97 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
|
||||
@@ -602,7 +658,7 @@ WriteLiteral(">\r\n Configure general preferences
|
||||
"\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 94 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 101 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -611,7 +667,7 @@ WriteLiteral(">\r\n Configure general preferences
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 95 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 102 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
if (Authorization.Has(Claims.Config.JobQueue.Show))
|
||||
{
|
||||
|
||||
@@ -625,20 +681,20 @@ WriteLiteral(" class=\"fa fa-cog\"");
|
||||
WriteLiteral("></i>");
|
||||
|
||||
|
||||
#line 97 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 104 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 97 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 104 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
Write(Html.ActionLinkClass("Job Queues", MVC.Config.JobQueue.Index(), "config"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 97 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 104 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
|
||||
@@ -652,7 +708,7 @@ WriteLiteral(">\r\n Create and manage job queues
|
||||
"ies and queue members.\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 101 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 108 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -661,23 +717,17 @@ WriteLiteral(">\r\n Create and manage job queues
|
||||
WriteLiteral(" </div>\r\n");
|
||||
|
||||
|
||||
#line 103 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 110 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 105 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 105 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
if (Authorization.HasAny(Claims.Config.DocumentTemplate.Show, Claims.Config.Plugin.Show))
|
||||
#line 111 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
if (Authorization.HasAny(Claims.Config.UserFlag.Show))
|
||||
{
|
||||
|
||||
|
||||
@@ -685,18 +735,97 @@ WriteLiteral("\r\n");
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"pageMenuArea\"");
|
||||
WriteLiteral(" class=\"pageMenuArea noSeperator\"");
|
||||
|
||||
WriteLiteral(">\r\n <h2>Features</h2>\r\n");
|
||||
WriteLiteral(">\r\n <h2>Users</h2>\r\n");
|
||||
|
||||
|
||||
#line 109 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 115 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 109 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 115 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
if (Authorization.Has(Claims.Config.UserFlag.Show))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-cog\"");
|
||||
|
||||
WriteLiteral("></i>");
|
||||
|
||||
|
||||
#line 117 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 117 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
Write(Html.ActionLinkClass("User Flags", MVC.Config.UserFlag.Index(), "config"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 117 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"pageMenuBlurb\"");
|
||||
|
||||
WriteLiteral(">\r\n Create and manage user flags.\r\n " +
|
||||
" </div>\r\n");
|
||||
|
||||
|
||||
#line 121 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n");
|
||||
|
||||
|
||||
#line 123 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 124 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
if (Authorization.HasAny(Claims.Config.DocumentTemplate.Show))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"pageMenuArea noSeperator\"");
|
||||
|
||||
WriteLiteral(">\r\n <h2>Features</h2>\r\n");
|
||||
|
||||
|
||||
#line 128 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 128 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
if (Authorization.Has(Claims.Config.DocumentTemplate.Show))
|
||||
{
|
||||
|
||||
@@ -710,20 +839,20 @@ WriteLiteral(" class=\"fa fa-cog\"");
|
||||
WriteLiteral("></i>");
|
||||
|
||||
|
||||
#line 111 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 130 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 111 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 130 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
Write(Html.ActionLinkClass("Document Templates", MVC.Config.DocumentTemplate.Index(), "config"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 111 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 130 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
|
||||
@@ -738,57 +867,7 @@ WriteLiteral(">\r\n Create, Update and Bulk Gener
|
||||
" </div>\r\n");
|
||||
|
||||
|
||||
#line 116 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 117 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
if (Authorization.Has(Claims.Config.Plugin.Show))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-cog\"");
|
||||
|
||||
WriteLiteral("></i>");
|
||||
|
||||
|
||||
#line 119 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 119 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
Write(Html.ActionLinkClass("Plugins", MVC.Config.Plugins.Index(), "config"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 119 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"pageMenuBlurb\"");
|
||||
|
||||
WriteLiteral(">\r\n Manage extensions to the Disco platform.\r\n " +
|
||||
" </div>\r\n");
|
||||
|
||||
|
||||
#line 123 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 135 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -797,7 +876,7 @@ WriteLiteral(">\r\n Manage extensions to the Disc
|
||||
WriteLiteral(" </div>\r\n");
|
||||
|
||||
|
||||
#line 125 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 137 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -806,7 +885,7 @@ WriteLiteral(" </div>\r\n");
|
||||
WriteLiteral(" </td>\r\n");
|
||||
|
||||
|
||||
#line 127 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 139 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -815,7 +894,7 @@ WriteLiteral(" </td>\r\n");
|
||||
WriteLiteral(" </tr>\r\n</table>\r\n");
|
||||
|
||||
|
||||
#line 130 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 142 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
if (Model.UpdateAvailable)
|
||||
{
|
||||
@@ -833,14 +912,14 @@ WriteLiteral(" class=\"fa fa-cloud-download info\"");
|
||||
|
||||
WriteLiteral("></i>\r\n <div>An updated version of Disco is available</div>\r\n <a");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 7166), Tuple.Create("\"", 7202)
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 7810), Tuple.Create("\"", 7846)
|
||||
|
||||
#line 136 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 7173), Tuple.Create<System.Object, System.Int32>(Model.UpdateResponse.UrlLink
|
||||
#line 148 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 7817), Tuple.Create<System.Object, System.Int32>(Model.UpdateResponse.UrlLink
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 7173), false)
|
||||
, 7817), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" class=\"button small alert\"");
|
||||
@@ -850,7 +929,7 @@ WriteLiteral(" target=\"_blank\"");
|
||||
WriteLiteral(">Download v");
|
||||
|
||||
|
||||
#line 136 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 148 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
Write(Model.UpdateResponse.Version);
|
||||
|
||||
|
||||
@@ -867,13 +946,13 @@ WriteLiteral(@" <script>
|
||||
");
|
||||
|
||||
|
||||
#line 144 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 156 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 144 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 156 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
if (Model.UpdateResponse.VersionReleasedTimestamp < DateTime.Now.AddDays(-14))
|
||||
{
|
||||
@@ -889,7 +968,7 @@ WriteLiteral("\r\n updateAvailableContainer.effect(\"shake\", { t
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 150 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 162 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -898,7 +977,7 @@ WriteLiteral("\r\n");
|
||||
WriteLiteral("\r\n });\r\n })();\r\n </script>\r\n");
|
||||
|
||||
|
||||
#line 155 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
#line 167 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -665,9 +665,9 @@
|
||||
{
|
||||
@Html.ActionLinkButton("Export Devices", MVC.Device.Export(null, Disco.Models.Services.Devices.Exporting.DeviceExportTypes.Batch, Model.DeviceBatch.Id))
|
||||
}
|
||||
if (Authorization.Has(Claims.Device.Search))
|
||||
if (Authorization.Has(Claims.Device.Search) && Model.DeviceCount > 0)
|
||||
{
|
||||
@Html.ActionLinkButton("View Devices", MVC.Search.Query(Model.DeviceBatch.Id.ToString(), "DeviceBatch"))
|
||||
@Html.ActionLinkButton(string.Format("View {0} Device{1}", Model.DeviceCount, (Model.DeviceCount != 1 ? "s" : null)), MVC.Search.Query(Model.DeviceBatch.Id.ToString(), "DeviceBatch"))
|
||||
}
|
||||
}
|
||||
</div>
|
||||
@@ -2025,7 +2025,7 @@ WriteLiteral(" ");
|
||||
#line 666 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||
|
||||
}
|
||||
if (Authorization.Has(Claims.Device.Search))
|
||||
if (Authorization.Has(Claims.Device.Search) && Model.DeviceCount > 0)
|
||||
{
|
||||
|
||||
|
||||
@@ -2033,7 +2033,7 @@ WriteLiteral(" ");
|
||||
#line hidden
|
||||
|
||||
#line 670 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml"
|
||||
Write(Html.ActionLinkButton("View Devices", MVC.Search.Query(Model.DeviceBatch.Id.ToString(), "DeviceBatch")));
|
||||
Write(Html.ActionLinkButton(string.Format("View {0} Device{1}", Model.DeviceCount, (Model.DeviceCount != 1 ? "s" : null)), MVC.Search.Query(Model.DeviceBatch.Id.ToString(), "DeviceBatch")));
|
||||
|
||||
|
||||
#line default
|
||||
@@ -2047,7 +2047,7 @@ WriteLiteral(" ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</div>\r\n");
|
||||
WriteLiteral("</div>");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,9 +252,9 @@
|
||||
{
|
||||
@Html.ActionLinkButton("Export Devices", MVC.Device.Export(null, Disco.Models.Services.Devices.Exporting.DeviceExportTypes.Model, Model.DeviceModel.Id))
|
||||
}
|
||||
if (Authorization.Has(Claims.Device.Search))
|
||||
if (Authorization.Has(Claims.Device.Search) && Model.DeviceCount > 0)
|
||||
{
|
||||
@Html.ActionLinkButton("View Devices", MVC.Search.Query(Model.DeviceModel.Id.ToString(), "DeviceModel"))
|
||||
@Html.ActionLinkButton(string.Format("View {0} Device{1}", Model.DeviceCount, (Model.DeviceCount != 1 ? "s" : null)), MVC.Search.Query(Model.DeviceModel.Id.ToString(), "DeviceModel"))
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -732,7 +732,7 @@ WriteLiteral(" ");
|
||||
#line 253 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
||||
|
||||
}
|
||||
if (Authorization.Has(Claims.Device.Search))
|
||||
if (Authorization.Has(Claims.Device.Search) && Model.DeviceCount > 0)
|
||||
{
|
||||
|
||||
|
||||
@@ -740,7 +740,7 @@ WriteLiteral(" ");
|
||||
#line hidden
|
||||
|
||||
#line 257 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
||||
Write(Html.ActionLinkButton("View Devices", MVC.Search.Query(Model.DeviceModel.Id.ToString(), "DeviceModel")));
|
||||
Write(Html.ActionLinkButton(string.Format("View {0} Device{1}", Model.DeviceCount, (Model.DeviceCount != 1 ? "s" : null)), MVC.Search.Query(Model.DeviceModel.Id.ToString(), "DeviceModel")));
|
||||
|
||||
|
||||
#line default
|
||||
|
||||
@@ -737,8 +737,8 @@
|
||||
{
|
||||
@Html.ActionLinkButton("Export Devices", MVC.Device.Export(null, Disco.Models.Services.Devices.Exporting.DeviceExportTypes.Profile, Model.DeviceProfile.Id))
|
||||
}
|
||||
@if (Authorization.Has(Claims.Device.Search))
|
||||
@if (Authorization.Has(Claims.Device.Search) && Model.DeviceCount > 0)
|
||||
{
|
||||
@Html.ActionLinkButton("View Devices", MVC.Search.Query(Model.DeviceProfile.Id.ToString(), "DeviceProfile"))
|
||||
@Html.ActionLinkButton(string.Format("View {0} Device{1}", Model.DeviceCount, (Model.DeviceCount != 1 ? "s" : null)), MVC.Search.Query(Model.DeviceProfile.Id.ToString(), "DeviceProfile"))
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -2049,7 +2049,7 @@ WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 740 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
|
||||
if (Authorization.Has(Claims.Device.Search))
|
||||
if (Authorization.Has(Claims.Device.Search) && Model.DeviceCount > 0)
|
||||
{
|
||||
|
||||
|
||||
@@ -2057,7 +2057,7 @@ WriteLiteral(" ");
|
||||
#line hidden
|
||||
|
||||
#line 742 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
|
||||
Write(Html.ActionLinkButton("View Devices", MVC.Search.Query(Model.DeviceProfile.Id.ToString(), "DeviceProfile")));
|
||||
Write(Html.ActionLinkButton(string.Format("View {0} Device{1}", Model.DeviceCount, (Model.DeviceCount != 1 ? "s" : null)), MVC.Search.Query(Model.DeviceProfile.Id.ToString(), "DeviceProfile")));
|
||||
|
||||
|
||||
#line default
|
||||
|
||||
@@ -97,13 +97,13 @@
|
||||
<div id="Config_JobQueues_Icon_Update_Dialog" class="dialog" title="Job Queue Icon">
|
||||
<div>
|
||||
<div class="icons">
|
||||
@foreach (var icon in JobQueueService.Icons)
|
||||
@foreach (var icon in Model.Icons)
|
||||
{
|
||||
<i data-icon="@(icon.Key)" class="fa fa-@(icon.Key)" title="@icon.Value"></i>
|
||||
}
|
||||
</div>
|
||||
<div class="colours">
|
||||
@foreach (var colour in JobQueueService.IconColours)
|
||||
@foreach (var colour in Model.ThemeColours)
|
||||
{
|
||||
<i data-colour="@(colour.Key)" class="fa fa-square d-@(colour.Key)" title="@colour.Value"></i>
|
||||
}
|
||||
@@ -629,43 +629,49 @@
|
||||
@if (canDelete || canShowJobs)
|
||||
{
|
||||
<div class="actionBar">
|
||||
@Html.ActionLinkButton("Delete", MVC.API.JobQueue.Delete(Model.Token.JobQueue.Id, true), "Config_JobQueues_Actions_Delete_Button")
|
||||
<div id="Config_JobQueues_Actions_Delete_Dialog" title="Delete this Job Queue?">
|
||||
<p>
|
||||
<i class="fa fa-exclamation-triangle fa-lg warning"></i>
|
||||
This item will be permanently deleted and cannot be recovered.<br />
|
||||
<br />
|
||||
Are you sure?
|
||||
</p>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var button = $('#Config_JobQueues_Actions_Delete_Button');
|
||||
var buttonDialog = $('#Config_JobQueues_Actions_Delete_Dialog');
|
||||
var buttonLink = button.attr('href');
|
||||
button.attr('href', '#');
|
||||
button.click(function () {
|
||||
buttonDialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
buttonDialog.dialog({
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Delete": function () {
|
||||
var $this = $(this);
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
window.location.href = buttonLink;
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
@if (canDelete)
|
||||
{
|
||||
@Html.ActionLinkButton("Delete", MVC.API.JobQueue.Delete(Model.Token.JobQueue.Id, true), "Config_JobQueues_Actions_Delete_Button")
|
||||
<div id="Config_JobQueues_Actions_Delete_Dialog" title="Delete this Job Queue?">
|
||||
<p>
|
||||
<i class="fa fa-exclamation-triangle fa-lg warning"></i>
|
||||
This item will be permanently deleted and cannot be recovered.<br />
|
||||
<br />
|
||||
Are you sure?
|
||||
</p>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var button = $('#Config_JobQueues_Actions_Delete_Button');
|
||||
var buttonDialog = $('#Config_JobQueues_Actions_Delete_Dialog');
|
||||
var buttonLink = button.attr('href');
|
||||
button.attr('href', '#');
|
||||
button.click(function () {
|
||||
buttonDialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
buttonDialog.dialog({
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Delete": function () {
|
||||
var $this = $(this);
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
window.location.href = buttonLink;
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@Html.ActionLinkButton(string.Format("Show {0} job{1}", Model.OpenJobCount, (Model.OpenJobCount == 1 ? null : "s")), MVC.Job.Queue(Model.Token.JobQueue.Id), "Config_JobQueues_Actions_ShowJobs_Button")
|
||||
</script>
|
||||
}
|
||||
@if (canShowJobs)
|
||||
{
|
||||
@Html.ActionLinkButton(string.Format("Show {0} job{1}", Model.OpenJobCount, (Model.OpenJobCount == 1 ? null : "s")), MVC.Job.Queue(Model.Token.JobQueue.Id), "Config_JobQueues_Actions_ShowJobs_Button")
|
||||
}
|
||||
</div>
|
||||
}
|
||||
@@ -450,7 +450,7 @@ WriteLiteral(">\r\n");
|
||||
#line hidden
|
||||
|
||||
#line 100 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
|
||||
foreach (var icon in JobQueueService.Icons)
|
||||
foreach (var icon in Model.Icons)
|
||||
{
|
||||
|
||||
|
||||
@@ -469,26 +469,26 @@ WriteLiteral(" data-icon=\"");
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 4256), Tuple.Create("\"", 4281)
|
||||
, Tuple.Create(Tuple.Create("", 4264), Tuple.Create("fa", 4264), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 4266), Tuple.Create("fa-", 4267), true)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 4246), Tuple.Create("\"", 4271)
|
||||
, Tuple.Create(Tuple.Create("", 4254), Tuple.Create("fa", 4254), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 4256), Tuple.Create("fa-", 4257), true)
|
||||
|
||||
#line 102 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4270), Tuple.Create<System.Object, System.Int32>(icon.Key
|
||||
, Tuple.Create(Tuple.Create("", 4260), Tuple.Create<System.Object, System.Int32>(icon.Key
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4270), false)
|
||||
, 4260), false)
|
||||
);
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 4282), Tuple.Create("\"", 4301)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 4272), Tuple.Create("\"", 4291)
|
||||
|
||||
#line 102 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4290), Tuple.Create<System.Object, System.Int32>(icon.Value
|
||||
, Tuple.Create(Tuple.Create("", 4280), Tuple.Create<System.Object, System.Int32>(icon.Value
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4290), false)
|
||||
, 4280), false)
|
||||
);
|
||||
|
||||
WriteLiteral("></i>\r\n");
|
||||
@@ -514,7 +514,7 @@ WriteLiteral(">\r\n");
|
||||
#line hidden
|
||||
|
||||
#line 106 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
|
||||
foreach (var colour in JobQueueService.IconColours)
|
||||
foreach (var colour in Model.ThemeColours)
|
||||
{
|
||||
|
||||
|
||||
@@ -533,27 +533,27 @@ WriteLiteral(" data-colour=\"");
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 4642), Tuple.Create("\"", 4678)
|
||||
, Tuple.Create(Tuple.Create("", 4650), Tuple.Create("fa", 4650), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 4652), Tuple.Create("fa-square", 4653), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 4662), Tuple.Create("d-", 4663), true)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 4623), Tuple.Create("\"", 4659)
|
||||
, Tuple.Create(Tuple.Create("", 4631), Tuple.Create("fa", 4631), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 4633), Tuple.Create("fa-square", 4634), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 4643), Tuple.Create("d-", 4644), true)
|
||||
|
||||
#line 108 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4665), Tuple.Create<System.Object, System.Int32>(colour.Key
|
||||
, Tuple.Create(Tuple.Create("", 4646), Tuple.Create<System.Object, System.Int32>(colour.Key
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4665), false)
|
||||
, 4646), false)
|
||||
);
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 4679), Tuple.Create("\"", 4700)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 4660), Tuple.Create("\"", 4681)
|
||||
|
||||
#line 108 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4687), Tuple.Create<System.Object, System.Int32>(colour.Value
|
||||
, Tuple.Create(Tuple.Create("", 4668), Tuple.Create<System.Object, System.Int32>(colour.Value
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4687), false)
|
||||
, 4668), false)
|
||||
);
|
||||
|
||||
WriteLiteral("></i>\r\n");
|
||||
@@ -658,27 +658,27 @@ WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n
|
||||
#line hidden
|
||||
WriteLiteral(" <i");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 9454), Tuple.Create("\"", 9502)
|
||||
, Tuple.Create(Tuple.Create("", 9462), Tuple.Create("fa", 9462), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 9464), Tuple.Create("d-priority-", 9465), true)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 9435), Tuple.Create("\"", 9483)
|
||||
, Tuple.Create(Tuple.Create("", 9443), Tuple.Create("fa", 9443), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 9445), Tuple.Create("d-priority-", 9446), true)
|
||||
|
||||
#line 201 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 9476), Tuple.Create<System.Object, System.Int32>(priorityValue.ToLower()
|
||||
, Tuple.Create(Tuple.Create("", 9457), Tuple.Create<System.Object, System.Int32>(priorityValue.ToLower()
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 9476), false)
|
||||
, 9457), false)
|
||||
);
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 9503), Tuple.Create("\"", 9536)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 9484), Tuple.Create("\"", 9517)
|
||||
|
||||
#line 201 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 9511), Tuple.Create<System.Object, System.Int32>(priorityValue
|
||||
, Tuple.Create(Tuple.Create("", 9492), Tuple.Create<System.Object, System.Int32>(priorityValue
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 9511), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 9527), Tuple.Create("Priority", 9528), true)
|
||||
, 9492), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 9508), Tuple.Create("Priority", 9509), true)
|
||||
);
|
||||
|
||||
WriteLiteral("></i>\r\n");
|
||||
@@ -1003,14 +1003,14 @@ WriteLiteral(">\r\n");
|
||||
#line hidden
|
||||
WriteLiteral(" <li");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 14510), Tuple.Create("\"", 14550)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 14491), Tuple.Create("\"", 14531)
|
||||
|
||||
#line 306 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 14518), Tuple.Create<System.Object, System.Int32>(sg.IsGroup ? "group" : "user"
|
||||
, Tuple.Create(Tuple.Create("", 14499), Tuple.Create<System.Object, System.Int32>(sg.IsGroup ? "group" : "user"
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 14518), false)
|
||||
, 14499), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
@@ -1054,14 +1054,14 @@ WriteLiteral("></i>");
|
||||
#line hidden
|
||||
WriteLiteral(" <a");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 14990), Tuple.Create("\"", 15032)
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 14971), Tuple.Create("\"", 15013)
|
||||
|
||||
#line 312 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 14997), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.User.Show(sg.Id))
|
||||
, Tuple.Create(Tuple.Create("", 14978), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.User.Show(sg.Id))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 14997), false)
|
||||
, 14978), false)
|
||||
);
|
||||
|
||||
WriteLiteral("><i");
|
||||
@@ -1164,14 +1164,14 @@ WriteLiteral(">\r\n");
|
||||
#line hidden
|
||||
WriteLiteral(" <li");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 16166), Tuple.Create("\"", 16206)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 16147), Tuple.Create("\"", 16187)
|
||||
|
||||
#line 328 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 16174), Tuple.Create<System.Object, System.Int32>(sg.IsGroup ? "group" : "user"
|
||||
, Tuple.Create(Tuple.Create("", 16155), Tuple.Create<System.Object, System.Int32>(sg.IsGroup ? "group" : "user"
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 16174), false)
|
||||
, 16155), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" data-subjectid=\"");
|
||||
@@ -1286,14 +1286,14 @@ WriteLiteral(">Add</a>\r\n </div>\r\n
|
||||
|
||||
WriteLiteral(" id=\"Config_JobQueues_Subjects_Update_Dialog_Form\"");
|
||||
|
||||
WriteAttribute("action", Tuple.Create(" action=\"", 17597), Tuple.Create("\"", 17689)
|
||||
WriteAttribute("action", Tuple.Create(" action=\"", 17578), Tuple.Create("\"", 17670)
|
||||
|
||||
#line 343 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 17606), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.JobQueue.UpdateSubjects(Model.Token.JobQueue.Id, null, true))
|
||||
, Tuple.Create(Tuple.Create("", 17587), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.JobQueue.UpdateSubjects(Model.Token.JobQueue.Id, null, true))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 17606), false)
|
||||
, 17587), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" method=\"post\"");
|
||||
@@ -1618,15 +1618,15 @@ WriteLiteral(">\r\n");
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 28953), Tuple.Create("\"", 28975)
|
||||
, Tuple.Create(Tuple.Create("", 28958), Tuple.Create("trJobType", 28958), true)
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 28934), Tuple.Create("\"", 28956)
|
||||
, Tuple.Create(Tuple.Create("", 28939), Tuple.Create("trJobType", 28939), true)
|
||||
|
||||
#line 548 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 28967), Tuple.Create<System.Object, System.Int32>(jt.Id
|
||||
, Tuple.Create(Tuple.Create("", 28948), Tuple.Create<System.Object, System.Int32>(jt.Id
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 28967), false)
|
||||
, 28948), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" class=\"jobTypes\"");
|
||||
@@ -1634,29 +1634,29 @@ WriteLiteral(" class=\"jobTypes\"");
|
||||
WriteLiteral(">\r\n <h4>\r\n <inp" +
|
||||
"ut");
|
||||
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 29076), Tuple.Create("\"", 29095)
|
||||
, Tuple.Create(Tuple.Create("", 29081), Tuple.Create("Types_", 29081), true)
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 29057), Tuple.Create("\"", 29076)
|
||||
, Tuple.Create(Tuple.Create("", 29062), Tuple.Create("Types_", 29062), true)
|
||||
|
||||
#line 550 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 29087), Tuple.Create<System.Object, System.Int32>(jt.Id
|
||||
, Tuple.Create(Tuple.Create("", 29068), Tuple.Create<System.Object, System.Int32>(jt.Id
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 29087), false)
|
||||
, 29068), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" class=\"jobType\"");
|
||||
|
||||
WriteLiteral(" type=\"checkbox\"");
|
||||
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 29128), Tuple.Create("\"", 29144)
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 29109), Tuple.Create("\"", 29125)
|
||||
|
||||
#line 550 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 29136), Tuple.Create<System.Object, System.Int32>(jt.Id
|
||||
, Tuple.Create(Tuple.Create("", 29117), Tuple.Create<System.Object, System.Int32>(jt.Id
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 29136), false)
|
||||
, 29117), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" ");
|
||||
@@ -1670,15 +1670,15 @@ WriteLiteral(" ");
|
||||
#line hidden
|
||||
WriteLiteral(" /><label");
|
||||
|
||||
WriteAttribute("for", Tuple.Create(" for=\"", 29215), Tuple.Create("\"", 29235)
|
||||
, Tuple.Create(Tuple.Create("", 29221), Tuple.Create("Types_", 29221), true)
|
||||
WriteAttribute("for", Tuple.Create(" for=\"", 29196), Tuple.Create("\"", 29216)
|
||||
, Tuple.Create(Tuple.Create("", 29202), Tuple.Create("Types_", 29202), true)
|
||||
|
||||
#line 550 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 29227), Tuple.Create<System.Object, System.Int32>(jt.Id
|
||||
, Tuple.Create(Tuple.Create("", 29208), Tuple.Create<System.Object, System.Int32>(jt.Id
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 29227), false)
|
||||
, 29208), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
@@ -1692,15 +1692,15 @@ WriteLiteral(">");
|
||||
#line hidden
|
||||
WriteLiteral("</label></h4>\r\n <div");
|
||||
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 29303), Tuple.Create("\"", 29325)
|
||||
, Tuple.Create(Tuple.Create("", 29308), Tuple.Create("SubTypes_", 29308), true)
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 29284), Tuple.Create("\"", 29306)
|
||||
, Tuple.Create(Tuple.Create("", 29289), Tuple.Create("SubTypes_", 29289), true)
|
||||
|
||||
#line 551 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 29317), Tuple.Create<System.Object, System.Int32>(jt.Id
|
||||
, Tuple.Create(Tuple.Create("", 29298), Tuple.Create<System.Object, System.Int32>(jt.Id
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 29317), false)
|
||||
, 29298), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" class=\"jobSubTypes\"");
|
||||
@@ -1813,74 +1813,118 @@ WriteLiteral(" class=\"actionBar\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 632 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
|
||||
Write(Html.ActionLinkButton("Delete", MVC.API.JobQueue.Delete(Model.Token.JobQueue.Id, true), "Config_JobQueues_Actions_Delete_Button"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <div");
|
||||
|
||||
#line 632 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
|
||||
if (canDelete)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 634 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
|
||||
Write(Html.ActionLinkButton("Delete", MVC.API.JobQueue.Delete(Model.Token.JobQueue.Id, true), "Config_JobQueues_Actions_Delete_Button"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 634 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"Config_JobQueues_Actions_Delete_Dialog\"");
|
||||
|
||||
WriteLiteral(" title=\"Delete this Job Queue?\"");
|
||||
|
||||
WriteLiteral(">\r\n <p>\r\n <i");
|
||||
WriteLiteral(">\r\n <p>\r\n <i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-exclamation-triangle fa-lg warning\"");
|
||||
|
||||
WriteLiteral("></i>\r\n This item will be permanently deleted and cannot be recove" +
|
||||
"red.<br />\r\n <br />\r\n Are you sure?\r\n <" +
|
||||
"/p>\r\n </div>\r\n <script");
|
||||
WriteLiteral("></i>\r\n This item will be permanently deleted and cannot be re" +
|
||||
"covered.<br />\r\n <br />\r\n Are you sure?\r\n " +
|
||||
" </p>\r\n </div>\r\n");
|
||||
|
||||
WriteLiteral(" <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
var button = $('#Config_JobQueues_Actions_Delete_Button');
|
||||
var buttonDialog = $('#Config_JobQueues_Actions_Delete_Dialog');
|
||||
var buttonLink = button.attr('href');
|
||||
button.attr('href', '#');
|
||||
button.click(function () {
|
||||
buttonDialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
buttonDialog.dialog({
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
""Delete"": function () {
|
||||
var $this = $(this);
|
||||
$this.dialog(""disable"");
|
||||
$this.dialog(""option"", ""buttons"", null);
|
||||
window.location.href = buttonLink;
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog(""close"");
|
||||
$(function () {
|
||||
var button = $('#Config_JobQueues_Actions_Delete_Button');
|
||||
var buttonDialog = $('#Config_JobQueues_Actions_Delete_Dialog');
|
||||
var buttonLink = button.attr('href');
|
||||
button.attr('href', '#');
|
||||
button.click(function () {
|
||||
buttonDialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
buttonDialog.dialog({
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
""Delete"": function () {
|
||||
var $this = $(this);
|
||||
$this.dialog(""disable"");
|
||||
$this.dialog(""option"", ""buttons"", null);
|
||||
window.location.href = buttonLink;
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog(""close"");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 669 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
|
||||
Write(Html.ActionLinkButton(string.Format("Show {0} job{1}", Model.OpenJobCount, (Model.OpenJobCount == 1 ? null : "s")), MVC.Job.Queue(Model.Token.JobQueue.Id), "Config_JobQueues_Actions_ShowJobs_Button"));
|
||||
#line 671 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </div>\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 671 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
|
||||
#line 672 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
|
||||
if (canShowJobs)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 674 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
|
||||
Write(Html.ActionLinkButton(string.Format("Show {0} job{1}", Model.OpenJobCount, (Model.OpenJobCount == 1 ? null : "s")), MVC.Job.Queue(Model.Token.JobQueue.Id), "Config_JobQueues_Actions_ShowJobs_Button"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 674 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n");
|
||||
|
||||
|
||||
#line 677 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
@model Disco.Web.Areas.Config.Models.UserFlag.CreateModel
|
||||
@{
|
||||
Authorization.RequireAll(Claims.Config.JobQueue.Create, Claims.Config.JobQueue.Configure);
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "User Flags", MVC.Config.UserFlag.Index(null), "Create");
|
||||
}
|
||||
@using (Html.BeginForm())
|
||||
{
|
||||
@Html.HiddenFor(m => m.UserFlag.Icon)
|
||||
@Html.HiddenFor(m => m.UserFlag.IconColour)
|
||||
<div class="form" style="width: 450px">
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name:
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(model => model.UserFlag.Name)<br />@Html.ValidationMessageFor(model => model.UserFlag.Name)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Description:
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(model => model.UserFlag.Description)<br />@Html.ValidationMessageFor(model => model.UserFlag.Description)
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p class="actions">
|
||||
<input type="submit" class="button" value="Create" />
|
||||
</p>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#UserFlag_Name').focus().select();
|
||||
});
|
||||
</script>
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.34014
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Areas.Config.Views.UserFlag
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Helpers;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc.Ajax;
|
||||
using System.Web.Mvc.Html;
|
||||
using System.Web.Routing;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/UserFlag/Create.cshtml")]
|
||||
public partial class Create : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.UserFlag.CreateModel>
|
||||
{
|
||||
public Create()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\UserFlag\Create.cshtml"
|
||||
|
||||
Authorization.RequireAll(Claims.Config.JobQueue.Create, Claims.Config.JobQueue.Configure);
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "User Flags", MVC.Config.UserFlag.Index(null), "Create");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 6 "..\..\Areas\Config\Views\UserFlag\Create.cshtml"
|
||||
using (Html.BeginForm())
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 8 "..\..\Areas\Config\Views\UserFlag\Create.cshtml"
|
||||
Write(Html.HiddenFor(m => m.UserFlag.Icon));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 8 "..\..\Areas\Config\Views\UserFlag\Create.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 9 "..\..\Areas\Config\Views\UserFlag\Create.cshtml"
|
||||
Write(Html.HiddenFor(m => m.UserFlag.IconColour));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 9 "..\..\Areas\Config\Views\UserFlag\Create.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 450px\"");
|
||||
|
||||
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>Name:\r\n " +
|
||||
"</th>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 16 "..\..\Areas\Config\Views\UserFlag\Create.cshtml"
|
||||
Write(Html.EditorFor(model => model.UserFlag.Name));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("<br />");
|
||||
|
||||
|
||||
#line 16 "..\..\Areas\Config\Views\UserFlag\Create.cshtml"
|
||||
Write(Html.ValidationMessageFor(model => model.UserFlag.Name));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
|
||||
">Description:\r\n </th>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 23 "..\..\Areas\Config\Views\UserFlag\Create.cshtml"
|
||||
Write(Html.EditorFor(model => model.UserFlag.Description));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("<br />");
|
||||
|
||||
|
||||
#line 23 "..\..\Areas\Config\Views\UserFlag\Create.cshtml"
|
||||
Write(Html.ValidationMessageFor(model => model.UserFlag.Description));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n </table>\r\n <p");
|
||||
|
||||
WriteLiteral(" class=\"actions\"");
|
||||
|
||||
WriteLiteral(">\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"submit\"");
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
|
||||
WriteLiteral(" value=\"Create\"");
|
||||
|
||||
WriteLiteral(" />\r\n </p>\r\n </div>\r\n");
|
||||
|
||||
WriteLiteral(" <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(">\r\n $(function () {\r\n $(\'#UserFlag_Name\').focus().select();\r\n " +
|
||||
" });\r\n </script>\r\n");
|
||||
|
||||
|
||||
#line 36 "..\..\Areas\Config\Views\UserFlag\Create.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,46 @@
|
||||
@model Disco.Web.Areas.Config.Models.UserFlag.IndexModel
|
||||
@{
|
||||
Authorization.RequireAll(Claims.Config.UserFlag.Create, Claims.Config.UserFlag.Configure);
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "User Flags", MVC.Config.UserFlag.Index(null));
|
||||
}
|
||||
<div id="Config_UserFlags_Index">
|
||||
@if (Model.UserFlags.Count == 0)
|
||||
{
|
||||
<div class="form" style="width: 450px; padding: 100px 0;">
|
||||
<h2>No user flags are configured</h2>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<table class="tableData">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
@foreach (var item in Model.UserFlags)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
<a href="@Url.Action(MVC.Config.UserFlag.Index(item.Id))">
|
||||
<i class="fa fa-@(item.Icon) fa-lg d-@(item.IconColour)"></i>
|
||||
@item.Name
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<span class="smallMessage">@if (string.IsNullOrWhiteSpace(item.Description))
|
||||
{
|
||||
<text><none></text>
|
||||
}
|
||||
else
|
||||
{
|
||||
@item.Description.ToMultilineString()
|
||||
}</span>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
}
|
||||
<div class="actionBar">
|
||||
@Html.ActionLinkButton("Create User Flag", MVC.Config.UserFlag.Create())
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,242 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.34014
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Areas.Config.Views.UserFlag
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Helpers;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc.Ajax;
|
||||
using System.Web.Mvc.Html;
|
||||
using System.Web.Routing;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/UserFlag/Index.cshtml")]
|
||||
public partial class Index : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.UserFlag.IndexModel>
|
||||
{
|
||||
public Index()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\UserFlag\Index.cshtml"
|
||||
|
||||
Authorization.RequireAll(Claims.Config.UserFlag.Create, Claims.Config.UserFlag.Configure);
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "User Flags", MVC.Config.UserFlag.Index(null));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"Config_UserFlags_Index\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 7 "..\..\Areas\Config\Views\UserFlag\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 7 "..\..\Areas\Config\Views\UserFlag\Index.cshtml"
|
||||
if (Model.UserFlags.Count == 0)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 450px; padding: 100px 0;\"");
|
||||
|
||||
WriteLiteral(">\r\n <h2>No user flags are configured</h2>\r\n </div> \r\n");
|
||||
|
||||
|
||||
#line 12 "..\..\Areas\Config\Views\UserFlag\Index.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <table");
|
||||
|
||||
WriteLiteral(" class=\"tableData\"");
|
||||
|
||||
WriteLiteral(">\r\n <tr>\r\n <th>Name</th>\r\n <th>Descripti" +
|
||||
"on</th>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 20 "..\..\Areas\Config\Views\UserFlag\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 20 "..\..\Areas\Config\Views\UserFlag\Index.cshtml"
|
||||
foreach (var item in Model.UserFlags)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <tr>\r\n <td>\r\n <a");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 815), Tuple.Create("\"", 869)
|
||||
|
||||
#line 24 "..\..\Areas\Config\Views\UserFlag\Index.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 822), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.UserFlag.Index(item.Id))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 822), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <i");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 903), Tuple.Create("\"", 956)
|
||||
, Tuple.Create(Tuple.Create("", 911), Tuple.Create("fa", 911), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 913), Tuple.Create("fa-", 914), true)
|
||||
|
||||
#line 25 "..\..\Areas\Config\Views\UserFlag\Index.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 917), Tuple.Create<System.Object, System.Int32>(item.Icon
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 917), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 929), Tuple.Create("fa-lg", 930), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 935), Tuple.Create("d-", 936), true)
|
||||
|
||||
#line 25 "..\..\Areas\Config\Views\UserFlag\Index.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 938), Tuple.Create<System.Object, System.Int32>(item.IconColour
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 938), false)
|
||||
);
|
||||
|
||||
WriteLiteral("></i>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 26 "..\..\Areas\Config\Views\UserFlag\Index.cshtml"
|
||||
Write(item.Name);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </a>\r\n </td>\r\n <t" +
|
||||
"d>\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"smallMessage\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 30 "..\..\Areas\Config\Views\UserFlag\Index.cshtml"
|
||||
if (string.IsNullOrWhiteSpace(item.Description))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
WriteLiteral("<none>");
|
||||
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 33 "..\..\Areas\Config\Views\UserFlag\Index.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 36 "..\..\Areas\Config\Views\UserFlag\Index.cshtml"
|
||||
Write(item.Description.ToMultilineString());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 36 "..\..\Areas\Config\Views\UserFlag\Index.cshtml"
|
||||
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</span>\r\n </td>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 40 "..\..\Areas\Config\Views\UserFlag\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </table>\r\n");
|
||||
|
||||
|
||||
#line 42 "..\..\Areas\Config\Views\UserFlag\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"actionBar\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 44 "..\..\Areas\Config\Views\UserFlag\Index.cshtml"
|
||||
Write(Html.ActionLinkButton("Create User Flag", MVC.Config.UserFlag.Create()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </div>\r\n</div>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,250 @@
|
||||
@model Disco.Web.Areas.Config.Models.UserFlag.ShowModel
|
||||
@using Disco.Services.Users.UserFlags;
|
||||
@{
|
||||
Authorization.Require(Claims.Config.UserFlag.Show);
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "User Flags", MVC.Config.UserFlag.Index(null), Model.UserFlag.ToString());
|
||||
|
||||
var canConfig = Authorization.Has(Claims.Config.UserFlag.Configure);
|
||||
var canDelete = Authorization.Has(Claims.Config.UserFlag.Delete);
|
||||
var canShowUsers = Model.CurrentAssignmentCount > 0 && Authorization.HasAll(Claims.User.Search, Claims.User.ShowFlagAssignments);
|
||||
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
|
||||
}
|
||||
<div id="Config_UserFlags_Show" class="form" style="width: 550px">
|
||||
<table>
|
||||
<tr>
|
||||
<th style="width: 150px">Id:
|
||||
</th>
|
||||
<td>
|
||||
@Html.DisplayFor(model => model.UserFlag.Id)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Name:
|
||||
</th>
|
||||
<td>@if (canConfig)
|
||||
{@Html.EditorFor(model => model.UserFlag.Name)
|
||||
@AjaxHelpers.AjaxSave()
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
document.DiscoFunctions.PropertyChangeHelper(
|
||||
$('#UserFlag_Name'),
|
||||
'Invalid Name',
|
||||
'@(Url.Action(MVC.API.UserFlag.UpdateName(Model.UserFlag.Id)))',
|
||||
'FlagName'
|
||||
);
|
||||
});
|
||||
</script>
|
||||
}
|
||||
else
|
||||
{
|
||||
@Model.UserFlag.Name
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Description:
|
||||
</th>
|
||||
<td>@if (canConfig)
|
||||
{@Html.EditorFor(model => model.UserFlag.Description)
|
||||
@AjaxHelpers.AjaxSave()
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
document.DiscoFunctions.PropertyChangeHelper(
|
||||
$('#UserFlag_Description'),
|
||||
'Invalid Description',
|
||||
'@(Url.Action(MVC.API.UserFlag.UpdateDescription(Model.UserFlag.Id)))',
|
||||
'Description'
|
||||
);
|
||||
});
|
||||
</script>
|
||||
}
|
||||
else
|
||||
{
|
||||
<pre>
|
||||
@if (string.IsNullOrEmpty(Model.UserFlag.Description))
|
||||
{
|
||||
<text><None></text>
|
||||
}
|
||||
else
|
||||
{
|
||||
@Model.UserFlag.Description
|
||||
}
|
||||
</pre>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Statistics:
|
||||
</th>
|
||||
<td>
|
||||
<div><strong>@Model.CurrentAssignmentCount user@(Model.CurrentAssignmentCount != 1 ? "s" : null) currently assigned</strong></div>
|
||||
<div>@Model.TotalAssignmentCount total user historical assignment@(Model.TotalAssignmentCount != 1 ? "s" : null)</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Icon:
|
||||
</th>
|
||||
<td>
|
||||
<i id="Config_UserFlags_Icon" data-icon="@(Model.UserFlag.Icon)" data-colour="@(Model.UserFlag.IconColour)" class="fa fa-@(Model.UserFlag.Icon) fa-4x d-@(Model.UserFlag.IconColour)"></i>
|
||||
@if (canConfig)
|
||||
{
|
||||
<div>
|
||||
<a id="Config_UserFlags_Icon_Update" href="#" class="button small">Update</a>
|
||||
<div id="Config_UserFlags_Icon_Update_Dialog" class="dialog" title="User Flag Icon">
|
||||
<div>
|
||||
<div class="icons">
|
||||
@foreach (var icon in Model.Icons)
|
||||
{
|
||||
<i data-icon="@(icon.Key)" class="fa fa-@(icon.Key)" title="@icon.Value"></i>
|
||||
}
|
||||
</div>
|
||||
<div class="colours">
|
||||
@foreach (var colour in Model.ThemeColours)
|
||||
{
|
||||
<i data-colour="@(colour.Key)" class="fa fa-square d-@(colour.Key)" title="@colour.Value"></i>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
(function () {
|
||||
var dialog, icon, colours, icons;
|
||||
|
||||
function showDialog() {
|
||||
if (!dialog) {
|
||||
dialog = $('#Config_UserFlags_Icon_Update_Dialog').dialog({
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
width: 750,
|
||||
height: 650,
|
||||
buttons: {
|
||||
"Save": save,
|
||||
Cancel: cancel
|
||||
}
|
||||
});
|
||||
|
||||
colours = dialog.find('.colours');
|
||||
icons = dialog.find('.icons');
|
||||
|
||||
colours.on('click', 'i', selectColour);
|
||||
icons.on('click', 'i', selectIcon);
|
||||
}
|
||||
|
||||
colours.find('i[data-colour="' + icon.attr('data-colour') + '"]').each(selectColour);
|
||||
icons.find('i[data-icon="' + icon.attr('data-icon') + '"]').each(selectIcon);
|
||||
|
||||
dialog.dialog('open');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function selectColour() {
|
||||
var $this = $(this),
|
||||
colourCode = $this.attr('data-colour'),
|
||||
previousColourCode = icons.attr('data-colour');
|
||||
|
||||
|
||||
colours.find('i').removeClass('selected fa-check-square').addClass('fa-square');
|
||||
$this.removeClass('fa-square').addClass('fa-check-square selected');
|
||||
|
||||
if (previousColourCode)
|
||||
icons.removeClass('d-' + previousColourCode);
|
||||
icons.attr('data-colour', colourCode)
|
||||
icons.addClass('d-' + colourCode);
|
||||
}
|
||||
function selectIcon() {
|
||||
var $this = $(this),
|
||||
iconCode = $this.attr('data-icon');
|
||||
|
||||
icons.find('i').removeClass('selected');
|
||||
$this.addClass('selected');
|
||||
}
|
||||
|
||||
function save() {
|
||||
var url = '@(Url.Action(MVC.API.UserFlag.UpdateIconAndColour(id: Model.UserFlag.Id, redirect: true)))',
|
||||
data = {
|
||||
Icon: icons.find('i.selected').attr('data-icon'),
|
||||
IconColour: colours.find('i.selected').attr('data-colour')
|
||||
};
|
||||
window.location.href = url + '&' + $.param(data);
|
||||
|
||||
dialog.dialog("disable");
|
||||
dialog.dialog("option", "buttons", null);
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
|
||||
$(function () {
|
||||
icon = $('#Config_UserFlags_Icon');
|
||||
$('#Config_UserFlags_Icon_Update').click(showDialog);
|
||||
});
|
||||
}());
|
||||
</script>
|
||||
</div>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@if (canDelete || canShowUsers)
|
||||
{
|
||||
<div class="actionBar">
|
||||
@if (canDelete)
|
||||
{
|
||||
@Html.ActionLinkButton("Delete", MVC.API.UserFlag.Delete(Model.UserFlag.Id, true), "Config_UserFlags_Actions_Delete_Button")
|
||||
<div id="Config_UserFlags_Actions_Delete_Dialog" title="Delete this User Flag?">
|
||||
<p>
|
||||
<i class="fa fa-exclamation-triangle fa-lg warning"></i>
|
||||
This item will be permanently deleted and cannot be recovered.<br />
|
||||
<br />
|
||||
@if (Model.CurrentAssignmentCount > 0)
|
||||
{
|
||||
<strong>@Model.CurrentAssignmentCount user@(Model.CurrentAssignmentCount != 1 ? "s are" : " is") currently assigned</strong>
|
||||
<br />
|
||||
<br />
|
||||
}
|
||||
Are you sure?
|
||||
</p>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var button = $('#Config_UserFlags_Actions_Delete_Button');
|
||||
var buttonDialog = $('#Config_UserFlags_Actions_Delete_Dialog');
|
||||
var buttonLink = button.attr('href');
|
||||
button.attr('href', '#');
|
||||
button.click(function () {
|
||||
buttonDialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
buttonDialog.dialog({
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Delete": function () {
|
||||
var $this = $(this);
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
window.location.href = buttonLink;
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
@if (canShowUsers)
|
||||
{
|
||||
@Html.ActionLinkButton(string.Format("Show {0} user{1}", Model.CurrentAssignmentCount, (Model.CurrentAssignmentCount == 1 ? null : "s")), MVC.Search.Query(Model.UserFlag.Id.ToString(), "UserFlag"), "Config_UserFlags_Actions_ShowUsers_Button")
|
||||
}
|
||||
</div>
|
||||
}
|
||||
@@ -0,0 +1,826 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.34014
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Areas.Config.Views.UserFlag
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Helpers;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc.Ajax;
|
||||
using System.Web.Mvc.Html;
|
||||
using System.Web.Routing;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
using Disco.Services.Users.UserFlags;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/UserFlag/Show.cshtml")]
|
||||
public partial class Show : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.UserFlag.ShowModel>
|
||||
{
|
||||
public Show()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 3 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
|
||||
Authorization.Require(Claims.Config.UserFlag.Show);
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "User Flags", MVC.Config.UserFlag.Index(null), Model.UserFlag.ToString());
|
||||
|
||||
var canConfig = Authorization.Has(Claims.Config.UserFlag.Configure);
|
||||
var canDelete = Authorization.Has(Claims.Config.UserFlag.Delete);
|
||||
var canShowUsers = Model.CurrentAssignmentCount > 0 && Authorization.HasAll(Claims.User.Search, Claims.User.ShowFlagAssignments);
|
||||
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"Config_UserFlags_Show\"");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 550px\"");
|
||||
|
||||
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th");
|
||||
|
||||
WriteLiteral(" style=\"width: 150px\"");
|
||||
|
||||
WriteLiteral(">Id:\r\n </th>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 20 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
Write(Html.DisplayFor(model => model.UserFlag.Id));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>Name:\r\n " +
|
||||
" </th>\r\n <td>");
|
||||
|
||||
|
||||
#line 26 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
if (canConfig)
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 27 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
Write(Html.EditorFor(model => model.UserFlag.Name));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 27 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 28 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
Write(AjaxHelpers.AjaxSave());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 28 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 29 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
Write(AjaxHelpers.AjaxLoader());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 29 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(">\r\n $(function () {\r\n document.DiscoFun" +
|
||||
"ctions.PropertyChangeHelper(\r\n $(\'#UserFlag_Name\'),\r\n" +
|
||||
" \'Invalid Name\',\r\n \'");
|
||||
|
||||
|
||||
#line 35 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
Write(Url.Action(MVC.API.UserFlag.UpdateName(Model.UserFlag.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\',\r\n \'FlagName\'\r\n );\r\n " +
|
||||
" });\r\n </script>\r\n");
|
||||
|
||||
|
||||
#line 40 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 43 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
Write(Model.UserFlag.Name);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 43 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>Description:\r\n " +
|
||||
" </th>\r\n <td>");
|
||||
|
||||
|
||||
#line 50 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
if (canConfig)
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 51 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
Write(Html.EditorFor(model => model.UserFlag.Description));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 51 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 52 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
Write(AjaxHelpers.AjaxSave());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 52 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 53 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
Write(AjaxHelpers.AjaxLoader());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 53 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(">\r\n $(function () {\r\n document.DiscoFun" +
|
||||
"ctions.PropertyChangeHelper(\r\n $(\'#UserFlag_Descripti" +
|
||||
"on\'),\r\n \'Invalid Description\',\r\n " +
|
||||
" \'");
|
||||
|
||||
|
||||
#line 59 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
Write(Url.Action(MVC.API.UserFlag.UpdateDescription(Model.UserFlag.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\',\r\n \'Description\'\r\n );\r\n " +
|
||||
" });\r\n </script>\r\n");
|
||||
|
||||
|
||||
#line 64 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <pre>\r\n");
|
||||
|
||||
|
||||
#line 68 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 68 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
if (string.IsNullOrEmpty(Model.UserFlag.Description))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
WriteLiteral("<None>");
|
||||
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 71 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 74 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
Write(Model.UserFlag.Description);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 74 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </pre>\r\n");
|
||||
|
||||
|
||||
#line 77 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>Statistics:\r\n " +
|
||||
" </th>\r\n <td>\r\n <div><strong>");
|
||||
|
||||
|
||||
#line 84 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
Write(Model.CurrentAssignmentCount);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" user");
|
||||
|
||||
|
||||
#line 84 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
Write(Model.CurrentAssignmentCount != 1 ? "s" : null);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" currently assigned</strong></div>\r\n <div>");
|
||||
|
||||
|
||||
#line 85 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
Write(Model.TotalAssignmentCount);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" total user historical assignment");
|
||||
|
||||
|
||||
#line 85 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
Write(Model.TotalAssignmentCount != 1 ? "s" : null);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>Icon:\r\n " +
|
||||
" </th>\r\n <td>\r\n <i");
|
||||
|
||||
WriteLiteral(" id=\"Config_UserFlags_Icon\"");
|
||||
|
||||
WriteLiteral(" data-icon=\"");
|
||||
|
||||
|
||||
#line 92 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
Write(Model.UserFlag.Icon);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(" data-colour=\"");
|
||||
|
||||
|
||||
#line 92 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
Write(Model.UserFlag.IconColour);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 3604), Tuple.Create("\"", 3677)
|
||||
, Tuple.Create(Tuple.Create("", 3612), Tuple.Create("fa", 3612), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 3614), Tuple.Create("fa-", 3615), true)
|
||||
|
||||
#line 92 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 3618), Tuple.Create<System.Object, System.Int32>(Model.UserFlag.Icon
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 3618), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 3640), Tuple.Create("fa-4x", 3641), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 3646), Tuple.Create("d-", 3647), true)
|
||||
|
||||
#line 92 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 3649), Tuple.Create<System.Object, System.Int32>(Model.UserFlag.IconColour
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 3649), false)
|
||||
);
|
||||
|
||||
WriteLiteral("></i>\r\n");
|
||||
|
||||
|
||||
#line 93 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 93 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
if (canConfig)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div>\r\n <a");
|
||||
|
||||
WriteLiteral(" id=\"Config_UserFlags_Icon_Update\"");
|
||||
|
||||
WriteLiteral(" href=\"#\"");
|
||||
|
||||
WriteLiteral(" class=\"button small\"");
|
||||
|
||||
WriteLiteral(">Update</a>\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"Config_UserFlags_Icon_Update_Dialog\"");
|
||||
|
||||
WriteLiteral(" class=\"dialog\"");
|
||||
|
||||
WriteLiteral(" title=\"User Flag Icon\"");
|
||||
|
||||
WriteLiteral(">\r\n <div>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"icons\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 100 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 100 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
foreach (var icon in Model.Icons)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <i");
|
||||
|
||||
WriteLiteral(" data-icon=\"");
|
||||
|
||||
|
||||
#line 102 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
Write(icon.Key);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 4242), Tuple.Create("\"", 4267)
|
||||
, Tuple.Create(Tuple.Create("", 4250), Tuple.Create("fa", 4250), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 4252), Tuple.Create("fa-", 4253), true)
|
||||
|
||||
#line 102 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4256), Tuple.Create<System.Object, System.Int32>(icon.Key
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4256), false)
|
||||
);
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 4268), Tuple.Create("\"", 4287)
|
||||
|
||||
#line 102 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4276), Tuple.Create<System.Object, System.Int32>(icon.Value
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4276), false)
|
||||
);
|
||||
|
||||
WriteLiteral("></i>\r\n");
|
||||
|
||||
|
||||
#line 103 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"colours\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 106 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 106 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
foreach (var colour in Model.ThemeColours)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <i");
|
||||
|
||||
WriteLiteral(" data-colour=\"");
|
||||
|
||||
|
||||
#line 108 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
Write(colour.Key);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 4619), Tuple.Create("\"", 4655)
|
||||
, Tuple.Create(Tuple.Create("", 4627), Tuple.Create("fa", 4627), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 4629), Tuple.Create("fa-square", 4630), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 4639), Tuple.Create("d-", 4640), true)
|
||||
|
||||
#line 108 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4642), Tuple.Create<System.Object, System.Int32>(colour.Key
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4642), false)
|
||||
);
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 4656), Tuple.Create("\"", 4677)
|
||||
|
||||
#line 108 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4664), Tuple.Create<System.Object, System.Int32>(colour.Value
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4664), false)
|
||||
);
|
||||
|
||||
WriteLiteral("></i>\r\n");
|
||||
|
||||
|
||||
#line 109 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n </div>\r\n " +
|
||||
" </div>\r\n <script>\r\n " +
|
||||
" (function () {\r\n var dialog, icon, colou" +
|
||||
"rs, icons;\r\n\r\n function showDialog() {\r\n " +
|
||||
" if (!dialog) {\r\n " +
|
||||
" dialog = $(\'#Config_UserFlags_Icon_Update_Dialog\').dialog({\r\n " +
|
||||
" resizable: false,\r\n " +
|
||||
" modal: true,\r\n autoOpen: f" +
|
||||
"alse,\r\n width: 750,\r\n " +
|
||||
" height: 650,\r\n " +
|
||||
" buttons: {\r\n \"Save\": save,\r" +
|
||||
"\n Cancel: cancel\r\n " +
|
||||
" }\r\n });\r\n\r\n " +
|
||||
" colours = dialog.find(\'.colours\');\r\n " +
|
||||
" icons = dialog.find(\'.icons\');\r\n\r\n " +
|
||||
" colours.on(\'click\', \'i\', selectColour);\r\n " +
|
||||
" icons.on(\'click\', \'i\', selectIcon);\r\n " +
|
||||
" }\r\n\r\n colours.find(\'i[" +
|
||||
"data-colour=\"\' + icon.attr(\'data-colour\') + \'\"]\').each(selectColour);\r\n " +
|
||||
" icons.find(\'i[data-icon=\"\' + icon.attr(\'data-icon\') +" +
|
||||
" \'\"]\').each(selectIcon);\r\n\r\n dialog.dialog(\'o" +
|
||||
"pen\');\r\n\r\n return false;\r\n " +
|
||||
" }\r\n\r\n function selectColour() {\r\n " +
|
||||
" var $this = $(this),\r\n " +
|
||||
" colourCode = $this.attr(\'data-colour\'),\r\n " +
|
||||
" previousColourCode = icons.attr(\'data-colour\');\r\n\r\n\r\n " +
|
||||
" colours.find(\'i\').removeClass(\'selected fa-check-square" +
|
||||
"\').addClass(\'fa-square\');\r\n $this.removeClass" +
|
||||
"(\'fa-square\').addClass(\'fa-check-square selected\');\r\n\r\n " +
|
||||
" if (previousColourCode)\r\n icon" +
|
||||
"s.removeClass(\'d-\' + previousColourCode);\r\n i" +
|
||||
"cons.attr(\'data-colour\', colourCode)\r\n icons." +
|
||||
"addClass(\'d-\' + colourCode);\r\n }\r\n " +
|
||||
" function selectIcon() {\r\n va" +
|
||||
"r $this = $(this),\r\n iconCode = $this.att" +
|
||||
"r(\'data-icon\');\r\n\r\n icons.find(\'i\').removeCla" +
|
||||
"ss(\'selected\');\r\n $this.addClass(\'selected\');" +
|
||||
"\r\n }\r\n\r\n function " +
|
||||
"save() {\r\n var url = \'");
|
||||
|
||||
|
||||
#line 169 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
Write(Url.Action(MVC.API.UserFlag.UpdateIconAndColour(id: Model.UserFlag.Id, redirect: true)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"',
|
||||
data = {
|
||||
Icon: icons.find('i.selected').attr('data-icon'),
|
||||
IconColour: colours.find('i.selected').attr('data-colour')
|
||||
};
|
||||
window.location.href = url + '&' + $.param(data);
|
||||
|
||||
dialog.dialog(""disable"");
|
||||
dialog.dialog(""option"", ""buttons"", null);
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
$(this).dialog(""close"");
|
||||
}
|
||||
|
||||
$(function () {
|
||||
icon = $('#Config_UserFlags_Icon');
|
||||
$('#Config_UserFlags_Icon_Update').click(showDialog);
|
||||
});
|
||||
}());
|
||||
</script>
|
||||
</div>
|
||||
");
|
||||
|
||||
|
||||
#line 191 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </td>\r\n </tr>\r\n </table>\r\n</div>\r\n");
|
||||
|
||||
|
||||
#line 196 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
if (canDelete || canShowUsers)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"actionBar\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 199 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 199 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
if (canDelete)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 201 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
Write(Html.ActionLinkButton("Delete", MVC.API.UserFlag.Delete(Model.UserFlag.Id, true), "Config_UserFlags_Actions_Delete_Button"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 201 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"Config_UserFlags_Actions_Delete_Dialog\"");
|
||||
|
||||
WriteLiteral(" title=\"Delete this User Flag?\"");
|
||||
|
||||
WriteLiteral(">\r\n <p>\r\n <i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-exclamation-triangle fa-lg warning\"");
|
||||
|
||||
WriteLiteral("></i>\r\n This item will be permanently deleted and cannot be re" +
|
||||
"covered.<br />\r\n <br />\r\n");
|
||||
|
||||
|
||||
#line 207 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 207 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
if (Model.CurrentAssignmentCount > 0)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <strong>");
|
||||
|
||||
|
||||
#line 209 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
Write(Model.CurrentAssignmentCount);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" user");
|
||||
|
||||
|
||||
#line 209 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
Write(Model.CurrentAssignmentCount != 1 ? "s are" : " is");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" currently assigned</strong>\r\n");
|
||||
|
||||
WriteLiteral(" <br />\r\n");
|
||||
|
||||
WriteLiteral(" <br />\r\n");
|
||||
|
||||
|
||||
#line 212 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" Are you sure?\r\n </p>\r\n </div>\r\n");
|
||||
|
||||
WriteLiteral(" <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
var button = $('#Config_UserFlags_Actions_Delete_Button');
|
||||
var buttonDialog = $('#Config_UserFlags_Actions_Delete_Dialog');
|
||||
var buttonLink = button.attr('href');
|
||||
button.attr('href', '#');
|
||||
button.click(function () {
|
||||
buttonDialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
buttonDialog.dialog({
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
""Delete"": function () {
|
||||
var $this = $(this);
|
||||
$this.dialog(""disable"");
|
||||
$this.dialog(""option"", ""buttons"", null);
|
||||
window.location.href = buttonLink;
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog(""close"");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
");
|
||||
|
||||
|
||||
#line 244 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 245 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
if (canShowUsers)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 247 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
Write(Html.ActionLinkButton(string.Format("Show {0} user{1}", Model.CurrentAssignmentCount, (Model.CurrentAssignmentCount == 1 ? null : "s")), MVC.Search.Query(Model.UserFlag.Id.ToString(), "UserFlag"), "Config_UserFlags_Actions_ShowUsers_Button"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 247 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n");
|
||||
|
||||
|
||||
#line 250 "..\..\Areas\Config\Views\UserFlag\Show.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -4406,6 +4406,16 @@ table.genericData td.id a {
|
||||
.dataTables_wrapper table > thead tr > th.sorting_disabled {
|
||||
background-image: none;
|
||||
}
|
||||
table.userTable div.flags {
|
||||
display: inline-block;
|
||||
float: right;
|
||||
}
|
||||
table.userTable div.flags > i {
|
||||
cursor: default;
|
||||
}
|
||||
table.userTable div.flags > i > .details {
|
||||
display: none;
|
||||
}
|
||||
.jobStatus {
|
||||
color: #333333;
|
||||
}
|
||||
@@ -4843,6 +4853,18 @@ div.disco-attachmentUpload-imageDialog {
|
||||
width: 720px !important;
|
||||
height: 540px !important;
|
||||
}
|
||||
body > .User_FlagAssignment_Tooltip span.name {
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
}
|
||||
body > .User_FlagAssignment_Tooltip span.comments {
|
||||
display: block;
|
||||
padding: 2px 0 2px 4px;
|
||||
}
|
||||
body > .User_FlagAssignment_Tooltip span.added {
|
||||
font-style: italic;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
.d-priority-high {
|
||||
color: #fa6800;
|
||||
width: 1.2857142857142858em;
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -1176,3 +1176,52 @@ div.logEventsViewport table.logEventsViewport > tbody > tr > td.eventType {
|
||||
#Config_JobQueues_Subjects_Update_Dialog #Config_JobQueues_Subjects_Update_Dialog_List li .remove:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
#Config_UserFlags_Index i {
|
||||
width: 1.2857142857142858em;
|
||||
text-align: center;
|
||||
}
|
||||
#Config_UserFlags_Icon {
|
||||
display: block;
|
||||
margin: 0 0 10px 10px;
|
||||
}
|
||||
#Config_UserFlags_Icon_Update_Dialog {
|
||||
display: none;
|
||||
}
|
||||
#Config_UserFlags_Icon_Update_Dialog div.colours {
|
||||
text-align: center;
|
||||
font-size: 30px;
|
||||
}
|
||||
#Config_UserFlags_Icon_Update_Dialog div.colours i {
|
||||
cursor: pointer;
|
||||
padding: 1px;
|
||||
opacity: .9;
|
||||
}
|
||||
#Config_UserFlags_Icon_Update_Dialog div.colours i:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
#Config_UserFlags_Icon_Update_Dialog div.colours i.selected {
|
||||
opacity: 1;
|
||||
}
|
||||
#Config_UserFlags_Icon_Update_Dialog div.icons {
|
||||
text-align: center;
|
||||
font-size: 34px;
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #d1d1d1;
|
||||
margin: 6px 0 14px 0;
|
||||
}
|
||||
#Config_UserFlags_Icon_Update_Dialog div.icons i {
|
||||
width: 1.2857142857142858em;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
padding: 6px 0px;
|
||||
color: #333333;
|
||||
opacity: .6;
|
||||
}
|
||||
#Config_UserFlags_Icon_Update_Dialog div.icons i:hover {
|
||||
opacity: .9;
|
||||
color: inherit;
|
||||
}
|
||||
#Config_UserFlags_Icon_Update_Dialog div.icons i.selected {
|
||||
opacity: 1;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
@@ -1368,3 +1368,65 @@ div.logEventsViewport {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Config_UserFlags_Index {
|
||||
i {
|
||||
width: 1.2857142857142858em;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
#Config_UserFlags_Icon {
|
||||
display: block;
|
||||
margin: 0 0 10px 10px;
|
||||
}
|
||||
|
||||
#Config_UserFlags_Icon_Update_Dialog {
|
||||
display: none;
|
||||
|
||||
div.colours {
|
||||
text-align: center;
|
||||
font-size: 30px;
|
||||
|
||||
i {
|
||||
cursor: pointer;
|
||||
padding: 1px;
|
||||
opacity: .9;
|
||||
|
||||
&:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
&.selected {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
div.icons {
|
||||
text-align: center;
|
||||
font-size: 34px;
|
||||
background-color: @white;
|
||||
border: 1px solid @BackgroundColour;
|
||||
margin: 6px 0 14px 0;
|
||||
|
||||
i {
|
||||
width: 1.2857142857142858em;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
padding: 6px 0px;
|
||||
color: @HeaderBackgroundColour;
|
||||
opacity: .6;
|
||||
|
||||
&:hover {
|
||||
opacity: .9;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
&.selected {
|
||||
opacity: 1;
|
||||
color: inherit;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -129,6 +129,15 @@
|
||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACWUlEQVQ4y6XRXWiSURgHcJsXa4WNNuuyiy6CoAupixERoXXhmljuxaJiFrVA1i72cVFCOSMt8rNt2YfGO5g5Z1NstWW+c4ZBq4QpqMkEbZDSCObAMprjdf90sIjxsgUdODd/zvmd5zwPCwDrf/aGB7q6utgmk8ngdruzVqt10eVyTWu1Wuk/AXK5vMpoNPpjsRgGbU8/9fbdH/J4PAuRSARKpfLKhoBYLG595nTCaDSZVjPp6TPbHQ5H0mAwfBeJRHXrAp0dna9JcqCguX2H/Xd+S625aLFYQBDE8XWBd+8/TI6Njc+vzcfGX4nLX4FOp5OuC0wGAlS53NzaPPAm2Gi32+H3+5tYJEl+pigKoVAIPp+PnpqaosPhMF1uHB2Px2mv14vya6VgMKhhHGN3d/dSMplENptFIpHA3NwcCoUCSqUSKqvScZVKBbPZHGQEFApFMZ1OI5PJIBqNrkD5fB40Ta8AlcrUajVsNpufEbh+42YxHEkh+/UbUqlZpGd/lAH8WTMzMzDd64d7NMAMDOobi/OpHqh6rqK9jcCvBQncQzK0Xm5DPn0BJ4lz6GgVIkedYAaamxqK0dEDePl4FziczehTsZGLs7BnNwdiwRac4lejvp6La83VzABv/8FF/qG9oD/WQS/fhNptHEw8rEJiuAo7ubXACAtH9m0Fu2YHxQzweEuEVIYnaiFmvQ04f1aItksi5KaP4ZFGjDB5GG/7j4LL5YYYgZYW2c/yiJbv6h/A0EvC4RjGiOsFnK4J+KgABmyjsDufL0skki8CgYCoXOLz+TWrwG+kXMkgQ6yv+QAAAABJRU5ErkJggg==) /*Images/Actions/unlocked.png*/;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Flags {
|
||||
font-size: 16px;
|
||||
}
|
||||
#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Flags > i {
|
||||
cursor: default;
|
||||
}
|
||||
#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Flags > i > .details {
|
||||
display: none;
|
||||
}
|
||||
#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_GenerateDocument_Container {
|
||||
padding-top: 4px;
|
||||
}
|
||||
|
||||
@@ -68,6 +68,20 @@
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
#Device_Show_User {
|
||||
#Device_Show_User_Flags {
|
||||
font-size: 16px;
|
||||
|
||||
& > i {
|
||||
cursor: default;
|
||||
|
||||
& > .details {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Device_Show_GenerateDocument_Container {
|
||||
padding-top: 4px;
|
||||
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -192,6 +192,16 @@
|
||||
#Job_Show #Job_Show_Subjects #Job_Show_Device #Job_Show_Device_DeviceHeld table > tbody > tr > td:first-child {
|
||||
width: 62px;
|
||||
}
|
||||
#Job_Show #Job_Show_Subjects #Job_Show_User #Job_Show_User_Flags {
|
||||
margin: 4px 0;
|
||||
font-size: 16px;
|
||||
}
|
||||
#Job_Show #Job_Show_Subjects #Job_Show_User #Job_Show_User_Flags > i {
|
||||
cursor: default;
|
||||
}
|
||||
#Job_Show #Job_Show_Subjects #Job_Show_User #Job_Show_User_Flags > i > .details {
|
||||
display: none;
|
||||
}
|
||||
#Job_Show #Job_Show_Subjects #Job_Show_Subjects_Actions > td {
|
||||
padding-top: 4px;
|
||||
}
|
||||
@@ -524,9 +534,9 @@
|
||||
margin-top: 4px;
|
||||
font-size: .9em;
|
||||
}
|
||||
#jobDetailTab-Queues #jobQueues td.added .comments,
|
||||
#jobDetailTab-Queues #jobQueues td.removed .comments {
|
||||
white-space: pre-line;
|
||||
#jobDetailTab-Queues #jobQueues td.added .commentsRaw,
|
||||
#jobDetailTab-Queues #jobQueues td.removed .commentsRaw {
|
||||
display: none;
|
||||
}
|
||||
#jobDetailTab-Queues #jobQueues td.removed.na {
|
||||
vertical-align: middle;
|
||||
|
||||
@@ -149,6 +149,21 @@
|
||||
}
|
||||
}
|
||||
|
||||
#Job_Show_User {
|
||||
#Job_Show_User_Flags {
|
||||
margin: 4px 0;
|
||||
font-size: 16px;
|
||||
|
||||
& > i {
|
||||
cursor: default;
|
||||
|
||||
& > .details {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Job_Show_Subjects_Actions {
|
||||
& > td {
|
||||
padding-top: 4px;
|
||||
@@ -161,8 +176,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#jobDetailTabs {
|
||||
margin-top: 10px;
|
||||
/*.jobPart
|
||||
@@ -548,8 +561,8 @@
|
||||
font-size: .9em;
|
||||
}
|
||||
|
||||
.comments {
|
||||
white-space: pre-line;
|
||||
.commentsRaw {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -745,6 +745,16 @@ table.genericData td.id a {
|
||||
.dataTables_wrapper table > thead tr > th.sorting_disabled {
|
||||
background-image: none;
|
||||
}
|
||||
table.userTable div.flags {
|
||||
display: inline-block;
|
||||
float: right;
|
||||
}
|
||||
table.userTable div.flags > i {
|
||||
cursor: default;
|
||||
}
|
||||
table.userTable div.flags > i > .details {
|
||||
display: none;
|
||||
}
|
||||
.jobStatus {
|
||||
color: #333333;
|
||||
}
|
||||
@@ -1182,6 +1192,18 @@ div.disco-attachmentUpload-imageDialog {
|
||||
width: 720px !important;
|
||||
height: 540px !important;
|
||||
}
|
||||
body > .User_FlagAssignment_Tooltip span.name {
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
}
|
||||
body > .User_FlagAssignment_Tooltip span.comments {
|
||||
display: block;
|
||||
padding: 2px 0 2px 4px;
|
||||
}
|
||||
body > .User_FlagAssignment_Tooltip span.added {
|
||||
font-style: italic;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
.d-priority-high {
|
||||
color: #fa6800;
|
||||
width: 1.2857142857142858em;
|
||||
|
||||
@@ -702,6 +702,21 @@ table {
|
||||
}
|
||||
}
|
||||
|
||||
table.userTable {
|
||||
div.flags {
|
||||
display: inline-block;
|
||||
float: right;
|
||||
|
||||
& > i {
|
||||
cursor: default;
|
||||
|
||||
& > .details {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.jobStatus {
|
||||
color: @StatusUnknown;
|
||||
|
||||
@@ -1169,6 +1184,23 @@ div.disco-attachmentUpload-imageDialog {
|
||||
height: 540px !important;
|
||||
}
|
||||
|
||||
body > .User_FlagAssignment_Tooltip {
|
||||
span.name {
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
span.comments {
|
||||
display: block;
|
||||
padding: 2px 0 2px 4px;
|
||||
}
|
||||
|
||||
span.added {
|
||||
font-style: italic;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
}
|
||||
|
||||
// Priority Colours
|
||||
.d-priority-high {
|
||||
color: @PriorityHigh;
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -78,6 +78,18 @@
|
||||
-moz-opacity: 1;
|
||||
opacity: 1;
|
||||
}
|
||||
#layout_PageHeading #User_Show_Flags {
|
||||
display: inline-block;
|
||||
float: right;
|
||||
height: 50px;
|
||||
font-size: 0.6em;
|
||||
}
|
||||
#layout_PageHeading #User_Show_Flags > i {
|
||||
cursor: default;
|
||||
}
|
||||
#layout_PageHeading #User_Show_Flags > i > .details {
|
||||
display: none;
|
||||
}
|
||||
#User_Show #User_Show_Subjects {
|
||||
table-layout: fixed;
|
||||
}
|
||||
@@ -196,6 +208,113 @@
|
||||
right: 220px;
|
||||
margin-top: -24px;
|
||||
}
|
||||
#User_Show_Details_Actions_AddFlag_Dialog {
|
||||
height: 400px;
|
||||
}
|
||||
#User_Show_Details_Actions_AddFlag_Dialog .flagPicker {
|
||||
position: absolute;
|
||||
width: 250px;
|
||||
height: 300px;
|
||||
overflow-y: auto;
|
||||
background-color: #fcfcfc;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
#User_Show_Details_Actions_AddFlag_Dialog .flagPicker > div {
|
||||
background-color: #ffffff;
|
||||
border-bottom: 1px solid #ddd;
|
||||
padding: 6px 0 6px 6px;
|
||||
cursor: pointer;
|
||||
}
|
||||
#User_Show_Details_Actions_AddFlag_Dialog .flagPicker > div:hover {
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
#User_Show_Details_Actions_AddFlag_Dialog .flagPicker > div.selected,
|
||||
#User_Show_Details_Actions_AddFlag_Dialog .flagPicker > div.selected:hover {
|
||||
background-color: #eeeeee;
|
||||
}
|
||||
#User_Show_Details_Actions_AddFlag_Dialog .details {
|
||||
display: none;
|
||||
position: absolute;
|
||||
left: 280px;
|
||||
top: 1em;
|
||||
}
|
||||
#User_Show_Details_Actions_AddFlag_Dialog .details h4 {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
#User_Show_Details_Actions_AddFlag_Dialog .details textarea {
|
||||
min-width: 280px;
|
||||
height: 200px;
|
||||
}
|
||||
#UserDetailTab-Flags #userFlags {
|
||||
border: solid 1px #d8d8d8;
|
||||
border-collapse: collapse;
|
||||
table-layout: fixed;
|
||||
}
|
||||
#UserDetailTab-Flags #userFlags td {
|
||||
border: solid 1px #d8d8d8;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
#UserDetailTab-Flags #userFlags th {
|
||||
background-color: #eeeeee;
|
||||
border: solid 1px #d8d8d8;
|
||||
}
|
||||
#UserDetailTab-Flags #userFlags i.fa-edit {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
margin-top: 4px;
|
||||
font-size: 1.1em;
|
||||
cursor: pointer;
|
||||
display: none;
|
||||
color: #335a87;
|
||||
}
|
||||
#UserDetailTab-Flags #userFlags i.fa-edit:hover {
|
||||
color: #5e8cc2;
|
||||
}
|
||||
#UserDetailTab-Flags #userFlags td:hover i.fa-edit {
|
||||
display: inline-block;
|
||||
}
|
||||
#UserDetailTab-Flags #userFlags th.name {
|
||||
width: 200px;
|
||||
}
|
||||
#UserDetailTab-Flags #userFlags tr.removed td {
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
#UserDetailTab-Flags #userFlags td.name {
|
||||
vertical-align: middle;
|
||||
}
|
||||
#UserDetailTab-Flags #userFlags td.name .fa-stack {
|
||||
line-height: 1.6em;
|
||||
}
|
||||
#UserDetailTab-Flags #userFlags td.added,
|
||||
#UserDetailTab-Flags #userFlags td.removed {
|
||||
vertical-align: middle;
|
||||
}
|
||||
#UserDetailTab-Flags #userFlags td.comments {
|
||||
vertical-align: middle;
|
||||
}
|
||||
#UserDetailTab-Flags #userFlags td.comments .editable {
|
||||
position: relative;
|
||||
}
|
||||
#UserDetailTab-Flags #userFlags td.comments .commentsRaw {
|
||||
display: none;
|
||||
}
|
||||
#UserDetailTab-Flags #userFlags td.removed.na {
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
}
|
||||
#UserDetailTab-Flags > .none {
|
||||
text-align: center;
|
||||
padding: 30px 0;
|
||||
font-style: italic;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
#User_Show_Flags_Actions_EditComments_Dialog h4 {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
#User_Show_Flags_Actions_EditComments_Dialog_Comments {
|
||||
width: 280px;
|
||||
}
|
||||
#UserDetailTab-Authorization #UserDetailTab-AuthorizationContainer {
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #cccccc;
|
||||
|
||||
@@ -1,5 +1,22 @@
|
||||
@import "Shared";
|
||||
|
||||
#layout_PageHeading {
|
||||
#User_Show_Flags {
|
||||
display: inline-block;
|
||||
float: right;
|
||||
height: 50px;
|
||||
font-size: 0.6em;
|
||||
|
||||
& > i {
|
||||
cursor: default;
|
||||
|
||||
& > .details {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#User_Show {
|
||||
#User_Show_Subjects {
|
||||
table-layout: fixed;
|
||||
@@ -157,6 +174,139 @@
|
||||
}
|
||||
}
|
||||
|
||||
#User_Show_Details_Actions_AddFlag_Dialog {
|
||||
height: 400px;
|
||||
|
||||
.flagPicker {
|
||||
position: absolute;
|
||||
width: 250px;
|
||||
height: 300px;
|
||||
overflow-y: auto;
|
||||
background-color: #fcfcfc;
|
||||
border: 1px solid #ccc;
|
||||
|
||||
& > div {
|
||||
background-color: @white;
|
||||
border-bottom: 1px solid #ddd;
|
||||
padding: 6px 0 6px 6px;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
background-color: @TableDataBorderColour;
|
||||
}
|
||||
|
||||
&.selected, &.selected:hover {
|
||||
background-color: @TableDataDarkBackgroundColour;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.details {
|
||||
display: none;
|
||||
position: absolute;
|
||||
left: 280px;
|
||||
top: 1em;
|
||||
|
||||
h4 {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
textarea {
|
||||
min-width: 280px;
|
||||
height: 200px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#UserDetailTab-Flags {
|
||||
#userFlags {
|
||||
.tableDataDark;
|
||||
table-layout: fixed;
|
||||
|
||||
i.fa-edit {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
margin-top: 4px;
|
||||
font-size: 1.1em;
|
||||
cursor: pointer;
|
||||
display: none;
|
||||
color: @HyperLinkColour;
|
||||
|
||||
&:hover {
|
||||
color: @HyperLinkHoverColour;
|
||||
}
|
||||
}
|
||||
|
||||
td:hover i.fa-edit {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
th.name {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
th.added {
|
||||
}
|
||||
|
||||
th.removed {
|
||||
}
|
||||
|
||||
tr.removed td {
|
||||
background-color: @TableDataBorderColour;
|
||||
}
|
||||
|
||||
td.name {
|
||||
vertical-align: middle;
|
||||
|
||||
.fa-stack {
|
||||
line-height: 1.6em;
|
||||
}
|
||||
}
|
||||
|
||||
td.added, td.removed {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
td.comments {
|
||||
vertical-align: middle;
|
||||
|
||||
.editable {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.commentsRaw {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
td.removed {
|
||||
&.na {
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
& > .none {
|
||||
text-align: center;
|
||||
padding: 30px 0;
|
||||
font-style: italic;
|
||||
background-color: @white;
|
||||
}
|
||||
}
|
||||
|
||||
#User_Show_Flags_Actions_EditComments_Dialog {
|
||||
h4 {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
#User_Show_Flags_Actions_EditComments_Dialog_Comments {
|
||||
width: 280px;
|
||||
}
|
||||
|
||||
#UserDetailTab-Authorization {
|
||||
#UserDetailTab-AuthorizationContainer {
|
||||
background-color: @white;
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -203,7 +203,7 @@ namespace Disco.Web.Controllers
|
||||
|
||||
m.Device = Database.Devices
|
||||
.Include("DeviceModel").Include("DeviceProfile").Include("DeviceBatch").Include("DeviceDetails")
|
||||
.Include("DeviceUserAssignments.AssignedUser").Include("AssignedUser").Include("DeviceCertificates")
|
||||
.Include("DeviceUserAssignments.AssignedUser.UserFlagAssignments").Include("AssignedUser.UserFlagAssignments").Include("DeviceCertificates")
|
||||
.Include("DeviceAttachments.TechUser").Include("DeviceAttachments.DocumentTemplate")
|
||||
.FirstOrDefault(d => d.SerialNumber == id);
|
||||
|
||||
|
||||
@@ -296,7 +296,7 @@ namespace Disco.Web.Controllers
|
||||
|
||||
m.Job = Database.Jobs
|
||||
.Include("Device.DeviceModel").Include("Device.DeviceBatch").Include("DeviceHeldTechUser").Include("DeviceReadyForReturnTechUser").Include("DeviceReturnedTechUser")
|
||||
.Include("OpenedTechUser").Include("ClosedTechUser").Include("JobType").Include("JobSubTypes").Include("User").Include("JobLogs.TechUser")
|
||||
.Include("OpenedTechUser").Include("ClosedTechUser").Include("JobType").Include("JobSubTypes").Include("User.UserFlagAssignments").Include("JobLogs.TechUser")
|
||||
.Include("JobAttachments.TechUser").Include("JobAttachments.DocumentTemplate")
|
||||
.FirstOrDefault(j => j.Id == id.Value);
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace Disco.Web.Controllers
|
||||
if (vm != null)
|
||||
{
|
||||
m.FriendlyTerm = string.Format("Device Model: {0}", vm.ToString());
|
||||
m.Devices = Services.Searching.Search.SearchDeviceModel(Database, vm.Id, LimitCount: null);
|
||||
m.Devices = Services.Searching.Search.SearchDeviceModel(Database, vm.Id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -101,7 +101,7 @@ namespace Disco.Web.Controllers
|
||||
if (dp != null)
|
||||
{
|
||||
m.FriendlyTerm = string.Format("Device Profile: {0}", dp.ToString());
|
||||
m.Devices = Services.Searching.Search.SearchDeviceProfile(Database, dp.Id, LimitCount: null);
|
||||
m.Devices = Services.Searching.Search.SearchDeviceProfile(Database, dp.Id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -118,7 +118,7 @@ namespace Disco.Web.Controllers
|
||||
if (db != null)
|
||||
{
|
||||
m.FriendlyTerm = string.Format("Device Batch: {0}", db.ToString());
|
||||
m.Devices = Services.Searching.Search.SearchDeviceBatch(Database, db.Id, LimitCount: null);
|
||||
m.Devices = Services.Searching.Search.SearchDeviceBatch(Database, db.Id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -232,6 +232,23 @@ namespace Disco.Web.Controllers
|
||||
return View(m);
|
||||
}
|
||||
}
|
||||
case "userflag":
|
||||
Authorization.RequireAll(Claims.User.Search, Claims.User.ShowFlagAssignments);
|
||||
int flagId;
|
||||
if (int.TryParse(term, out flagId))
|
||||
{
|
||||
var flag = Database.UserFlags.Find(flagId);
|
||||
if (flag != null)
|
||||
{
|
||||
m.FriendlyTerm = string.Format("User Flag: {0}", flag.ToString());
|
||||
m.Users = Services.Searching.Search.SearchUserFlag(Database, flag.Id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
m.FriendlyTerm = string.Format("User Flag: {0}", term);
|
||||
m.Success = false;
|
||||
m.ErrorMessage = "Invalid User Flag Id";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ using Disco.Services.Authorization.Roles;
|
||||
using Disco.Services.Interop.ActiveDirectory;
|
||||
using Disco.Services.Plugins.Features.UIExtension;
|
||||
using Disco.Services.Users;
|
||||
using Disco.Services.Users.UserFlags;
|
||||
using Disco.Services.Web;
|
||||
using System;
|
||||
using System.Linq;
|
||||
@@ -61,6 +62,8 @@ namespace Disco.Web.Controllers
|
||||
.Include("DeviceUserAssignments.Device.DeviceBatch")
|
||||
.Include("UserAttachments.TechUser")
|
||||
.Include("UserAttachments.DocumentTemplate")
|
||||
.Include("UserFlagAssignments.AddedUser")
|
||||
.Include("UserFlagAssignments.RemovedUser")
|
||||
.FirstOrDefault(um => um.UserId == id);
|
||||
|
||||
if (m.User == null)
|
||||
@@ -80,6 +83,16 @@ namespace Disco.Web.Controllers
|
||||
m.Jobs.Fill(Database, Disco.Services.Searching.Search.BuildJobTableModel(Database).Where(j => j.UserId == id).OrderByDescending(j => j.Id), true);
|
||||
}
|
||||
|
||||
if (Authorization.Has(Claims.User.ShowFlagAssignments))
|
||||
{
|
||||
var usedFlags = m.User.UserFlagAssignments
|
||||
.Where(a => !a.RemovedDate.HasValue)
|
||||
.Select(a => a.UserFlagId)
|
||||
.Distinct().ToList();
|
||||
|
||||
m.AvailableUserFlags = UserFlagService.GetUserFlags().Where(f => !usedFlags.Contains(f.Id)).ToList();
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (Authorization.Has(Claims.User.ShowAuthorization))
|
||||
|
||||
@@ -196,6 +196,8 @@
|
||||
</Compile>
|
||||
<Compile Include="App_Start\OwinStartupConfig.cs" />
|
||||
<Compile Include="Areas\API\Controllers\AuthorizationRoleController.cs" />
|
||||
<Compile Include="Areas\API\Controllers\UserFlagAssignmentController.cs" />
|
||||
<Compile Include="Areas\API\Controllers\UserFlagController.cs" />
|
||||
<Compile Include="Areas\API\Controllers\JobPreferencesController.cs" />
|
||||
<Compile Include="Areas\API\Controllers\JobQueueController.cs" />
|
||||
<Compile Include="Areas\API\Controllers\JobQueueJobController.cs" />
|
||||
@@ -205,12 +207,16 @@
|
||||
<Compile Include="Areas\API\Models\Shared\SubjectDescriptorModel.cs" />
|
||||
<Compile Include="Areas\API\Models\System\DomainOrganisationalUnitsModel.cs" />
|
||||
<Compile Include="Areas\Config\Controllers\AuthorizationRoleController.cs" />
|
||||
<Compile Include="Areas\Config\Controllers\UserFlagController.cs" />
|
||||
<Compile Include="Areas\Config\Controllers\JobPreferencesController.cs" />
|
||||
<Compile Include="Areas\Config\Controllers\JobQueueController.cs" />
|
||||
<Compile Include="Areas\Config\Models\AuthorizationRole\CreateModel.cs" />
|
||||
<Compile Include="Areas\Config\Models\AuthorizationRole\IndexModel.cs" />
|
||||
<Compile Include="Areas\Config\Models\AuthorizationRole\ShowModel.cs" />
|
||||
<Compile Include="Areas\Config\Models\Config\IndexModel.cs" />
|
||||
<Compile Include="Areas\Config\Models\UserFlag\CreateModel.cs" />
|
||||
<Compile Include="Areas\Config\Models\UserFlag\IndexModel.cs" />
|
||||
<Compile Include="Areas\Config\Models\UserFlag\ShowModel.cs" />
|
||||
<Compile Include="Areas\Config\Models\DeviceBatch\CreateModel.cs" />
|
||||
<Compile Include="Areas\Config\Models\DeviceBatch\TimelineModel.cs" />
|
||||
<Compile Include="Areas\Config\Models\DeviceBatch\_ShowModelMembership.cs" />
|
||||
@@ -277,6 +283,21 @@
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>TaskStatus.cshtml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Areas\Config\Views\UserFlag\Create.generated.cs">
|
||||
<DependentUpon>Create.cshtml</DependentUpon>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Compile Include="Areas\Config\Views\UserFlag\Index.generated.cs">
|
||||
<DependentUpon>Index.cshtml</DependentUpon>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Compile Include="Areas\Config\Views\UserFlag\Show.generated.cs">
|
||||
<DependentUpon>Show.cshtml</DependentUpon>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Compile Include="Areas\Public\Controllers\HeldDevicesController.cs" />
|
||||
<Compile Include="Areas\Public\Views\HeldDevices\Index.generated.cs">
|
||||
<DependentUpon>Index.cshtml</DependentUpon>
|
||||
@@ -905,6 +926,11 @@
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Show.cshtml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\User\UserParts\_Flags.generated.cs">
|
||||
<DependentUpon>_Flags.cshtml</DependentUpon>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Compile Include="Views\User\UserParts\_Authorization.generated.cs">
|
||||
<DependentUpon>_Authorization.cshtml</DependentUpon>
|
||||
<AutoGen>True</AutoGen>
|
||||
@@ -992,6 +1018,18 @@
|
||||
<Generator>RazorGenerator</Generator>
|
||||
<LastGenOutput>TaskStatus.generated.cs</LastGenOutput>
|
||||
</None>
|
||||
<Content Include="Areas\Config\Views\UserFlag\Create.cshtml">
|
||||
<Generator>RazorGenerator</Generator>
|
||||
<LastGenOutput>Create.generated.cs</LastGenOutput>
|
||||
</Content>
|
||||
<Content Include="Areas\Config\Views\UserFlag\Index.cshtml">
|
||||
<Generator>RazorGenerator</Generator>
|
||||
<LastGenOutput>Index.generated.cs</LastGenOutput>
|
||||
</Content>
|
||||
<Content Include="Areas\Config\Views\UserFlag\Show.cshtml">
|
||||
<Generator>RazorGenerator</Generator>
|
||||
<LastGenOutput>Show.generated.cs</LastGenOutput>
|
||||
</Content>
|
||||
<None Include="Areas\Public\Views\HeldDevices\Index.cshtml">
|
||||
<Generator>RazorGenerator</Generator>
|
||||
<LastGenOutput>Index.generated.cs</LastGenOutput>
|
||||
@@ -1962,6 +2000,10 @@
|
||||
<Generator>RazorGenerator</Generator>
|
||||
<LastGenOutput>Show.generated.cs</LastGenOutput>
|
||||
</None>
|
||||
<Content Include="Views\User\UserParts\_Flags.cshtml">
|
||||
<Generator>RazorGenerator</Generator>
|
||||
<LastGenOutput>_Flags.generated.cs</LastGenOutput>
|
||||
</Content>
|
||||
<None Include="Views\User\UserParts\_Authorization.cshtml">
|
||||
<Generator>RazorGenerator</Generator>
|
||||
<LastGenOutput>_Authorization.generated.cs</LastGenOutput>
|
||||
@@ -2112,7 +2154,7 @@
|
||||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
||||
</WebProjectProperties>
|
||||
</FlavorProperties>
|
||||
<UserProperties BuildVersion_StartDate="2011/7/1" BuildVersion_BuildAction="Both" BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="False" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_UpdateFileVersion="True" />
|
||||
<UserProperties BuildVersion_UpdateFileVersion="True" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildAction="Both" BuildVersion_StartDate="2011/7/1" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
|
||||
@@ -11,6 +11,8 @@ using System.Web.WebPages;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.IO;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using Disco.Services.Interop.ActiveDirectory;
|
||||
|
||||
namespace Disco.Web
|
||||
{
|
||||
@@ -107,12 +109,66 @@ namespace Disco.Web
|
||||
return breadCrumbs;
|
||||
}
|
||||
|
||||
private static Lazy<Regex> _ToMultilineJobRefString = new Lazy<Regex>(() => { return new Regex("(?<![\\&])\\#(\\d+)"); });
|
||||
public static MvcHtmlString ToMultilineJobRefString(this string s)
|
||||
private static Lazy<Regex> htmlCommentJobRegex = new Lazy<Regex>(() => { return new Regex(@"(#(\d+))", RegexOptions.Compiled, TimeSpan.FromSeconds(.1)); });
|
||||
private static Lazy<Regex> htmlCommentUserRegex = new Lazy<Regex>(() => { return new Regex(@"(@([^\s\\]+\\)?([^\s\\]+[\w\d]))", RegexOptions.Compiled, TimeSpan.FromSeconds(.1)); });
|
||||
private static Lazy<Regex> htmlCommentDeviceRegex = new Lazy<Regex>(() => { return new Regex(@"(!([\S]+[\w\d]))", RegexOptions.Compiled, TimeSpan.FromSeconds(.1)); });
|
||||
public static MvcHtmlString ToHtmlComment(this string s)
|
||||
{
|
||||
var multiLineString = HttpUtility.HtmlEncode(s).Replace("\n", "<br />").Replace(Environment.NewLine, "<br />");
|
||||
var urlHelper = new UrlHelper(HttpContext.Current.Request.RequestContext);
|
||||
return new MvcHtmlString(_ToMultilineJobRefString.Value.Replace(multiLineString, string.Format("<a href=\"{0}?id=$1\">#$1</a>", urlHelper.Action(MVC.Job.Show(null)))));
|
||||
var html = HttpUtility.HtmlEncode(s);
|
||||
|
||||
try
|
||||
{
|
||||
// Job Matches
|
||||
html = htmlCommentJobRegex.Value.Replace(html, match => {
|
||||
int jobId;
|
||||
if (int.TryParse(match.Groups[2].Value, out jobId))
|
||||
return string.Format("<a href=\"{2}\" title=\"Job {1}\">{0}</a>", match.Value, jobId, urlHelper.Action(MVC.Job.Show(jobId)));
|
||||
else
|
||||
return match.Value;
|
||||
});
|
||||
|
||||
// User Matches
|
||||
html = htmlCommentUserRegex.Value.Replace(html, match =>
|
||||
{
|
||||
string domainId = match.Groups[2].Value;
|
||||
string userId = match.Groups[3].Value;
|
||||
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(userId))
|
||||
return match.Value;
|
||||
if (string.IsNullOrWhiteSpace(domainId))
|
||||
userId = string.Concat(ActiveDirectory.Context.PrimaryDomain.NetBiosName, @"\", userId);
|
||||
else
|
||||
userId = string.Concat(domainId, userId);
|
||||
|
||||
return string.Format("<a href=\"{2}\" title=\"User {1}\">{0}</a>", match.Value, userId, urlHelper.Action(MVC.User.Show(userId)));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Ignore incorrectly encoded User Ids
|
||||
return match.Value;
|
||||
}
|
||||
});
|
||||
|
||||
// Device Matches
|
||||
html = htmlCommentDeviceRegex.Value.Replace(html, match =>
|
||||
{
|
||||
string deviceSerialNumber = match.Groups[2].Value;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(deviceSerialNumber))
|
||||
return match.Value;
|
||||
|
||||
return string.Format("<a href=\"{2}\" title=\"Device {1}\">{0}</a>", match.Value, deviceSerialNumber, urlHelper.Action(MVC.Device.Show(deviceSerialNumber)));
|
||||
});
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Ignore Encoding Exceptions
|
||||
}
|
||||
|
||||
return new MvcHtmlString(html.Replace("\n", "<br />").Replace(Environment.NewLine, "<br />"));
|
||||
}
|
||||
|
||||
public static IEnumerable<SelectListItem> ToSelectListItems(this IEnumerable<string> Items, string SelectedItem = null)
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using Disco.Models.Services.Authorization;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Models.Services.Authorization;
|
||||
using Disco.Models.Services.Jobs.JobLists;
|
||||
using Disco.Models.UI.User;
|
||||
using Disco.Services.Users.UserFlags;
|
||||
using Disco.Web.Extensions;
|
||||
using Disco.Web.Models.Shared;
|
||||
using System.Collections.Generic;
|
||||
@@ -13,7 +15,10 @@ namespace Disco.Web.Models.User
|
||||
{
|
||||
public Disco.Models.Repository.User User { get; set; }
|
||||
public JobTableModel Jobs { get; set; }
|
||||
public List<Disco.Models.Repository.DocumentTemplate> DocumentTemplates { get; set; }
|
||||
public List<DocumentTemplate> DocumentTemplates { get; set; }
|
||||
|
||||
public List<UserFlag> AvailableUserFlags { get; set; }
|
||||
|
||||
public IAuthorizationToken AuthorizationToken { get; set; }
|
||||
public IClaimNavigatorItem ClaimNavigator { get; set; }
|
||||
|
||||
|
||||
@@ -67,6 +67,8 @@ namespace T4MVC
|
||||
public Disco.Web.Areas.API.Controllers.SearchController Search = new Disco.Web.Areas.API.Controllers.T4MVC_SearchController();
|
||||
public Disco.Web.Areas.API.Controllers.SystemController System = new Disco.Web.Areas.API.Controllers.T4MVC_SystemController();
|
||||
public Disco.Web.Areas.API.Controllers.UserController User = new Disco.Web.Areas.API.Controllers.T4MVC_UserController();
|
||||
public Disco.Web.Areas.API.Controllers.UserFlagAssignmentController UserFlagAssignment = new Disco.Web.Areas.API.Controllers.T4MVC_UserFlagAssignmentController();
|
||||
public Disco.Web.Areas.API.Controllers.UserFlagController UserFlag = new Disco.Web.Areas.API.Controllers.T4MVC_UserFlagController();
|
||||
}
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ConfigClass
|
||||
@@ -86,6 +88,7 @@ namespace T4MVC
|
||||
public Disco.Web.Areas.Config.Controllers.OrganisationController Organisation = new Disco.Web.Areas.Config.Controllers.T4MVC_OrganisationController();
|
||||
public Disco.Web.Areas.Config.Controllers.PluginsController Plugins = new Disco.Web.Areas.Config.Controllers.T4MVC_PluginsController();
|
||||
public Disco.Web.Areas.Config.Controllers.SystemConfigController SystemConfig = new Disco.Web.Areas.Config.Controllers.T4MVC_SystemConfigController();
|
||||
public Disco.Web.Areas.Config.Controllers.UserFlagController UserFlag = new Disco.Web.Areas.Config.Controllers.T4MVC_UserFlagController();
|
||||
public T4MVC.Config.SharedController Shared = new T4MVC.Config.SharedController();
|
||||
}
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
@@ -2517,12 +2520,14 @@ namespace Disco.Web.Controllers
|
||||
{
|
||||
public readonly string _AssignmentHistory = "_AssignmentHistory";
|
||||
public readonly string _Authorization = "_Authorization";
|
||||
public readonly string _Flags = "_Flags";
|
||||
public readonly string _Jobs = "_Jobs";
|
||||
public readonly string _Resources = "_Resources";
|
||||
public readonly string _Subject = "_Subject";
|
||||
}
|
||||
public readonly string _AssignmentHistory = "~/Views/User/UserParts/_AssignmentHistory.cshtml";
|
||||
public readonly string _Authorization = "~/Views/User/UserParts/_Authorization.cshtml";
|
||||
public readonly string _Flags = "~/Views/User/UserParts/_Flags.cshtml";
|
||||
public readonly string _Jobs = "~/Views/User/UserParts/_Jobs.cshtml";
|
||||
public readonly string _Resources = "~/Views/User/UserParts/_Resources.cshtml";
|
||||
public readonly string _Subject = "~/Views/User/UserParts/_Subject.cshtml";
|
||||
@@ -10834,6 +10839,522 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
public partial class UserFlagAssignmentController
|
||||
{
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public UserFlagAssignmentController() { }
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
protected UserFlagAssignmentController(Dummy d) { }
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
protected RedirectToRouteResult RedirectToAction(ActionResult result)
|
||||
{
|
||||
var callInfo = result.GetT4MVCResult();
|
||||
return RedirectToRoute(callInfo.RouteValueDictionary);
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
protected RedirectToRouteResult RedirectToAction(Task<ActionResult> taskResult)
|
||||
{
|
||||
return RedirectToAction(taskResult.Result);
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
protected RedirectToRouteResult RedirectToActionPermanent(ActionResult result)
|
||||
{
|
||||
var callInfo = result.GetT4MVCResult();
|
||||
return RedirectToRoutePermanent(callInfo.RouteValueDictionary);
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
protected RedirectToRouteResult RedirectToActionPermanent(Task<ActionResult> taskResult)
|
||||
{
|
||||
return RedirectToActionPermanent(taskResult.Result);
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult Update()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Update);
|
||||
}
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult UpdateComments()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateComments);
|
||||
}
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult AddUser()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.AddUser);
|
||||
}
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult RemoveUser()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.RemoveUser);
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public UserFlagAssignmentController Actions { get { return MVC.API.UserFlagAssignment; } }
|
||||
[GeneratedCode("T4MVC", "2.0")]
|
||||
public readonly string Area = "API";
|
||||
[GeneratedCode("T4MVC", "2.0")]
|
||||
public readonly string Name = "UserFlagAssignment";
|
||||
[GeneratedCode("T4MVC", "2.0")]
|
||||
public const string NameConst = "UserFlagAssignment";
|
||||
|
||||
static readonly ActionNamesClass s_actions = new ActionNamesClass();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionNamesClass ActionNames { get { return s_actions; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionNamesClass
|
||||
{
|
||||
public readonly string Update = "Update";
|
||||
public readonly string UpdateComments = "UpdateComments";
|
||||
public readonly string AddUser = "AddUser";
|
||||
public readonly string RemoveUser = "RemoveUser";
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionNameConstants
|
||||
{
|
||||
public const string Update = "Update";
|
||||
public const string UpdateComments = "UpdateComments";
|
||||
public const string AddUser = "AddUser";
|
||||
public const string RemoveUser = "RemoveUser";
|
||||
}
|
||||
|
||||
|
||||
static readonly ActionParamsClass_Update s_params_Update = new ActionParamsClass_Update();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_Update UpdateParams { get { return s_params_Update; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_Update
|
||||
{
|
||||
public readonly string id = "id";
|
||||
public readonly string key = "key";
|
||||
public readonly string value = "value";
|
||||
public readonly string redirect = "redirect";
|
||||
}
|
||||
static readonly ActionParamsClass_UpdateComments s_params_UpdateComments = new ActionParamsClass_UpdateComments();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_UpdateComments UpdateCommentsParams { get { return s_params_UpdateComments; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_UpdateComments
|
||||
{
|
||||
public readonly string id = "id";
|
||||
public readonly string Comments = "Comments";
|
||||
public readonly string redirect = "redirect";
|
||||
}
|
||||
static readonly ActionParamsClass_AddUser s_params_AddUser = new ActionParamsClass_AddUser();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_AddUser AddUserParams { get { return s_params_AddUser; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_AddUser
|
||||
{
|
||||
public readonly string id = "id";
|
||||
public readonly string UserId = "UserId";
|
||||
public readonly string Comments = "Comments";
|
||||
}
|
||||
static readonly ActionParamsClass_RemoveUser s_params_RemoveUser = new ActionParamsClass_RemoveUser();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_RemoveUser RemoveUserParams { get { return s_params_RemoveUser; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_RemoveUser
|
||||
{
|
||||
public readonly string id = "id";
|
||||
}
|
||||
static readonly ViewsClass s_views = new ViewsClass();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ViewsClass Views { get { return s_views; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ViewsClass
|
||||
{
|
||||
static readonly _ViewNamesClass s_ViewNames = new _ViewNamesClass();
|
||||
public _ViewNamesClass ViewNames { get { return s_ViewNames; } }
|
||||
public class _ViewNamesClass
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public partial class T4MVC_UserFlagAssignmentController : Disco.Web.Areas.API.Controllers.UserFlagAssignmentController
|
||||
{
|
||||
public T4MVC_UserFlagAssignmentController() : base(Dummy.Instance) { }
|
||||
|
||||
[NonAction]
|
||||
partial void UpdateOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string key, string value, bool? redirect);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult Update(int id, string key, string value, bool? redirect)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Update);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "key", key);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "value", value);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||
UpdateOverride(callInfo, id, key, value, redirect);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void UpdateCommentsOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string Comments, bool? redirect);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult UpdateComments(int id, string Comments, bool? redirect)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateComments);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "Comments", Comments);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||
UpdateCommentsOverride(callInfo, id, Comments, redirect);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void AddUserOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string UserId, string Comments);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult AddUser(int id, string UserId, string Comments)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.AddUser);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "UserId", UserId);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "Comments", Comments);
|
||||
AddUserOverride(callInfo, id, UserId, Comments);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void RemoveUserOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult RemoveUser(int id)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.RemoveUser);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
RemoveUserOverride(callInfo, id);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
public partial class UserFlagController
|
||||
{
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public UserFlagController() { }
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
protected UserFlagController(Dummy d) { }
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
protected RedirectToRouteResult RedirectToAction(ActionResult result)
|
||||
{
|
||||
var callInfo = result.GetT4MVCResult();
|
||||
return RedirectToRoute(callInfo.RouteValueDictionary);
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
protected RedirectToRouteResult RedirectToAction(Task<ActionResult> taskResult)
|
||||
{
|
||||
return RedirectToAction(taskResult.Result);
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
protected RedirectToRouteResult RedirectToActionPermanent(ActionResult result)
|
||||
{
|
||||
var callInfo = result.GetT4MVCResult();
|
||||
return RedirectToRoutePermanent(callInfo.RouteValueDictionary);
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
protected RedirectToRouteResult RedirectToActionPermanent(Task<ActionResult> taskResult)
|
||||
{
|
||||
return RedirectToActionPermanent(taskResult.Result);
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult Update()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Update);
|
||||
}
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult UpdateName()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateName);
|
||||
}
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult UpdateDescription()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateDescription);
|
||||
}
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult UpdateIcon()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateIcon);
|
||||
}
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult UpdateIconColour()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateIconColour);
|
||||
}
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult UpdateIconAndColour()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateIconAndColour);
|
||||
}
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult Delete()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Delete);
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public UserFlagController Actions { get { return MVC.API.UserFlag; } }
|
||||
[GeneratedCode("T4MVC", "2.0")]
|
||||
public readonly string Area = "API";
|
||||
[GeneratedCode("T4MVC", "2.0")]
|
||||
public readonly string Name = "UserFlag";
|
||||
[GeneratedCode("T4MVC", "2.0")]
|
||||
public const string NameConst = "UserFlag";
|
||||
|
||||
static readonly ActionNamesClass s_actions = new ActionNamesClass();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionNamesClass ActionNames { get { return s_actions; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionNamesClass
|
||||
{
|
||||
public readonly string Update = "Update";
|
||||
public readonly string UpdateName = "UpdateName";
|
||||
public readonly string UpdateDescription = "UpdateDescription";
|
||||
public readonly string UpdateIcon = "UpdateIcon";
|
||||
public readonly string UpdateIconColour = "UpdateIconColour";
|
||||
public readonly string UpdateIconAndColour = "UpdateIconAndColour";
|
||||
public readonly string Delete = "Delete";
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionNameConstants
|
||||
{
|
||||
public const string Update = "Update";
|
||||
public const string UpdateName = "UpdateName";
|
||||
public const string UpdateDescription = "UpdateDescription";
|
||||
public const string UpdateIcon = "UpdateIcon";
|
||||
public const string UpdateIconColour = "UpdateIconColour";
|
||||
public const string UpdateIconAndColour = "UpdateIconAndColour";
|
||||
public const string Delete = "Delete";
|
||||
}
|
||||
|
||||
|
||||
static readonly ActionParamsClass_Update s_params_Update = new ActionParamsClass_Update();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_Update UpdateParams { get { return s_params_Update; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_Update
|
||||
{
|
||||
public readonly string id = "id";
|
||||
public readonly string key = "key";
|
||||
public readonly string value = "value";
|
||||
public readonly string redirect = "redirect";
|
||||
}
|
||||
static readonly ActionParamsClass_UpdateName s_params_UpdateName = new ActionParamsClass_UpdateName();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_UpdateName UpdateNameParams { get { return s_params_UpdateName; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_UpdateName
|
||||
{
|
||||
public readonly string id = "id";
|
||||
public readonly string FlagName = "FlagName";
|
||||
public readonly string redirect = "redirect";
|
||||
}
|
||||
static readonly ActionParamsClass_UpdateDescription s_params_UpdateDescription = new ActionParamsClass_UpdateDescription();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_UpdateDescription UpdateDescriptionParams { get { return s_params_UpdateDescription; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_UpdateDescription
|
||||
{
|
||||
public readonly string id = "id";
|
||||
public readonly string Description = "Description";
|
||||
public readonly string redirect = "redirect";
|
||||
}
|
||||
static readonly ActionParamsClass_UpdateIcon s_params_UpdateIcon = new ActionParamsClass_UpdateIcon();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_UpdateIcon UpdateIconParams { get { return s_params_UpdateIcon; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_UpdateIcon
|
||||
{
|
||||
public readonly string id = "id";
|
||||
public readonly string Icon = "Icon";
|
||||
public readonly string redirect = "redirect";
|
||||
}
|
||||
static readonly ActionParamsClass_UpdateIconColour s_params_UpdateIconColour = new ActionParamsClass_UpdateIconColour();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_UpdateIconColour UpdateIconColourParams { get { return s_params_UpdateIconColour; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_UpdateIconColour
|
||||
{
|
||||
public readonly string id = "id";
|
||||
public readonly string IconColour = "IconColour";
|
||||
public readonly string redirect = "redirect";
|
||||
}
|
||||
static readonly ActionParamsClass_UpdateIconAndColour s_params_UpdateIconAndColour = new ActionParamsClass_UpdateIconAndColour();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_UpdateIconAndColour UpdateIconAndColourParams { get { return s_params_UpdateIconAndColour; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_UpdateIconAndColour
|
||||
{
|
||||
public readonly string id = "id";
|
||||
public readonly string Icon = "Icon";
|
||||
public readonly string IconColour = "IconColour";
|
||||
public readonly string redirect = "redirect";
|
||||
}
|
||||
static readonly ActionParamsClass_Delete s_params_Delete = new ActionParamsClass_Delete();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_Delete DeleteParams { get { return s_params_Delete; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_Delete
|
||||
{
|
||||
public readonly string id = "id";
|
||||
public readonly string redirect = "redirect";
|
||||
}
|
||||
static readonly ViewsClass s_views = new ViewsClass();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ViewsClass Views { get { return s_views; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ViewsClass
|
||||
{
|
||||
static readonly _ViewNamesClass s_ViewNames = new _ViewNamesClass();
|
||||
public _ViewNamesClass ViewNames { get { return s_ViewNames; } }
|
||||
public class _ViewNamesClass
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public partial class T4MVC_UserFlagController : Disco.Web.Areas.API.Controllers.UserFlagController
|
||||
{
|
||||
public T4MVC_UserFlagController() : base(Dummy.Instance) { }
|
||||
|
||||
[NonAction]
|
||||
partial void UpdateOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string key, string value, bool? redirect);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult Update(int id, string key, string value, bool? redirect)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Update);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "key", key);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "value", value);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||
UpdateOverride(callInfo, id, key, value, redirect);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void UpdateNameOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string FlagName, bool? redirect);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult UpdateName(int id, string FlagName, bool? redirect)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateName);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "FlagName", FlagName);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||
UpdateNameOverride(callInfo, id, FlagName, redirect);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void UpdateDescriptionOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string Description, bool? redirect);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult UpdateDescription(int id, string Description, bool? redirect)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateDescription);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "Description", Description);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||
UpdateDescriptionOverride(callInfo, id, Description, redirect);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void UpdateIconOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string Icon, bool? redirect);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult UpdateIcon(int id, string Icon, bool? redirect)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateIcon);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "Icon", Icon);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||
UpdateIconOverride(callInfo, id, Icon, redirect);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void UpdateIconColourOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string IconColour, bool? redirect);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult UpdateIconColour(int id, string IconColour, bool? redirect)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateIconColour);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "IconColour", IconColour);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||
UpdateIconColourOverride(callInfo, id, IconColour, redirect);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void UpdateIconAndColourOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string Icon, string IconColour, bool redirect);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult UpdateIconAndColour(int id, string Icon, string IconColour, bool redirect)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateIconAndColour);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "Icon", Icon);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "IconColour", IconColour);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||
UpdateIconAndColourOverride(callInfo, id, Icon, IconColour, redirect);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void DeleteOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, bool? redirect);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult Delete(int id, bool? redirect)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Delete);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||
DeleteOverride(callInfo, id, redirect);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
namespace Disco.Web.Areas.Config.Controllers
|
||||
{
|
||||
public partial class AuthorizationRoleController
|
||||
@@ -12703,6 +13224,155 @@ namespace Disco.Web.Areas.Config.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
namespace Disco.Web.Areas.Config.Controllers
|
||||
{
|
||||
public partial class UserFlagController
|
||||
{
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public UserFlagController() { }
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
protected UserFlagController(Dummy d) { }
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
protected RedirectToRouteResult RedirectToAction(ActionResult result)
|
||||
{
|
||||
var callInfo = result.GetT4MVCResult();
|
||||
return RedirectToRoute(callInfo.RouteValueDictionary);
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
protected RedirectToRouteResult RedirectToAction(Task<ActionResult> taskResult)
|
||||
{
|
||||
return RedirectToAction(taskResult.Result);
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
protected RedirectToRouteResult RedirectToActionPermanent(ActionResult result)
|
||||
{
|
||||
var callInfo = result.GetT4MVCResult();
|
||||
return RedirectToRoutePermanent(callInfo.RouteValueDictionary);
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
protected RedirectToRouteResult RedirectToActionPermanent(Task<ActionResult> taskResult)
|
||||
{
|
||||
return RedirectToActionPermanent(taskResult.Result);
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult Index()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Index);
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public UserFlagController Actions { get { return MVC.Config.UserFlag; } }
|
||||
[GeneratedCode("T4MVC", "2.0")]
|
||||
public readonly string Area = "Config";
|
||||
[GeneratedCode("T4MVC", "2.0")]
|
||||
public readonly string Name = "UserFlag";
|
||||
[GeneratedCode("T4MVC", "2.0")]
|
||||
public const string NameConst = "UserFlag";
|
||||
|
||||
static readonly ActionNamesClass s_actions = new ActionNamesClass();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionNamesClass ActionNames { get { return s_actions; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionNamesClass
|
||||
{
|
||||
public readonly string Index = "Index";
|
||||
public readonly string Create = "Create";
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionNameConstants
|
||||
{
|
||||
public const string Index = "Index";
|
||||
public const string Create = "Create";
|
||||
}
|
||||
|
||||
|
||||
static readonly ActionParamsClass_Index s_params_Index = new ActionParamsClass_Index();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_Index IndexParams { get { return s_params_Index; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_Index
|
||||
{
|
||||
public readonly string id = "id";
|
||||
}
|
||||
static readonly ActionParamsClass_Create s_params_Create = new ActionParamsClass_Create();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_Create CreateParams { get { return s_params_Create; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_Create
|
||||
{
|
||||
public readonly string model = "model";
|
||||
}
|
||||
static readonly ViewsClass s_views = new ViewsClass();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ViewsClass Views { get { return s_views; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ViewsClass
|
||||
{
|
||||
static readonly _ViewNamesClass s_ViewNames = new _ViewNamesClass();
|
||||
public _ViewNamesClass ViewNames { get { return s_ViewNames; } }
|
||||
public class _ViewNamesClass
|
||||
{
|
||||
public readonly string Create = "Create";
|
||||
public readonly string Index = "Index";
|
||||
public readonly string Show = "Show";
|
||||
}
|
||||
public readonly string Create = "~/Areas/Config/Views/UserFlag/Create.cshtml";
|
||||
public readonly string Index = "~/Areas/Config/Views/UserFlag/Index.cshtml";
|
||||
public readonly string Show = "~/Areas/Config/Views/UserFlag/Show.cshtml";
|
||||
}
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public partial class T4MVC_UserFlagController : Disco.Web.Areas.Config.Controllers.UserFlagController
|
||||
{
|
||||
public T4MVC_UserFlagController() : base(Dummy.Instance) { }
|
||||
|
||||
[NonAction]
|
||||
partial void IndexOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int? id);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult Index(int? id)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Index);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
IndexOverride(callInfo, id);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void CreateOverride(T4MVC_System_Web_Mvc_ActionResult callInfo);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult Create()
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Create);
|
||||
CreateOverride(callInfo);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void CreateOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, Disco.Web.Areas.Config.Models.UserFlag.CreateModel model);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult Create(Disco.Web.Areas.Config.Models.UserFlag.CreateModel model)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Create);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "model", model);
|
||||
CreateOverride(callInfo, model);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
namespace T4MVC.Config
|
||||
{
|
||||
public class SharedController
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@model Disco.Web.Models.Device.ShowModel
|
||||
@using Disco.Services.Users.UserFlags;
|
||||
@{
|
||||
Authorization.Require(Claims.Device.Show);
|
||||
|
||||
@@ -210,6 +211,46 @@
|
||||
<div id="Device_Show_User_EmailAddress" title="Email Address"><a href="mailto:@(Model.Device.AssignedUser.EmailAddress)">@assignedUser.EmailAddress</a></div>
|
||||
}
|
||||
}
|
||||
@if (Authorization.Has(Claims.User.ShowFlagAssignments))
|
||||
{
|
||||
<div id="Device_Show_User_Flags">
|
||||
@foreach (var flag in assignedUser.UserFlagAssignments.Where(f => !f.RemovedDate.HasValue).Select(f => Tuple.Create(f, UserFlagService.GetUserFlag(f.UserFlagId))))
|
||||
{
|
||||
<i class="flag fa fa-@(flag.Item2.Icon) fa-fw d-@(flag.Item2.IconColour)"><span class="details"><span class="name">@flag.Item2.Name</span>@if (flag.Item1.Comments != null)
|
||||
{<span class="comments">@flag.Item1.Comments.ToHtmlComment()</span>}<span class="added">@CommonHelpers.FriendlyDateAndUser(flag.Item1.AddedDate, flag.Item1.AddedUserId)</span></span></i>
|
||||
}
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#Device_Show_User_Flags')
|
||||
.tooltip({
|
||||
items: 'i.flag',
|
||||
content: function () {
|
||||
var $this = $(this);
|
||||
return $this.children('.details').html();
|
||||
},
|
||||
tooltipClass: 'User_FlagAssignment_Tooltip',
|
||||
position: {
|
||||
my: "right top",
|
||||
at: "right bottom",
|
||||
collision: "flipfit flip"
|
||||
},
|
||||
hade: {
|
||||
effect: ''
|
||||
},
|
||||
close: function (e, ui) {
|
||||
ui.tooltip.hover(
|
||||
function () {
|
||||
$(this).stop(true).fadeTo(100, 1);
|
||||
},
|
||||
function () {
|
||||
$(this).fadeOut(100, function () { $(this).remove(); });
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
else
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -11,7 +11,7 @@
|
||||
var hasJobQueueShow = Authorization.Has(Claims.Config.JobQueue.Show);
|
||||
|
||||
var queues = JobQueueService.GetQueues();
|
||||
var queueHistory = Model.Job.JobQueues.Select(jq => new Tuple<JobQueueJob, JobQueueToken>(jq, queues.First(q => q.JobQueue.Id == jq.JobQueueId))).OrderBy(jq => jq.Item1.AddedDate).ToList();
|
||||
var queueHistory = Model.Job.JobQueues.Select(jq => new Tuple<JobQueueJob, JobQueueToken>(jq, queues.First(q => q.JobQueue.Id == jq.JobQueueId))).ToList();
|
||||
}
|
||||
@if (queueHistory.Count > 0)
|
||||
{
|
||||
@@ -52,7 +52,8 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="comments">@jq.Item1.AddedComment</div>
|
||||
<div class="comments">@jq.Item1.AddedComment.ToHtmlComment()</div>
|
||||
<div class="commentsRaw">@jq.Item1.AddedComment</div>
|
||||
}
|
||||
<div class="when">@CommonHelpers.FriendlyDateAndUser(jq.Item1.AddedDate, jq.Item1.AddedUser)</div>
|
||||
</td>
|
||||
@@ -69,7 +70,8 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="comments">@jq.Item1.RemovedComment</div>
|
||||
<div class="comments">@jq.Item1.RemovedComment.ToHtmlComment()</div>
|
||||
<div class="commentsRaw">@jq.Item1.RemovedComment</div>
|
||||
}
|
||||
<div class="when">@CommonHelpers.FriendlyDateAndUser(jq.Item1.RemovedDate.Value, jq.Item1.RemovedUser)</div>
|
||||
}
|
||||
@@ -250,7 +252,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
var $comments = $this.closest('td').find('.comments');
|
||||
var $comments = $this.closest('td').find('.commentsRaw');
|
||||
if ($comments.hasClass('smallMessage')) {
|
||||
$('#Job_Show_Queues_Actions_EditAddedComment_Dialog_Comment').val('');
|
||||
} else {
|
||||
@@ -288,7 +290,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
var $comments = $this.closest('td').find('.comments');
|
||||
var $comments = $this.closest('td').find('.commentsRaw');
|
||||
if ($comments.hasClass('smallMessage')) {
|
||||
$('#Job_Show_Queues_Actions_EditRemovedComment_Dialog_Comment').val('');
|
||||
} else {
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace Disco.Web.Views.Job.JobParts
|
||||
var hasJobQueueShow = Authorization.Has(Claims.Config.JobQueue.Show);
|
||||
|
||||
var queues = JobQueueService.GetQueues();
|
||||
var queueHistory = Model.Job.JobQueues.Select(jq => new Tuple<JobQueueJob, JobQueueToken>(jq, queues.First(q => q.JobQueue.Id == jq.JobQueueId))).OrderBy(jq => jq.Item1.AddedDate).ToList();
|
||||
var queueHistory = Model.Job.JobQueues.Select(jq => new Tuple<JobQueueJob, JobQueueToken>(jq, queues.First(q => q.JobQueue.Id == jq.JobQueueId))).ToList();
|
||||
|
||||
|
||||
#line default
|
||||
@@ -139,14 +139,14 @@ WriteLiteral(" data-jobqueuejobaddeddate=\"");
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 1405), Tuple.Create("\"", 1468)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 1371), Tuple.Create("\"", 1434)
|
||||
|
||||
#line 28 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1413), Tuple.Create<System.Object, System.Int32>(!jq.Item1.RemovedDate.HasValue ? "added" : "removed"
|
||||
, Tuple.Create(Tuple.Create("", 1379), Tuple.Create<System.Object, System.Int32>(!jq.Item1.RemovedDate.HasValue ? "added" : "removed"
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1413), false)
|
||||
, 1379), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <td");
|
||||
@@ -155,26 +155,26 @@ WriteLiteral(" class=\"name\"");
|
||||
|
||||
WriteLiteral(">\r\n <i");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 1529), Tuple.Create("\"", 1614)
|
||||
, Tuple.Create(Tuple.Create("", 1537), Tuple.Create("fa", 1537), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 1539), Tuple.Create("fa-", 1540), true)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 1495), Tuple.Create("\"", 1580)
|
||||
, Tuple.Create(Tuple.Create("", 1503), Tuple.Create("fa", 1503), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 1505), Tuple.Create("fa-", 1506), true)
|
||||
|
||||
#line 30 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1543), Tuple.Create<System.Object, System.Int32>(jq.Item2.JobQueue.Icon
|
||||
, Tuple.Create(Tuple.Create("", 1509), Tuple.Create<System.Object, System.Int32>(jq.Item2.JobQueue.Icon
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1543), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 1568), Tuple.Create("fa-fw", 1569), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 1574), Tuple.Create("fa-lg", 1575), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 1580), Tuple.Create("d-", 1581), true)
|
||||
, 1509), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 1534), Tuple.Create("fa-fw", 1535), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 1540), Tuple.Create("fa-lg", 1541), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 1546), Tuple.Create("d-", 1547), true)
|
||||
|
||||
#line 30 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1583), Tuple.Create<System.Object, System.Int32>(jq.Item2.JobQueue.IconColour
|
||||
, Tuple.Create(Tuple.Create("", 1549), Tuple.Create<System.Object, System.Int32>(jq.Item2.JobQueue.IconColour
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1583), false)
|
||||
, 1549), false)
|
||||
);
|
||||
|
||||
WriteLiteral("></i>\r\n");
|
||||
@@ -237,28 +237,28 @@ WriteLiteral(" ");
|
||||
#line hidden
|
||||
WriteLiteral(" <i");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 2077), Tuple.Create("\"", 2149)
|
||||
, Tuple.Create(Tuple.Create("", 2085), Tuple.Create("fa", 2085), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 2087), Tuple.Create("d-priority-", 2088), true)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 2043), Tuple.Create("\"", 2115)
|
||||
, Tuple.Create(Tuple.Create("", 2051), Tuple.Create("fa", 2051), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 2053), Tuple.Create("d-priority-", 2054), true)
|
||||
|
||||
#line 41 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 2099), Tuple.Create<System.Object, System.Int32>(jq.Item2.JobQueue.Priority.ToString().ToLower()
|
||||
, Tuple.Create(Tuple.Create("", 2065), Tuple.Create<System.Object, System.Int32>(jq.Item2.JobQueue.Priority.ToString().ToLower()
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 2099), false)
|
||||
, 2065), false)
|
||||
);
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 2150), Tuple.Create("\"", 2213)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 2116), Tuple.Create("\"", 2179)
|
||||
|
||||
#line 41 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 2158), Tuple.Create<System.Object, System.Int32>(jq.Item2.JobQueue.Priority.ToString()
|
||||
, Tuple.Create(Tuple.Create("", 2124), Tuple.Create<System.Object, System.Int32>(jq.Item2.JobQueue.Priority.ToString()
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 2158), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 2198), Tuple.Create("Queue", 2199), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 2204), Tuple.Create("Priority", 2205), true)
|
||||
, 2124), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 2164), Tuple.Create("Queue", 2165), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 2170), Tuple.Create("Priority", 2171), true)
|
||||
);
|
||||
|
||||
WriteLiteral("></i>\r\n");
|
||||
@@ -338,7 +338,22 @@ WriteLiteral(">");
|
||||
|
||||
|
||||
#line 55 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
Write(jq.Item1.AddedComment);
|
||||
Write(jq.Item1.AddedComment.ToHtmlComment());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</div>\r\n");
|
||||
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"commentsRaw\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 56 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
Write(jq.Item1.AddedComment);
|
||||
|
||||
|
||||
#line default
|
||||
@@ -346,7 +361,7 @@ WriteLiteral(">");
|
||||
WriteLiteral("</div>\r\n");
|
||||
|
||||
|
||||
#line 56 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 57 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -359,7 +374,7 @@ WriteLiteral(" class=\"when\"");
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 57 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 58 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
Write(CommonHelpers.FriendlyDateAndUser(jq.Item1.AddedDate, jq.Item1.AddedUser));
|
||||
|
||||
|
||||
@@ -367,27 +382,27 @@ WriteLiteral(">");
|
||||
#line hidden
|
||||
WriteLiteral("</div>\r\n </td>\r\n <td");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 2978), Tuple.Create("\"", 3041)
|
||||
, Tuple.Create(Tuple.Create("", 2986), Tuple.Create("removed", 2986), true)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 3039), Tuple.Create("\"", 3102)
|
||||
, Tuple.Create(Tuple.Create("", 3047), Tuple.Create("removed", 3047), true)
|
||||
|
||||
#line 59 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 2993), Tuple.Create<System.Object, System.Int32>(!jq.Item1.RemovedDate.HasValue ? " na" : null
|
||||
#line 60 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 3054), Tuple.Create<System.Object, System.Int32>(!jq.Item1.RemovedDate.HasValue ? " na" : null
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 2993), false)
|
||||
, 3054), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 60 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 61 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 60 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 61 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
if (jq.Item1.RemovedDate.HasValue)
|
||||
{
|
||||
if (jq.Item1.CanEditRemovedComment())
|
||||
@@ -405,7 +420,7 @@ WriteLiteral(" title=\"Edit Comment\"");
|
||||
WriteLiteral("></i>\r\n");
|
||||
|
||||
|
||||
#line 65 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 66 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
}
|
||||
if (jq.Item1.RemovedComment == null)
|
||||
{
|
||||
@@ -420,7 +435,7 @@ WriteLiteral(" class=\"comments smallMessage\"");
|
||||
WriteLiteral(">[no comment]</div>\r\n");
|
||||
|
||||
|
||||
#line 69 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 70 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -435,8 +450,23 @@ WriteLiteral(" class=\"comments\"");
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 72 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
Write(jq.Item1.RemovedComment);
|
||||
#line 73 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
Write(jq.Item1.RemovedComment.ToHtmlComment());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</div>\r\n");
|
||||
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"commentsRaw\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 74 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
Write(jq.Item1.RemovedComment);
|
||||
|
||||
|
||||
#line default
|
||||
@@ -444,7 +474,7 @@ WriteLiteral(">");
|
||||
WriteLiteral("</div>\r\n");
|
||||
|
||||
|
||||
#line 73 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 75 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -457,7 +487,7 @@ WriteLiteral(" class=\"when\"");
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 74 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 76 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
Write(CommonHelpers.FriendlyDateAndUser(jq.Item1.RemovedDate.Value, jq.Item1.RemovedUser));
|
||||
|
||||
|
||||
@@ -466,7 +496,7 @@ WriteLiteral(">");
|
||||
WriteLiteral("</div>\r\n");
|
||||
|
||||
|
||||
#line 75 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 77 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
}
|
||||
else if (jq.Item1.CanRemove())
|
||||
{
|
||||
@@ -478,23 +508,23 @@ WriteLiteral(" <a");
|
||||
|
||||
WriteLiteral(" href=\"#\"");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 3945), Tuple.Create("\"", 4046)
|
||||
, Tuple.Create(Tuple.Create("", 3953), Tuple.Create("button", 3953), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 3959), Tuple.Create("small", 3960), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 3965), Tuple.Create("remove", 3966), true)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 4103), Tuple.Create("\"", 4204)
|
||||
, Tuple.Create(Tuple.Create("", 4111), Tuple.Create("button", 4111), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 4117), Tuple.Create("small", 4118), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 4123), Tuple.Create("remove", 4124), true)
|
||||
|
||||
#line 78 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
, Tuple.Create(Tuple.Create(" ", 3972), Tuple.Create<System.Object, System.Int32>(jq.Item1.CanCloseJobNormallyAfterRemoved() ? "canCloseNormally" : null
|
||||
#line 80 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
, Tuple.Create(Tuple.Create(" ", 4130), Tuple.Create<System.Object, System.Int32>(jq.Item1.CanCloseJobNormallyAfterRemoved() ? "canCloseNormally" : null
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 3973), false)
|
||||
, 4131), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">Remove</a>\r\n");
|
||||
|
||||
|
||||
#line 79 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 81 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -509,7 +539,7 @@ WriteLiteral(" class=\"smallMessage\"");
|
||||
WriteLiteral(">In Progress</span>\r\n");
|
||||
|
||||
|
||||
#line 83 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 85 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -517,35 +547,35 @@ WriteLiteral(">In Progress</span>\r\n");
|
||||
#line hidden
|
||||
WriteLiteral(" </td>\r\n <td");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 4268), Tuple.Create("\"", 4413)
|
||||
, Tuple.Create(Tuple.Create("", 4276), Tuple.Create("sla", 4276), true)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 4426), Tuple.Create("\"", 4571)
|
||||
, Tuple.Create(Tuple.Create("", 4434), Tuple.Create("sla", 4434), true)
|
||||
|
||||
#line 85 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
, Tuple.Create(Tuple.Create(" ", 4279), Tuple.Create<System.Object, System.Int32>(overdue ? "overdue" : null
|
||||
#line 87 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
, Tuple.Create(Tuple.Create(" ", 4437), Tuple.Create<System.Object, System.Int32>(overdue ? "overdue" : null
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4280), false)
|
||||
, 4438), false)
|
||||
|
||||
#line 85 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
, Tuple.Create(Tuple.Create(" ", 4309), Tuple.Create<System.Object, System.Int32>(jq.Item1.CanEditSla() ? "canEditSLA" : null
|
||||
#line 87 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
, Tuple.Create(Tuple.Create(" ", 4467), Tuple.Create<System.Object, System.Int32>(jq.Item1.CanEditSla() ? "canEditSLA" : null
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4310), false)
|
||||
, 4468), false)
|
||||
|
||||
#line 85 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
, Tuple.Create(Tuple.Create(" ", 4356), Tuple.Create<System.Object, System.Int32>(jq.Item1.CanEditPriority() ? "canEditPriority" : null
|
||||
#line 87 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
, Tuple.Create(Tuple.Create(" ", 4514), Tuple.Create<System.Object, System.Int32>(jq.Item1.CanEditPriority() ? "canEditPriority" : null
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4357), false)
|
||||
, 4515), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" data-priority=\"");
|
||||
|
||||
|
||||
#line 85 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 87 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
Write(jq.Item1.Priority.ToString());
|
||||
|
||||
|
||||
@@ -556,7 +586,7 @@ WriteLiteral("\"");
|
||||
WriteLiteral(" data-sla=\"");
|
||||
|
||||
|
||||
#line 85 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 87 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
Write(jq.Item1.SLAExpiresDate.HasValue ? jq.Item1.SLAExpiresDate.Value.ToString("s") : null);
|
||||
|
||||
|
||||
@@ -567,13 +597,13 @@ WriteLiteral("\"");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 86 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 88 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 86 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 88 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
if (jq.Item1.CanEditSla() || jq.Item1.CanEditPriority())
|
||||
{
|
||||
|
||||
@@ -589,7 +619,7 @@ WriteLiteral(" title=\"Edit SLA\"");
|
||||
WriteLiteral("></i>\r\n");
|
||||
|
||||
|
||||
#line 89 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 91 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -597,40 +627,40 @@ WriteLiteral("></i>\r\n");
|
||||
#line hidden
|
||||
WriteLiteral(" <i");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 4787), Tuple.Create("\"", 4850)
|
||||
, Tuple.Create(Tuple.Create("", 4795), Tuple.Create("fa", 4795), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 4797), Tuple.Create("d-priority-", 4798), true)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 4945), Tuple.Create("\"", 5008)
|
||||
, Tuple.Create(Tuple.Create("", 4953), Tuple.Create("fa", 4953), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 4955), Tuple.Create("d-priority-", 4956), true)
|
||||
|
||||
#line 90 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4809), Tuple.Create<System.Object, System.Int32>(jq.Item1.Priority.ToString().ToLower()
|
||||
#line 92 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4967), Tuple.Create<System.Object, System.Int32>(jq.Item1.Priority.ToString().ToLower()
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4809), false)
|
||||
, 4967), false)
|
||||
);
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 4851), Tuple.Create("\"", 4903)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 5009), Tuple.Create("\"", 5061)
|
||||
|
||||
#line 90 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4859), Tuple.Create<System.Object, System.Int32>(jq.Item1.Priority.ToString()
|
||||
#line 92 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 5017), Tuple.Create<System.Object, System.Int32>(jq.Item1.Priority.ToString()
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4859), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 4890), Tuple.Create("Job", 4891), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 4894), Tuple.Create("Priority", 4895), true)
|
||||
, 5017), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 5048), Tuple.Create("Job", 5049), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 5052), Tuple.Create("Priority", 5053), true)
|
||||
);
|
||||
|
||||
WriteLiteral("></i>\r\n");
|
||||
|
||||
|
||||
#line 91 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 93 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 91 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 93 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
if (jq.Item1.SLAExpiresDate.HasValue)
|
||||
{
|
||||
if (jq.Item1.RemovedDate.HasValue)
|
||||
@@ -640,14 +670,14 @@ WriteLiteral("></i>\r\n");
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 95 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 97 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
Write(CommonHelpers.FriendlyDate(jq.Item1.SLAExpiresDate.Value, WithoutSuffix: true));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 95 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 97 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
|
||||
if (jq.Item1.RemovedDate.Value <= jq.Item1.SLAExpiresDate.Value)
|
||||
{
|
||||
@@ -658,7 +688,7 @@ WriteLiteral("></i>\r\n");
|
||||
WriteLiteral(" <span>early</span>\r\n");
|
||||
|
||||
|
||||
#line 99 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 101 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -669,7 +699,7 @@ WriteLiteral(" <span>early</span>\r\n");
|
||||
WriteLiteral(" <span>late</span>\r\n");
|
||||
|
||||
|
||||
#line 103 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 105 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -681,20 +711,20 @@ WriteLiteral(" <span>late</span>\r\n");
|
||||
WriteLiteral(" <span>due </span>");
|
||||
|
||||
|
||||
#line 107 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 109 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 107 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 109 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
Write(CommonHelpers.FriendlyDate(jq.Item1.SLAExpiresDate.Value));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 107 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 109 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
|
||||
}
|
||||
}
|
||||
@@ -705,7 +735,7 @@ WriteLiteral(" <span>due </span>");
|
||||
WriteLiteral(" </td>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 112 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 114 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -724,13 +754,13 @@ WriteLiteral(" title=\"Remove this Job from the queue?\"");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 115 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 117 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 115 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 117 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
using (Html.BeginForm(MVC.API.JobQueueJob.RemoveJob()))
|
||||
{
|
||||
|
||||
@@ -786,7 +816,7 @@ WriteLiteral(" for=\"Job_Show_Queues_Actions_Remove_Dialog_CloseJob\"");
|
||||
WriteLiteral(">Close the Job</label>\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 129 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 131 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -805,13 +835,13 @@ WriteLiteral(" title=\"Edit the Added Comment\"");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 132 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 134 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 132 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 134 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
using (Html.BeginForm(MVC.API.JobQueueJob.UpdateAddedComment()))
|
||||
{
|
||||
|
||||
@@ -853,7 +883,7 @@ WriteLiteral(" class=\"block\"");
|
||||
WriteLiteral("></textarea>\r\n </p>\r\n");
|
||||
|
||||
|
||||
#line 140 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 142 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -872,13 +902,13 @@ WriteLiteral(" title=\"Edit the Removed Comment\"");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 143 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 145 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 143 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 145 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
using (Html.BeginForm(MVC.API.JobQueueJob.UpdateRemovedComment()))
|
||||
{
|
||||
|
||||
@@ -920,7 +950,7 @@ WriteLiteral(" class=\"block\"");
|
||||
WriteLiteral("></textarea>\r\n </p>\r\n");
|
||||
|
||||
|
||||
#line 151 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 153 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -939,13 +969,13 @@ WriteLiteral(" title=\"Edit the SLA\"");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 154 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 156 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 154 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 156 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
using (Html.BeginForm(MVC.API.JobQueueJob.UpdateSlaAndPriority()))
|
||||
{
|
||||
|
||||
@@ -994,13 +1024,13 @@ WriteLiteral(" autofocus=\"autofocus\"");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 163 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 165 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 163 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 165 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
foreach (var priorityItem in Enum.GetNames(typeof(JobQueuePriority)))
|
||||
{
|
||||
|
||||
@@ -1009,20 +1039,20 @@ WriteLiteral(">\r\n");
|
||||
#line hidden
|
||||
WriteLiteral(" <option");
|
||||
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 8686), Tuple.Create("\"", 8709)
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 8844), Tuple.Create("\"", 8867)
|
||||
|
||||
#line 165 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 8694), Tuple.Create<System.Object, System.Int32>(priorityItem
|
||||
#line 167 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 8852), Tuple.Create<System.Object, System.Int32>(priorityItem
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 8694), false)
|
||||
, 8852), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 165 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 167 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
Write(priorityItem);
|
||||
|
||||
|
||||
@@ -1031,7 +1061,7 @@ WriteLiteral(">");
|
||||
WriteLiteral("</option>\r\n");
|
||||
|
||||
|
||||
#line 166 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 168 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -1057,7 +1087,7 @@ WriteLiteral(" placeholder=\"None\"");
|
||||
WriteLiteral(" />\r\n </p>\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 176 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 178 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -1080,7 +1110,7 @@ WriteLiteral(@">
|
||||
var dialogEditSla_BothUrl = '");
|
||||
|
||||
|
||||
#line 186 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 188 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
Write(Url.Action(MVC.API.JobQueueJob.UpdateSlaAndPriority()));
|
||||
|
||||
|
||||
@@ -1089,7 +1119,7 @@ WriteLiteral(@">
|
||||
WriteLiteral("\';\r\n var dialogEditSla_SlaUrl = \'");
|
||||
|
||||
|
||||
#line 187 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 189 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
Write(Url.Action(MVC.API.JobQueueJob.UpdateSla()));
|
||||
|
||||
|
||||
@@ -1098,7 +1128,7 @@ WriteLiteral("\';\r\n var dialogEditSla_SlaUrl = \'");
|
||||
WriteLiteral("\';\r\n var dialogEditSla_PriorityUrl = \'");
|
||||
|
||||
|
||||
#line 188 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 190 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
Write(Url.Action(MVC.API.JobQueueJob.UpdatePriority()));
|
||||
|
||||
|
||||
@@ -1139,88 +1169,88 @@ WriteLiteral("\';\r\n\r\n jobQueues.on(\'click\', \'a.remove\', funct
|
||||
" },\r\n Cancel: function () {\r\n " +
|
||||
" $(this).dialog(\"close\");\r\n }\r\n " +
|
||||
" }\r\n });\r\n }\r\n\r\n " +
|
||||
" var $comments = $this.closest(\'td\').find(\'.comments\');\r\n if " +
|
||||
"($comments.hasClass(\'smallMessage\')) {\r\n $(\'#Job_Show_Queues_" +
|
||||
"Actions_EditAddedComment_Dialog_Comment\').val(\'\');\r\n } else {\r\n " +
|
||||
" $(\'#Job_Show_Queues_Actions_EditAddedComment_Dialog_Comment\')." +
|
||||
"val($comments.text());\r\n }\r\n\r\n $(\'#Job_Show_Queues" +
|
||||
"_Actions_EditAddedComment_Dialog_Id\').val(jobQueueJobId);\r\n dialo" +
|
||||
"gEditAddedComment.dialog(\'open\');\r\n e.preventDefault();\r\n " +
|
||||
" return false;\r\n });\r\n\r\n jobQueues.on(\'click\', \'td." +
|
||||
"removed i.fa-edit\', function (e) {\r\n var $this = $(this);\r\n " +
|
||||
" var jobQueueJobId = $this.closest(\'tr\').attr(\'data-jobqueuejobid\');\r\n\r" +
|
||||
"\n if (!dialogEditRemovedComment) {\r\n dialogEdi" +
|
||||
"tRemovedComment = $(\'#Job_Show_Queues_Actions_EditRemovedComment_Dialog\');\r\n " +
|
||||
" dialogEditRemovedComment.dialog({\r\n resiz" +
|
||||
"able: false,\r\n modal: true,\r\n widt" +
|
||||
"h: 320,\r\n autoOpen: false,\r\n butto" +
|
||||
"ns: {\r\n \"Save Changes\": function () {\r\n " +
|
||||
" var $this = $(this);\r\n $this.di" +
|
||||
"alog(\"disable\");\r\n $this.dialog(\"option\", \"button" +
|
||||
"s\", null);\r\n $this.find(\'form\').submit();\r\n " +
|
||||
" },\r\n Cancel: function () {\r\n " +
|
||||
" $(this).dialog(\"close\");\r\n " +
|
||||
" }\r\n }\r\n });\r\n }\r\n\r\n " +
|
||||
" var $comments = $this.closest(\'td\').find(\'.comments\');\r\n " +
|
||||
" if ($comments.hasClass(\'smallMessage\')) {\r\n $(\'#Job_Sh" +
|
||||
"ow_Queues_Actions_EditRemovedComment_Dialog_Comment\').val(\'\');\r\n " +
|
||||
"} else {\r\n $(\'#Job_Show_Queues_Actions_EditRemovedComment_Dia" +
|
||||
"log_Comment\').val($comments.text());\r\n }\r\n\r\n $(\'#J" +
|
||||
"ob_Show_Queues_Actions_EditRemovedComment_Dialog_Id\').val(jobQueueJobId);\r\n " +
|
||||
" dialogEditRemovedComment.dialog(\'open\');\r\n e.preventDe" +
|
||||
"fault();\r\n return false;\r\n });\r\n\r\n jobQueue" +
|
||||
"s.on(\'click\', \'td.sla i.fa-edit\', function (e) {\r\n var $this = $(" +
|
||||
"this);\r\n var jobQueueJobId = $this.closest(\'tr\').attr(\'data-jobqu" +
|
||||
"euejobid\');\r\n\r\n var priorityChange = function () {\r\n " +
|
||||
" var $element = $(\'#Job_Show_Queues_Actions_EditSla_Dialog_Priority\');\r\n " +
|
||||
" var icon = dialogEditSla.find(\'.priority i\');\r\n " +
|
||||
" icon[0].className = \'\';\r\n icon.addClass(\'fa d-priority-\'" +
|
||||
" + $element.val().toLowerCase()).attr(\'title\', $element.val() + \' Priority\');\r\n " +
|
||||
" };\r\n\r\n if (!dialogEditSla) {\r\n " +
|
||||
"dialogEditSla = $(\'#Job_Show_Queues_Actions_EditSla_Dialog\');\r\n " +
|
||||
" dialogEditSla.dialog({\r\n resizable: false,\r\n " +
|
||||
" modal: true,\r\n width: 320,\r\n " +
|
||||
" autoOpen: false,\r\n buttons: {\r\n " +
|
||||
" \"Save Changes\": function () {\r\n var $t" +
|
||||
"his = $(this);\r\n $this.dialog(\"disable\");\r\n " +
|
||||
" $this.dialog(\"option\", \"buttons\", null);\r\n " +
|
||||
" $this.find(\'form\').submit();\r\n }," +
|
||||
"\r\n Cancel: function () {\r\n " +
|
||||
" $(this).dialog(\"close\");\r\n }\r\n " +
|
||||
" }\r\n });\r\n\r\n $(\'#Job_Show_Queues_Acti" +
|
||||
"ons_EditSla_Dialog_Priority\').change(priorityChange);\r\n }\r\n\r\n " +
|
||||
" var $td = $this.closest(\'td\');\r\n var priority = $td.a" +
|
||||
"ttr(\'data-priority\');\r\n var sla = $td.attr(\'data-sla\');\r\n " +
|
||||
" var slaStart = $this.closest(\'tr\').attr(\'data-jobqueuejobaddeddate\');\r\n\r" +
|
||||
"\n var canEditSla = $td.hasClass(\'canEditSLA\');\r\n v" +
|
||||
"ar canEditPriority = $td.hasClass(\'canEditPriority\');\r\n\r\n if (can" +
|
||||
"EditPriority) {\r\n $(\'#Job_Show_Queues_Actions_EditSla_Dialog_" +
|
||||
"Priority\').val(priority);\r\n priorityChange();\r\n " +
|
||||
" dialogEditSla.find(\'div.priority\').show();\r\n } else {\r\n " +
|
||||
" dialogEditSla.find(\'div.priority\').hide();\r\n }\r\n\r" +
|
||||
"\n if (canEditSla) {\r\n var $sla = $(\'#Job_Show_" +
|
||||
"Queues_Actions_EditSla_Dialog_Sla\');\r\n\r\n $sla.datetimepicker(" +
|
||||
"\'destroy\').datetimepicker({\r\n defaultDate: new Date(),\r\n " +
|
||||
" ampm: true,\r\n changeYear: true,\r\n " +
|
||||
" changeMonth: true,\r\n minDate: mome" +
|
||||
"nt(slaStart).add(\'m\', 1).toDate(),\r\n dateFormat: \'yy/mm/d" +
|
||||
"d\'\r\n });\r\n\r\n if (sla) {\r\n " +
|
||||
" $sla.datetimepicker(\'setDate\', moment(sla).toDate());\r\n " +
|
||||
" } else {\r\n $sla.val(\'\');\r\n }\r\n " +
|
||||
" dialogEditSla.find(\'div.sla\').show();\r\n } else {\r\n " +
|
||||
" dialogEditSla.find(\'div.sla\').hide();\r\n }\r\n\r\n " +
|
||||
" if (canEditPriority && canEditSla)\r\n dialogEdi" +
|
||||
"tSla.find(\'form\').attr(\'action\', dialogEditSla_BothUrl);\r\n else i" +
|
||||
"f (canEditPriority)\r\n dialogEditSla.find(\'form\').attr(\'action" +
|
||||
"\', dialogEditSla_PriorityUrl);\r\n else if (canEditSla)\r\n " +
|
||||
" dialogEditSla.find(\'form\').attr(\'action\', dialogEditSla_SlaUrl);\r\n\r\n " +
|
||||
" $(\'#Job_Show_Queues_Actions_EditSla_Dialog_Id\').val(jobQueueJobId)" +
|
||||
";\r\n dialogEditSla.dialog(\'open\');\r\n e.preventDefau" +
|
||||
"lt();\r\n return false;\r\n });\r\n });\r\n </script" +
|
||||
">\r\n");
|
||||
" var $comments = $this.closest(\'td\').find(\'.commentsRaw\');\r\n " +
|
||||
"if ($comments.hasClass(\'smallMessage\')) {\r\n $(\'#Job_Show_Queu" +
|
||||
"es_Actions_EditAddedComment_Dialog_Comment\').val(\'\');\r\n } else {\r" +
|
||||
"\n $(\'#Job_Show_Queues_Actions_EditAddedComment_Dialog_Comment" +
|
||||
"\').val($comments.text());\r\n }\r\n\r\n $(\'#Job_Show_Que" +
|
||||
"ues_Actions_EditAddedComment_Dialog_Id\').val(jobQueueJobId);\r\n di" +
|
||||
"alogEditAddedComment.dialog(\'open\');\r\n e.preventDefault();\r\n " +
|
||||
" return false;\r\n });\r\n\r\n jobQueues.on(\'click\', \'" +
|
||||
"td.removed i.fa-edit\', function (e) {\r\n var $this = $(this);\r\n " +
|
||||
" var jobQueueJobId = $this.closest(\'tr\').attr(\'data-jobqueuejobid\');" +
|
||||
"\r\n\r\n if (!dialogEditRemovedComment) {\r\n dialog" +
|
||||
"EditRemovedComment = $(\'#Job_Show_Queues_Actions_EditRemovedComment_Dialog\');\r\n " +
|
||||
" dialogEditRemovedComment.dialog({\r\n re" +
|
||||
"sizable: false,\r\n modal: true,\r\n w" +
|
||||
"idth: 320,\r\n autoOpen: false,\r\n bu" +
|
||||
"ttons: {\r\n \"Save Changes\": function () {\r\n " +
|
||||
" var $this = $(this);\r\n $this" +
|
||||
".dialog(\"disable\");\r\n $this.dialog(\"option\", \"but" +
|
||||
"tons\", null);\r\n $this.find(\'form\').submit();\r\n " +
|
||||
" },\r\n Cancel: function () {\r\n" +
|
||||
" $(this).dialog(\"close\");\r\n " +
|
||||
" }\r\n }\r\n });\r\n }\r\n" +
|
||||
"\r\n var $comments = $this.closest(\'td\').find(\'.commentsRaw\');\r\n " +
|
||||
" if ($comments.hasClass(\'smallMessage\')) {\r\n $(\'#" +
|
||||
"Job_Show_Queues_Actions_EditRemovedComment_Dialog_Comment\').val(\'\');\r\n " +
|
||||
" } else {\r\n $(\'#Job_Show_Queues_Actions_EditRemovedComme" +
|
||||
"nt_Dialog_Comment\').val($comments.text());\r\n }\r\n\r\n " +
|
||||
" $(\'#Job_Show_Queues_Actions_EditRemovedComment_Dialog_Id\').val(jobQueueJobId);\r" +
|
||||
"\n dialogEditRemovedComment.dialog(\'open\');\r\n e.pre" +
|
||||
"ventDefault();\r\n return false;\r\n });\r\n\r\n jo" +
|
||||
"bQueues.on(\'click\', \'td.sla i.fa-edit\', function (e) {\r\n var $thi" +
|
||||
"s = $(this);\r\n var jobQueueJobId = $this.closest(\'tr\').attr(\'data" +
|
||||
"-jobqueuejobid\');\r\n\r\n var priorityChange = function () {\r\n " +
|
||||
" var $element = $(\'#Job_Show_Queues_Actions_EditSla_Dialog_Priority\'" +
|
||||
");\r\n var icon = dialogEditSla.find(\'.priority i\');\r\n " +
|
||||
" icon[0].className = \'\';\r\n icon.addClass(\'fa d-prio" +
|
||||
"rity-\' + $element.val().toLowerCase()).attr(\'title\', $element.val() + \' Priority" +
|
||||
"\');\r\n };\r\n\r\n if (!dialogEditSla) {\r\n " +
|
||||
" dialogEditSla = $(\'#Job_Show_Queues_Actions_EditSla_Dialog\');\r\n " +
|
||||
" dialogEditSla.dialog({\r\n resizable: false,\r\n " +
|
||||
" modal: true,\r\n width: 320,\r\n " +
|
||||
" autoOpen: false,\r\n buttons: {\r\n " +
|
||||
" \"Save Changes\": function () {\r\n " +
|
||||
"var $this = $(this);\r\n $this.dialog(\"disable\");\r\n" +
|
||||
" $this.dialog(\"option\", \"buttons\", null);\r\n " +
|
||||
" $this.find(\'form\').submit();\r\n " +
|
||||
" },\r\n Cancel: function () {\r\n " +
|
||||
" $(this).dialog(\"close\");\r\n }\r\n " +
|
||||
" }\r\n });\r\n\r\n $(\'#Job_Show_Queue" +
|
||||
"s_Actions_EditSla_Dialog_Priority\').change(priorityChange);\r\n }\r\n" +
|
||||
"\r\n var $td = $this.closest(\'td\');\r\n var priority =" +
|
||||
" $td.attr(\'data-priority\');\r\n var sla = $td.attr(\'data-sla\');\r\n " +
|
||||
" var slaStart = $this.closest(\'tr\').attr(\'data-jobqueuejobaddeddate" +
|
||||
"\');\r\n\r\n var canEditSla = $td.hasClass(\'canEditSLA\');\r\n " +
|
||||
" var canEditPriority = $td.hasClass(\'canEditPriority\');\r\n\r\n i" +
|
||||
"f (canEditPriority) {\r\n $(\'#Job_Show_Queues_Actions_EditSla_D" +
|
||||
"ialog_Priority\').val(priority);\r\n priorityChange();\r\n " +
|
||||
" dialogEditSla.find(\'div.priority\').show();\r\n } else {" +
|
||||
"\r\n dialogEditSla.find(\'div.priority\').hide();\r\n " +
|
||||
" }\r\n\r\n if (canEditSla) {\r\n var $sla = $(\'#Job" +
|
||||
"_Show_Queues_Actions_EditSla_Dialog_Sla\');\r\n\r\n $sla.datetimep" +
|
||||
"icker(\'destroy\').datetimepicker({\r\n defaultDate: new Date" +
|
||||
"(),\r\n ampm: true,\r\n changeYear: tr" +
|
||||
"ue,\r\n changeMonth: true,\r\n minDate" +
|
||||
": moment(slaStart).add(\'m\', 1).toDate(),\r\n dateFormat: \'y" +
|
||||
"y/mm/dd\'\r\n });\r\n\r\n if (sla) {\r\n " +
|
||||
" $sla.datetimepicker(\'setDate\', moment(sla).toDate());\r\n " +
|
||||
" } else {\r\n $sla.val(\'\');\r\n }\r\n" +
|
||||
" dialogEditSla.find(\'div.sla\').show();\r\n } els" +
|
||||
"e {\r\n dialogEditSla.find(\'div.sla\').hide();\r\n " +
|
||||
"}\r\n\r\n if (canEditPriority && canEditSla)\r\n dia" +
|
||||
"logEditSla.find(\'form\').attr(\'action\', dialogEditSla_BothUrl);\r\n " +
|
||||
"else if (canEditPriority)\r\n dialogEditSla.find(\'form\').attr(\'" +
|
||||
"action\', dialogEditSla_PriorityUrl);\r\n else if (canEditSla)\r\n " +
|
||||
" dialogEditSla.find(\'form\').attr(\'action\', dialogEditSla_SlaUrl);" +
|
||||
"\r\n\r\n $(\'#Job_Show_Queues_Actions_EditSla_Dialog_Id\').val(jobQueue" +
|
||||
"JobId);\r\n dialogEditSla.dialog(\'open\');\r\n e.preven" +
|
||||
"tDefault();\r\n return false;\r\n });\r\n });\r\n </" +
|
||||
"script>\r\n");
|
||||
|
||||
|
||||
#line 390 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 392 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1235,7 +1265,7 @@ WriteLiteral(" class=\"none\"");
|
||||
WriteLiteral(">This job has no associated queue history</div>\r\n");
|
||||
|
||||
|
||||
#line 394 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
#line 396 "..\..\Views\Job\JobParts\Queues.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<div data-logid="@jl.Id">
|
||||
<span class="author">@jl.TechUser.ToStringFriendly()</span>@if (canRemoveAnyLogs || (canRemoveOwnLogs && jl.TechUserId == CurrentUser.UserId))
|
||||
{<text><span class="remove fa fa-times-circle"></span></text>}<span class="timestamp" data-livestamp="@(jl.Timestamp.ToUnixEpoc())" title="@jl.Timestamp.ToFullDateTime()">@jl.Timestamp.ToFullDateTime()</span>
|
||||
<span class="comment">@jl.Comments.ToMultilineJobRefString()</span>
|
||||
<span class="comment">@jl.Comments.ToHtmlComment()</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@@ -264,10 +264,7 @@
|
||||
e.find('.timestamp').text(c.TimestampFull).attr('title', c.TimestampFull).livestamp(c.TimestampUnixEpoc);
|
||||
if (canRemove)
|
||||
e.find('.remove').click(removePost);
|
||||
var eComment = e.find('.comment').text(c.Comments);
|
||||
var commentHtml = eComment.text().replace(/\r\n|\r|\n/g, '<br />');
|
||||
commentHtml = commentHtml.replace(/\#(\d+)/g, '<a href="@Url.Action(MVC.Job.Show(null))?id=$1">#$1</a>');
|
||||
eComment.html(commentHtml);
|
||||
var eComment = e.find('.comment').html(c.HtmlComments);
|
||||
|
||||
$CommentOutput.append(e);
|
||||
|
||||
|
||||
@@ -240,7 +240,7 @@ WriteLiteral(">");
|
||||
|
||||
|
||||
#line 39 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
Write(jl.Comments.ToMultilineJobRefString());
|
||||
Write(jl.Comments.ToHtmlComment());
|
||||
|
||||
|
||||
#line default
|
||||
@@ -324,14 +324,14 @@ WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"Attachments\"");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 2951), Tuple.Create("\"", 3026)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 2941), Tuple.Create("\"", 3016)
|
||||
|
||||
#line 56 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 2959), Tuple.Create<System.Object, System.Int32>(canAddAttachments ? "canAddAttachments" : "cannotAddAttachments"
|
||||
, Tuple.Create(Tuple.Create("", 2949), Tuple.Create<System.Object, System.Int32>(canAddAttachments ? "canAddAttachments" : "cannotAddAttachments"
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 2959), false)
|
||||
, 2949), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
@@ -361,14 +361,14 @@ WriteLiteral(">\r\n");
|
||||
#line hidden
|
||||
WriteLiteral(" <a");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 3363), Tuple.Create("\"", 3420)
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 3353), Tuple.Create("\"", 3410)
|
||||
|
||||
#line 63 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 3370), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentDownload(ja.Id))
|
||||
, Tuple.Create(Tuple.Create("", 3360), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentDownload(ja.Id))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 3370), false)
|
||||
, 3360), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" data-attachmentid=\"");
|
||||
@@ -397,42 +397,42 @@ WriteLiteral(">\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"icon\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 3530), Tuple.Create("\"", 3550)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 3520), Tuple.Create("\"", 3540)
|
||||
|
||||
#line 64 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 3538), Tuple.Create<System.Object, System.Int32>(ja.Filename
|
||||
, Tuple.Create(Tuple.Create("", 3528), Tuple.Create<System.Object, System.Int32>(ja.Filename
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 3538), false)
|
||||
, 3528), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <img");
|
||||
|
||||
WriteLiteral(" alt=\"Attachment Thumbnail\"");
|
||||
|
||||
WriteAttribute("src", Tuple.Create(" src=\"", 3621), Tuple.Create("\"", 3680)
|
||||
WriteAttribute("src", Tuple.Create(" src=\"", 3611), Tuple.Create("\"", 3670)
|
||||
|
||||
#line 65 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 3627), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id))
|
||||
, Tuple.Create(Tuple.Create("", 3617), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 3627), false)
|
||||
, 3617), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" /></span>\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"comments\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 3747), Tuple.Create("\"", 3767)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 3737), Tuple.Create("\"", 3757)
|
||||
|
||||
#line 66 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 3755), Tuple.Create<System.Object, System.Int32>(ja.Comments
|
||||
, Tuple.Create(Tuple.Create("", 3745), Tuple.Create<System.Object, System.Int32>(ja.Comments
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 3755), false)
|
||||
, 3745), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
@@ -527,14 +527,14 @@ WriteLiteral(" data-livestamp=\"");
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 4462), Tuple.Create("\"", 4500)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 4452), Tuple.Create("\"", 4490)
|
||||
|
||||
#line 72 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4470), Tuple.Create<System.Object, System.Int32>(ja.Timestamp.ToFullDateTime()
|
||||
, Tuple.Create(Tuple.Create("", 4460), Tuple.Create<System.Object, System.Int32>(ja.Timestamp.ToFullDateTime()
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4470), false)
|
||||
, 4460), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
@@ -925,76 +925,42 @@ WriteLiteral("addComment(d, false, false);");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to load live comment ' + id + ': ' + textStatus);
|
||||
}
|
||||
});
|
||||
}
|
||||
function liveRemoveComment(key) {
|
||||
$CommentOutput.children('div[data-logid=""' + key + '""]').slideUp(300).delay(300).queue(function () {
|
||||
var $this = $(this);
|
||||
$this.find('.timestamp').livestamp('destroy');
|
||||
$this.remove();
|
||||
});
|
||||
}
|
||||
function addComment(c, quick, canRemove) {
|
||||
var t = '<div><span class=""author"" />';
|
||||
if (canRemove)
|
||||
t += '<span class=""remove fa fa-times-circle"" />';
|
||||
t += '<span class=""timestamp"" /><span class=""comment"" /></div>';
|
||||
|
||||
var e = $(t);
|
||||
e.attr('data-logid', c.Id);
|
||||
e.find('.author').text(c.Author);
|
||||
e.find('.timestamp').text(c.TimestampFull).attr('title', c.TimestampFull).livestamp(c.TimestampUnixEpoc);
|
||||
if (canRemove)
|
||||
e.find('.remove').click(removePost);
|
||||
var eComment = e.find('.comment').text(c.Comments);
|
||||
var commentHtml = eComment.text().replace(/\r\n|\r|\n/g, '<br />');
|
||||
commentHtml = commentHtml.replace(/\#(\d+)/g, '<a href=""");
|
||||
WriteLiteral("\r\n }\r\n },\r\n error: f" +
|
||||
"unction (jqXHR, textStatus, errorThrown) {\r\n alert(\'Unabl" +
|
||||
"e to load live comment \' + id + \': \' + textStatus);\r\n }\r\n " +
|
||||
" });\r\n }\r\n function liveRemoveComment(key) {\r\n " +
|
||||
" $CommentOutput.children(\'div[data-logid=\"\' + key + \'\"]\').slideUp(" +
|
||||
"300).delay(300).queue(function () {\r\n var $this = $(this);\r\n " +
|
||||
" $this.find(\'.timestamp\').livestamp(\'destroy\');\r\n " +
|
||||
" $this.remove();\r\n });\r\n }\r\n function" +
|
||||
" addComment(c, quick, canRemove) {\r\n var t = \'<div><span class=\"a" +
|
||||
"uthor\" />\';\r\n if (canRemove)\r\n t += \'<span cla" +
|
||||
"ss=\"remove fa fa-times-circle\" />\';\r\n t += \'<span class=\"timestam" +
|
||||
"p\" /><span class=\"comment\" /></div>\';\r\n\r\n var e = $(t);\r\n " +
|
||||
" e.attr(\'data-logid\', c.Id);\r\n e.find(\'.author\').text(c.Au" +
|
||||
"thor);\r\n e.find(\'.timestamp\').text(c.TimestampFull).attr(\'title\'," +
|
||||
" c.TimestampFull).livestamp(c.TimestampUnixEpoc);\r\n if (canRemove" +
|
||||
")\r\n e.find(\'.remove\').click(removePost);\r\n var" +
|
||||
" eComment = e.find(\'.comment\').html(c.HtmlComments);\r\n\r\n $Comment" +
|
||||
"Output.append(e);\r\n\r\n if (!quick) {\r\n e.animat" +
|
||||
"e({ backgroundColor: \'#ffff99\' }, 500, function () {\r\n e." +
|
||||
"animate({ backgroundColor: \'#fafafa\' }, 500, function () {\r\n " +
|
||||
" e.css(\'background-color\', \'\');\r\n });\r\n " +
|
||||
" });\r\n $CommentOutput.animate({ scrollTop: $CommentOu" +
|
||||
"tput[0].scrollHeight }, 250)\r\n }\r\n }\r\n\r\n //" +
|
||||
" Add Globally Available Functions\r\n document.DiscoFunctions.liveLoadC" +
|
||||
"omment = loadLiveComment;\r\n document.DiscoFunctions.liveRemoveComment" +
|
||||
" = liveRemoveComment;\r\n //#endregion\r\n });\r\n </script>\r\n");
|
||||
|
||||
|
||||
#line 269 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
Write(Url.Action(MVC.Job.Show(null)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"?id=$1"">#$1</a>');
|
||||
eComment.html(commentHtml);
|
||||
|
||||
$CommentOutput.append(e);
|
||||
|
||||
if (!quick) {
|
||||
e.animate({ backgroundColor: '#ffff99' }, 500, function () {
|
||||
e.animate({ backgroundColor: '#fafafa' }, 500, function () {
|
||||
e.css('background-color', '');
|
||||
});
|
||||
});
|
||||
$CommentOutput.animate({ scrollTop: $CommentOutput[0].scrollHeight }, 250)
|
||||
}
|
||||
}
|
||||
|
||||
// Add Globally Available Functions
|
||||
document.DiscoFunctions.liveLoadComment = loadLiveComment;
|
||||
document.DiscoFunctions.liveRemoveComment = liveRemoveComment;
|
||||
//#endregion
|
||||
});
|
||||
</script>
|
||||
");
|
||||
|
||||
|
||||
#line 290 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 287 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 291 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 288 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
if (canShowAttachments)
|
||||
{
|
||||
|
||||
@@ -1015,7 +981,7 @@ WriteLiteral(@" <script>
|
||||
var jobId = parseInt('");
|
||||
|
||||
|
||||
#line 304 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 301 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
Write(Model.Job.Id);
|
||||
|
||||
|
||||
@@ -1026,13 +992,13 @@ WriteLiteral("\');\r\n\r\n //#region Attachments\r\n var $
|
||||
"tput\');\r\n\r\n");
|
||||
|
||||
|
||||
#line 310 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 307 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 310 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 307 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
if (canAddAttachments)
|
||||
{
|
||||
|
||||
@@ -1042,7 +1008,7 @@ WriteLiteral("\r\n //#region Add Attachments\r\n var attac
|
||||
" document.Disco.AttachmentUploader(\r\n \'");
|
||||
|
||||
|
||||
#line 314 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 311 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.Job.AttachmentUpload(Model.Job.Id, null)));
|
||||
|
||||
|
||||
@@ -1077,7 +1043,7 @@ WriteLiteral(@"',
|
||||
");
|
||||
|
||||
|
||||
#line 340 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 337 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -1086,13 +1052,13 @@ WriteLiteral(@"',
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 342 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 339 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 342 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 339 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
if (canRemoveAnyAttachments || canRemoveOwnAttachments)
|
||||
{
|
||||
|
||||
@@ -1127,7 +1093,7 @@ WriteLiteral(@"
|
||||
url: '");
|
||||
|
||||
|
||||
#line 369 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 366 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.Job.AttachmentRemove()));
|
||||
|
||||
|
||||
@@ -1163,7 +1129,7 @@ WriteLiteral(@"',
|
||||
");
|
||||
|
||||
|
||||
#line 396 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 393 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -1173,7 +1139,7 @@ WriteLiteral("\r\n function addAttachment(key, quick) {\r\n
|
||||
"id: key };\r\n $.ajax({\r\n url: \'");
|
||||
|
||||
|
||||
#line 401 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 398 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.Job.Attachment()));
|
||||
|
||||
|
||||
@@ -1184,13 +1150,13 @@ WriteLiteral("\',\r\n dataType: \'json\',\r\n
|
||||
"\'OK\') {\r\n var a = d.Attachment;\r\n");
|
||||
|
||||
|
||||
#line 407 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 404 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 407 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 404 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
if (canRemoveAnyAttachments)
|
||||
{
|
||||
|
||||
@@ -1204,7 +1170,7 @@ WriteLiteral("buildAttachment(a, true, quick);");
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 410 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 407 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
}
|
||||
else if (canRemoveOwnAttachments)
|
||||
{
|
||||
@@ -1217,7 +1183,7 @@ WriteLiteral(" ");
|
||||
WriteLiteral("buildAttachment(a, (a.AuthorId === \'");
|
||||
|
||||
|
||||
#line 413 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 410 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
Write(CurrentUser.UserId);
|
||||
|
||||
|
||||
@@ -1228,7 +1194,7 @@ WriteLiteral("\'), quick);");
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 414 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 411 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1243,7 +1209,7 @@ WriteLiteral("buildAttachment(a, false, quick);");
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 418 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 415 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -1270,7 +1236,7 @@ WriteLiteral(@" } else {
|
||||
e.attr('data-attachmentid', a.Id).attr('data-mimetype', a.MimeType).attr('href', '");
|
||||
|
||||
|
||||
#line 437 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 434 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.Job.AttachmentDownload()));
|
||||
|
||||
|
||||
@@ -1302,7 +1268,7 @@ WriteLiteral(@"/' + a.Id);
|
||||
img.attr('src', '");
|
||||
|
||||
|
||||
#line 460 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 457 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.Job.AttachmentThumbnail()));
|
||||
|
||||
|
||||
@@ -1349,14 +1315,14 @@ WriteLiteral("/\' + a.Id + \'?v=\' + retryCount);\r\n };\
|
||||
"script>\r\n");
|
||||
|
||||
|
||||
#line 530 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 527 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 531 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 528 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
if (canShowLogs || canShowAttachments)
|
||||
{
|
||||
|
||||
@@ -1366,7 +1332,7 @@ WriteLiteral("/\' + a.Id + \'?v=\' + retryCount);\r\n };\
|
||||
WriteLiteral(" <script>\r\n $(function () {\r\n var jobId = parseInt(\'");
|
||||
|
||||
|
||||
#line 535 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 532 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
Write(Model.Job.Id);
|
||||
|
||||
|
||||
@@ -1376,7 +1342,7 @@ WriteLiteral("\');\r\n\r\n //#region LiveEvents\r\n var hu
|
||||
"dates;\r\n\r\n // Map Functions\r\n");
|
||||
|
||||
|
||||
#line 541 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 538 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
if (canShowLogs)
|
||||
{
|
||||
|
||||
@@ -1387,14 +1353,14 @@ WriteLiteral("\r\n hub.client.addLog = document.DiscoFunctions.liveLo
|
||||
" ");
|
||||
|
||||
|
||||
#line 545 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 542 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 546 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 543 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
if (canShowAttachments)
|
||||
{
|
||||
|
||||
@@ -1415,7 +1381,7 @@ WriteLiteral(@"
|
||||
");
|
||||
|
||||
|
||||
#line 559 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 556 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -1438,7 +1404,7 @@ WriteLiteral(@"
|
||||
");
|
||||
|
||||
|
||||
#line 574 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 571 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@model Disco.Web.Models.Job.ShowModel
|
||||
@using Disco.Services.Users.UserFlags;
|
||||
@{
|
||||
Authorization.Require(Claims.Job.Show);
|
||||
}
|
||||
@@ -466,6 +467,46 @@
|
||||
if (!string.IsNullOrWhiteSpace(Model.Job.User.EmailAddress))
|
||||
{<div id="Job_Show_User_EmailAddress" title="Email Address">Email: <a href="mailto:@(Model.Job.User.EmailAddress)">@Model.Job.User.EmailAddress</a></div>}
|
||||
}
|
||||
@if (Authorization.Has(Claims.User.ShowFlagAssignments))
|
||||
{
|
||||
<div id="Job_Show_User_Flags">
|
||||
@foreach (var flag in Model.Job.User.UserFlagAssignments.Where(f => !f.RemovedDate.HasValue).Select(f => Tuple.Create(f, UserFlagService.GetUserFlag(f.UserFlagId))))
|
||||
{
|
||||
<i class="flag fa fa-@(flag.Item2.Icon) fa-fw d-@(flag.Item2.IconColour)"><span class="details"><span class="name">@flag.Item2.Name</span>@if (flag.Item1.Comments != null)
|
||||
{<span class="comments">@flag.Item1.Comments.ToHtmlComment()</span>}<span class="added">@CommonHelpers.FriendlyDateAndUser(flag.Item1.AddedDate, flag.Item1.AddedUserId)</span></span></i>
|
||||
}
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#Job_Show_User_Flags')
|
||||
.tooltip({
|
||||
items: 'i.flag',
|
||||
content: function () {
|
||||
var $this = $(this);
|
||||
return $this.children('.details').html();
|
||||
},
|
||||
tooltipClass: 'User_FlagAssignment_Tooltip',
|
||||
position: {
|
||||
my: "right top",
|
||||
at: "right bottom",
|
||||
collision: "flipfit flip"
|
||||
},
|
||||
hade: {
|
||||
effect: ''
|
||||
},
|
||||
close: function (e, ui) {
|
||||
ui.tooltip.hover(
|
||||
function () {
|
||||
$(this).stop(true).fadeTo(100, 1);
|
||||
},
|
||||
function () {
|
||||
$(this).fadeOut(100, function () { $(this).remove(); });
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
}
|
||||
@if (Model.Job.WaitingForUserAction.HasValue)
|
||||
{
|
||||
<div id="Job_Show_User_WaitingForUserAction" class="status">
|
||||
@@ -694,6 +735,7 @@
|
||||
var buttonLink = button.attr('href');
|
||||
|
||||
var queuePicker = null;
|
||||
var queueId = null;
|
||||
var details = null;
|
||||
|
||||
function queueSelected(){
|
||||
@@ -702,7 +744,7 @@
|
||||
queuePicker.children().removeClass('selected');
|
||||
queue.addClass('selected');
|
||||
|
||||
$('#Job_Show_Job_Actions_AddQueue_Dialog_Id').val(queue.attr('data-queueid'));
|
||||
queueId.val(queue.attr('data-queueid'));
|
||||
|
||||
var queueSLA = queue.attr('data-queuesla');
|
||||
if (!queueSLA)
|
||||
@@ -730,15 +772,20 @@
|
||||
$(this).dialog("close");
|
||||
},
|
||||
"Add to Queue": function () {
|
||||
var $this = $(this);
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
buttonDialog.find('form').submit();
|
||||
if (!!queueId.val()){
|
||||
var $this = $(this);
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
buttonDialog.find('form').submit();
|
||||
}else{
|
||||
alert('Select a Job Queue');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
queuePicker = buttonDialog.find('.queuePicker');
|
||||
queueId = $('#Job_Show_Job_Actions_AddQueue_Dialog_Id');
|
||||
details = buttonDialog.find('.details');
|
||||
|
||||
var priorityList = buttonDialog.find('#Priority');
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -20,8 +20,8 @@
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#Job_Show_Status').appendTo('#layout_PageHeading')
|
||||
$('#Job_Show_QueueStatus').appendTo('#layout_PageHeading')
|
||||
$('#Job_Show_Status').appendTo('#layout_PageHeading');
|
||||
$('#Job_Show_QueueStatus').appendTo('#layout_PageHeading');
|
||||
});
|
||||
</script>
|
||||
@Html.Partial(MVC.Job.Views.JobParts._Subject, Model)
|
||||
|
||||
@@ -201,8 +201,8 @@ WriteLiteral(" </div>\r\n <script");
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(">\r\n $(function () {\r\n $(\'#Job_Show_Status\').appendTo(\'#layout_P" +
|
||||
"ageHeading\')\r\n $(\'#Job_Show_QueueStatus\').appendTo(\'#layout_PageHeadi" +
|
||||
"ng\')\r\n });\r\n </script>\r\n");
|
||||
"ageHeading\');\r\n $(\'#Job_Show_QueueStatus\').appendTo(\'#layout_PageHead" +
|
||||
"ing\');\r\n });\r\n </script>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
@@ -1,10 +1,49 @@
|
||||
@model Disco.Web.Models.User.ShowModel
|
||||
@using Disco.Services.Users.UserFlags;
|
||||
@{
|
||||
Authorization.Require(Claims.User.Show);
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Users", MVC.User.Index(), string.Format("User: {0} ({1})", Model.User.DisplayName, Model.User.FriendlyId()));
|
||||
}
|
||||
<div id="User_Show">
|
||||
<div id="User_Show_Flags">
|
||||
@foreach (var flag in Model.User.UserFlagAssignments.Where(f => !f.RemovedDate.HasValue).Select(f => Tuple.Create(f, UserFlagService.GetUserFlag(f.UserFlagId))))
|
||||
{
|
||||
<i class="flag fa fa-@(flag.Item2.Icon) fa-fw fa-lg d-@(flag.Item2.IconColour)"><span class="details"><span class="name">@flag.Item2.Name</span>@if (flag.Item1.Comments != null)
|
||||
{<span class="comments">@flag.Item1.Comments.ToHtmlComment()</span>}<span class="added">@CommonHelpers.FriendlyDateAndUser(flag.Item1.AddedDate, flag.Item1.AddedUser)</span></span></i>
|
||||
}
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#User_Show_Flags')
|
||||
.appendTo('#layout_PageHeading')
|
||||
.tooltip({
|
||||
items: 'i.flag',
|
||||
content: function () {
|
||||
var $this = $(this);
|
||||
return $this.children('.details').html();
|
||||
},
|
||||
tooltipClass: 'User_FlagAssignment_Tooltip',
|
||||
position: {
|
||||
my: "right top",
|
||||
at: "right bottom",
|
||||
collision: "flipfit flip"
|
||||
},
|
||||
hade: {
|
||||
effect: ''
|
||||
},
|
||||
close: function (e, ui) {
|
||||
ui.tooltip.hover(
|
||||
function () {
|
||||
$(this).stop(true).fadeTo(100, 1);
|
||||
},
|
||||
function () {
|
||||
$(this).fadeOut(100, function () { $(this).remove(); });
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@Html.Partial(MVC.User.Views.UserParts._Subject, Model)
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
@@ -53,6 +92,10 @@
|
||||
{
|
||||
@Html.Partial(MVC.User.Views.UserParts._Resources, Model)
|
||||
}
|
||||
@if (Authorization.Has(Claims.User.ShowFlagAssignments))
|
||||
{
|
||||
@Html.Partial(MVC.User.Views.UserParts._Flags, Model)
|
||||
}
|
||||
@if (Authorization.Has(Claims.User.ShowAuthorization))
|
||||
{
|
||||
@Html.Partial(MVC.User.Views.UserParts._Authorization, Model)
|
||||
|
||||
@@ -31,6 +31,12 @@ namespace Disco.Web.Views.User
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
|
||||
#line 2 "..\..\Views\User\Show.cshtml"
|
||||
using Disco.Services.Users.UserFlags;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
@@ -45,7 +51,7 @@ namespace Disco.Web.Views.User
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Views\User\Show.cshtml"
|
||||
#line 3 "..\..\Views\User\Show.cshtml"
|
||||
|
||||
Authorization.Require(Claims.User.Show);
|
||||
|
||||
@@ -58,12 +64,161 @@ WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"User_Show\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"User_Show_Flags\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 10 "..\..\Views\User\Show.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 10 "..\..\Views\User\Show.cshtml"
|
||||
foreach (var flag in Model.User.UserFlagAssignments.Where(f => !f.RemovedDate.HasValue).Select(f => Tuple.Create(f, UserFlagService.GetUserFlag(f.UserFlagId))))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <i");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 535), Tuple.Create("\"", 611)
|
||||
, Tuple.Create(Tuple.Create("", 543), Tuple.Create("flag", 543), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 547), Tuple.Create("fa", 548), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 550), Tuple.Create("fa-", 551), true)
|
||||
|
||||
#line 12 "..\..\Views\User\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 554), Tuple.Create<System.Object, System.Int32>(flag.Item2.Icon
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 554), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 572), Tuple.Create("fa-fw", 573), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 578), Tuple.Create("fa-lg", 579), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 584), Tuple.Create("d-", 585), true)
|
||||
|
||||
#line 12 "..\..\Views\User\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 587), Tuple.Create<System.Object, System.Int32>(flag.Item2.IconColour
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 587), false)
|
||||
);
|
||||
|
||||
WriteLiteral("><span");
|
||||
|
||||
WriteLiteral(" class=\"details\"");
|
||||
|
||||
WriteLiteral("><span");
|
||||
|
||||
WriteLiteral(" class=\"name\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 12 "..\..\Views\User\Show.cshtml"
|
||||
Write(flag.Item2.Name);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</span>");
|
||||
|
||||
|
||||
#line 12 "..\..\Views\User\Show.cshtml"
|
||||
if (flag.Item1.Comments != null)
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("<span");
|
||||
|
||||
WriteLiteral(" class=\"comments\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 13 "..\..\Views\User\Show.cshtml"
|
||||
Write(flag.Item1.Comments.ToHtmlComment());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</span>");
|
||||
|
||||
|
||||
#line 13 "..\..\Views\User\Show.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("<span");
|
||||
|
||||
WriteLiteral(" class=\"added\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 13 "..\..\Views\User\Show.cshtml"
|
||||
Write(CommonHelpers.FriendlyDateAndUser(flag.Item1.AddedDate, flag.Item1.AddedUser));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</span></span></i>\r\n");
|
||||
|
||||
|
||||
#line 14 "..\..\Views\User\Show.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
$('#User_Show_Flags')
|
||||
.appendTo('#layout_PageHeading')
|
||||
.tooltip({
|
||||
items: 'i.flag',
|
||||
content: function () {
|
||||
var $this = $(this);
|
||||
return $this.children('.details').html();
|
||||
},
|
||||
tooltipClass: 'User_FlagAssignment_Tooltip',
|
||||
position: {
|
||||
my: ""right top"",
|
||||
at: ""right bottom"",
|
||||
collision: ""flipfit flip""
|
||||
},
|
||||
hade: {
|
||||
effect: ''
|
||||
},
|
||||
close: function (e, ui) {
|
||||
ui.tooltip.hover(
|
||||
function () {
|
||||
$(this).stop(true).fadeTo(100, 1);
|
||||
},
|
||||
function () {
|
||||
$(this).fadeOut(100, function () { $(this).remove(); });
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 8 "..\..\Views\User\Show.cshtml"
|
||||
#line 47 "..\..\Views\User\Show.cshtml"
|
||||
Write(Html.Partial(MVC.User.Views.UserParts._Subject, Model));
|
||||
|
||||
|
||||
@@ -103,13 +258,13 @@ WriteLiteral(" id=\"UserDetailTabItems\"");
|
||||
WriteLiteral("></ul>\r\n");
|
||||
|
||||
|
||||
#line 44 "..\..\Views\User\Show.cshtml"
|
||||
#line 83 "..\..\Views\User\Show.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 44 "..\..\Views\User\Show.cshtml"
|
||||
#line 83 "..\..\Views\User\Show.cshtml"
|
||||
if (Authorization.Has(Claims.User.ShowJobs))
|
||||
{
|
||||
|
||||
@@ -117,14 +272,14 @@ WriteLiteral("></ul>\r\n");
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 46 "..\..\Views\User\Show.cshtml"
|
||||
#line 85 "..\..\Views\User\Show.cshtml"
|
||||
Write(Html.Partial(MVC.User.Views.UserParts._Jobs, Model));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 46 "..\..\Views\User\Show.cshtml"
|
||||
#line 85 "..\..\Views\User\Show.cshtml"
|
||||
|
||||
}
|
||||
|
||||
@@ -134,7 +289,7 @@ WriteLiteral("></ul>\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 48 "..\..\Views\User\Show.cshtml"
|
||||
#line 87 "..\..\Views\User\Show.cshtml"
|
||||
if (Authorization.Has(Claims.User.ShowAssignmentHistory))
|
||||
{
|
||||
|
||||
@@ -142,14 +297,14 @@ WriteLiteral(" ");
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 50 "..\..\Views\User\Show.cshtml"
|
||||
#line 89 "..\..\Views\User\Show.cshtml"
|
||||
Write(Html.Partial(MVC.User.Views.UserParts._AssignmentHistory, Model));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 50 "..\..\Views\User\Show.cshtml"
|
||||
#line 89 "..\..\Views\User\Show.cshtml"
|
||||
|
||||
}
|
||||
|
||||
@@ -159,7 +314,7 @@ WriteLiteral(" ");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 52 "..\..\Views\User\Show.cshtml"
|
||||
#line 91 "..\..\Views\User\Show.cshtml"
|
||||
if (Authorization.Has(Claims.User.ShowAttachments))
|
||||
{
|
||||
|
||||
@@ -167,14 +322,14 @@ WriteLiteral(" ");
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 54 "..\..\Views\User\Show.cshtml"
|
||||
#line 93 "..\..\Views\User\Show.cshtml"
|
||||
Write(Html.Partial(MVC.User.Views.UserParts._Resources, Model));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 54 "..\..\Views\User\Show.cshtml"
|
||||
#line 93 "..\..\Views\User\Show.cshtml"
|
||||
|
||||
}
|
||||
|
||||
@@ -184,7 +339,32 @@ WriteLiteral(" ");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 56 "..\..\Views\User\Show.cshtml"
|
||||
#line 95 "..\..\Views\User\Show.cshtml"
|
||||
if (Authorization.Has(Claims.User.ShowFlagAssignments))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 97 "..\..\Views\User\Show.cshtml"
|
||||
Write(Html.Partial(MVC.User.Views.UserParts._Flags, Model));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 97 "..\..\Views\User\Show.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 99 "..\..\Views\User\Show.cshtml"
|
||||
if (Authorization.Has(Claims.User.ShowAuthorization))
|
||||
{
|
||||
|
||||
@@ -192,14 +372,14 @@ WriteLiteral(" ");
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 58 "..\..\Views\User\Show.cshtml"
|
||||
#line 101 "..\..\Views\User\Show.cshtml"
|
||||
Write(Html.Partial(MVC.User.Views.UserParts._Authorization, Model));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 58 "..\..\Views\User\Show.cshtml"
|
||||
#line 101 "..\..\Views\User\Show.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,174 @@
|
||||
@model Disco.Web.Models.User.ShowModel
|
||||
@using Disco.Services.Users.UserFlags;
|
||||
@{
|
||||
Authorization.Require(Claims.User.ShowFlagAssignments);
|
||||
|
||||
var hasRemove = Authorization.Has(Claims.User.Actions.RemoveFlags);
|
||||
var hasEdit = Authorization.Has(Claims.User.Actions.EditFlags);
|
||||
|
||||
var hasUserFlagShow = Authorization.Has(Claims.Config.UserFlag.Show);
|
||||
var activeAssignmentCount = Model.User.UserFlagAssignments == null ? 0 : Model.User.UserFlagAssignments.Count(a => !a.RemovedDate.HasValue);
|
||||
|
||||
var flagAssignments = Model.User.UserFlagAssignments.Select(a => Tuple.Create(a, UserFlagService.GetUserFlag(a.UserFlagId))).ToList();
|
||||
}
|
||||
<div id="UserDetailTab-Flags" class="UserPart">
|
||||
@if (flagAssignments.Count > 0)
|
||||
{
|
||||
<table id="userFlags">
|
||||
<tr>
|
||||
<th class="name">Name</th>
|
||||
<th class="added">Added</th>
|
||||
<th class="sla">Comments</th>
|
||||
<th class="removed">Removed</th>
|
||||
</tr>
|
||||
@foreach (var fa in flagAssignments.OrderByDescending(a => a.Item1.AddedDate))
|
||||
{
|
||||
<tr data-userflagassignmentid="@fa.Item1.Id" data-flagassignmentaddeddate="@(fa.Item1.AddedDate.ToString("s"))" class="@(!fa.Item1.RemovedDate.HasValue ? "added" : "removed")">
|
||||
<td class="name">
|
||||
<i class="fa fa-@(fa.Item2.Icon) fa-fw fa-lg d-@(fa.Item2.IconColour)"></i>
|
||||
@if (hasUserFlagShow)
|
||||
{
|
||||
@Html.ActionLink(fa.Item2.Name, MVC.Config.UserFlag.Index(fa.Item2.Id))
|
||||
}
|
||||
else
|
||||
{
|
||||
@fa.Item2.Name
|
||||
}
|
||||
</td>
|
||||
<td class="added">
|
||||
@CommonHelpers.FriendlyDateAndUser(fa.Item1.AddedDate, fa.Item1.AddedUser)
|
||||
</td>
|
||||
<td class="comments">
|
||||
@if (hasEdit)
|
||||
{
|
||||
<div class="editable"><i class="fa fa-fw fa-edit" title="Edit Comments"></i></div>
|
||||
}
|
||||
@if (fa.Item1.Comments == null)
|
||||
{
|
||||
<div class="comments smallMessage">[no comments]</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="comments">@fa.Item1.Comments.ToHtmlComment()</div>
|
||||
<div class="commentsRaw">@fa.Item1.Comments</div>
|
||||
}
|
||||
</td>
|
||||
<td class="removed@(!fa.Item1.RemovedDate.HasValue ? " na" : null)">
|
||||
@if (fa.Item1.RemovedDate.HasValue)
|
||||
{
|
||||
@CommonHelpers.FriendlyDateAndUser(fa.Item1.RemovedDate.Value, fa.Item1.RemovedUser)
|
||||
}
|
||||
else if (fa.Item1.CanRemove())
|
||||
{
|
||||
<a href="#" class="button small remove">Remove</a>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
<div id="User_Show_Flags_Actions_Remove_Dialog" class="dialog" title="Remove this flag from the user?">
|
||||
@using (Html.BeginForm(MVC.API.UserFlagAssignment.RemoveUser()))
|
||||
{
|
||||
<input id="User_Show_Flags_Actions_Remove_Dialog_Id" type="hidden" name="id" value="" />
|
||||
<p>
|
||||
<i class="fa fa-exclamation-triangle fa-lg"></i> Are you sure?
|
||||
</p>
|
||||
}
|
||||
</div>
|
||||
<div id="User_Show_Flags_Actions_EditComments_Dialog" class="dialog" title="Edit the Comments">
|
||||
@using (Html.BeginForm(MVC.API.UserFlagAssignment.UpdateComments()))
|
||||
{
|
||||
<input id="User_Show_Flags_Actions_EditComments_Dialog_Id" type="hidden" name="id" value="" />
|
||||
<input type="hidden" name="redirect" value="true" />
|
||||
<h4>Comments:</h4>
|
||||
<p>
|
||||
<textarea id="User_Show_Flags_Actions_EditComments_Dialog_Comments" name="Comments" class="block"></textarea>
|
||||
</p>
|
||||
}
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var userFlags = $('#userFlags');
|
||||
|
||||
var dialog = null;
|
||||
var dialogEditComments = null;
|
||||
|
||||
userFlags.on('click', 'a.remove', function (e) {
|
||||
var $this = $(this);
|
||||
var UserFlagAssignmentId = $this.closest('tr').attr('data-userflagassignmentid');
|
||||
|
||||
if (!dialog) {
|
||||
dialog = $('#User_Show_Flags_Actions_Remove_Dialog');
|
||||
dialog.dialog({
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Remove Flag": function () {
|
||||
var $this = $(this);
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
$this.find('form').submit();
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('#User_Show_Flags_Actions_Remove_Dialog_Id').val(UserFlagAssignmentId);
|
||||
dialog.dialog('open');
|
||||
|
||||
e.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
userFlags.on('click', 'td.comments i.fa-edit', function (e) {
|
||||
var $this = $(this);
|
||||
var UserFlagAssignmentId = $this.closest('tr').attr('data-userflagassignmentid');
|
||||
|
||||
if (!dialogEditComments) {
|
||||
dialogEditComments = $('#User_Show_Flags_Actions_EditComments_Dialog');
|
||||
dialogEditComments.dialog({
|
||||
resizable: false,
|
||||
modal: true,
|
||||
width: 320,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Save Changes": function () {
|
||||
var $this = $(this);
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
$this.find('form').submit();
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var $comments = $this.closest('td').find('.commentsRaw');
|
||||
if ($comments.hasClass('smallMessage')) {
|
||||
$('#User_Show_Flags_Actions_EditComments_Dialog_Comments').val('');
|
||||
} else {
|
||||
$('#User_Show_Flags_Actions_EditComments_Dialog_Comments').val($comments.text());
|
||||
}
|
||||
|
||||
$('#User_Show_Flags_Actions_EditComments_Dialog_Id').val(UserFlagAssignmentId);
|
||||
dialogEditComments.dialog('open');
|
||||
e.preventDefault();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="none">This user has no associated flags</div>
|
||||
}
|
||||
<script>
|
||||
$('#UserDetailTabItems').append('<li><a href="#UserDetailTab-Flags">Flags [@activeAssignmentCount]</a></li>');
|
||||
</script>
|
||||
</div>
|
||||
@@ -0,0 +1,629 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.34014
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Views.User.UserParts
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Helpers;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc.Ajax;
|
||||
using System.Web.Mvc.Html;
|
||||
using System.Web.Routing;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
|
||||
#line 2 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
using Disco.Services.Users.UserFlags;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/User/UserParts/_Flags.cshtml")]
|
||||
public partial class Flags : Disco.Services.Web.WebViewPage<Disco.Web.Models.User.ShowModel>
|
||||
{
|
||||
public Flags()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 3 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
|
||||
Authorization.Require(Claims.User.ShowFlagAssignments);
|
||||
|
||||
var hasRemove = Authorization.Has(Claims.User.Actions.RemoveFlags);
|
||||
var hasEdit = Authorization.Has(Claims.User.Actions.EditFlags);
|
||||
|
||||
var hasUserFlagShow = Authorization.Has(Claims.Config.UserFlag.Show);
|
||||
var activeAssignmentCount = Model.User.UserFlagAssignments == null ? 0 : Model.User.UserFlagAssignments.Count(a => !a.RemovedDate.HasValue);
|
||||
|
||||
var flagAssignments = Model.User.UserFlagAssignments.Select(a => Tuple.Create(a, UserFlagService.GetUserFlag(a.UserFlagId))).ToList();
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"UserDetailTab-Flags\"");
|
||||
|
||||
WriteLiteral(" class=\"UserPart\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 15 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 15 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
if (flagAssignments.Count > 0)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <table");
|
||||
|
||||
WriteLiteral(" id=\"userFlags\"");
|
||||
|
||||
WriteLiteral(">\r\n <tr>\r\n <th");
|
||||
|
||||
WriteLiteral(" class=\"name\"");
|
||||
|
||||
WriteLiteral(">Name</th>\r\n <th");
|
||||
|
||||
WriteLiteral(" class=\"added\"");
|
||||
|
||||
WriteLiteral(">Added</th>\r\n <th");
|
||||
|
||||
WriteLiteral(" class=\"sla\"");
|
||||
|
||||
WriteLiteral(">Comments</th>\r\n <th");
|
||||
|
||||
WriteLiteral(" class=\"removed\"");
|
||||
|
||||
WriteLiteral(">Removed</th>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 24 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 24 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
foreach (var fa in flagAssignments.OrderByDescending(a => a.Item1.AddedDate))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <tr");
|
||||
|
||||
WriteLiteral(" data-userflagassignmentid=\"");
|
||||
|
||||
|
||||
#line 26 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
Write(fa.Item1.Id);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(" data-flagassignmentaddeddate=\"");
|
||||
|
||||
|
||||
#line 26 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
Write(fa.Item1.AddedDate.ToString("s"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 1240), Tuple.Create("\"", 1303)
|
||||
|
||||
#line 26 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1248), Tuple.Create<System.Object, System.Int32>(!fa.Item1.RemovedDate.HasValue ? "added" : "removed"
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1248), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"name\"");
|
||||
|
||||
WriteLiteral(">\r\n <i");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 1372), Tuple.Create("\"", 1439)
|
||||
, Tuple.Create(Tuple.Create("", 1380), Tuple.Create("fa", 1380), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 1382), Tuple.Create("fa-", 1383), true)
|
||||
|
||||
#line 28 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1386), Tuple.Create<System.Object, System.Int32>(fa.Item2.Icon
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1386), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 1402), Tuple.Create("fa-fw", 1403), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 1408), Tuple.Create("fa-lg", 1409), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 1414), Tuple.Create("d-", 1415), true)
|
||||
|
||||
#line 28 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1417), Tuple.Create<System.Object, System.Int32>(fa.Item2.IconColour
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1417), false)
|
||||
);
|
||||
|
||||
WriteLiteral("></i>\r\n");
|
||||
|
||||
|
||||
#line 29 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 29 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
if (hasUserFlagShow)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 31 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
Write(Html.ActionLink(fa.Item2.Name, MVC.Config.UserFlag.Index(fa.Item2.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 31 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 35 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
Write(fa.Item2.Name);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 35 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </td>\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"added\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 39 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
Write(CommonHelpers.FriendlyDateAndUser(fa.Item1.AddedDate, fa.Item1.AddedUser));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"comments\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 42 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 42 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
if (hasEdit)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"editable\"");
|
||||
|
||||
WriteLiteral("><i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-fw fa-edit\"");
|
||||
|
||||
WriteLiteral(" title=\"Edit Comments\"");
|
||||
|
||||
WriteLiteral("></i></div>\r\n");
|
||||
|
||||
|
||||
#line 45 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 46 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
if (fa.Item1.Comments == null)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"comments smallMessage\"");
|
||||
|
||||
WriteLiteral(">[no comments]</div>\r\n");
|
||||
|
||||
|
||||
#line 49 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"comments\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 52 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
Write(fa.Item1.Comments.ToHtmlComment());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</div>\r\n");
|
||||
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"commentsRaw\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 53 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
Write(fa.Item1.Comments);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</div>\r\n");
|
||||
|
||||
|
||||
#line 54 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </td>\r\n <td");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 2719), Tuple.Create("\"", 2782)
|
||||
, Tuple.Create(Tuple.Create("", 2727), Tuple.Create("removed", 2727), true)
|
||||
|
||||
#line 56 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 2734), Tuple.Create<System.Object, System.Int32>(!fa.Item1.RemovedDate.HasValue ? " na" : null
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 2734), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 57 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 57 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
if (fa.Item1.RemovedDate.HasValue)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 59 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
Write(CommonHelpers.FriendlyDateAndUser(fa.Item1.RemovedDate.Value, fa.Item1.RemovedUser));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 59 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
|
||||
}
|
||||
else if (fa.Item1.CanRemove())
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <a");
|
||||
|
||||
WriteLiteral(" href=\"#\"");
|
||||
|
||||
WriteLiteral(" class=\"button small remove\"");
|
||||
|
||||
WriteLiteral(">Remove</a>\r\n");
|
||||
|
||||
|
||||
#line 64 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </td>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 67 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </table>\r\n");
|
||||
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"User_Show_Flags_Actions_Remove_Dialog\"");
|
||||
|
||||
WriteLiteral(" class=\"dialog\"");
|
||||
|
||||
WriteLiteral(" title=\"Remove this flag from the user?\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 70 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 70 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
using (Html.BeginForm(MVC.API.UserFlagAssignment.RemoveUser()))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <input");
|
||||
|
||||
WriteLiteral(" id=\"User_Show_Flags_Actions_Remove_Dialog_Id\"");
|
||||
|
||||
WriteLiteral(" type=\"hidden\"");
|
||||
|
||||
WriteLiteral(" name=\"id\"");
|
||||
|
||||
WriteLiteral(" value=\"\"");
|
||||
|
||||
WriteLiteral(" />\r\n");
|
||||
|
||||
WriteLiteral(" <p>\r\n <i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-exclamation-triangle fa-lg\"");
|
||||
|
||||
WriteLiteral("></i> Are you sure?\r\n </p>\r\n");
|
||||
|
||||
|
||||
#line 76 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n");
|
||||
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"User_Show_Flags_Actions_EditComments_Dialog\"");
|
||||
|
||||
WriteLiteral(" class=\"dialog\"");
|
||||
|
||||
WriteLiteral(" title=\"Edit the Comments\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 79 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 79 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
using (Html.BeginForm(MVC.API.UserFlagAssignment.UpdateComments()))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <input");
|
||||
|
||||
WriteLiteral(" id=\"User_Show_Flags_Actions_EditComments_Dialog_Id\"");
|
||||
|
||||
WriteLiteral(" type=\"hidden\"");
|
||||
|
||||
WriteLiteral(" name=\"id\"");
|
||||
|
||||
WriteLiteral(" value=\"\"");
|
||||
|
||||
WriteLiteral(" />\r\n");
|
||||
|
||||
WriteLiteral(" <input");
|
||||
|
||||
WriteLiteral(" type=\"hidden\"");
|
||||
|
||||
WriteLiteral(" name=\"redirect\"");
|
||||
|
||||
WriteLiteral(" value=\"true\"");
|
||||
|
||||
WriteLiteral(" />\r\n");
|
||||
|
||||
WriteLiteral(" <h4>Comments:</h4>\r\n");
|
||||
|
||||
WriteLiteral(" <p>\r\n <textarea");
|
||||
|
||||
WriteLiteral(" id=\"User_Show_Flags_Actions_EditComments_Dialog_Comments\"");
|
||||
|
||||
WriteLiteral(" name=\"Comments\"");
|
||||
|
||||
WriteLiteral(" class=\"block\"");
|
||||
|
||||
WriteLiteral("></textarea>\r\n </p>\r\n");
|
||||
|
||||
|
||||
#line 87 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n");
|
||||
|
||||
WriteLiteral(" <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(">\r\n $(function () {\r\n var userFlags = $(\'#userFlags\');\r" +
|
||||
"\n\r\n var dialog = null;\r\n var dialogEditComments = " +
|
||||
"null;\r\n\r\n userFlags.on(\'click\', \'a.remove\', function (e) {\r\n " +
|
||||
" var $this = $(this);\r\n var UserFlagAssignmentI" +
|
||||
"d = $this.closest(\'tr\').attr(\'data-userflagassignmentid\');\r\n\r\n " +
|
||||
" if (!dialog) {\r\n dialog = $(\'#User_Show_Flags_Actions_R" +
|
||||
"emove_Dialog\');\r\n dialog.dialog({\r\n " +
|
||||
" resizable: false,\r\n modal: true,\r\n " +
|
||||
" autoOpen: false,\r\n buttons: {\r\n " +
|
||||
" \"Remove Flag\": function () {\r\n " +
|
||||
" var $this = $(this);\r\n $this.dialo" +
|
||||
"g(\"disable\");\r\n $this.dialog(\"option\", \"butto" +
|
||||
"ns\", null);\r\n $this.find(\'form\').submit();\r\n " +
|
||||
" },\r\n Cancel: funct" +
|
||||
"ion () {\r\n $(this).dialog(\"close\");\r\n " +
|
||||
" }\r\n }\r\n " +
|
||||
" });\r\n }\r\n\r\n $(\'#User_Show_Flags_Actions_" +
|
||||
"Remove_Dialog_Id\').val(UserFlagAssignmentId);\r\n dialog.dialog" +
|
||||
"(\'open\');\r\n\r\n e.preventDefault();\r\n return" +
|
||||
" false;\r\n });\r\n\r\n userFlags.on(\'click\', \'td.commen" +
|
||||
"ts i.fa-edit\', function (e) {\r\n var $this = $(this);\r\n " +
|
||||
" var UserFlagAssignmentId = $this.closest(\'tr\').attr(\'data-userflaga" +
|
||||
"ssignmentid\');\r\n\r\n if (!dialogEditComments) {\r\n " +
|
||||
" dialogEditComments = $(\'#User_Show_Flags_Actions_EditComments_Dialog\')" +
|
||||
";\r\n dialogEditComments.dialog({\r\n " +
|
||||
" resizable: false,\r\n modal: true,\r\n " +
|
||||
" width: 320,\r\n autoOpen: false,\r\n " +
|
||||
" buttons: {\r\n \"Save Changes\": " +
|
||||
"function () {\r\n var $this = $(this);\r\n " +
|
||||
" $this.dialog(\"disable\");\r\n " +
|
||||
" $this.dialog(\"option\", \"buttons\", null);\r\n " +
|
||||
" $this.find(\'form\').submit();\r\n },\r\n " +
|
||||
" Cancel: function () {\r\n " +
|
||||
" $(this).dialog(\"close\");\r\n }\r\n " +
|
||||
" }\r\n });\r\n }\r\n\r\n " +
|
||||
" var $comments = $this.closest(\'td\').find(\'.commentsRaw\');\r\n " +
|
||||
" if ($comments.hasClass(\'smallMessage\')) {\r\n $(" +
|
||||
"\'#User_Show_Flags_Actions_EditComments_Dialog_Comments\').val(\'\');\r\n " +
|
||||
" } else {\r\n $(\'#User_Show_Flags_Actions_EditComment" +
|
||||
"s_Dialog_Comments\').val($comments.text());\r\n }\r\n\r\n " +
|
||||
" $(\'#User_Show_Flags_Actions_EditComments_Dialog_Id\').val(UserFlagAssign" +
|
||||
"mentId);\r\n dialogEditComments.dialog(\'open\');\r\n " +
|
||||
" e.preventDefault();\r\n return false;\r\n })" +
|
||||
";\r\n });\r\n </script>\r\n");
|
||||
|
||||
|
||||
#line 166 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"none\"");
|
||||
|
||||
WriteLiteral(">This user has no associated flags</div>\r\n");
|
||||
|
||||
|
||||
#line 170 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <script>\r\n $(\'#UserDetailTabItems\').append(\'<li><a href=\"#UserDetailTa" +
|
||||
"b-Flags\">Flags [");
|
||||
|
||||
|
||||
#line 172 "..\..\Views\User\UserParts\_Flags.cshtml"
|
||||
Write(activeAssignmentCount);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("]</a></li>\');\r\n </script>\r\n</div>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user