Add date-based managed group filtering

This commit is contained in:
Gary Sharp
2016-10-10 19:21:01 +11:00
parent 062769a7e3
commit 23975f8fc3
18 changed files with 2025 additions and 1610 deletions
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34014
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -27,7 +27,6 @@ namespace Disco.Web.Areas.Config.Views.Shared
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;
@@ -44,7 +43,15 @@ namespace Disco.Web.Areas.Config.Views.Shared
}
public override void Execute()
{
WriteLiteral("<div");
#line 1 "..\..\Areas\Config\Views\Shared\LinkedGroupShared.cshtml"
Html.BundleDeferred("~/ClientScripts/Modules/jQueryUI-TimePicker");
#line default
#line hidden
WriteLiteral("\r\n<div");
WriteLiteral(" id=\"Config_LinkedGroup_Dialog\"");
@@ -56,7 +63,50 @@ WriteLiteral(">\r\n <h3");
WriteLiteral(" id=\"Config_LinkedGroup_Title\"");
WriteLiteral("></h3>\r\n <div");
WriteLiteral("></h3>\r\n <form");
WriteLiteral(" action=\"#\"");
WriteLiteral(" method=\"post\"");
WriteLiteral(">\r\n <table");
WriteLiteral(" class=\"input\"");
WriteLiteral(">\r\n <tbody>\r\n <tr>\r\n <th>\r\n " +
" <label");
WriteLiteral(" for=\"Config_LinkedGroup_Id\"");
WriteLiteral(">Linked Group:</label>\r\n </th>\r\n <td>\r\n " +
" <input");
WriteLiteral(" id=\"Config_LinkedGroup_Id\"");
WriteLiteral(" type=\"text\"");
WriteLiteral(" name=\"GroupId\"");
WriteLiteral(" />\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
" <th>\r\n <label");
WriteLiteral(" for=\"Config_LinkedGroup_FilterDate\"");
WriteLiteral(">Filter Date: </label>\r\n </th>\r\n <td>\r\n " +
" <input");
WriteLiteral(" id=\"Config_LinkedGroup_FilterDate\"");
WriteLiteral(" type=\"text\"");
WriteLiteral(" name=\"FilterBeginDate\"");
WriteLiteral(" placeholder=\"No Filter\"");
WriteLiteral(" autocomplete=\"off\"");
WriteLiteral(" />\r\n </td>\r\n </tr>\r\n </tbody>\r\n " +
" </table>\r\n </form>\r\n <div");
WriteLiteral(" class=\"info-box error\"");
@@ -72,39 +122,15 @@ WriteLiteral(@"></i><strong>Warning:</strong> This group will be managed by Disc
Any <strong>existing members will be removed from the group</strong>, and it will be automatically synchronized with related members.
</p>
</div>
<form");
WriteLiteral(" action=\"#\"");
WriteLiteral(" method=\"post\"");
WriteLiteral(">\r\n <div");
WriteLiteral(" class=\"input\"");
WriteLiteral(">\r\n <label");
WriteLiteral(" for=\"Config_LinkedGroup_Id\"");
WriteLiteral(">Linked Group: </label>\r\n <input");
WriteLiteral(" id=\"Config_LinkedGroup_Id\"");
WriteLiteral(" type=\"text\"");
WriteLiteral(" name=\"GroupId\"");
WriteLiteral(@" />
</div>
</form>
</div>
<script>
$(function () {
var dialog;
var dialogGroupId;
var dialogFilterDate;
var dialogTitle;
function showDialog(groupId, updateUrl, title) {
function showDialog(groupId, filterDateOption, filterDateValue, updateUrl, title) {
if (dialog == null) {
dialog = $('#Config_LinkedGroup_Dialog').dialog({
width: 450,
@@ -113,13 +139,21 @@ WriteLiteral(@" />
autoOpen: false
});
dialogFilterDate = $('#Config_LinkedGroup_FilterDate');
dialogFilterDate.datetimepicker({
ampm: true,
changeYear: true,
changeMonth: true,
dateFormat: 'yy/mm/dd'
});
dialogGroupId = $('#Config_LinkedGroup_Id');
dialogGroupId.focus(function () { $(this).select(); });
dialogGroupId.autocomplete({
source: '");
#line 34 "..\..\Areas\Config\Views\Shared\LinkedGroupShared.cshtml"
#line 62 "..\..\Areas\Config\Views\Shared\LinkedGroupShared.cshtml"
Write(Url.Action(MVC.API.System.SearchGroupSubjects()));
@@ -144,15 +178,23 @@ WriteLiteral("\',\r\n minLength: 2,\r\n se
" dialogGroupId.closest(\'form\').attr(\'action\', updateUrl).submit();\r\n " +
" }\r\n dialogButtons[\'Cancel\'] = function () {\r\n $(t" +
"his).dialog(\'close\');\r\n };\r\n\r\n dialogGroupId.val(groupId);" +
"\r\n dialogTitle.text(title);\r\n dialog.dialog(\'option\', \'but" +
"tons\', dialogButtons);\r\n dialog.dialog(\'option\', \'title\', \'Linked Gro" +
"up: \' + title);\r\n dialog.dialog(\'open\');\r\n }\r\n\r\n $(docu" +
"ment).on(\'click\', \'.Config_LinkedGroup_LinkButton\', function () {\r\n $" +
"this = $(this);\r\n\r\n var configuredGroupId = $this.attr(\'data-linkedgr" +
"oupid\');\r\n var description = $this.attr(\'data-linkedroupdescription\')" +
";\r\n var updateUrl = $this.attr(\'data-linkedroupupdateurl\');\r\n\r\n " +
" showDialog(configuredGroupId, updateUrl, description);\r\n\r\n retu" +
"rn false;\r\n });\r\n });\r\n</script>\r\n");
"\r\n\r\n if (!!filterDateOption) {\r\n if (!!filterDateValue" +
") {\r\n dialogFilterDate.datetimepicker(\'setDate\', moment(filte" +
"rDateValue).toDate());\r\n } else {\r\n dialogFilt" +
"erDate.val(\'\');\r\n }\r\n dialogFilterDate.closest(\'tr" +
"\').show();\r\n } else {\r\n dialogFilterDate.closest(\'tr\')" +
".hide();\r\n }\r\n\r\n dialogTitle.text(title);\r\n dia" +
"log.dialog(\'option\', \'buttons\', dialogButtons);\r\n dialog.dialog(\'opti" +
"on\', \'title\', \'Linked Group: \' + title);\r\n dialog.dialog(\'open\');\r\n " +
" }\r\n\r\n $(document).on(\'click\', \'.Config_LinkedGroup_LinkButton\', fun" +
"ction () {\r\n $this = $(this);\r\n\r\n var configuredGroupId = " +
"$this.attr(\'data-linkedgroupid\');\r\n var configuredFilterBeginDate = $" +
"this.attr(\'data-linkedgroupfilterdate\');\r\n var filterDateOption = $th" +
"is.attr(\'data-linkedgroupfilterdateoption\') == \'True\';\r\n var descript" +
"ion = $this.attr(\'data-linkedroupdescription\');\r\n var updateUrl = $th" +
"is.attr(\'data-linkedroupupdateurl\');\r\n\r\n showDialog(configuredGroupId" +
", filterDateOption, configuredFilterBeginDate, updateUrl, description);\r\n\r\n " +
" return false;\r\n });\r\n });\r\n</script>\r\n");
}
}