Esempio n. 1
0
        public void just_writes_the_literal_html_it_is_given()
        {
            var html = "<div>I did this</div>";
            var tag  = new LiteralTag(html);

            tag.ToString().ShouldEqual(html);
        }
Esempio n. 2
0
        public void just_writes_the_literal_html_it_is_given()
        {
            var html = "<div>I did this</div>";
            var tag = new LiteralTag(html);

            tag.ToString().ShouldEqual(html);
        }
Esempio n. 3
0
        public void literal_tag_hosted_inside_of_another_tag()
        {
            var html = "<div>I did this</div>";
            var tag  = new LiteralTag(html);

            new HtmlTag("body").Append(tag)
            .ToString().ShouldEqual("<body>" + html + "</body>");
        }
Esempio n. 4
0
        public void literal_tag_hosted_inside_of_another_tag()
        {
            var html = "<div>I did this</div>";
            var tag = new LiteralTag(html);

            new HtmlTag("body").Append(tag)
                .ToString().ShouldEqual("<body>" + html + "</body>");
        }
Esempio n. 5
0
        public static HtmlTag PrependGlyph(this HtmlTag tag, string glyphName)
        {
            var glyph   = new HtmlTag("i").AddClass(glyphName);
            var literal = new LiteralTag(" ");

            tag.InsertFirst(literal);
            tag.InsertFirst(glyph);

            return(tag);
        }
Esempio n. 6
0
        public void writes_the_summary_tag()
        {
            var theTag = new LiteralTag("testing");

            Services.PartialMockTheClassUnderTest();
            ClassUnderTest.Stub(x => x.BuildSummary()).Return(theTag);
            ClassUnderTest.Write(MimeType.Html.Value, new ValidationSummary());

            MockFor <IOutputWriter>().AssertWasCalled(x => x.Write(MimeType.Html.ToString(), theTag.ToString()));
        }
Esempio n. 7
0
        public static HtmlTag MailingList(this IFubuPage page, string text)
        {
            var project = page.Get <ITopicContext>().Project;

            if (project == null || project.UserGroupUrl.IsEmpty())
            {
                return(LiteralTag.Empty());
            }

            return(new HtmlTag("em")
                   .Append("a", a => a.Attr("href", project.UserGroupUrl).Text(text)));
        }
Esempio n. 8
0
        static HtmlTag GenerateCalendar <TModel> (TModel model, PropertyInfo member)
        {
            var modelValue = member.GetValue(model, null);

            if (modelValue == null)
            {
                return(null);
            }

            //http://www.eyecon.ro/bootstrap-datepicker/
            //<div class="control-group">
            //  <label class="control-label" for="Email">Email:</label>
            //  <div class="controls">
            //<div class="input-append date" id="dp3" data-date="12-02-2012" data-date-format="dd-mm-yyyy">
            //<input class="span2" size="16" type="text" value="12-02-2012">
            //<span class="add-on"><i class="icon-th"></i></span>
            //</div>
            //    <span class="field-validation-valid error" data-valmsg-for="Email"
            //        data-valmsg-replace="true"></span>
            //    <p class="help-block">Ex.: [email protected]</p>
            //  </div>
            //</div>

            var cg  = CreateControlGroup(model, member);
            var div = new DivTag().AddClass("datepicker");

            var input = new TextboxTag(member.Name, modelValue.ToString())
                        .Id(member.Name);
            var span = new LiteralTag("span").AddClass("add-on");

            div.Append(input);
            div.Append(span);

            FillValidation <TModel>(input, member);

            cg.Children[1].InsertFirst(input);

            return(cg);
        }