diff --git a/src/Orchard.Web/Core/Contents/Views/Content.ControlWrapper.cshtml b/src/Orchard.Web/Core/Contents/Views/Content.ControlWrapper.cshtml index c34821b5b..1d5f1cee5 100644 --- a/src/Orchard.Web/Core/Contents/Views/Content.ControlWrapper.cshtml +++ b/src/Orchard.Web/Core/Contents/Views/Content.ControlWrapper.cshtml @@ -1,6 +1,6 @@ @using Orchard.ContentManagement; @using Orchard.Core.Contents; -@if (AuthorizedFor(Permissions.EditContent)) { +@if (AuthorizedFor(Permissions.EditContent) && Model.ContentItem.Id > 0) {
@Html.ItemEditLinkWithReturnUrl(T("Edit").Text, (ContentItem)Model.ContentItem)
@Display(Model.Child) diff --git a/src/Orchard.Web/Core/Contents/Views/Content.cshtml b/src/Orchard.Web/Core/Contents/Views/Content.cshtml index d2a451e87..e8c800f77 100644 --- a/src/Orchard.Web/Core/Contents/Views/Content.cshtml +++ b/src/Orchard.Web/Core/Contents/Views/Content.cshtml @@ -1,6 +1,9 @@ @using Orchard.Utility.Extensions; @{ - Layout.Title = Model.Title; + if (Model.Title != null) { + Layout.Title = Model.Title; + } + var contentTypeClassName = ((string)Model.ContentItem.ContentType).HtmlClassify(); }
diff --git a/src/Orchard.Web/Modules/Orchard.MediaPicker/Styles/mediapicker.css b/src/Orchard.Web/Modules/Orchard.MediaPicker/Styles/mediapicker.css index 4486c5cdd..585ba77fc 100644 --- a/src/Orchard.Web/Modules/Orchard.MediaPicker/Styles/mediapicker.css +++ b/src/Orchard.Web/Modules/Orchard.MediaPicker/Styles/mediapicker.css @@ -1,14 +1,4 @@ -/* Clearing Floats -***************************************************************/ - -.group:after { - content: "."; - display: block; - height: 0; - clear: both; - visibility: hidden; -} - +html { background:none !important } body { color: #333; @@ -17,6 +7,7 @@ body { line-height:1.6em; padding:12px; width:640px; + min-width:640px; margin: 0 auto; } @@ -29,6 +20,27 @@ body { text-decoration:none; } +#file-details, #image-preview, #gallery { + /*border:1px solid #ff0000;*/ + width:340px; + min-height:430px; + float:left; + } + +#file-details { + float:right; + width:220px; + } + +#file-list { + border:1px solid #bdbcbc; + height:324px; + max-height:324px; + overflow:scroll; + overflow-y:scroll; + overflow-x:hidden; + } + input[disabled], input[disabled="disabled"], input.disabled { color: White } @@ -96,7 +108,7 @@ legend { font-weight: normal; border:none; } fieldset { padding:0; margin: 0; border: 0px solid #dbdbdb; } #orchardmediapicker label { font-weight:normal; display:block; padding: 0 0 0 0; margin:10px 0 0 0; } #orchardmediapicker label.forcheckbox { display: inline; margin: 10px 0 0 4px; } -#orchardmediapicker .actions { margin:12px 0 0 0; } +#orchardmediapicker .actions { margin:12px 0 0 0; clear:both; text-align:left; } input[type="text"], select, textarea, input.text, input.textMedium, input.text-box { padding:3px; @@ -139,101 +151,6 @@ textarea { min-height:8em; } - -form.link button { - background:inherit; - border:0; - padding:0; - width:auto; - margin:-2px -3px 0; - - /*Remove CSS3 button properties*/ - filter:none; - background:none; - background:none; - box-shadow:none; - -webkit-box-shadow:none; - -moz-box-shadow:none; - border-radius:none; - -webkit-border-radius:none; - -moz-border-radius:none; -} - -button.remove, .remove.button, .remove.button:link, .remove.button:visited { - background-color:#DECCCA; - background-image:url(images/tableHeaderBackgroundRed.gif); - border-color:#d6c9c7; - color:#5c3732; -} -button.remove:hover, .remove.button:hover, -button.remove:active, .remove.button:active, -button.remove:focus, .remove.button:focus { - background:#8f7c79; - border-color:#6e5551; - color:#faedeb; -} -button.remove:focus::-moz-focus-inner, .remove.button:focus::-moz-focus-inner { - border-color:#8f7c79; -} -.delete.button { - float:right; -} -input[type="submit"], input[type="reset"], input[type="button"], button, submit, .button, .button:link, .button:visited { - background:#6a7b42; - border:1px solid #487328; - color:#fff; - cursor:pointer; - padding:0 14px 2px 14px; - text-align:center; - margin:0px; - - /*CSS3 properties*/ - text-shadow: rgba(0,0,0,.5) 0px 0px 1px; - /*In ie the first couplet sets the alpha value so 00=transparent and ff=opaque)*/ - filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, startColorstr='#ff6e7f45', endColorstr='#ff6a7b42'); - background: -webkit-gradient(linear, 0 0, 0 100%, from(rgba(110, 127, 69, 1.0)), rgba((106, 123, 66, 1.0))); - background: -moz-linear-gradient(top, rgba(110, 127, 69, 1.0), rgba(106, 123, 66, 1.0)); - - box-shadow: inset 0px 0px 1px rgba(255, 255, 255, 1.0), 1px 1px 1px rgba(102, 102, 102, 0.2); - -webkit-box-shadow: inset 0px 0px 1px rgba(255, 255, 255, 1.0), 1px 1px 1px rgba(102, 102, 102, 0.2); - -moz-box-shadow: inset 0px 0px 1px rgba(255, 255, 255, 1.0), 1px 1px 1px rgba(102, 102, 102, 0.2); - - border-radius: 2px; - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - - } -input[type="submit"]:hover,input[type="reset"]:hover, input[type="button"]:hover, button:hover, .button:hover, .button.primaryAction:hover { - border-color:#3a822e; - color:#fff; - color:eefcec; - text-decoration:none; - background: #809f43; - - /*CSS3 properties*/ - filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, startColorstr='#ff9bb36c', endColorstr='#ff809f43'); - background: -webkit-gradient(linear, 0 0, 0 100%, from(rgba(110, 127, 69, 1.0)), rgba((106, 123, 66, 1.0))); - background: -moz-linear-gradient(top, rgba(155, 179, 108, 1.0), rgba(128, 159, 67, 1.0)); - -} -input[type="submit"]:active, input[type="reset"]:active, input[type="button"]:active, button:active, .buton:active, .button.primaryAction:active { - text-decoration:none; - background:#6a7b42; - border:1px solid #487328; - color:#fff; - - /*CSS3 properties*/ - text-shadow: rgba(0,0,0,.5) 0px 0px 1px; - filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, startColorstr='#ff6e7f45', endColorstr='#ff6a7b42'); - background: -webkit-gradient(linear, 0 0, 0 100%, from(rgba(110, 127, 69, 1.0)), rgba((106, 123, 66, 1.0))); - background: -moz-linear-gradient(top, rgba(110, 127, 69, 1.0), rgba(106, 123, 66, 1.0)); -} -input[type="submit"]:focus::-moz-focus-inner, button:focus::-moz-focus-inner, .button:focus::-moz-focus-inner { - border: 1px dotted transparent; -} - - - .clearboth { clear:both; } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.MediaPicker/Views/Admin/Index.cshtml b/src/Orchard.Web/Modules/Orchard.MediaPicker/Views/Admin/Index.cshtml index cd1b97dd1..05804580c 100644 --- a/src/Orchard.Web/Modules/Orchard.MediaPicker/Views/Admin/Index.cshtml +++ b/src/Orchard.Web/Modules/Orchard.MediaPicker/Views/Admin/Index.cshtml @@ -27,7 +27,7 @@ -
+
  • @T("Insert/Upload Image")
  • @T("Browse Gallery")
  • diff --git a/src/Orchard.Web/Modules/Orchard.MediaPicker/Views/Admin/Tab_Gallery.cshtml b/src/Orchard.Web/Modules/Orchard.MediaPicker/Views/Admin/Tab_Gallery.cshtml index 40f882e1e..edffe48ab 100644 --- a/src/Orchard.Web/Modules/Orchard.MediaPicker/Views/Admin/Tab_Gallery.cshtml +++ b/src/Orchard.Web/Modules/Orchard.MediaPicker/Views/Admin/Tab_Gallery.cshtml @@ -17,7 +17,7 @@ @{ var uploadAction = Url.Action("AddFromClient", "Admin", new { area = "Orchard.Media" }); } -
    + -
    +
    -
    +
    @@ -107,9 +109,11 @@ - + - +
    + +
    diff --git a/src/Orchard.Web/Modules/Orchard.MediaPicker/Views/Admin/Tab_Url.cshtml b/src/Orchard.Web/Modules/Orchard.MediaPicker/Views/Admin/Tab_Url.cshtml index aae5e7006..51d45520c 100644 --- a/src/Orchard.Web/Modules/Orchard.MediaPicker/Views/Admin/Tab_Url.cshtml +++ b/src/Orchard.Web/Modules/Orchard.MediaPicker/Views/Admin/Tab_Url.cshtml @@ -12,7 +12,7 @@ mediaPath = ""; } } -
    +
    @T( @@ -32,8 +32,8 @@
    -
    -
    +
    +
    @@ -64,9 +64,11 @@ - + - +
    + +
    diff --git a/src/Orchard.Web/Modules/Orchard.Modules/Controllers/AdminController.cs b/src/Orchard.Web/Modules/Orchard.Modules/Controllers/AdminController.cs index 28846a644..ba9ab98d7 100644 --- a/src/Orchard.Web/Modules/Orchard.Modules/Controllers/AdminController.cs +++ b/src/Orchard.Web/Modules/Orchard.Modules/Controllers/AdminController.cs @@ -3,21 +3,26 @@ using System.Collections.Generic; using System.Linq; using System.Web.Mvc; using Orchard.Data.Migration; +using Orchard.DisplayManagement; using Orchard.Environment.Descriptor.Models; using Orchard.Environment.Extensions; using Orchard.Environment.Extensions.Models; using Orchard.Environment.Features; using Orchard.Localization; using Orchard.Logging; +using Orchard.Modules.Events; +using Orchard.Modules.Models; using Orchard.Modules.Services; using Orchard.Modules.ViewModels; using Orchard.Reports.Services; using Orchard.Security; +using Orchard.UI.Navigation; using Orchard.UI.Notify; using Orchard.Utility.Extensions; namespace Orchard.Modules.Controllers { public class AdminController : Controller { + private readonly IExtensionDisplayEventHandler _extensionDisplayEventHandler; private readonly IModuleService _moduleService; private readonly IDataMigrationManager _dataMigrationManager; private readonly IReportsCoordinator _reportsCoordinator; @@ -25,21 +30,26 @@ namespace Orchard.Modules.Controllers { private readonly IFeatureManager _featureManager; private readonly ShellDescriptor _shellDescriptor; - public AdminController(IOrchardServices services, + public AdminController( + IEnumerable extensionDisplayEventHandlers, + IOrchardServices services, IModuleService moduleService, IDataMigrationManager dataMigrationManager, IReportsCoordinator reportsCoordinator, IExtensionManager extensionManager, IFeatureManager featureManager, - ShellDescriptor shellDescriptor) + ShellDescriptor shellDescriptor, + IShapeFactory shapeFactory) { Services = services; + _extensionDisplayEventHandler = extensionDisplayEventHandlers.FirstOrDefault(); _moduleService = moduleService; _dataMigrationManager = dataMigrationManager; _reportsCoordinator = reportsCoordinator; _extensionManager = extensionManager; _featureManager = featureManager; _shellDescriptor = shellDescriptor; + Shape = shapeFactory; T = NullLocalizer.Instance; Logger = NullLogger.Instance; @@ -48,20 +58,44 @@ namespace Orchard.Modules.Controllers { public Localizer T { get; set; } public IOrchardServices Services { get; set; } public ILogger Logger { get; set; } + public dynamic Shape { get; set; } - public ActionResult Index() { + public ActionResult Index(ModulesIndexOptions options, PagerParameters pagerParameters) { if (!Services.Authorizer.Authorize(StandardPermissions.SiteOwner, T("Not allowed to manage modules"))) return new HttpUnauthorizedResult(); - IEnumerable modules = _extensionManager.AvailableExtensions() - .Where(x => DefaultExtensionTypes.IsModule(x.ExtensionType)) - .Select(extensionDescriptor => new Module(extensionDescriptor) { - IsRecentlyInstalled = _moduleService.IsRecentlyInstalled(extensionDescriptor) - }); + Pager pager = new Pager(Services.WorkContext.CurrentSite, pagerParameters); - return View(new ModulesIndexViewModel { + IEnumerable modules = _extensionManager.AvailableExtensions() + .Where(extensionDescriptor => DefaultExtensionTypes.IsModule(extensionDescriptor.ExtensionType) && + (string.IsNullOrEmpty(options.SearchText) || extensionDescriptor.Name.ToLowerInvariant().Contains(options.SearchText.ToLowerInvariant()))) + .OrderBy(extensionDescriptor => extensionDescriptor.Name) + .Select(extensionDescriptor => { + ModuleEntry moduleEntry = new ModuleEntry { + Descriptor = extensionDescriptor, + IsRecentlyInstalled = _moduleService.IsRecentlyInstalled(extensionDescriptor) + }; + + if (_extensionDisplayEventHandler != null) { + foreach (string notification in _extensionDisplayEventHandler.Displaying(moduleEntry.Descriptor)) { + moduleEntry.Notifications.Add(notification); + } + } + + return moduleEntry; + }); + + int totalItemCount = modules.Count(); + + if (pager.PageSize != 0) { + modules = modules.Skip((pager.Page - 1) * pager.PageSize).Take(pager.PageSize); + } + + return View(new ModulesIndexViewModel { Modules = modules, - InstallModules = _featureManager.GetEnabledFeatures().FirstOrDefault(f => f.Id == "PackagingServices") != null + InstallModules = _featureManager.GetEnabledFeatures().FirstOrDefault(f => f.Id == "PackagingServices") != null, + Options = options, + Pager = Shape.Pager(pager).TotalItemCount(totalItemCount) }); } diff --git a/src/Orchard.Web/Modules/Orchard.Modules/Events/IExtensionDisplayEventHandler.cs b/src/Orchard.Web/Modules/Orchard.Modules/Events/IExtensionDisplayEventHandler.cs new file mode 100644 index 000000000..731ddaef6 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Modules/Events/IExtensionDisplayEventHandler.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; +using Orchard.Environment.Extensions.Models; +using Orchard.Events; + +namespace Orchard.Modules.Events { + public interface IExtensionDisplayEventHandler : IEventHandler { + /// + /// Called before an extension is displayed + /// + IEnumerable Displaying(ExtensionDescriptor extensionDescriptor); + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Modules/ViewModels/Module.cs b/src/Orchard.Web/Modules/Orchard.Modules/Models/ModuleEntry.cs similarity index 62% rename from src/Orchard.Web/Modules/Orchard.Modules/ViewModels/Module.cs rename to src/Orchard.Web/Modules/Orchard.Modules/Models/ModuleEntry.cs index 7364692fc..7f67c69ae 100644 --- a/src/Orchard.Web/Modules/Orchard.Modules/ViewModels/Module.cs +++ b/src/Orchard.Web/Modules/Orchard.Modules/Models/ModuleEntry.cs @@ -1,21 +1,16 @@ -using Orchard.Environment.Extensions.Models; +using System.Collections.Generic; +using Orchard.Environment.Extensions.Models; -namespace Orchard.Modules.ViewModels { +namespace Orchard.Modules.Models { /// /// Represents a module. /// - public class Module { + public class ModuleEntry { /// /// Default constructor. /// - public Module() {} - - /// - /// Instantiates a module based on an extension descriptor. - /// - /// The extension descriptor. - public Module(ExtensionDescriptor extensionDescriptor) { - Descriptor = extensionDescriptor; + public ModuleEntry() { + Notifications = new List(); } /// @@ -32,5 +27,10 @@ namespace Orchard.Modules.ViewModels { /// Boolean value indicating if the feature was recently installed. /// public bool IsRecentlyInstalled { get; set; } + + /// + /// List of module notifications. + /// + public List Notifications { get; set; } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Modules/ViewModels/ModuleFeature.cs b/src/Orchard.Web/Modules/Orchard.Modules/Models/ModuleFeature.cs similarity index 93% rename from src/Orchard.Web/Modules/Orchard.Modules/ViewModels/ModuleFeature.cs rename to src/Orchard.Web/Modules/Orchard.Modules/Models/ModuleFeature.cs index 24b912816..2ca10f4fd 100644 --- a/src/Orchard.Web/Modules/Orchard.Modules/ViewModels/ModuleFeature.cs +++ b/src/Orchard.Web/Modules/Orchard.Modules/Models/ModuleFeature.cs @@ -1,6 +1,6 @@ using Orchard.Environment.Extensions.Models; -namespace Orchard.Modules.ViewModels { +namespace Orchard.Modules.Models { /// /// Represents a module's feature. /// diff --git a/src/Orchard.Web/Modules/Orchard.Modules/Orchard.Modules.csproj b/src/Orchard.Web/Modules/Orchard.Modules/Orchard.Modules.csproj index 732a63aff..66746e9da 100644 --- a/src/Orchard.Web/Modules/Orchard.Modules/Orchard.Modules.csproj +++ b/src/Orchard.Web/Modules/Orchard.Modules/Orchard.Modules.csproj @@ -43,6 +43,7 @@ False ..\..\..\..\lib\autofac\Autofac.dll + @@ -52,14 +53,15 @@ + - - + + @@ -98,6 +100,9 @@ + + +