- Bringing ArchiveLater back

- Fixing a couple issues in Comments views.

--HG--
branch : dev
This commit is contained in:
Suha Can
2010-09-15 13:36:56 -07:00
parent 668f356331
commit e854a5e39e
10 changed files with 77 additions and 62 deletions

View File

@@ -103,9 +103,6 @@
<Content Include="Styles\jquery-ui-1.7.2.custom.css" />
<Content Include="Styles\ui.datepicker.css" />
<Content Include="Styles\ui.timepickr.css" />
<Content Include="Views\DisplayTemplates\Parts\ArchiveLater.Metadata.ascx" />
<Content Include="Views\DisplayTemplates\Parts\ArchiveLater.Metadata.SummaryAdmin.ascx" />
<Content Include="Views\EditorTemplates\Parts\ArchiveLater.ascx" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Web.config" />
@@ -120,6 +117,11 @@
<Name>Orchard.Framework</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Views\DisplayTemplates\Parts\ArchiveLater.Metadata.cshtml" />
<None Include="Views\DisplayTemplates\Parts\ArchiveLater.Metadata.SummaryAdmin.cshtml" />
<None Include="Views\EditorTemplates\Parts\ArchiveLater.cshtml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@@ -1,11 +0,0 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.ArchiveLater.ViewModels.ArchiveLaterViewModel>" %>
<%
if ((Model.IsPublished && Model.ScheduledArchiveUtc.HasValue && Model.ScheduledArchiveUtc.Value > DateTime.UtcNow)) {%>
<ul class="pageStatus">
<li>
<img class="icon" src="<%=ResolveUrl("~/Modules/ArchiveLater/Content/Admin/images/scheduled.gif") %>" alt="<%:T("Scheduled") %>" title="<%:T("The page is scheduled for archiving") %>" /><%:T("Unpublish on") %>
<%:Html.DateTime(Model.ScheduledArchiveUtc.Value.ToLocalTime(), T("M/d/yyyy h:mm tt"))%>
&nbsp;&#124;&nbsp;
</li>
</ul><%
} %>

View File

@@ -0,0 +1,14 @@
@model Orchard.ArchiveLater.ViewModels.ArchiveLaterViewModel
@using Orchard.Mvc.Html
@if ((Model.IsPublished && Model.ScheduledArchiveUtc.HasValue && Model.ScheduledArchiveUtc.Value > DateTime.UtcNow)) {
<ul class="pageStatus">
<li>
<img class="icon" src="@ResolveUrl("~/Modules/ArchiveLater/Content/Admin/images/scheduled.gif")" alt="@T("Scheduled")" title="@T("The page is scheduled for archiving")" />@T("Unpublish on")
@Html.DateTime(Model.ScheduledArchiveUtc.Value.ToLocalTime(), T("M/d/yyyy h:mm tt"))
&nbsp;&#124;&nbsp;
</li>
</ul>
}

View File

@@ -1 +0,0 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.ArchiveLater.ViewModels.ArchiveLaterViewModel>" %>

View File

@@ -0,0 +1 @@
@model Orchard.ArchiveLater.ViewModels.ArchiveLaterViewModel

View File

@@ -1,39 +0,0 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.ArchiveLater.ViewModels.ArchiveLaterViewModel>" %>
<% Html.RegisterStyle("datetime.css"); %>
<% Html.RegisterStyle("jquery-ui-1.7.2.custom.css"); %>
<% Html.RegisterStyle("ui.datepicker.css"); %>
<% Html.RegisterStyle("ui.timepickr.css"); %>
<% Html.RegisterFootScript("jquery.ui.core.js"); %>
<% Html.RegisterFootScript("jquery.ui.widget.js"); %>
<% Html.RegisterFootScript("jquery.ui.datepicker.js"); %>
<% Html.RegisterFootScript("jquery.utils.js"); %>
<% Html.RegisterFootScript("ui.timepickr.js"); %>
<fieldset>
<legend><%: T("Archive Settings")%></legend>
<div>
<%: Html.CheckBox("ArchiveLater", Model.ScheduledArchiveUtc.HasValue, new { id = ViewData.TemplateInfo.GetFullHtmlFieldId("Command_ArchiveLater") })%>
<label class="forcheckbox" for="<%:ViewData.TemplateInfo.GetFullHtmlFieldId("Command_ArchiveLater") %>"><%: T("Archive Later")%></label>
</div>
<div>
<label class="forpicker" for="<%:ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledArchiveDate") %>"><%: T("Date")%></label>
<%: Html.EditorFor(m => m.ScheduledArchiveDate)%>
<label class="forpicker" for="<%:ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledArchiveTime") %>"><%: T("Time")%></label>
<%: Html.EditorFor(m => m.ScheduledArchiveTime)%>
</div>
</fieldset>
<script type="text/javascript"> $(function () {
//todo: (heskew) make a plugin
$("label.forpicker").each(function () {
var $this = $(this);
var pickerInput = $("#" + $this.attr("for"));
pickerInput.data("hint", $this.text());
if (!pickerInput.val()) {
pickerInput.addClass("hinted")
.val(pickerInput.data("hint"))
.focus(function () { var $this = $(this); if ($this.val() == $this.data("hint")) { $this.removeClass("hinted").val("") } })
.blur(function () { var $this = $(this); setTimeout(function () { if (!$this.val()) { $this.addClass("hinted").val($this.data("hint")) } }, 300) });
}
});
$(<%=string.Format("\"#{0}\"", ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledArchiveDate")) %>).datepicker({ showAnim: "" }).focus(function () { $(<%=string.Format("\"#{0}\"", ViewData.TemplateInfo.GetFullHtmlFieldId("Command_ArchiveLater")) %>).attr("checked", "checked") });
$(<%=string.Format("\"#{0}\"", ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledArchiveTime")) %>).timepickr().focus(function () { $(<%=string.Format("\"#{0}\"", ViewData.TemplateInfo.GetFullHtmlFieldId("Command_ArchiveLater")) %>).attr("checked", "checked") });
})</script>

