Пример #1
0
            public string get_partial(PartialInput input)
            {
                var builder       = new StringBuilder();
                var partialModels = new[]
                {
                    new PartialViewModel {
                        Name = "Item1"
                    },
                    new PartialViewModel {
                        Name = "Item2"
                    },
                    new PartialViewModel {
                        Name = "Item3"
                    }
                };

                partialModels.Each(m =>
                {
                    _request.Set(m);
                    var page = new FubuHtmlDocument <PartialViewModel>(_locator, _request);
                    builder.AppendLine(SourceModifier(page).ToString());
                    //builder.AppendLine();
                });

                return(builder.ToString());
            }
        public virtual HtmlDocument BuildView(LoginRequest request)
        {
            // TODO -- Revisit all of this when we get HTML conventions everywhere
            var view = new FubuHtmlDocument <LoginRequest>(_services, _request);
            var form = view.FormFor <LoginRequest>();

            form.Append(new HtmlTag("legend").Text(LoginKeys.Login));

            if (request.Message.IsNotEmpty())
            {
                form.Append(new HtmlTag("p").Text(request.Message).Style("color", "red"));
            }

            form.Append(view.Edit(x => x.UserName));
            form.Append(view.Edit(x => x.Password));
            form.Append(view.Edit(x => x.RememberMe));
            form.Append(view.DisplayFor(x => x.Message).Id("login-message"));

            form.Append(new HiddenTag().Name("Url").Attr("value", request.Url));

            form.Append(new HtmlTag("input").Attr("type", "submit").Attr("value", LoginKeys.Login).Id("login-submit"));

            view.Add(form);
            view.Add(new LiteralTag(view.WriteExtensions().ToHtmlString()));

            return(view);
        }
Пример #3
0
 public FubuContinuation CreateCombinations()
 {
     var doc = new FubuHtmlDocument(_serviceLocator);
     doc.WriteCssTags("site-styles");
     doc.WriteScriptTags("site-scripts");
     return FubuContinuation.RedirectTo<HomeAction>(x => x.Home());
 }
Пример #4
0
 public CaseController(IRepository repository, FubuHtmlDocument <Case> document, ISqlRunner runner, IUrlRegistry urls)
 {
     _repository = repository;
     _document   = document;
     _runner     = runner;
     _urls       = urls;
 }
Пример #5
0
        public void WriteAssetsInto(FubuHtmlDocument document, IEnumerable<Specification> specs)
        {
            RegisterRequirements(specs);
            document.WriteAssetsToHead();

            RegisterSpecifications(specs);
            document.WriteAssetsToHead();
        }
Пример #6
0
 public HomeEndpoint(IServiceBus serviceBus, INumberCache cache, FubuHtmlDocument document, FubuRuntime runtime, MessagePumper pumper)
 {
     _serviceBus = serviceBus;
     _cache      = cache;
     _document   = document;
     _runtime    = runtime;
     _pumper     = pumper;
 }
Пример #7
0
        public void WriteAssetsInto(FubuHtmlDocument document, IEnumerable <Specification> specs)
        {
            RegisterRequirements(specs);
            document.WriteAssetsToHead();

            RegisterSpecifications(specs);
            document.WriteAssetsToHead();
        }
Пример #8
0
 public HomeEndpoint(IServiceBus serviceBus, INumberCache cache, FubuHtmlDocument document, FubuRuntime runtime, MessagePumper pumper)
 {
     _serviceBus = serviceBus;
     _cache = cache;
     _document = document;
     _runtime = runtime;
     _pumper = pumper;
 }
Пример #9
0
        public DetailTableBuilder(FubuHtmlDocument document)
        {
            _document = document;


            _detailTag = new DetailsTableTag();
            _document.Add(_detailTag);
        }
