Exemple #1
0
        public override void Execute()
        {
            WriteLiteral("\r\n");


            #line 10 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"


            /*  описание свойств:
             *
             *
             *          string Data - имя ключа, по которому можно получить список элементов для селекта
             *          string OptionTitle - текст
             *          string OptionValue - ключ
             *          List<OptionSettings> Options - предпределённые элементы
             *          bool Levels - использует ли вложенность
             *          bool Multiple - доступен ли множественный выбор
             *
             *          string TypeName - тип, с помощью которого можно получить данные
             *          string PropertyName - свойство, возвращающее список доступных элементов (работает только при указанном типе)
             *          string MethodName - метод, возвращающий список доступных элементов (работает только при указанном типе)
             *
             * если по данным ничего не установлено, берутся значения из бд по типу
             *
             *
             *  принцип работы
             *     берём текущее значение из модели
             *     если оно не указано, смотрим, есть ли такое значение в предопределённых (PreValue должно быть выставлено в true), если да, то устанавливаем именно его
             *
             *      получаем данные: сначала просматривается свойство Data, если оно пустое, то тип, в котором свойство или метод, через которые и получаем данные
             *
             *
             */


            var fieldSettings = (SelectSettings)WebContext.FieldSettings;

            var model = TypeHelpers.GetPropertyValue(WebContext.Model, fieldSettings.Name, null); // текущее значение свойства

            var modelString = model != null?model.ToString() : "";

            if (fieldSettings.PreValue && string.IsNullOrEmpty(modelString))
            {
                modelString = Session[string.Format("prevalue_{0}_{1}", fieldSettings.Name, ViewBag.EditViewModel.FormData.GetType().Name)];
            }

            IEnumerable <object> data = null;

            if (!string.IsNullOrEmpty(fieldSettings.Data))
            {
                data = (IEnumerable <object>)WebContext.ViewData[fieldSettings.Data];
            }
            else if (!string.IsNullOrEmpty(fieldSettings.TypeName))
            {
                if (!string.IsNullOrEmpty(fieldSettings.PropertyName))
                {
                    data = (IEnumerable <object>)TypeHelpers.GetPropertyValue(fieldSettings.TypeName, fieldSettings.PropertyName);
                }
                else if (!string.IsNullOrEmpty(fieldSettings.MethodName))
                {
                    data = (IEnumerable <object>)TypeHelpers.ExecuteMethod(fieldSettings.TypeName, fieldSettings.MethodName);
                }
            }
            else if (!string.IsNullOrEmpty(fieldSettings.Reference))
            {
                var db = ((OziController)ViewContext.Controller).DataModelContext;
                if (db != null)
                {
                    var t = TypeHelpers.GetPropertyType(WebContext.ModelType, fieldSettings.GetFullPropertyName());
                    var d = TypeHelpers.GetEntitySet(db, t).Cast <IEntity>();

                    if (typeof(ISortableEntity).IsAssignableFrom(t))
                    {
                        d = d.OrderBy(entity => ((ISortableEntity)entity).Sort);
                    }

                    if (fieldSettings.Levels)
                    {
                        d = PlainTree.GetTree(d.Cast <IPlainTreeItem>().Where(p => WebContext.Model == null || (p.GetType() != WebContext.Model.GetType() || (p.ParentId != WebContext.Model.Id || p.ParentId == null) && p.Id != WebContext.Model.Id)));
                    }
                    data = d.ToList();
                }
            }


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


            #line 88 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
            if (!fieldSettings.Editable)
            {
            #line default
            #line hidden
                WriteLiteral("    <select");

                WriteAttribute("name", Tuple.Create(" name=\"", 3455), Tuple.Create("\"", 3500)

            #line 91 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                               , Tuple.Create(Tuple.Create("", 3462), Tuple.Create <System.Object, System.Int32>(ViewData.TemplateInfo.HtmlFieldPrefix

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

                WriteLiteral(" class=\"ozi-select\"");

                WriteLiteral(" \r\n        ");


            #line 92 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                if (fieldSettings.Multiple)
                {
            #line default
            #line hidden
                    WriteLiteral("            ");

                    WriteLiteral("multiple=\"multiple\" style=\"width: 400px;\"");

                    WriteLiteral("\r\n");


            #line 95 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                    if (fieldSettings.Height != 0)
                    {
            #line default
            #line hidden
                        WriteLiteral("                ");

                        WriteLiteral("size=\"");


            #line 97 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                        Write(fieldSettings.Height);


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

                        WriteLiteral("\r\n");


            #line 98 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                    }
                }


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


            #line 100 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                if (fieldSettings.Disabled)
                {
            #line default
            #line hidden
                    WriteLiteral(" ");

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

                    WriteLiteral(" ");


            #line 101 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                }


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


            #line 102 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                if (fieldSettings.Readonly)
                {
            #line default
            #line hidden
                    WriteLiteral(" ");

                    WriteLiteral("readonly=\"readonly\"");


            #line 103 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                }

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


            #line 105 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"


            #line default
            #line hidden

            #line 105 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                foreach (OptionSettings option in fieldSettings.Options)
                {
            #line default
            #line hidden
                    WriteLiteral("<option ");


            #line 106 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                    Write(IsValue(option.Value, model, modelString));


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


            #line 106 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                    Write(option.Value);


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


            #line 106 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                    Write(option.Title);


            #line default
            #line hidden
                    WriteLiteral("</option>");


            #line 106 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                }


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


            #line 107 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                if (data != null)
                {
                    foreach (var option in data)
                    {
                        var optionValue = TypeHelpers.GetPropertyValue(option, fieldSettings.OptionValue).ToString();
                        var value       = TypeHelpers.GetPropertyValue(option, fieldSettings.OptionTitle);
                        if (fieldSettings.Localizable && value is Guid)
                        {
                            value = Lp.GetMessage((Guid)value);
                        }


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


            #line 117 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                        Write(IsValue(optionValue, model, modelString));


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


            #line 117 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                        Write(optionValue);


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


            #line 117 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                        if (fieldSettings.Levels)
                        {
                            for (var i = 0; i < (Int32.Parse(TypeHelpers.GetPropertyValue(option, "Level").ToString()) - 1); i++)
                            {
            #line default
            #line hidden
                                WriteLiteral("&nbsp;-&nbsp;");


            #line 120 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                            }

            #line default
            #line hidden
                            WriteLiteral("○&nbsp;");

                            WriteLiteral(" ");


            #line 120 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                        }

            #line default
            #line hidden

            #line 120 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                        Write(value);


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


            #line 121 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                    }
                }


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


            #line 124 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
            }
            else
            {
                string val   = string.Empty;
                string label = string.Empty;
                if (model != null)
                {
                    if (fieldSettings.Multiple)
                    {
                        label = string.Join(", ", ((IListSource)model).GetList().Cast <object>().ToList().Select <object, string>(a => (TypeHelpers.GetPropertyValue(a, fieldSettings.OptionTitle)).ToString()));
                    }
                    else
                    {
                        label = (TypeHelpers.GetPropertyValue(model, fieldSettings.OptionTitle)).ToString();
                        val   = (TypeHelpers.GetPropertyValue(model, fieldSettings.OptionValue)).ToString();
                    }
                }


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

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

                WriteAttribute("name", Tuple.Create(" name=\"", 5826), Tuple.Create("\"", 5883)

            #line 141 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                               , Tuple.Create(Tuple.Create("", 5833), Tuple.Create <System.Object, System.Int32>(fieldSettings.Name

            #line default
            #line hidden
                                                                                                                 , 5833), false)
                               , Tuple.Create(Tuple.Create("", 5854), Tuple.Create(".", 5854), true)

            #line 141 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                               , Tuple.Create(Tuple.Create("", 5855), Tuple.Create <System.Object, System.Int32>(fieldSettings.OptionValue

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

                WriteAttribute("id", Tuple.Create(" id=\"", 5884), Tuple.Create("\"", 5939)

            #line 141 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                               , Tuple.Create(Tuple.Create("", 5889), Tuple.Create <System.Object, System.Int32>(fieldSettings.Name

            #line default
            #line hidden
                                                                                                                 , 5889), false)
                               , Tuple.Create(Tuple.Create("", 5910), Tuple.Create("_", 5910), true)

            #line 141 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                               , Tuple.Create(Tuple.Create("", 5911), Tuple.Create <System.Object, System.Int32>(fieldSettings.OptionValue

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

                WriteAttribute("value", Tuple.Create(" value=\"", 5940), Tuple.Create("\"", 5952)

            #line 141 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                               , Tuple.Create(Tuple.Create("", 5948), Tuple.Create <System.Object, System.Int32>(val

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

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

                WriteLiteral("    <input");

                WriteAttribute("value", Tuple.Create(" value=\"", 5968), Tuple.Create("\"", 5982)

            #line 142 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                               , Tuple.Create(Tuple.Create("", 5976), Tuple.Create <System.Object, System.Int32>(label

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

                WriteLiteral(" class=\"autocomplete ozi-string\"");

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

                WriteLiteral(" ");


            #line 142 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                Write(Html.Raw(ByCondition(fieldSettings.Multiple, "multiple='true'")));


            #line default
            #line hidden
                WriteLiteral(" data-hiddenid=\"");


            #line 142 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                Write(fieldSettings.Name);


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


            #line 142 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                Write(fieldSettings.OptionValue);


            #line default
            #line hidden
                WriteLiteral("\" data-sourcename=\"");


            #line 142 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                Write(fieldSettings.Name);


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


            #line 142 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                Write(fieldSettings.Name);


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


            #line 142 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                Write(fieldSettings.OptionTitle);


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

                WriteLiteral("    <script>\r\n        var d;\r\n        try {\r\n            d = $(\"body\").data(\"");


            #line 146 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                Write(fieldSettings.Name);


            #line default
            #line hidden
                WriteLiteral("\");\r\n        } catch(e) {\r\n            \r\n        }\r\n        if (!d) {\r\n          " +
                             "      d = [\r\n");


            #line 152 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"


            #line default
            #line hidden

            #line 152 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                foreach (var option in data)
                {
                    var optionValue = TypeHelpers.GetPropertyValue(option, fieldSettings.OptionValue).ToString();
                    var value       = TypeHelpers.GetPropertyValue(option, fieldSettings.OptionTitle);


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

                    WriteLiteral("{ value: \'");


            #line 156 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                    Write(optionValue);


            #line default
            #line hidden
                    WriteLiteral("\', label : \'");


            #line 156 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                    if (fieldSettings.Levels)
                    {
                        for (var i = 0; i < (Int32.Parse(TypeHelpers.GetPropertyValue(option, "Level").ToString()) - 1); i++)
                        {
            #line default
            #line hidden
                            WriteLiteral("&nbsp;-&nbsp;");


            #line 156 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                        }

            #line default
            #line hidden
                        WriteLiteral("○&nbsp;");


            #line 156 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                    }

            #line default
            #line hidden

            #line 156 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                    Write(value);


            #line default
            #line hidden
                    WriteLiteral("\'},");

                    WriteLiteral("\r\n");


            #line 157 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                }


            #line default
            #line hidden
                WriteLiteral("                ];\r\n                $(\"body\").data(\"");


            #line 159 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
                Write(fieldSettings.Name);


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


            #line 162 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_Select.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("\r\n\r\n\r\n");
        }
Exemple #2
0
        public override void Execute()
        {
            #line 5 "..\..\Areas\Admin\Views\Shared\Index.cshtml"

            ViewBag.HtmlPageTitle = "OziCms.cms — список объектов";
            Func <string, bool> allowed = role => true;


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

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

            WriteLiteral(">\r\n    _sorlListActionUrl = \'");


            #line 11 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
            Write(Url.Action(Constants.SortListAction));


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

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

            WriteAttribute("src", Tuple.Create(" src=\"", 319), Tuple.Create("\"", 378)

            #line 13 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                           , Tuple.Create(Tuple.Create("", 325), Tuple.Create <System.Object, System.Int32>(Url.Content("~/Areas/Admin/Scripts/Default/List.js")

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

            WriteLiteral("></script>\r\n\r\n<div");

            WriteLiteral(" class=\"global-actions\"");

            WriteLiteral(">\r\n");


            #line 16 "..\..\Areas\Admin\Views\Shared\Index.cshtml"


            #line default
            #line hidden

            #line 16 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
            foreach (GlobalActionSettings globalAction in Model.Settings.ListSettings.GlobalActions)
            {
                if (!string.IsNullOrEmpty(globalAction.Control))
                {
                    Html.RenderPartial("GlobalActions/" + globalAction.Control, new ViewDataDictionary(Model)
                    {
                        { "Settings", Model.Settings }, { "globalActionSettings", globalAction }
                    });
                }
                else
                {
            #line default
            #line hidden

            #line 24 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                    Write(Html.ActionLink(globalAction.Text, globalAction.Action, null, new { @class = "global-action" }));


            #line default
            #line hidden

            #line 24 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                }
            }


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


            #line 29 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
            using (Html.BeginForm(null, null, FormMethod.Post, new { id = "list-form" }))
            {
            #line default
            #line hidden
                WriteLiteral("    <input");

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

                WriteLiteral(" name=\"page\"");

                WriteAttribute("value", Tuple.Create(" value=\"", 1060), Tuple.Create("\"", 1084)

            #line 31 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                               , Tuple.Create(Tuple.Create("", 1068), Tuple.Create <System.Object, System.Int32>(Request["page"]

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

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

                WriteLiteral("    <table");

                WriteLiteral(" class=\"list-table\"");

                WriteLiteral(">\r\n        <colgroup>\r\n            <col ");


            #line 34 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                Write(Html.Raw("width=\"24\""));


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

                WriteLiteral("            ");


            #line 35 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                Write(OutputCollection(Model.Settings.ListSettings.Cols.Where(s => allowed(s.RoleName)).Select(col => string.Format("<col {0} />", col.Width > 0 ? string.Format("width={0}", col.Width) : string.Empty))));


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

                WriteLiteral("            ");


            #line 36 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                Write(OutputCollection(Model.Settings.ListSettings.ListActions.Select(settings => "<col width=\"24\" />")));


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

                WriteLiteral("            ");


            #line 40 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                Write(OutputCollection(Model.Settings.ListSettings.Cols.Where(settings => settings != null && allowed(settings.RoleName)).Select(settings =>
                {
                    var value = settings.HeaderValue();
                    return(string.Join(string.Empty, "<th>", Html.DisplayFor(model => value, settings.HeaderControl, new { ColSettings = settings, Model.Settings }), "</th>"));
                })));


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


            #line 46 "..\..\Areas\Admin\Views\Shared\Index.cshtml"


            #line default
            #line hidden

            #line 46 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                foreach (var listAction in Model.Settings.ListSettings.ListActions.Where(settings => settings != null))
                {
                    if (listAction.Control == "sort")
                    {
            #line default
            #line hidden
                        WriteLiteral("                    <th><input");

                        WriteLiteral(" id=\"sort-button\"");

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

                        WriteLiteral(" value=\"Применить\"");

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


            #line 51 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("                    <th>&nbsp;</th>\r\n");


            #line 55 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                    }
                }


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


            #line 58 "..\..\Areas\Admin\Views\Shared\Index.cshtml"


            #line default
            #line hidden

            #line 58 "..\..\Areas\Admin\Views\Shared\Index.cshtml"

                var number  = 0;
                var hasEdit = Model.Settings.ListSettings.ListActions.Any(a => a.Control == "edit");


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


            #line 63 "..\..\Areas\Admin\Views\Shared\Index.cshtml"


            #line default
            #line hidden

            #line 63 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                foreach (IEntity row in Model.ListData)
                {
                    var action      = Html.Raw(hasEdit ? string.Format("target=\"{0}\"", Url.Action(Constants.EditView, new { id = row.Id })) : string.Empty);
                    var selectedRow = (bool)TypeHelpers.GetPropertyValue(row, Model.Settings.ListSettings.SelectRowProperty, false);


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


            #line 67 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                    Write(Html.ByCondition(selectedRow, "class=\"selected\""));


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

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

                    WriteLiteral(">");


            #line 69 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                    Write(++number + (Model.FilterParameters.StartPosition));


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


            #line 70 "..\..\Areas\Admin\Views\Shared\Index.cshtml"


            #line default
            #line hidden

            #line 70 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                    foreach (var col in Model.Settings.ListSettings.Cols.Where(s => allowed(s.RoleName)))
                    {
            #line default
            #line hidden
                        WriteLiteral("                    <td ");


            #line 72 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                        Write(action);


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

                        WriteLiteral("                        ");


            #line 73 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                        Write(Indents(row, col));


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


            #line 74 "..\..\Areas\Admin\Views\Shared\Index.cshtml"


            #line default
            #line hidden

            #line 74 "..\..\Areas\Admin\Views\Shared\Index.cshtml"

                        var propValue = TypeHelpers.GetPropertyValue(row, col.Name);
                        if (col.Localizable)
                        {
                            var key = (Guid?)propValue;
                            propValue = Lp.GetMessage(key);
                        }


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

                        WriteLiteral("                        ");


            #line 82 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                        Write(Html.DisplayFor(model => propValue, col.Control, new { ColSettings = col, Row = row }));


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


            #line 84 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                    }


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


            #line 87 "..\..\Areas\Admin\Views\Shared\Index.cshtml"


            #line default
            #line hidden

            #line 87 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                    foreach (var listAction in Model.Settings.ListSettings.ListActions)
                    {
            #line default
            #line hidden
                        WriteLiteral("                    <td");

                        WriteLiteral(" class=\"list-action\"");

                        WriteLiteral(">\r\n");


            #line 90 "..\..\Areas\Admin\Views\Shared\Index.cshtml"


            #line default
            #line hidden

            #line 90 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                        Html.RenderPartial("ListActions/" + listAction.Control, row, new ViewDataDictionary {
                            { "Settings", Model.Settings }, { "listActionSettings", listAction }, { "listViewModel", Model }
                        });

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


            #line 92 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                    }


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


            #line 94 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                }


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


            #line 96 "..\..\Areas\Admin\Views\Shared\Index.cshtml"


            #line default
            #line hidden

            #line 96 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                if (Model.FilterParameters.ItemsCount == 0)
                {
                    var colspan = Model.Settings.ListSettings.Cols.Count() + Model.Settings.ListSettings.ListActions.Count();


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

                    WriteAttribute("colspan", Tuple.Create(" colspan=\"", 4570), Tuple.Create("\"", 4594)

            #line 100 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                                   , Tuple.Create(Tuple.Create("", 4580), Tuple.Create <System.Object, System.Int32>(colspan + 1

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

                    WriteLiteral(">Список пуст</td>\r\n            </tr>\r\n");


            #line 102 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                }


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


            #line 104 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
            }


            #line default
            #line hidden

            #line 105 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
            if (Model.FilterParameters.HasPager())
            {
                var count = Model.FilterParameters.GetPagesCount();


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

                WriteLiteral(" id=\"pager\"");

                WriteLiteral(">\r\n        Страница:\r\n");


            #line 110 "..\..\Areas\Admin\Views\Shared\Index.cshtml"


            #line default
            #line hidden

            #line 110 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                for (var i = 1; i <= count; i++)
                {
                    if (Model.FilterParameters.Page == i)
                    {
            #line default
            #line hidden
                        WriteLiteral("            <span>");


            #line 114 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                        Write(i);


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


            #line 115 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                    }
                    else
                    {
            #line default
            #line hidden
                        WriteLiteral("            <a");

                        WriteLiteral(" class=\"list-action\"");

                        WriteAttribute("href", Tuple.Create(" href=\"", 4992), Tuple.Create("\"", 5046)

            #line 118 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                                       , Tuple.Create(Tuple.Create("", 4999), Tuple.Create <System.Object, System.Int32>(Request.Url.SetParameter("page", i.ToString())

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

                        WriteLiteral(">");


            #line 118 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                        Write(i);


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


            #line 119 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
                    }
                }


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


            #line 123 "..\..\Areas\Admin\Views\Shared\Index.cshtml"
            }


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

            WriteLiteral("\r\n");
        }
Exemple #3
0
        public override void Execute()
        {
            #line 2 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_String.cshtml"

            var value = ViewData.TemplateInfo.FormattedModelValue;
            if (WebContext.FieldSettings.Localizable && Model != null)
            {
                value = Lp.GetMessage((Guid)Model);
            }


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

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

            WriteAttribute("name", Tuple.Create(" name=\"", 226), Tuple.Create("\"", 271)

            #line 9 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_String.cshtml"
                           , Tuple.Create(Tuple.Create("", 233), Tuple.Create <System.Object, System.Int32>(ViewData.TemplateInfo.HtmlFieldPrefix

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

            WriteAttribute("value", Tuple.Create(" value=\"", 272), Tuple.Create("\"", 286)

            #line 9 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_String.cshtml"
                           , Tuple.Create(Tuple.Create("", 280), Tuple.Create <System.Object, System.Int32>(value

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

            WriteLiteral(" class=\"ozi-string\"");

            WriteLiteral(" ");


            #line 9 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_String.cshtml"
            if (WebContext.FieldSettings.Disabled)
            {
            #line default
            #line hidden
                WriteLiteral(" ");

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

                WriteLiteral(" ");


            #line 9 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_String.cshtml"
            }

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


            #line 9 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_String.cshtml"
            if (WebContext.FieldSettings.Readonly)
            {
            #line default
            #line hidden
                WriteLiteral(" ");

                WriteLiteral("readonly=\"readonly\"");

                WriteLiteral(" ");


            #line 9 "..\..\Areas\Admin\Views\Shared\EditorTemplates\ozi_String.cshtml"
            }

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