Example #1
0
        private void AddLocalsMenu(Control ul)
        {
            // County Admins always see a local menu
            // Masters and State Admins see it if they are on a County or Local Admin page
            string stateCode  = null;
            string countyCode = null;

            if (SecurePage.IsCountyAdminUser ||
                (SecurePage.IsMasterUser || SecurePage.IsStateAdminUser) &&
                (SecurePage.IsCountyAdminPage || SecurePage.IsLocalAdminPage))
            {
                stateCode  = SecurePage.FindStateCode();
                countyCode = SecurePage.FindCountyCode();
            }
            var template = "/admin/{page}?state={StateCode}&county={CountyCode}&local={LocalKey}";

            if (SecurePage.IsStateAdminUser)
            {
                template = "/admin/{page}?county={CountyCode}&local={LocalKey}";
            }
            else if (SecurePage.IsCountyAdminUser)
            {
                template = "/admin/{page}?local={LocalKey}";
            }
            template = GetMenuPage(template);
            if (stateCode != null && countyCode != null)
            {
                AddMenuItem(ul, "Locals",
                            GetLocalsMenu(template, stateCode, countyCode));
            }
        }
Example #2
0
        private static void AddMasterOfficesMenu(Control parent)
        {
            // Masters only see it if they are on an Admin page
            if (!SecurePage.IsMasterUser)
            {
                return;
            }
            string stateCode = null;

            if (SecurePage.IsAdminPage)
            {
                stateCode = SecurePage.FindStateCode();
            }
            if (StateCache.IsValidStateCode(stateCode))
            {
                var ul         = CreateDropdownMenu();
                var countyCode = SecurePage.FindCountyCode();
                var localKey   = SecurePage.FindLocalKey();
                AddMenuItem(ul, "Manage Offices, Office Templates and Incumbents",
                            SecureAdminPage.GetUpdateOfficesPageUrl(stateCode, countyCode, localKey));
                AddMenuItem(ul, "Offices Report",
                            SecureAdminPage.GetOfficesPageUrl(stateCode, countyCode, localKey));
                AddMenuItem(ul, "Incumbents Report",
                            SecureAdminPage.GetOfficialsPageUrl(stateCode, countyCode, localKey));
                AddMenuItem(ul, "Download County or Local Offices CSV",
                            SecureAdminPage.GetAdminFolderPageUrl("DownloadOfficesCsv", "state", stateCode));
                AddMenuItem(parent, "Offices", ul);
            }
        }
Example #3
0
        private static void AddJurisdictionsMenu(Control ul)
        {
            var stateCode = SecurePage.FindStateCode();

            AddMenuItem(ul, "Jurisdictions",
                        SecureAdminPage.GetUpdateJurisdictionsPageUrl(stateCode,
                                                                      SecurePage.FindCountyCode(), SecurePage.FindLocalKey()));
        }
Example #4
0
        private static void AddElectionsMenu(Control ul)
        {
            // Admins always see an elections menu
            // Masters see it if they are on any Admin page
            string stateCode = null;

            if (SecurePage.IsMasterUser && SecurePage.IsAdminPage)
            {
                stateCode = SecurePage.FindStateCode();
            }
            if (SecurePage.IsAdminUser || StateCache.IsValidStateCode(stateCode))
            {
                AddMenuItem(ul, "Elections",
                            SecureAdminPage.GetUpdateElectionsPageUrl(stateCode, SecurePage.FindCountyCode(),
                                                                      SecurePage.FindLocalKey()));
            }
        }