Example #1
0
 private static HtmlBuilder Content(
     this HtmlBuilder hb,
     Context context,
     SiteSettings ss,
     View view,
     Error.Types errorType,
     string[] messageData,
     long siteId        = 0,
     string title       = null,
     bool useBreadcrumb = true,
     bool useTitle      = true,
     Action action      = null)
 {
     return(hb.Article(id: "Application", action: () =>
     {
         if (!errorType.Has())
         {
             hb.Nav(css: "both cf", action: () => hb
                    .Breadcrumb(
                        context: context,
                        ss: ss,
                        view: view,
                        _using: useBreadcrumb))
             .Guide(
                 context: context,
                 ss: ss)
             .Title(
                 context: context,
                 ss: ss,
                 siteId: siteId,
                 title: title,
                 useTitle: useTitle)
             .Warnings(
                 context: context,
                 ss: ss);
             action?.Invoke();
             hb.Message(message: context.Message());
         }
         else
         {
             var message = errorType.Message(
                 context: context,
                 data: messageData);
             hb
             .Message(message: message)
             .MainCommands(
                 context: context,
                 ss: ss,
                 siteId: siteId,
                 verType: Versions.VerTypes.Latest);
         }
     }));
 }
Example #2
0
 private static HtmlBuilder Content(
     this HtmlBuilder hb,
     SiteSettings ss,
     Error.Types errorType,
     long siteId        = 0,
     string title       = null,
     bool useBreadcrumb = true,
     bool useTitle      = true,
     Action action      = null)
 {
     return(hb.Article(id: "Application", action: () =>
     {
         if (!errorType.Has())
         {
             hb.Nav(css: "both cf", action: () => hb
                    .Breadcrumb(
                        siteId: siteId,
                        ss: ss,
                        _using: useBreadcrumb));
             if (useTitle)
             {
                 hb.Title(ss: ss, siteId: siteId, text: title);
             }
             action?.Invoke();
             hb.P(id: "Message", css: "message", action: () => hb
                  .Raw(text: Sessions.Message()));
         }
         else
         {
             hb
             .P(id: "Message", css: "message", action: () => hb
                .Raw(text: errorType.Message().Html))
             .MainCommands(
                 siteId: siteId,
                 ss: ss,
                 verType: Versions.VerTypes.Latest);
         }
     }));
 }
Example #3
0
 public Message Message(Context context)
 {
     return(Type.Message(
                context: context,
                data: Data));
 }
 private static HtmlBuilder Content(
     this HtmlBuilder hb,
     Context context,
     SiteSettings ss,
     View view,
     Error.Types errorType,
     string[] messageData,
     long siteId        = 0,
     string title       = null,
     bool useBreadcrumb = true,
     bool useTitle      = true,
     Action action      = null)
 {
     return(hb.Div(id: "Application", action: () =>
     {
         if (!errorType.Has())
         {
             hb.Nav(css: "both cf", action: () => hb
                    .Breadcrumb(
                        context: context,
                        ss: ss,
                        view: view,
                        _using: useBreadcrumb))
             .Guide(
                 context: context,
                 ss: ss)
             .Title(
                 context: context,
                 ss: ss,
                 siteId: siteId,
                 title: title,
                 useTitle: useTitle)
             .Warnings(
                 context: context,
                 ss: ss);
             action?.Invoke();
             hb.Message(
                 message: context.Message(),
                 messages: context.Messages);
         }
         else
         {
             var message = errorType.Message(
                 context: context,
                 data: messageData);
             var exceptionSiteId = context.SessionData.Get("ExceptionSiteId")?.ToLong() ?? 0;
             hb
             .Message(
                 message: message,
                 messages: context.Messages)
             .MainCommands(
                 context: context,
                 ss: ss,
                 verType: Versions.VerTypes.Latest,
                 extensions: () => hb.Button(
                     controlId: "ManageTableCommand",
                     text: Displays.ManageTable(context: context),
                     controlCss: "button-icon",
                     href: Locations.ItemEdit(
                         context: context,
                         id: exceptionSiteId),
                     icon: "ui-icon-gear",
                     _using: exceptionSiteId > 0));
         }
     }));
 }