Пример #10
0
 public Visualizer(BehaviorGraph graph, FubuHtmlDocument document)
 {
     _document      = document;
     _hasVisualizer = new Cache <Type, bool>(type =>
     {
         return(graph.Behaviors.Any(x => type == x.InputType()));
     });
 }
        public DetailTableBuilder(FubuHtmlDocument document)
        {
            _document = document;


            _detailTag = new DetailsTableTag();
            _document.Add(_detailTag);
        }
Пример #12
0
 public HomeEndpoint(IClientConnector connector, StorytellerContext context, FubuHtmlDocument document, IPersistenceController persistence, IAssetTagBuilder tags, IFubuApplicationFiles files)
 {
     _connector = connector;
     _context = context;
     _document = document;
     _persistence = persistence;
     _tags = tags;
     _files = files;
 }
Пример #13
0
        public void SetUp()
        {
            var services = new InMemoryServiceLocator();

            theDocument = new FubuHtmlDocument(services);
            theDocument.Push("div");

            theBuilder = new DetailTableBuilder(theDocument);
        }
Пример #14
0
        public void SetUp()
        {
            var services = new InMemoryServiceLocator();


            theDocument = new FubuHtmlDocument(services);
            theDocument.Push("div");

            theBuilder = new DetailTableBuilder(theDocument);
        }
Пример #15
0
        public JasminePages(SpecificationGraph specifications, SpecHierarchyBuilder builder,
            SpecAssetRequirements requirements, FubuHtmlDocument document)
        {
            _specifications = specifications;
            _builder = builder;
            _requirements = requirements;
            _document = document;

            _document.Body.Append(new HtmlTag("div").Text(_header).Encoded(false));
        }
Пример #16
0
 public HomeEndpoint(IClientConnector connector, StorytellerContext context, FubuHtmlDocument document,
                     IPersistenceController persistence, IAssetTagBuilder tags, IFubuApplicationFiles files)
 {
     _connector   = connector;
     _context     = context;
     _document    = document;
     _persistence = persistence;
     _tags        = tags;
     _files       = files;
 }
Пример #17
0
        public JasminePages(SpecificationGraph specifications, SpecHierarchyBuilder builder,
                            SpecAssetRequirements requirements, FubuHtmlDocument document)
        {
            _specifications = specifications;
            _builder        = builder;
            _requirements   = requirements;
            _document       = document;


            _document.Body.Append(new HtmlTag("div").Text(_header).Encoded(false));
        }
Пример #18
0
        public HtmlDocument GettingStarted()
        {
            var document = new FubuHtmlDocument(_services);
            document.Title = "Getting Started with FubuMVC";
            document.Add(x => x.Image("logo.png"));

            document.Push("div");
            document.Add("hr");
            document.Add(x => x.LinkTo<BehaviorGraphWriter>(o => o.Index()).Text("Diagnostics for your application"));

            document.Add("div").Encoded(false).Text(getContent());

            return document;
        }
Пример #19
0
        public HtmlDocument GettingStarted()
        {
            var document = new FubuHtmlDocument(_services);

            document.Title = "Getting Started with FubuMVC";
            document.Add(x => x.Image("logo.png"));

            document.Push("div");
            document.Add("hr");
            document.Add(x => x.LinkTo <BehaviorGraphWriter>(o => o.Index()).Text("Diagnostics for your application"));

            document.Add("div").Encoded(false).Text(getContent());

            return(document);
        }
Пример #20
0
        public HtmlDocument get_person_Name(TextModel model)
        {
            var document = new FubuHtmlDocument <TextModel>(_services, new InMemoryFubuRequest())
            {
                Model = model
            };

            document.Title = "Persion:" + model.Name;

            document.Push("p");
            document.Add(x => x.LabelFor(o => o.Name));
            document.Add(x => x.InputFor(o => o.Name));

            return(document);
        }
