private static HtmlBuilder Breadcrumb(
     HtmlBuilder hb, string controller, string display = null)
 {
     return(display != null
         ? hb.Breadcrumb(new Dictionary <string, string>
     {
         { Locations.Index("Admins"), Displays.Admin() },
         { Locations.Index(controller), display }
     })
         : hb.Breadcrumb(new Dictionary <string, string>
     {
         { Locations.Index("Admins"), Displays.Admin() }
     }));
 }
示例#2
0
        public static string AdminsIndex(this HtmlBuilder hb)
        {
            if (!Permissions.CanManageTenant())
            {
                return(HtmlTemplates.Error(Error.Types.HasNotPermission));
            }
            var ss = new SiteSettings();

            return(hb.Template(
                       ss: ss,
                       methodType: Pleasanter.Models.BaseModel.MethodTypes.NotSet,
                       title: Displays.Admin(),
                       verType: Versions.VerTypes.Latest,
                       useNavigationMenu: false,
                       action: () => hb
                       .Nav(css: "cf", action: () => hb
                            .Ul(css: "nav-sites", action: () => hb
                                .Li(css: "nav-site", action: () => hb
                                    .A(
                                        attributes: new HtmlAttributes()
                                        .Href(Locations.Index("Depts")),
                                        action: () => hb
                                        .Div(action: () => hb
                                             .Text(Displays.Depts()))
                                        .StackStyles()))
                                .Li(css: "nav-site", action: () => hb
                                    .A(
                                        attributes: new HtmlAttributes()
                                        .Href(Locations.Index("Groups")),
                                        action: () => hb
                                        .Div(action: () => hb
                                             .Text(Displays.Groups()))
                                        .StackStyles()))
                                .Li(css: "nav-site", action: () => hb
                                    .A(
                                        attributes: new HtmlAttributes()
                                        .Href(Locations.Index("Users")),
                                        action: () => hb
                                        .Div(action: () => hb
                                             .Text(Displays.Users()))
                                        .StackStyles()))))
                       .MainCommands(
                           ss: ss,
                           siteId: 0,
                           verType: Versions.VerTypes.Latest))
                   .ToString());
        }
示例#3
0
 private static HtmlBuilder Breadcrumb(
     HtmlBuilder hb,
     Context context,
     SiteSettings ss,
     string controller,
     string display = null)
 {
     return(display != null
         ? hb.Breadcrumb(context : context, ss : ss, data : new Dictionary <string, string>
     {
         { Locations.Index("Admins"), Displays.Admin() },
         { Locations.Index(controller), display }
     })
         : hb.Breadcrumb(context: context, ss: ss, data: new Dictionary <string, string>
     {
         { Locations.Index("Admins"), Displays.Admin() }
     }));
 }
示例#4
0
        public static string AdminsIndex(this HtmlBuilder hb, Context context)
        {
            if (!Permissions.CanManageTenant(context: context))
            {
                return(HtmlTemplates.Error(
                           context: context,
                           errorData: new ErrorData(type: Error.Types.HasNotPermission)));
            }
            var ss = new SiteSettings();

            return(hb.Template(
                       context: context,
                       ss: ss,
                       view: null,
                       methodType: Pleasanter.Models.BaseModel.MethodTypes.NotSet,
                       title: Displays.Admin(context: context),
                       verType: Versions.VerTypes.Latest,
                       useNavigationMenu: false,
                       action: () => hb
                       .Nav(css: "cf", action: () => hb
                            .Ul(css: "nav-sites", action: () => hb
                                .Li(css: "nav-site", action: () => hb
                                    .A(
                                        attributes: new HtmlAttributes()
                                        .Href(Locations.Edit(
                                                  context: context,
                                                  controller: "Tenants")),
                                        action: () => hb
                                        .Div(action: () => hb
                                             .Text(Displays.Tenants(context: context)))))
                                .Li(css: "nav-site", action: () => hb
                                    .A(
                                        attributes: new HtmlAttributes()
                                        .Href(Locations.Index(
                                                  context: context,
                                                  controller: "Depts")),
                                        action: () => hb
                                        .Div(action: () => hb
                                             .Text(Displays.Depts(context: context)))
                                        .StackStyles()))
                                .Li(css: "nav-site", action: () => hb
                                    .A(
                                        attributes: new HtmlAttributes()
                                        .Href(Locations.Index(
                                                  context: context,
                                                  controller: "Groups")),
                                        action: () => hb
                                        .Div(action: () => hb
                                             .Text(Displays.Groups(context: context)))
                                        .StackStyles()))
                                .Li(
                                    css: "nav-site", action: () => hb
                                    .A(
                                        attributes: new HtmlAttributes()
                                        .Href(Locations.Index(
                                                  context: context,
                                                  controller: "Users")),
                                        action: () => hb
                                        .Div(action: () => hb
                                             .Text(Displays.Users(context: context)))
                                        .StackStyles()),
                                    _using: Permissions.CanManageUser(context: context))
                                .Li(
                                    css: "nav-site", action: () => hb
                                    .A(
                                        attributes: new HtmlAttributes()
                                        .Href(Locations.Index(
                                                  context: context,
                                                  controller: "Registrations")),
                                        action: () => hb
                                        .Div(action: () => hb
                                             .Text(Displays.Registrations(context: context)))
                                        .StackStyles()),
                                    _using: Parameters.Registration.Enabled)
                                ))
                       .MainCommands(
                           context: context,
                           ss: ss,
                           verType: Versions.VerTypes.Latest))
                   .ToString());
        }