コード例 #1
0
 private static HtmlBuilder AccountMenu(this HtmlBuilder hb)
 {
     return(hb.Ul(id: "AccountMenu", css: "menu", action: () => hb
                  .Li(action: () => hb
                      .A(
                          href: Locations.Logout(),
                          action: () => hb
                          .Span(css: "ui-icon ui-icon-locked")
                          .Text(text: Displays.Logout())))
                  .Li(
                      action: () => hb
                      .A(
                          href: Locations.Edit("Users", Sessions.UserId()),
                          action: () => hb
                          .Span(css: "ui-icon ui-icon-wrench")
                          .Text(text: Displays.EditProfile())),
                      _using: Parameters.Service.ShowProfiles)
                  .Li(
                      action: () => hb
                      .A(
                          href: Locations.Get("Users", "EditApi"),
                          action: () => hb
                          .Span(css: "ui-icon ui-icon-link")
                          .Text(text: Displays.ApiSettings())),
                      _using: Contract.Api())
                  .Li(action: () => hb
                      .A(
                          href: Parameters.General.HtmlUsageGuideUrl,
                          target: "_blank",
                          action: () => hb
                          .Span(css: "ui-icon ui-icon-help")
                          .Text(text: Displays.UsageGuide())))
                  .Li(action: () => hb
                      .A(
                          href: Parameters.General.HtmlBlogUrl,
                          target: "_blank",
                          action: () => hb
                          .Span(css: "ui-icon ui-icon-info")
                          .Text(text: Displays.Blog())))
                  .Li(action: () => hb
                      .A(
                          href: Parameters.General.HtmlCopyrightUrl,
                          target: "_blank",
                          action: () => hb
                          .Span(css: "ui-icon ui-icon-contact")
                          .Text(text: Displays.Support())))
                  .Li(action: () => hb
                      .A(
                          href: Parameters.General.HtmlPortalUrl,
                          target: "_blank",
                          action: () => hb
                          .Span(css: "ui-icon ui-icon-cart")
                          .Text(text: Displays.Portal())))
                  .Li(action: () => hb
                      .A(
                          href: Locations.Get("versions"),
                          action: () => hb
                          .Span(css: "ui-icon ui-icon-info")
                          .Text(text: Displays.Version())))));
 }
コード例 #2
0
 private static HtmlBuilder AccountMenu(this HtmlBuilder hb, Context context)
 {
     return(hb.Ul(id: "AccountMenu", css: "menu", action: () => hb
                  .Li(
                      action: () => hb
                      .A(
                          href: Locations.Logout(context: context),
                          action: () => hb
                          .Span(css: "ui-icon ui-icon-locked")
                          .Text(text: Displays.Logout(context: context))))
                  .Li(
                      action: () => hb
                      .A(
                          href: "javascript:void(0);",
                          attributes: new HtmlAttributes()
                          .OnClick("$p.setStartGuide(0,1);"),
                          action: () => hb
                          .Span(css: "ui-icon ui-icon-help")
                          .Text(text: Displays.ShowStartGuide(context: context))),
                      _using: context.UserSettings.ShowStartGuideAvailable(context: context))
                  .Li(
                      action: () => hb
                      .A(
                          href: Locations.Edit(
                              context: context,
                              controller: "Users",
                              id: context.UserId),
                          action: () => hb
                          .Span(css: "ui-icon ui-icon-wrench")
                          .Text(text: Displays.EditProfile(context: context))),
                      _using: Parameters.Service.ShowProfiles)
                  .Li(
                      action: () => hb
                      .A(
                          href: "javascript:void(0);",
                          attributes: new HtmlAttributes()
                          .OnClick("$p.openChangePasswordDialog($(this), 'ChangePasswordForm');")
                          .DataMethod("post")
                          .DataAction("OpenChangePasswordDialog"),
                          action: () => hb
                          .Span(css: "ui-icon ui-icon-person")
                          .Text(text: Displays.ChangePassword(context: context))),
                      _using: !Parameters.Service.ShowProfiles &&
                      Parameters.Service.ShowChangePassword)
                  .Li(
                      action: () => hb
                      .A(
                          href: Locations.Get(
                              context: context,
                              parts: new string[]
     {
         "Users",
         "EditApi"
     }),
                          action: () => hb
                          .Span(css: "ui-icon ui-icon-link")
                          .Text(text: Displays.ApiSettings(context: context))),
                      _using: context.ContractSettings.Api != false && Parameters.Api.Enabled)));
 }
