Exemple #1
0
        public static void Start(bool toExcelPlain, bool excelReport, bool excelAttachment)
        {
            if (Navigator.Manager.NotDefined(MethodInfo.GetCurrentMethod()))
            {
                ToExcelPlain = toExcelPlain;
                ExcelReport  = excelReport;

                Navigator.RegisterArea(typeof(ExcelClient));

                if (excelReport)
                {
                    if (!Navigator.Manager.EntitySettings.ContainsKey(typeof(FileEmbedded)))
                    {
                        throw new InvalidOperationException("Call FileEmbedded first");
                    }

                    if (!Navigator.Manager.EntitySettings.ContainsKey(typeof(QueryEntity)))
                    {
                        Navigator.Manager.EntitySettings.Add(typeof(QueryEntity), new EntitySettings <QueryEntity>());
                    }


                    Navigator.AddSetting(new EntitySettings <ExcelReportEntity> {
                        PartialViewName = _ => ViewPrefix.FormatWith("ExcelReport")
                    });
                }

                if (toExcelPlain || excelReport)
                {
                    ButtonBarQueryHelper.RegisterGlobalButtons(ButtonBarQueryHelper_GetButtonBarForQueryName);
                }

                if (excelAttachment)
                {
                    Navigator.AddSetting(new EntitySettings <ExcelAttachmentEntity> {
                        PartialViewName = _ => ViewPrefix.FormatWith("ExcelAttachment")
                    });
                }
            }
        }
Exemple #2
0
        public static void Start()
        {
            if (!Navigator.Manager.EntitySettings.ContainsKey(typeof(FileEntity)))
            {
                throw new InvalidOperationException("Call FileClient.Start first with FileEntity");
            }

            if (Navigator.Manager.NotDefined(MethodInfo.GetCurrentMethod()))
            {
                Navigator.RegisterArea(typeof(ChartClient));

                Navigator.AddSettings(new List <EntitySettings>
                {
                    new ModelEntitySettings <ChartRequest>(),
                    new EmbeddedEntitySettings <ChartParameterEmbedded>(),
                    new EmbeddedEntitySettings <ChartColumnEmbedded> {
                        PartialViewName = _ => ViewPrefix.FormatWith("ChartColumn")
                    },
                    new EmbeddedEntitySettings <ChartScriptColumnEmbedded> {
                        PartialViewName = _ => ViewPrefix.FormatWith("ChartScriptColumn")
                    },
                    new EmbeddedEntitySettings <ChartScriptParameterEmbedded> {
                        PartialViewName = _ => ViewPrefix.FormatWith("ChartScriptParameter")
                    },
                    new EntitySettings <ChartScriptEntity> {
                        PartialViewName = _ => ViewPrefix.FormatWith("ChartScript")
                    },
                });

                ButtonBarQueryHelper.RegisterGlobalButtons(ButtonBarQueryHelper_GetButtonBarForQueryName);

                RouteTable.Routes.MapRoute(null, "ChartFor/{webQueryName}",
                                           new { controller = "Chart", action = "Index", webQueryName = "" });

                UserChartClient.Start();
                ChartColorClient.Start();
            }
        }
Exemple #3
0
        public static void Start(string imageFolder, string baseUrl)
        {
            if (Navigator.Manager.NotDefined(MethodInfo.GetCurrentMethod()))
            {
                HelpUrls.BaseUrl      = baseUrl;
                HelpUrls.ImagesFolder = imageFolder;

                Navigator.RegisterArea(typeof(HelpClient));

                Navigator.AddSettings(new List <EntitySettings>
                {
                    new EntitySettings <EntityHelpEntity>(),
                    new EntitySettings <QueryHelpEntity>(),
                    new EntitySettings <AppendixHelpEntity>(),
                    new EntitySettings <NamespaceHelpEntity>(),
                    new EmbeddedEntitySettings <PropertyRouteHelpEmbedded>(),
                    new EntitySettings <OperationHelpEntity>(),
                    new EmbeddedEntitySettings <QueryColumnHelpEmbedded>(),
                });

                Navigator.EmbeddedEntitySettings <PropertyRouteHelpEmbedded>().MappingDefault.AsEntityMapping()
                .SetProperty(a => a.Property, ctx =>
                {
                    var type = ctx.FindParent <EntityHelpEntity>().Value.Type.ToType();
                    return(PropertyRoute.Parse(type, ctx.Input).ToPropertyRouteEntity());
                });

                RegisterHelpRoutes();

                Common.CommonTask += Common_CommonTask;

                WidgetsHelper.GetWidget += WidgetsHelper_GetWidget;

                ButtonBarQueryHelper.RegisterGlobalButtons(ButtonBarQueryHelper_RegisterGlobalButtons);
            }
        }
