diff --git a/Site5/App_GlobalResources/Controls.Swarm.resx b/Site5/App_GlobalResources/Controls.Swarm.resx index 47faef02..79647be0 100644 --- a/Site5/App_GlobalResources/Controls.Swarm.resx +++ b/Site5/App_GlobalResources/Controls.Swarm.resx @@ -117,6 +117,19 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Assign another person... + To an existing position that accepts multiple people (like "assistants") + + + Assign a fifth person... + + + Assign somebody... + + + Assign a fourth person... + Assignment duration (extendable) @@ -124,16 +137,19 @@ Expires The date a position assignment autoterminates - - Assign one more person... - To an existing position that accepts multiple people (like "assistants") - - - Assign person... - Assign this person to position + + Assign a second person... + + + Assign a sixth person... + ok, this is not strictly necessary, just a bell & whistle + + + Assign a third person... + Assign Kind of "hire" but also for volunteers @@ -149,7 +165,7 @@ Please select a person to assign. - (vacant) + (position is vacant) For unassigned positions \ No newline at end of file diff --git a/Site5/Automation/Json-PositionsTree.aspx.cs b/Site5/Automation/Json-PositionsTree.aspx.cs index 7e20e71c..d6c856e6 100644 --- a/Site5/Automation/Json-PositionsTree.aspx.cs +++ b/Site5/Automation/Json-PositionsTree.aspx.cs @@ -43,7 +43,7 @@ namespace Swarmops.Frontend.Automation PositionAssignments assignments = position.Assignments; string expires = string.Empty; - string assignedName = string.Format("{2} {0}", Resources.Controls.Swarm.Positions_Vacant, _customCookieClass, Resources.Controls.Swarm.Positions_AssignPerson, position.Identity, JavascriptEscape(position.Localized())); + string assignedName = string.Format("{2} {0}", Resources.Controls.Swarm.Positions_Vacant, _customCookieClass, Resources.Controls.Swarm.Positions_AssignFirstPerson, position.Identity, JavascriptEscape(position.Localized())); if (assignments.Count > 0) { @@ -58,7 +58,7 @@ namespace Swarmops.Frontend.Automation string element = string.Format("\"id\":\"{0}-1\",\"positionTitle\":\"{1}\",\"assignedName\":\"{2}\",\"expires\":\"{3}\",\"minMax\":\"{4} / {5}\",\"iconType\":\"{6}\"", position.Identity, JsonSanitize (localizedPositionName), JsonSanitize (assignedName), JsonSanitize (expires), position.MinCount, position.MaxCount == 0? @"∞" : position.MaxCount.ToString(CultureInfo.InvariantCulture), - position.MaxCount == 1? "singular" : "plural"); + position.MaxCount == 1? "Person" : "Group"); // TODO: Add all assignments after the first one right here @@ -78,7 +78,7 @@ namespace Swarmops.Frontend.Automation } element = String.Format ( - "\"id\":\"{0}-{1}\",\"iconType\":\"hidden\",\"positionTitle\":\" \",\"assignedName\":\"{2}\",\"expires\":\"{3}\"", + "\"id\":\"{0}-{1}\",\"iconType\":\"Hidden\",\"positionTitle\":\" \",\"assignedName\":\"{2}\",\"expires\":\"{3}\"", position.Identity, assignmentCount+1, assignments[assignmentCount].Person.Canonical, expires); assignmentCount++; @@ -88,16 +88,32 @@ namespace Swarmops.Frontend.Automation { // finally, if the assigned count is less than max count, add a "assign another person" link + int count = position.Assignments.Count; + if (count > 6) + { + count = 6; + } + string[] overEngineeredAssignmentPrompts = + { + Resources.Controls.Swarm.Positions_AssignFirstPerson, + Resources.Controls.Swarm.Positions_AssignSecondPerson, + Resources.Controls.Swarm.Positions_AssignThirdPerson, + Resources.Controls.Swarm.Positions_AssignFourthPerson, + Resources.Controls.Swarm.Positions_AssignFifthPerson, + Resources.Controls.Swarm.Positions_AssignSixthPerson, + Resources.Controls.Swarm.Positions_AssignAnotherPerson + }; + elements.Add ("{" + element + "}"); string addPerson = string.Format ( "{0}", - Resources.Controls.Swarm.Positions_AssignMorePerson, position.Identity, + overEngineeredAssignmentPrompts[count], position.Identity, JavascriptEscape (position.Localized()), _customCookieClass); element = String.Format( - "\"id\":\"{0}-0\",\"iconType\":\"hidden\",\"positionTitle\":\" \",\"assignedName\":\"{1}\"", + "\"id\":\"{0}-0\",\"iconType\":\"Hidden\",\"positionTitle\":\" \",\"assignedName\":\"{1}\"", position.Identity, addPerson); } diff --git a/Site5/Controls/v5/Swarm/TreePositions.ascx b/Site5/Controls/v5/Swarm/TreePositions.ascx index ca2f6d4d..9df54d83 100644 --- a/Site5/Controls/v5/Swarm/TreePositions.ascx +++ b/Site5/Controls/v5/Swarm/TreePositions.ascx @@ -7,6 +7,13 @@ $('#<%=this.ClientID%>_tablePositions').treegrid( { + rowStyler: function (rowData) { + if (rowData.iconType != null) { + return { class: "iconType" + rowData.iconType }; + } + + return ''; + }, onLoadSuccess: function () { $('.LocalAssignPerson.LocalPosition<%=this.Cookie%>').click(function () { @@ -27,7 +34,7 @@ if (personId == 0) { // abort - alert("No person selected, not assigning anybody"); + alertify.error("Please select a person."); // LOC return; } @@ -57,7 +64,6 @@ - div.datagrid-wrap.panel-body { } +tr.iconTypeHidden > td > div > span.tree-icon { + visibility: hidden; +} + +tr.iconTypeGroup > td > div > span.tree-icon { + background: url('/Images/Icons/iconshock-group-diversified-64px.png'); + background-size: 16px 16px; + background-repeat: no-repeat; +} + +tr.iconTypePerson > td > div > span.tree-icon { + background: url('/Images/Icons/iconshock-user-16px.png'); + background-repeat: no-repeat; +} + + /* TABS */