View File

@@ -0,0 +1,32 @@
@model Orchard.ArchiveLater.ViewModels.ArchiveLaterViewModel
@using System.Web.Mvc.Html
<fieldset>
<legend>@T("Archive Settings")</legend>
<div>
@Html.CheckBox("ArchiveLater", Model.ScheduledArchiveUtc.HasValue, new { id = ViewData.TemplateInfo.GetFullHtmlFieldId("Command_ArchiveLater") })
<label class="forcheckbox" for="@ViewData.TemplateInfo.GetFullHtmlFieldId("Command_ArchiveLater")">@T("Archive Later")</label>
</div>
<div>
<label class="forpicker" for="@ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledArchiveDate")">@T("Date")</label>
@Html.EditorFor(m => m.ScheduledArchiveDate)
<label class="forpicker" for="@ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledArchiveTime")">@T("Time")</label>
@Html.EditorFor(m => m.ScheduledArchiveTime)
</div>
</fieldset>
<script type="text/javascript"> $(function () {
//todo: (heskew) make a plugin
$("label.forpicker").each(function () {
var $this = $(this);
var pickerInput = $("#" + $this.attr("for"));
pickerInput.data("hint", $this.text());
if (!pickerInput.val()) {
pickerInput.addClass("hinted")
.val(pickerInput.data("hint"))
.focus(function () { var $this = $(this); if ($this.val() == $this.data("hint")) { $this.removeClass("hinted").val("") } })
.blur(function () { var $this = $(this); setTimeout(function () { if (!$this.val()) { $this.addClass("hinted").val($this.data("hint")) } }, 300) });
}
});
$(@string.Format("\"#{0}\"", ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledArchiveDate"))).datepicker({ showAnim: "" }).focus(function () { $(@string.Format("\"#{0}\"", ViewData.TemplateInfo.GetFullHtmlFieldId("Command_ArchiveLater"))).attr("checked", "checked") });
$(@string.Format("\"#{0}\"", ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledArchiveTime"))).timepickr().focus(function () { $(@string.Format("\"#{0}\"", ViewData.TemplateInfo.GetFullHtmlFieldId("Command_ArchiveLater"))).attr("checked", "checked") });
})</script>

View File

@@ -1,5 +1,6 @@
@model Orchard.Comments.ViewModels.CommentsDetailsViewModel
@using Orchard.Comments.Models
@using Orchard.Comments.ViewModels
<h1>@Html.TitleForPage(T("Comments for {0}", Model.DisplayNameForCommentedItem).ToString())</h1>
<div class="manage">
@@ -70,14 +71,15 @@
<input type="hidden" value="@Model.CommentedItemId" name="CommentedItemId" />
</td>
<td>
@if (commentEntry.Comment.Status == CommentStatus.Spam) { T("Spam") }
else if (commentEntry.Comment.Status == CommentStatus.Pending) { T("Pending") }
else { T("Approved") }
@if (commentEntry.Comment.Status == CommentStatus.Spam) { T("Spam"); }
else if (commentEntry.Comment.Status == CommentStatus.Pending) { T("Pending"); }
else { T("Approved"); }
</td>
<td>@commentEntry.Comment.UserName</td>
<td>
@if (commentEntry.Comment.CommentText != null) {
commentEntry.Comment.CommentText.Length > 23 ? commentEntry.Comment.CommentText.Substring(0, 24) : (commentEntry.Comment.CommentText + T(" ..."))
var text = commentEntry.Comment.CommentText.Length > 23 ? commentEntry.Comment.CommentText.Substring(0, 24) : (commentEntry.Comment.CommentText + T(" ..."));
@text
}
</td>
<td>@Html.DateTime(commentEntry.Comment.CommentDateUtc.GetValueOrDefault())</td>

