Exemplo n.º 1
0
        protected override object GetNavPanelBottom(SpinneretPage page)
        {
            var sections = new List <object>();

            var values = Program.CurFile.UserScripts.Values.Where(v => v.Location.HasFlag(ScriptDisplayLocation.Sidebar)).ToList();

            if (values.Count > 0)
            {
                sections.Add(new object[] {
                    new A(Program.Tr.PgCalculations.EditLink)
                    {
                        href = "/CalculationsEdit", style = "float: right; font-size: 10pt; margin-top: 1px; margin-right: 4px;"
                    },
                    new H2(Program.Tr.PgCalculations.Title),
                    new UL(values.Select(v => new LI(v.Name, ": ", v.TagSoupValue)))
                });
            }

            if (Program.CurFile.Session != null && Program.CurFile.Session.EnumWarnings().Any())
            {
                sections.Add(new object[] {
                    new H2(new IMG()
                    {
                        src = "/Static/warning_10.png", width = 14, style = "position: relative; top: 1px;"
                    }, " ", Program.Tr.WarningsLink),
                    new UL(new LI(new A(Program.Tr.WarningsLink)
                    {
                        href = "/Warnings"
                    }))
                });
            }

            return(sections);
        }
Exemplo n.º 2
0
        public override Tag GetPageHtml(SpinneretPage page)
        {
            bool globmsg = Program.CurFile.GlobalErrorMessage != null && !(page as WebPage).IgnoreGlobalMessage;

            if (!globmsg)
            {
                return(base.GetPageHtml(page));
            }
            else
            {
                Tag content = new DIV(
                    new P(Program.Tr.GlobalMessage.Explanation.Fmt("AccountsWeb")),
                    Program.CurFile.GlobalErrorMessage
                    );
                try
                {
                    (page as WebPage).FullScreen = false;
                    return(MakePage(page, Program.Tr.GlobalMessage.Title, content));
                }
                catch (Exception e)
                {
                    return(new DIV(content, new P(Program.Tr.GlobalMessage.AlsoException),
                                   e.SelectChain(ex => ex.InnerException)
                                   .Select(ex => new DIV {
                        class_ = "exception"
                    }._(
                                               new H3(ex.GetType().FullName),
                                               new P(ex.Message),
                                               new PRE(ex.StackTrace)
                                               )).InsertBetween(new HR())));
                }
            }
        }
Exemplo n.º 3
0
        protected override IEnumerable <A> GetFloatingLinks(SpinneretPage page)
        {
            yield return(new A(Program.Tr.AddLink)
            {
                href = "/AddLink?Href=" + page.Request.Url.ToHref().UrlEscape()
            });

            foreach (var a in baseGetFloatingLinks(page))
            {
                yield return(a);
            }
        }
Exemplo n.º 4
0
 private IEnumerable <A> baseGetFloatingLinks(SpinneretPage page)
 {
     return(base.GetFloatingLinks(page));
 }