コード例 #3
0
        public static HtmlBuilder Breadcrumb(
            this HtmlBuilder hb, SiteSettings ss, long siteId, bool _using)
        {
            if (!Sessions.LoggedIn() || !_using)
            {
                return(hb);
            }
            var controller = Routes.Controller();

            switch (controller)
            {
            case "admins":
                return(Breadcrumb(hb, controller));

            case "depts":
                return(Breadcrumb(hb, controller, Displays.Depts()));

            case "groups":
                return(Permissions.CanManageTenant()
                        ? Breadcrumb(hb, controller, Displays.Groups())
                        : Breadcrumb(hb));

            case "users":
                switch (Routes.Action())
                {
                case "editapi":
                    return(hb.Breadcrumb(new Dictionary <string, string>
                    {
                        { Locations.Get("Users", "EditApi"), Displays.ApiSettings() }
                    }));

                default:
                    return(Permissions.CanManageTenant()
                                ? Breadcrumb(hb, controller, Displays.Users())
                                : Breadcrumb(hb));
                }

            case "items":
            case "permissions":
                return(hb.Breadcrumb(siteId));

            default:
                return(hb);
            }
        }
コード例 #4
0
        public static HtmlBuilder Breadcrumb(
            this HtmlBuilder hb, Context context, SiteSettings ss, View view, bool _using)
        {
            if ((!context.Authenticated && !context.Publish) || !_using)
            {
                return(hb);
            }
            switch (context.Controller)
            {
            case "admins":
                return(Breadcrumb(
                           hb: hb,
                           context: context,
                           ss: ss,
                           controller: context.Controller));

            case "depts":
                return(Breadcrumb(
                           hb: hb,
                           context: context,
                           ss: ss,
                           controller: context.Controller,
                           display: Displays.Depts(context: context)));

            case "tenants":
                return(Permissions.CanManageTenant(context: context)
                        ? Breadcrumb(
                           hb: hb,
                           context: context,
                           ss: ss,
                           controller: context.Controller,
                           display: Displays.Tenants(context: context),
                           action: "Edit")
                        : (context.UserSettings?.EnableManageTenant == true)
                            ? BreadcrumbWithoutAdmins(
                           hb: hb,
                           context: context,
                           ss: ss,
                           controller: context.Controller,
                           display: Displays.Tenants(context: context),
                           action: "Edit")
                            : Breadcrumb(
                           hb: hb,
                           context: context,
                           ss: ss));

            case "groups":
                return(Permissions.CanManageTenant(context: context)
                        ? Breadcrumb(
                           hb: hb,
                           context: context,
                           ss: ss,
                           controller: context.Controller,
                           display: Displays.Groups(context: context))
                        : Breadcrumb(
                           hb: hb,
                           context: context,
                           ss: ss));

            case "users":
                switch (context.Action)
                {
                case "editapi":
                    return(hb.Breadcrumb(
                               context: context,
                               ss: ss,
                               data: new Dictionary <string, string>
                    {
                        {
                            Locations.Get(
                                context: context,
                                parts: new string[]
                            {
                                "Users",
                                "EditApi"
                            }),
                            Displays.ApiSettings(context: context)
                        }
                    }));

                default:
                    return(Permissions.CanManageTenant(context: context)
                                ? Breadcrumb(
                               hb: hb,
                               context: context,
                               ss: ss,
                               controller: context.Controller,
                               display: Displays.Users(context: context))
                                : Breadcrumb(
                               hb: hb,
                               context: context,
                               ss: ss));
                }

            case "registrations":
                return(Permissions.CanManageTenant(context: context)
                        ? Breadcrumb(
                           hb: hb,
                           context: context,
                           ss: ss,
                           controller: context.Controller,
                           display: Displays.Registrations(context: context))
                        : Breadcrumb(
                           hb: hb,
                           context: context,
                           ss: ss));

            case "publishes":
            case "items":
                return(hb
                       .CopyDirectUrlToClipboard(
                           context: context,
                           view: view)
                       .Breadcrumb(
                           context: context,
                           ss: ss));

            case "permissions":
                return(hb.Breadcrumb(context: context, ss: ss));

            default:
                return(hb);
            }
        }