View File

@@ -1,5 +1,6 @@
@model Orchard.Comments.ViewModels.CommentsIndexViewModel
@using Orchard.Comments.Models
@using Orchard.Comments.ViewModels
<h1>@Html.TitleForPage(T("Manage Comments").ToString())</h1>
@using(Html.BeginFormAntiForgeryPost()) {
@@ -55,13 +56,14 @@
<input type="checkbox" value="true" name="@Html.NameOf(m => m.Comments[commentIndex].IsChecked)"/>
</td>
<td>
@if (commentEntry.Comment.Status == CommentStatus.Spam) { T("Spam") }
else if (commentEntry.Comment.Status == CommentStatus.Pending) { T("Pending") }
else { T("Approved") }</td>
@if (commentEntry.Comment.Status == CommentStatus.Spam) { T("Spam"); }
else if (commentEntry.Comment.Status == CommentStatus.Pending) { T("Pending"); }
else { T("Approved"); }</td>
<td>@commentEntry.Comment.UserName</td>
<td>
@if (commentEntry.Comment.CommentText != null) {
commentEntry.Comment.CommentText.Length > 23 ? commentEntry.Comment.CommentText.Substring(0, 24) : (commentEntry.Comment.CommentText + T(" ..."))
var text = commentEntry.Comment.CommentText.Length > 23 ? commentEntry.Comment.CommentText.Substring(0, 24) : (commentEntry.Comment.CommentText + T(" ..."));
@text
}
</td>
<td>@Html.DateTime(commentEntry.Comment.CommentDateUtc.GetValueOrDefault())</td>

View File

@@ -70,6 +70,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Email", "Orchard.We
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Comments", "Orchard.Web\Modules\Orchard.Comments\Orchard.Comments.csproj", "{14C049FD-B35B-415A-A824-87F26B26E7FD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.ArchiveLater", "Orchard.Web\Modules\Orchard.ArchiveLater\Orchard.ArchiveLater.csproj", "{1C981BB3-26F7-494C-9005-CC27A5144233}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
CodeCoverage|Any CPU = CodeCoverage|Any CPU
@@ -359,6 +361,16 @@ Global
{14C049FD-B35B-415A-A824-87F26B26E7FD}.FxCop|Any CPU.Build.0 = Release|Any CPU
{14C049FD-B35B-415A-A824-87F26B26E7FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{14C049FD-B35B-415A-A824-87F26B26E7FD}.Release|Any CPU.Build.0 = Release|Any CPU
{1C981BB3-26F7-494C-9005-CC27A5144233}.CodeCoverage|Any CPU.ActiveCfg = Release|Any CPU
{1C981BB3-26F7-494C-9005-CC27A5144233}.CodeCoverage|Any CPU.Build.0 = Release|Any CPU
{1C981BB3-26F7-494C-9005-CC27A5144233}.Coverage|Any CPU.ActiveCfg = Release|Any CPU
{1C981BB3-26F7-494C-9005-CC27A5144233}.Coverage|Any CPU.Build.0 = Release|Any CPU
{1C981BB3-26F7-494C-9005-CC27A5144233}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1C981BB3-26F7-494C-9005-CC27A5144233}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1C981BB3-26F7-494C-9005-CC27A5144233}.FxCop|Any CPU.ActiveCfg = Release|Any CPU
{1C981BB3-26F7-494C-9005-CC27A5144233}.FxCop|Any CPU.Build.0 = Release|Any CPU
{1C981BB3-26F7-494C-9005-CC27A5144233}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1C981BB3-26F7-494C-9005-CC27A5144233}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -378,6 +390,7 @@ Global
{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{05660F47-D649-48BD-9DED-DF4E01E7CFF9} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{14C049FD-B35B-415A-A824-87F26B26E7FD} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{1C981BB3-26F7-494C-9005-CC27A5144233} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{ABC826D4-2FA1-4F2F-87DE-E6095F653810} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
{F112851D-B023-4746-B6B1-8D2E5AD8F7AA} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
{6CB3EB30-F725-45C0-9742-42599BA8E8D2} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}