Пример #21
0
        public HtmlDocument get_person_Name(TextModel model)
        {
            var document = new FubuHtmlDocument <TextModel>(_services, new InMemoryFubuRequest())
            {
                Model = model
            };

            document.Title = "Persion:" + model.Name;

            document.Push("p");
            document.Add("span").Text(document.Model.Name);
            document.Add("input").Attr("type", "text").Id("Name").Name("Name").Value(model.Name);

            return(document);
        }
        public HtmlDocument get_register(CreateAccount account)
        {
            var document = new FubuHtmlDocument<CreateAccount>(_services, _request);

            var form = document.FormFor<CreateAccount>()
                .Append(document.Edit(x => x.Name))
                .Append(document.Edit(x => x.EmailAddress))
                .Append(document.Edit(x => x.Password))
                .Append(document.Edit(x => x.Subscriptions))
                .Append(new HtmlTag("input").Attr("type", "submit").Attr("value", "Create Account").Id(Submit));

            document.Add("h1").Text("Create New Account");
            document.Add(form);

            return document;
        }
Пример #23
0
        public HtmlDocument GettingStarted()
        {
            var document = new FubuHtmlDocument(_services);
            document.Title = "Getting Started with FubuMVC";
            document.Add(x => x.Image("logo.png"));

            document.Push("div");
            document.Add("hr");

            // we're gonna cheat here since the diagnostics markers changed
            // TODO -- Share input models for the dashboard
            document.Add(new LinkTag("Diagnostics for your application", _request.ToFullUrl("_fubu")));

            document.Add("div").Encoded(false).Text(getContent());

            return document;
        }
Пример #24
0
        public HtmlDocument GettingStarted()
        {
            var document = new FubuHtmlDocument(_services);

            document.Title = "Getting Started with FubuMVC";
            document.Add(x => x.Image("logo.png"));

            document.Push("div");
            document.Add("hr");

            // we're gonna cheat here since the diagnostics markers changed
            // TODO -- Share input models for the dashboard
            document.Add(new LinkTag("Diagnostics for your application", _request.ToFullUrl("_fubu")));

            document.Add("div").Encoded(false).Text(getContent());

            return(document);
        }
Пример #25
0
 public HtmlDocument Home()
 {
     var doc = new FubuHtmlDocument(_serviceLocator);
     doc.Add("div").Add("a")
         .Attr("href", "/_content/styles/c7006a7dd72c7f9160a2e2edd8ac9265.css")
         .Attr("target", "_blank")
         .Text("site-styles");
     doc.Add("div").Add("a")
         .Attr("href", "/_content/scripts/c31341d908c2ecf36dccc1f009346361.js")
         .Attr("target", "_blank")
         .Text("site-scripts");
     doc.Add("div").Add("a")
         .Attr("href", doc.Urls.UrlFor<HomeAction>(x => x.CreateCombinations()))
         .Text("create combinations");
     doc.Add("div").Add("a")
         .Attr("href", doc.Urls.UrlFor<HomeAction>(x => x.RecycleApp()))
         .Text("recycle app");
     return doc;
 }
Пример #26
0
 public HomeEndpoint(IServiceBus serviceBus, INumberCache cache, FubuHtmlDocument document)
 {
     _serviceBus = serviceBus;
     _cache = cache;
     _document = document;
 }
Пример #27
0
 public AjaxEndpoint(FubuHtmlDocument <AjaxModel> page)
 {
     _page = page;
 }
Пример #28
0
 public InstrumentationEndpoint(FubuHtmlDocument document, IUrlRegistry urls)
 {
     _document = document;
     _urls     = urls;
 }
Пример #29
0
 public AppErrorEndpoint(FubuHtmlDocument document)
 {
     _document = document;
 }
Пример #30
0
 public IgnoredEndpoint(FubuHtmlDocument<IgnoredModel> page)
 {
     _page = page;
 }
 public TagBuildingEndpoint(FubuHtmlDocument document)
 {
     _document = document;
 }
 public IndexerOwnerEndpoint(FubuHtmlDocument<Parent> document)
 {
     _document = document;
 }
