Exemple #1
0
        public override IHtmlString RenderItemColumn(System.Web.Mvc.ViewContext viewContext)
        {
            var inheritable = DataItem as IInheritable;
            var data = (IIdentifiable)DataItem;
            if (inheritable != null)
            {
                var localized = inheritable.IsLocalized(Site.Current);
                if (localized)
                {
                    var hasParent = Site.Current.Parent != null;
                    if (hasParent)
                    {
                        return viewContext.HtmlHelper().ActionLink("Unlocalize".Localize(), "Unlocalize", viewContext.RequestContext.AllRouteValues().Merge("UUID", data.UUID),
                       new Dictionary<string, object> { { "class", "o-icon unlocalize actionCommand" }, { "ConfirmMessage", "Are you sure you want to unlocalize this item?".Localize() } });
                    }
                }
                else
                {
                    var linkText = "Localize".Localize();

                    return viewContext.HtmlHelper().ActionLink(linkText, "Localize", viewContext.RequestContext.AllRouteValues().Merge("UUID", data.UUID),
                        new Dictionary<string, object> { { "class", "o-icon localize" }, { "ConfirmMessage", "Are you sure you want to localize this item?".Localize() } });
                }
            }
            return new HtmlString("");
        }
        public override IHtmlString RenderItemColumn(System.Web.Mvc.ViewContext viewContext)
        {
            var data = (VersionInfo)DataItem;

            var linkText = "Preview".Localize();

            return viewContext.HtmlHelper().ActionLink(linkText, "PreviewVersion", viewContext.RequestContext.AllRouteValues().Merge("Version", data.Version),
                new Dictionary<string, object> { { "class", "o-icon preview dialog-link" } });
        }
        public override IHtmlString RenderItemColumn(System.Web.Mvc.ViewContext viewContext)
        {
            var data = (VersionInfo)DataItem;

            var linkText = "Revert".Localize();

                    return viewContext.HtmlHelper().ActionLink(linkText, "Revert", viewContext.RequestContext.AllRouteValues().Merge("Version", data.Version),
                  new Dictionary<string, object> { { "class", "o-icon revert ajax-post-link" }, { "ConfirmMessage", ("Are you sure you want to rever to this version?").Localize() } });
        }
        public override IHtmlString RenderItemColumn(System.Web.Mvc.ViewContext viewContext)
        {
            var data = (ModuleInfo)DataItem;

            var linkText = "Uninstall".Localize();

            return viewContext.HtmlHelper().ActionLink(linkText, "Uninstall", viewContext.RequestContext.AllRouteValues().Merge("ModuleName", data.ModuleName),
                new Dictionary<string, object> { { "class", "o-icon delete dialog-link" } });
        }
 public override IHtmlString RenderItemColumn(System.Web.Mvc.ViewContext viewContext)
 {
     var module = (ModuleListInSiteModel)DataItem;
     if (module.Included)
     {
         return viewContext.HtmlHelper().ActionLink("Exclude".Localize(), "Exclude", viewContext.RequestContext.AllRouteValues().Merge("ModuleName", module.ModuleName),
             new Dictionary<string, object> { { "class", "o-icon delete ajax-post-link" }, { "confirm", "Are you sure you want to exclude this module from the site?".Localize() } });
     }
     return new HtmlString("");
 }
Exemple #6
0
        public override IHtmlString RenderItemColumn(System.Web.Mvc.ViewContext viewContext)
        {
            var inheritableData = DataItem as Kooboo.CMS.Sites.Models.IInheritable;
            if (inheritableData == null || inheritableData.IsLocalized(Site.Current))
            {
                var data = (IIdentifiable)DataItem;

                var linkText = "Copy".Localize();

                return viewContext.HtmlHelper().ActionLink(linkText, "Copy", viewContext.RequestContext.AllRouteValues().Merge("sourceName", data.UUID),
                    new Dictionary<string, object> { { "class", "common-copy o-icon copy" } });
            }
               return  new HtmlString("");
        }
        public override IHtmlString RenderItemColumn(System.Web.Mvc.ViewContext viewContext)
        {
            var inheritableData = DataItem as Kooboo.CMS.Sites.Models.IInheritable;
            if (inheritableData == null || inheritableData.IsLocalized(Site.Current))
            {
                var data = (IIdentifiable)DataItem;

                var linkText = "Move".Localize();

                //routeValueDictionary["ReturnUrl"] = (new UrlHelper(viewContext.RequestContext)).Action("Index", viewContext.RequestContext.AllRouteValues());
                //routeValueDictionary["from"] = "page";

                return viewContext.HtmlHelper().ActionLink(linkText, "Move", viewContext.RequestContext.AllRouteValues().Merge("UUID", data.UUID),
                    new Dictionary<string, object> { { "class", "o-icon move-page dialog-link" } });
            }
               return  new HtmlString("");
        }
Exemple #8
0
        public override IHtmlString RenderItemColumn(System.Web.Mvc.ViewContext viewContext)
        {
            if (Site.Current.EnableVersioning.HasValue ? Site.Current.EnableVersioning.Value : true)
            {
                var inheritableData = DataItem as Kooboo.CMS.Sites.Models.IInheritable;
                if (inheritableData == null || inheritableData.IsLocalized(Site.Current))
                {
                    var data = (IIdentifiable)DataItem;

                    var linkText = "Version".Localize();

                    return viewContext.HtmlHelper().ActionLink(linkText, "Version", viewContext.RequestContext.AllRouteValues().Merge("UUID", data.UUID),
                        new Dictionary<string, object> { { "class", "o-icon version dialog-link" } });
                }
            }

            return new HtmlString("");
        }
        public override IHtmlString RenderItemColumn(System.Web.Mvc.ViewContext viewContext)
        {
            var inheritableData = DataItem as Kooboo.CMS.Sites.Models.IInheritable;
            if (inheritableData == null || inheritableData.IsLocalized(Site.Current))
            {
                var page = (Page)DataItem;
                if (ServiceFactory.PageManager.HasDraft(page))
                {
                    var data = (IIdentifiable)DataItem;

                    var linkText = "Draft".Localize();

                    return viewContext.HtmlHelper().ActionLink(linkText, "Draft", viewContext.RequestContext.AllRouteValues().Merge("UUID", data.UUID).Merge("return", viewContext.HttpContext.Request.RawUrl),
                        new Dictionary<string, object>());
                }
            }
            return new HtmlString("-");
        }
 public override IHtmlString RenderItemColumn(System.Web.Mvc.ViewContext viewContext)
 {
     return viewContext.HtmlHelper().Partial("_ValueGridItemColumn", this.DataItem);
 }