Exemple #4
0
        public static void Start()
        {
            if (Navigator.Manager.NotDefined(MethodInfo.GetCurrentMethod()))
            {
                QueryClient.Start();

                Navigator.RegisterArea(typeof(UserQueriesClient));

                UserAssetsClient.Start();
                UserAssetsClient.RegisterExportAssertLink <UserQueryEntity>();

                LinksClient.RegisterEntityLinks <UserQueryEntity>((lite, ctx) => new[]
                {
                    new QuickLinkAction(UserQueryMessage.Preview, RouteHelper.New().Action <UserQueriesController>(cc => cc.View(lite, null, null)))
                    {
                        IsVisible = UserQueryPermission.ViewUserQuery.IsAuthorized()
                    }
                });

                RouteTable.Routes.MapRoute(null, "UQ/{webQueryName}/{lite}",
                                           new { controller = "UserQueries", action = "View" });

                Navigator.AddSettings(new List <EntitySettings>
                {
                    new EntitySettings <UserQueryEntity> {
                        PartialViewName = e => ViewPrefix.FormatWith("UserQuery"), IsCreable = EntityWhen.Never
                    },

                    new EmbeddedEntitySettings <QueryFilterEmbedded>
                    {
                        PartialViewName = e => ViewPrefix.FormatWith("QueryFilter"),
                        MappingDefault  = new EntityMapping <QueryFilterEmbedded>(false)
                                          .SetProperty(a => a.Token, QueryTokenMapping(SubTokensOptions.CanAnyAll | SubTokensOptions.CanElement))
                                          .CreateProperty(a => a.Operation)
                                          .CreateProperty(a => a.ValueString)
                    },

                    new EmbeddedEntitySettings <QueryColumnEmbedded>
                    {
                        PartialViewName = e => ViewPrefix.FormatWith("QueryColumn"),
                        MappingDefault  = new EntityMapping <QueryColumnEmbedded>(false)
                                          .SetProperty(a => a.Token, QueryTokenMapping(SubTokensOptions.CanElement))
                                          .CreateProperty(a => a.DisplayName)
                    },

                    new EmbeddedEntitySettings <QueryOrderEmbedded>
                    {
                        PartialViewName = e => ViewPrefix.FormatWith("QueryOrder"),
                        MappingDefault  = new EntityMapping <QueryOrderEmbedded>(false)
                                          .SetProperty(a => a.Token, QueryTokenMapping(SubTokensOptions.CanElement))
                                          .CreateProperty(a => a.OrderType)
                    },
                });

                ButtonBarQueryHelper.RegisterGlobalButtons(ButtonBarQueryHelper_GetButtonBarForQueryName);

                OperationClient.AddSettings(new List <OperationSettings>
                {
                    new EntityOperationSettings <UserQueryEntity>(UserQueryOperation.Delete)
                    {
                        Click = ctx => Module["deleteUserQuery"](ctx.Options(), Finder.FindRoute(((UserQueryEntity)ctx.Entity).Query.ToQueryName())),
                    }
                });

                LinksClient.RegisterEntityLinks <Entity>((entity, ctrl) =>
                {
                    if (!UserQueryPermission.ViewUserQuery.IsAuthorized())
                    {
                        return(null);
                    }

                    return(UserQueryLogic.GetUserQueriesEntity(entity.EntityType)
                           .Select(cp => new UserQueryQuickLink(cp, entity)).ToArray());
                });
            }
        }
        public override void Execute()
        {
            #line 7 "..\..\Signum\Views\SearchControl.cshtml"

            Model.ReadOnly = false; /*SearchControls Context should never inherit Readonly property of parent context */
            FindOptions      findOptions      = (FindOptions)ViewData[ViewDataKeys.FindOptions];
            QueryDescription queryDescription = (QueryDescription)ViewData[ViewDataKeys.QueryDescription];
            var             entityColumn      = queryDescription.Columns.SingleEx(a => a.IsEntity);
            Type            entitiesType      = Lite.Extract(entityColumn.Type);
            Implementations implementations   = entityColumn.Implementations.Value;
            var             settings          = Finder.QuerySettings(findOptions.QueryName);
            findOptions.Pagination             = findOptions.Pagination ?? settings.Pagination ?? FindOptions.DefaultPagination;
            ViewData[ViewDataKeys.FindOptions] = findOptions;

            var sfb = settings.SimpleFilterBuilder == null ? null :
                      settings.SimpleFilterBuilder(Html, Model, queryDescription, findOptions);

            var prefix = Model.Compose("sfSearchControl");


            #line default
            #line hidden
            WriteLiteral("\r\n<div");

            WriteAttribute("id", Tuple.Create(" id=\"", 1121), Tuple.Create("\"", 1133)

            #line 23 "..\..\Signum\Views\SearchControl.cshtml"
                           , Tuple.Create(Tuple.Create("", 1126), Tuple.Create <System.Object, System.Int32>(prefix

            #line default
            #line hidden
                                                                                                             , 1126), false)
                           );

            WriteLiteral(" \r\n     class=\"sf-search-control SF-control-container\"");

            WriteLiteral(" \r\n     data-prefix=\"");


            #line 25 "..\..\Signum\Views\SearchControl.cshtml"
            Write(Model.Prefix);


            #line default
            #line hidden
            WriteLiteral("\"");

            WriteLiteral(" \r\n     data-find-url=\"");


            #line 26 "..\..\Signum\Views\SearchControl.cshtml"
            Write(Finder.FindRoute(findOptions.QueryName));


            #line default
            #line hidden
            WriteLiteral("\"");

            WriteLiteral(" \r\n     data-queryName=\"");


            #line 27 "..\..\Signum\Views\SearchControl.cshtml"
            Write(QueryUtils.GetQueryUniqueKey(findOptions.QueryName));


            #line default
            #line hidden
            WriteLiteral("\"");

            WriteLiteral(" \r\n     >\r\n");


            #line 29 "..\..\Signum\Views\SearchControl.cshtml"


            #line default
            #line hidden

            #line 29 "..\..\Signum\Views\SearchControl.cshtml"
            if (sfb != null)
            {
                findOptions.ShowFilters = false;


            #line default
            #line hidden
                WriteLiteral("        <div");

                WriteAttribute("id", Tuple.Create(" id=\"", 1459), Tuple.Create("\"", 1500)

            #line 32 "..\..\Signum\Views\SearchControl.cshtml"
                               , Tuple.Create(Tuple.Create("", 1464), Tuple.Create <System.Object, System.Int32>(Model.Compose("simpleFilerBuilder")

            #line default
            #line hidden
                                                                                                                 , 1464), false)
                               );

                WriteLiteral(" class=\"form-horizontal\"");

                WriteLiteral(">\r\n");

                WriteLiteral("            ");


            #line 33 "..\..\Signum\Views\SearchControl.cshtml"
                Write(sfb.Control);


            #line default
            #line hidden
                WriteLiteral("\r\n        </div>\r\n");


            #line 35 "..\..\Signum\Views\SearchControl.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("\r\n");


            #line 37 "..\..\Signum\Views\SearchControl.cshtml"


            #line default
            #line hidden

            #line 37 "..\..\Signum\Views\SearchControl.cshtml"

            bool filtersAlwaysHidden = !findOptions.ShowHeader || !findOptions.ShowFilters && !findOptions.ShowFilterButton;


            #line default
            #line hidden
            WriteLiteral("\r\n\r\n    <div");

            WriteAttribute("style", Tuple.Create(" style=\"", 1726), Tuple.Create("\"", 1783)
                           , Tuple.Create(Tuple.Create("", 1734), Tuple.Create("display:", 1734), true)

            #line 41 "..\..\Signum\Views\SearchControl.cshtml"
                           , Tuple.Create(Tuple.Create("", 1742), Tuple.Create <System.Object, System.Int32>(filtersAlwaysHidden ? "none" : "block"

            #line default
            #line hidden
                                                                                                             , 1742), false)
                           );

            WriteLiteral(">\r\n");


            #line 42 "..\..\Signum\Views\SearchControl.cshtml"


            #line default
            #line hidden

            #line 42 "..\..\Signum\Views\SearchControl.cshtml"

            ViewData[ViewDataKeys.FilterOptions]  = findOptions.FilterOptions;
            ViewData[ViewDataKeys.FiltersVisible] = findOptions.ShowFilters;
            ViewData[ViewDataKeys.ShowAddColumn]  = string.IsNullOrEmpty(Model.Prefix) && findOptions.AllowChangeColumns;
            Html.RenderPartial(Finder.Manager.FilterBuilderView);


            #line default
            #line hidden
            WriteLiteral("\r\n    </div>\r\n\r\n\r\n\r\n\r\n    <div");

            WriteLiteral(" class=\"sf-query-button-bar\"");

            WriteAttribute("style", Tuple.Create(" style=\"", 2213), Tuple.Create("\"", 2270)

            #line 53 "..\..\Signum\Views\SearchControl.cshtml"
                           , Tuple.Create(Tuple.Create("", 2221), Tuple.Create <System.Object, System.Int32>(findOptions.ShowHeader ? null : "display:none"

            #line default
            #line hidden
                                                                                                             , 2221), false)
                           );

            WriteLiteral(">\r\n");


            #line 54 "..\..\Signum\Views\SearchControl.cshtml"


            #line default
            #line hidden

            #line 54 "..\..\Signum\Views\SearchControl.cshtml"
            if (!filtersAlwaysHidden)
            {
            #line default
            #line hidden
                WriteLiteral("            <a");

                WriteAttribute("class", Tuple.Create("  class=\"", 2335), Tuple.Create("\"", 2436)
                               , Tuple.Create(Tuple.Create("", 2344), Tuple.Create("sf-query-button", 2344), true)
                               , Tuple.Create(Tuple.Create(" ", 2359), Tuple.Create("sf-filters-header", 2360), true)
                               , Tuple.Create(Tuple.Create(" ", 2377), Tuple.Create("btn", 2378), true)
                               , Tuple.Create(Tuple.Create(" ", 2381), Tuple.Create("btn-default", 2382), true)

            #line 56 "..\..\Signum\Views\SearchControl.cshtml"
                               , Tuple.Create(Tuple.Create(" ", 2393), Tuple.Create <System.Object, System.Int32>(findOptions.ShowFilters ? "active" : ""

            #line default
            #line hidden
                                                                                                                  , 2394), false)
                               );

                WriteAttribute("onclick", Tuple.Create("\r\n            onclick=\"", 2437), Tuple.Create("\"", 2512)

            #line 57 "..\..\Signum\Views\SearchControl.cshtml"
                               , Tuple.Create(Tuple.Create("", 2460), Tuple.Create <System.Object, System.Int32>(JsFunction.SFControlThen(prefix, "toggleFilters()")

            #line default
            #line hidden
                                                                                                                 , 2460), false)
                               );

                WriteAttribute("title", Tuple.Create("\r\n            title=\"", 2513), Tuple.Create("\"", 2654)

            #line 58 "..\..\Signum\Views\SearchControl.cshtml"
                               , Tuple.Create(Tuple.Create("", 2534), Tuple.Create <System.Object, System.Int32>(findOptions.ShowFilters ? JavascriptMessage.hideFilters.NiceToString() : JavascriptMessage.showFilters.NiceToString()

            #line default
            #line hidden
                                                                                                                 , 2534), false)
                               );

                WriteLiteral(">\r\n                <span");

                WriteLiteral(" class=\"glyphicon glyphicon glyphicon-filter\"");

                WriteLiteral("></span>\r\n            </a>\r\n");


            #line 61 "..\..\Signum\Views\SearchControl.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("        <button");

            WriteLiteral(" type=\"button\"");

            WriteLiteral(" class=\"sf-query-button sf-search btn btn-primary\"");

            WriteAttribute("id", Tuple.Create(" id=\"", 2842), Tuple.Create("\"", 2873)

            #line 62 "..\..\Signum\Views\SearchControl.cshtml"
                           , Tuple.Create(Tuple.Create("", 2847), Tuple.Create <System.Object, System.Int32>(Model.Compose("qbSearch")

            #line default
            #line hidden
                                                                                                             , 2847), false)
                           );

            WriteLiteral(">");


            #line 62 "..\..\Signum\Views\SearchControl.cshtml"
            Write(SearchMessage.Search.NiceToString());


            #line default
            #line hidden
            WriteLiteral("</button>\r\n        <script");

            WriteLiteral(" type=\"text/javascript\"");

            WriteLiteral(">\r\n            $(\"#");


            #line 64 "..\..\Signum\Views\SearchControl.cshtml"
            Write(Model.Compose("qbSearch"));


            #line default
            #line hidden
            WriteLiteral("\").click(function(e){ $(\"#");


            #line 64 "..\..\Signum\Views\SearchControl.cshtml"
            Write(Model.Compose("sfSearchControl"));


            #line default
            #line hidden
            WriteLiteral("\").SFControl().then(function(c){c.search();}) });\r\n            $(\"#");


            #line 65 "..\..\Signum\Views\SearchControl.cshtml"
            Write(Model.Compose("tblFilterBuilder"));


            #line default
            #line hidden
            WriteLiteral("\").keyup(function(e){ if (e.which == 13) { $(\"#");


            #line 65 "..\..\Signum\Views\SearchControl.cshtml"
            Write(Model.Compose("qbSearch"));


            #line default
            #line hidden
            WriteLiteral("\").click(); } });\r\n        </script>\r\n\r\n");


            #line 68 "..\..\Signum\Views\SearchControl.cshtml"


            #line default
            #line hidden

            #line 68 "..\..\Signum\Views\SearchControl.cshtml"
            if (findOptions.Create)
            {
            #line default
            #line hidden
                WriteLiteral("            <a");

                WriteLiteral(" class=\"sf-query-button btn btn-default sf-line-button sf-create\"");

                WriteAttribute("id", Tuple.Create(" id=\"", 3402), Tuple.Create("\"", 3439)

            #line 70 "..\..\Signum\Views\SearchControl.cshtml"
                               , Tuple.Create(Tuple.Create("", 3407), Tuple.Create <System.Object, System.Int32>(Model.Compose("qbSearchCreate")

            #line default
            #line hidden
                                                                                                                 , 3407), false)
                               );

                WriteAttribute("title", Tuple.Create(" title=\"", 3440), Tuple.Create("\"", 3604)

            #line 70 "..\..\Signum\Views\SearchControl.cshtml"
                               , Tuple.Create(Tuple.Create("", 3448), Tuple.Create <System.Object, System.Int32>(SearchMessage.CreateNew0_G.NiceToString().ForGenderAndNumber().FormatWith(implementations.IsByAll ? "?" : implementations.Types.CommaOr(a => a.NiceName()))

            #line default
            #line hidden
                                                                                                                 , 3448), false)
                               );

                WriteAttribute("onclick", Tuple.Create(" onclick=\"", 3605), Tuple.Create("\"", 3671)

            #line 70 "..\..\Signum\Views\SearchControl.cshtml"
                               , Tuple.Create(Tuple.Create("", 3615), Tuple.Create <System.Object, System.Int32>(JsFunction.SFControlThen(prefix, "create_click(event)")

            #line default
            #line hidden
                                                                                                                 , 3615), false)
                               );

                WriteLiteral(">\r\n                <span");

                WriteLiteral(" class=\"glyphicon glyphicon-plus\"");

                WriteLiteral("></span>\r\n            </a>\r\n");


            #line 73 "..\..\Signum\Views\SearchControl.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("\r\n");


            #line 75 "..\..\Signum\Views\SearchControl.cshtml"


            #line default
            #line hidden

            #line 75 "..\..\Signum\Views\SearchControl.cshtml"
            if (findOptions.ShowContextMenu)
            {
            #line default
            #line hidden
                WriteLiteral("            <div");

                WriteLiteral(" class=\"btn-group\"");

                WriteLiteral(">\r\n                <button");

                WriteLiteral(" class=\"sf-query-button sf-tm-selected btn btn-default dropdown-toggle\"");

                WriteLiteral(" data-toggle=\"dropdown\"");

                WriteAttribute("id", Tuple.Create(" id=\"", 3980), Tuple.Create("\"", 4014)

            #line 79 "..\..\Signum\Views\SearchControl.cshtml"
                               , Tuple.Create(Tuple.Create("", 3985), Tuple.Create <System.Object, System.Int32>(Model.Compose("btnSelected")

            #line default
            #line hidden
                                                                                                                 , 3985), false)
                               );

                WriteLiteral(" disabled=\"disabled\"");

                WriteLiteral(">\r\n");

                WriteLiteral("                    ");


            #line 80 "..\..\Signum\Views\SearchControl.cshtml"
                Write(JavascriptMessage.Selected);


            #line default
            #line hidden
                WriteLiteral("\r\n                    (<span");

                WriteAttribute("id", Tuple.Create(" id=\"", 4113), Tuple.Create("\"", 4151)

            #line 81 "..\..\Signum\Views\SearchControl.cshtml"
                               , Tuple.Create(Tuple.Create("", 4118), Tuple.Create <System.Object, System.Int32>(Model.Compose("btnSelectedSpan")

            #line default
            #line hidden
                                                                                                                 , 4118), false)
                               );

                WriteLiteral(">0</span>)\r\n                <span");

                WriteLiteral(" class=\"caret\"");

                WriteLiteral("></span>\r\n                </button>\r\n                <ul");

                WriteLiteral(" class=\"dropdown-menu\"");

                WriteAttribute("id", Tuple.Create(" id=\"", 4277), Tuple.Create("\"", 4319)

            #line 84 "..\..\Signum\Views\SearchControl.cshtml"
                               , Tuple.Create(Tuple.Create("", 4282), Tuple.Create <System.Object, System.Int32>(Model.Compose("btnSelectedDropDown")

            #line default
            #line hidden
                                                                                                                 , 4282), false)
                               );

                WriteLiteral(">\r\n                    <li>Error: DropDown not initialized</li>\r\n                " +
                             "</ul>\r\n            </div>\r\n");


            #line 88 "..\..\Signum\Views\SearchControl.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("\r\n");

            WriteLiteral("        ");


            #line 90 "..\..\Signum\Views\SearchControl.cshtml"
            Write(ButtonBarQueryHelper.GetButtonBarElementsForQuery(new QueryButtonContext
            {
                Url = Url,
                ControllerContext  = this.ViewContext,
                QueryName          = findOptions.QueryName,
                ManualQueryButtons = (ToolBarButton[])ViewData[ViewDataKeys.ManualToolbarButtons],
                EntityType         = entitiesType,
                Prefix             = Model.Prefix
            }).ToStringButton(Html));


            #line default
            #line hidden
            WriteLiteral("\r\n\r\n");


            #line 100 "..\..\Signum\Views\SearchControl.cshtml"


            #line default
            #line hidden

            #line 100 "..\..\Signum\Views\SearchControl.cshtml"
            if ((bool?)ViewData[ViewDataKeys.AvoidFullScreenButton] != true)
            {
            #line default
            #line hidden
                WriteLiteral("             <a");

                WriteAttribute("id", Tuple.Create(" id=\"", 4958), Tuple.Create("\"", 4993)

            #line 102 "..\..\Signum\Views\SearchControl.cshtml"
                               , Tuple.Create(Tuple.Create("", 4963), Tuple.Create <System.Object, System.Int32>(Model.Compose("sfFullScreen")

            #line default
            #line hidden
                                                                                                                 , 4963), false)
                               );

                WriteLiteral(" class=\"sf-query-button btn btn-default\"");

                WriteLiteral(" href=\"#\"");

                WriteLiteral(">\r\n                <span");

                WriteLiteral(" class=\"glyphicon glyphicon-new-window\"");

                WriteLiteral("></span>\r\n            </a>\r\n");


            #line 105 "..\..\Signum\Views\SearchControl.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("\r\n    </div>\r\n    <div");

            WriteAttribute("id", Tuple.Create(" id=\"", 5167), Tuple.Create("\"", 5200)

            #line 108 "..\..\Signum\Views\SearchControl.cshtml"
                           , Tuple.Create(Tuple.Create("", 5172), Tuple.Create <System.Object, System.Int32>(Model.Compose("divResults")

            #line default
            #line hidden
                                                                                                             , 5172), false)
                           );

            WriteLiteral(" class=\"sf-search-results-container table-responsive\"");

            WriteLiteral(">\r\n        <table");

            WriteAttribute("id", Tuple.Create(" id=\"", 5271), Tuple.Create("\"", 5304)

            #line 109 "..\..\Signum\Views\SearchControl.cshtml"
                           , Tuple.Create(Tuple.Create("", 5276), Tuple.Create <System.Object, System.Int32>(Model.Compose("tblResults")

            #line default
            #line hidden
                                                                                                             , 5276), false)
                           );

            WriteLiteral(" class=\"sf-search-results  table table-hover  table-condensed\"");

            WriteLiteral(">\r\n            <thead>\r\n                <tr>\r\n");


            #line 112 "..\..\Signum\Views\SearchControl.cshtml"


            #line default
            #line hidden

            #line 112 "..\..\Signum\Views\SearchControl.cshtml"
            if (findOptions.AllowSelection)
            {
            #line default
            #line hidden
                WriteLiteral("                        <th");

                WriteLiteral(" class=\"sf-th-selection\"");

                WriteLiteral(">\r\n");

                WriteLiteral("                            ");


            #line 115 "..\..\Signum\Views\SearchControl.cshtml"
                Write(Html.CheckBox(Model.Compose("cbSelectAll"), false, new { onclick = JsFunction.SFControlThen(prefix, "toggleSelectAll()") }));


            #line default
            #line hidden
                WriteLiteral("\r\n                        </th>\r\n");


            #line 117 "..\..\Signum\Views\SearchControl.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("                    ");


            #line 118 "..\..\Signum\Views\SearchControl.cshtml"
            if (findOptions.Navigate)
            {
            #line default
            #line hidden
                WriteLiteral("                        <th");

                WriteLiteral(" class=\"sf-th-entity\"");

                WriteLiteral("></th>\r\n");


            #line 121 "..\..\Signum\Views\SearchControl.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("                    ");


            #line 122 "..\..\Signum\Views\SearchControl.cshtml"
            List <Column> columns = findOptions.MergeColumns();

            #line default
            #line hidden
            WriteLiteral("\r\n");


            #line 123 "..\..\Signum\Views\SearchControl.cshtml"


            #line default
            #line hidden

            #line 123 "..\..\Signum\Views\SearchControl.cshtml"
            foreach (var col in columns)
            {
                var       order     = findOptions.OrderOptions.FirstOrDefault(oo => oo.Token.FullKey() == col.Name);
                OrderType?orderType = null;
                if (order != null)
                {
                    orderType = order.OrderType;
                }


            #line default
            #line hidden

            #line 131 "..\..\Signum\Views\SearchControl.cshtml"
                Write(SearchControlHelper.Header(col, orderType));


            #line default
            #line hidden

            #line 131 "..\..\Signum\Views\SearchControl.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("                </tr>\r\n            </thead>\r\n            <tbody>\r\n");


            #line 136 "..\..\Signum\Views\SearchControl.cshtml"


            #line default
            #line hidden

            #line 136 "..\..\Signum\Views\SearchControl.cshtml"
            int columnsCount = columns.Count + (findOptions.Navigate ? 1 : 0) + (findOptions.AllowSelection ? 1 : 0);

            #line default
            #line hidden
            WriteLiteral("\r\n                <tr>\r\n                    <td");

            WriteAttribute("colspan", Tuple.Create(" colspan=\"", 6709), Tuple.Create("\"", 6732)

            #line 138 "..\..\Signum\Views\SearchControl.cshtml"
                           , Tuple.Create(Tuple.Create("", 6719), Tuple.Create <System.Object, System.Int32>(columnsCount

            #line default
            #line hidden
                                                                                                             , 6719), false)
                           );

            WriteLiteral(">");


            #line 138 "..\..\Signum\Views\SearchControl.cshtml"
            Write(JavascriptMessage.searchForResults.NiceToString());


            #line default
            #line hidden
            WriteLiteral("</td>\r\n                </tr>\r\n            </tbody>\r\n        </table>\r\n    </div>\r" +
                         "\n\r\n");


            #line 144 "..\..\Signum\Views\SearchControl.cshtml"


            #line default
            #line hidden

            #line 144 "..\..\Signum\Views\SearchControl.cshtml"

            ViewData[ViewDataKeys.ShowFooter] = findOptions.ShowFooter;
            ViewData[ViewDataKeys.Pagination] = findOptions.Pagination;


            #line default
            #line hidden

            #line 147 "..\..\Signum\Views\SearchControl.cshtml"
            Write(Html.Partial(Finder.Manager.PaginationSelectorView, Model));


            #line default
            #line hidden

            #line 147 "..\..\Signum\Views\SearchControl.cshtml"



            #line default
            #line hidden
            WriteLiteral("\r\n</div>\r\n<script");

            WriteLiteral(" type=\"text/javascript\"");

            WriteLiteral(">\r\n    require([\"");


            #line 151 "..\..\Signum\Views\SearchControl.cshtml"
            Write(JsModule.Finder);


            #line default
            #line hidden
            WriteLiteral("\"], function(Finder) { new Finder.SearchControl($(\"#");


            #line 151 "..\..\Signum\Views\SearchControl.cshtml"
            Write(Model.Compose("sfSearchControl"));


            #line default
            #line hidden
            WriteLiteral("\"),\r\n");

            WriteLiteral("        ");


            #line 152 "..\..\Signum\Views\SearchControl.cshtml"
            Write(MvcHtmlString.Create(findOptions.ToJS(Model.Prefix).ToString()));


            #line default
            #line hidden
            WriteLiteral(",\r\n");

            WriteLiteral("        ");


            #line 153 "..\..\Signum\Views\SearchControl.cshtml"
            Write(Html.Json(implementations.ToJsTypeInfos(isSearch: true, prefix: prefix)));


            #line default
            #line hidden
            WriteLiteral(",\r\n");

            WriteLiteral("        ");


            #line 154 "..\..\Signum\Views\SearchControl.cshtml"
            Write(Html.Json(sfb == null ? null : sfb.Url));


            #line default
            #line hidden
            WriteLiteral(").ready();});\r\n</script>\r\n");
        }