Пример #33
0
 public SelectTagEndpoint(FubuHtmlDocument<SelectTagModel> page)
 {
     _page = page;
 }
Пример #34
0
 public CachedEndpoints(FubuHtmlDocument document, IOutputWriter writer, IPartialInvoker partials)
 {
     _document = document;
     _writer   = writer;
     _partials = partials;
 }
Пример #35
0
 public HomeEndpoint(BehaviorGraph graph, FubuHtmlDocument document, ILogger logger)
 {
     _graph    = graph;
     _document = document;
     _logger   = logger;
 }
 public static void WriteAssetsToHead(this FubuHtmlDocument document)
 {
     document.Head.Append(document.WriteAssetTags());
 }
 public ConventionEndpoint(FubuHtmlDocument<ImageTarget> document)
 {
     _document = document;
 }
 public IndexerOwnerEndpoint(FubuHtmlDocument <Parent> document)
 {
     _document = document;
 }
 public ElementHandlerEndpoint(FubuHtmlDocument <ElementHandler> page)
 {
     _page = page;
 }
Пример #40
0
 public JavascriptRoutesEndpoint(FubuHtmlDocument document)
 {
     _document = document;
 }
Пример #41
0
 public CachedEndpoints(FubuHtmlDocument document, IOutputWriter writer)
 {
     _document = document;
     _writer   = writer;
 }
Пример #42
0
 public CreateUserEndpoint(FubuHtmlDocument<User> page, IUserService users)
 {
     _page = page;
     _users = users;
 }
Пример #43
0
 public JavascriptRoutesEndpoint(FubuHtmlDocument document)
 {
     _document = document;
 }
Пример #44
0
 public HomeEndpoint(FubuHtmlDocument document)
 {
     _document = document;
 }
 public TagBuildingEndpoint(FubuHtmlDocument document)
 {
     _document = document;
 }
Пример #46
0
 public FormRequestEndpoint(FubuHtmlDocument <FormTagModel> document)
 {
     _document = document;
 }
Пример #47
0
 public AjaxEndpoint(FubuHtmlDocument<AjaxModel> page)
 {
     _page = page;
 }
Пример #48
0
 public IgnoredEndpoint(FubuHtmlDocument <IgnoredModel> page)
 {
     _page = page;
 }
 public ShowEditEndpoints(FubuHtmlDocument<ShowModel> document, ActiveProfile profile)
 {
     _document = document;
     _profile = profile;
 }
 public ChainEndpoint(IUrlRegistry urls, BehaviorGraph graph, FubuHtmlDocument document)
 {
     _urls = urls;
     _graph = graph;
     _document = document;
 }
Пример #51
0
 public HomeEndpoint(FubuHtmlDocument document)
 {
     _document = document;
 }
 public PublicAssetFolderEndpoint(FubuHtmlDocument document)
 {
     _document = document;
 }
 public CachedEndpoints(FubuHtmlDocument document, IOutputWriter writer, IPartialInvoker partials)
 {
     _document = document;
     _writer = writer;
     _partials = partials;
 }
Пример #54
0
 public PublicAssetFolderEndpoint(FubuHtmlDocument document)
 {
     _document = document;
 }
 public static void WriteScriptsToBody(this FubuHtmlDocument document)
 {
     document.Body.Append(document.WriteScriptTags());
 }
 public AssetEndpoint(FubuHtmlDocument document)
 {
     _document = document;
 }
 public IntegrationEndpoint(FubuHtmlDocument<IntegrationModel> page)
 {
     _page = page;
 }
Пример #58
0
 public ConventionEndpoint(FubuHtmlDocument <ConventionTarget> document)
 {
     _document = document;
 }
 public InstrumentationEndpoint(FubuHtmlDocument document, IUrlRegistry urls)
 {
     _document = document;
     _urls = urls;
 }
 public InlineModelEndpoint(FubuHtmlDocument<InlineModel> page)
 {
     _page = page;
 }