コード例 #5
0
 private static HtmlBuilder AccountMenu(this HtmlBuilder hb, Context context)
 {
     return(hb.Ul(id: "AccountMenu", css: "menu", action: () => hb
                  .Li(action: () => hb
                      .A(
                          href: Locations.Logout(context: context),
                          action: () => hb
                          .Span(css: "ui-icon ui-icon-locked")
                          .Text(text: Displays.Logout(context: context))))
                  .Li(action: () => hb
                      .A(
                          href: Parameters.General.HtmlUserManualUrl,
                          target: "_blank",
                          action: () => hb
                          .Span(css: "ui-icon ui-icon-help")
                          .Text(text: Displays.UserManual(context: context))))
                  .Li(
                      action: () => hb
                      .A(
                          href: "javascript:void(0);",
                          attributes: new HtmlAttributes()
                          .OnClick("$p.setStartGuide(0,1);"),
                          action: () => hb
                          .Span(css: "ui-icon ui-icon-help")
                          .Text(text: Displays.ShowStartGuide(context: context))),
                      _using: context.UserSettings.ShowStartGuideAvailable(context: context))
                  .Li(
                      action: () => hb
                      .A(
                          href: Locations.Edit(
                              context: context,
                              controller: "Users",
                              id: context.UserId),
                          action: () => hb
                          .Span(css: "ui-icon ui-icon-wrench")
                          .Text(text: Displays.EditProfile(context: context))),
                      _using: Parameters.Service.ShowProfiles)
                  .Li(
                      action: () => hb
                      .A(
                          href: Locations.Get(
                              context: context,
                              parts: new string[]
     {
         "Users",
         "EditApi"
     }),
                          action: () => hb
                          .Span(css: "ui-icon ui-icon-link")
                          .Text(text: Displays.ApiSettings(context: context))),
                      _using: context.ContractSettings.Api != false && Parameters.Api.Enabled)
                  .Li(action: () => hb
                      .A(
                          href: Parameters.General.HtmlBlogUrl,
                          target: "_blank",
                          action: () => hb
                          .Span(css: "ui-icon ui-icon-info")
                          .Text(text: Displays.Blog(context: context))))
                  .Li(action: () => hb
                      .A(
                          href: Parameters.General.HtmlSupportUrl,
                          target: "_blank",
                          action: () => hb
                          .Span(css: "ui-icon ui-icon-contact")
                          .Text(text: Displays.Support(context: context))))
                  .Li(action: () => hb
                      .A(
                          href: Parameters.General.HtmlContactUrl,
                          target: "_blank",
                          action: () => hb
                          .Span(css: "ui-icon ui-icon-contact")
                          .Text(text: Displays.Contact(context: context))))
                  .Li(action: () => hb
                      .A(
                          href: Parameters.General.HtmlPortalUrl,
                          target: "_blank",
                          action: () => hb
                          .Span(css: "ui-icon ui-icon-cart")
                          .Text(text: Displays.Portal(context: context))))
                  .Li(action: () => hb
                      .A(
                          href: Locations.Get(
                              context: context,
                              parts: "versions"),
                          action: () => hb
                          .Span(css: "ui-icon ui-icon-info")
                          .Text(text: Displays.Version(context: context))))));
 }
コード例 #6
0
        public static HtmlBuilder Breadcrumb(
            this HtmlBuilder hb, Context context, SiteSettings ss, bool _using)
        {
            if (!Sessions.LoggedIn() || !_using)
            {
                return(hb);
            }
            switch (context.Controller)
            {
            case "admins":
                return(Breadcrumb(
                           hb: hb,
                           context: context,
                           ss: ss,
                           controller: context.Controller));

            case "depts":
                return(Breadcrumb(
                           hb: hb,
                           context: context,
                           ss: ss,
                           controller: context.Controller,
                           display: Displays.Depts()));

            case "groups":
                return(Permissions.CanManageTenant(context: context)
                        ? Breadcrumb(
                           hb: hb,
                           context: context,
                           ss: ss,
                           controller: context.Controller,
                           display: Displays.Groups())
                        : Breadcrumb(
                           hb: hb,
                           context: context,
                           ss: ss));

            case "users":
                switch (context.Action)
                {
                case "editapi":
                    return(hb.Breadcrumb(
                               context: context,
                               ss: ss,
                               data: new Dictionary <string, string>
                    {
                        {
                            Locations.Get("Users", "EditApi"),
                            Displays.ApiSettings()
                        }
                    }));

                default:
                    return(Permissions.CanManageTenant(context: context)
                                ? Breadcrumb(
                               hb: hb,
                               context: context,
                               ss: ss,
                               controller: context.Controller,
                               display: Displays.Users())
                                : Breadcrumb(
                               hb: hb,
                               context: context,
                               ss: ss));
                }

            case "items":
                return(hb
                       .CopyDirectUrlToClipboard(ss: ss)
                       .Breadcrumb(context: context, ss: ss));

            case "permissions":
                return(hb.Breadcrumb(context: context, ss: ss));

            default:
                return(hb);
            }
        }