From 775567683c4fd312e9597fb11bdeb10ae05eee24 Mon Sep 17 00:00:00 2001 From: skewed Date: Fri, 15 Jan 2010 00:38:02 +0000 Subject: [PATCH] Some rough style/script for the blog archives faux widget --HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4045442 --- src/Orchard.Web/Core/Themes/Styles/site.css | 18 +++++ src/Orchard.Web/Core/Themes/Views/layout.ascx | 25 ++++--- .../Orchard.Blogs/Orchard.Blogs.csproj | 2 + .../Orchard.Blogs/Scripts/archives.js | 14 ++++ .../Orchard.Blogs/Styles/archives.css | 68 +++++++++++++++++++ .../Orchard.Blogs/Views/Archives.ascx | 6 +- 6 files changed, 122 insertions(+), 11 deletions(-) create mode 100644 src/Orchard.Web/Packages/Orchard.Blogs/Scripts/archives.js create mode 100644 src/Orchard.Web/Packages/Orchard.Blogs/Styles/archives.css diff --git a/src/Orchard.Web/Core/Themes/Styles/site.css b/src/Orchard.Web/Core/Themes/Styles/site.css index 3035d04fa..764d6d247 100644 --- a/src/Orchard.Web/Core/Themes/Styles/site.css +++ b/src/Orchard.Web/Core/Themes/Styles/site.css @@ -114,9 +114,27 @@ page width. Or, you can specify an exact pixel width. */ padding: 30px 30px 15px 30px; background-color: #fff; margin-bottom: 30px; + overflow:auto; _height: 1px; /* only IE6 applies CSS properties starting with an underscrore */ } +#contentwrapper +{ + float:left; + width:100%; +} +#content +{ + margin-right:230px; +} + +#sidebar +{ + float:left; + margin-left:-200px; + width:200px; +} + #footer { color: #999; diff --git a/src/Orchard.Web/Core/Themes/Views/layout.ascx b/src/Orchard.Web/Core/Themes/Views/layout.ascx index 91e00abfd..6b37f645d 100644 --- a/src/Orchard.Web/Core/Themes/Views/layout.ascx +++ b/src/Orchard.Web/Core/Themes/Views/layout.ascx @@ -12,14 +12,21 @@ Model.Zones.AddRenderPartial("content:before", "messages", Model.Messages); Html.Zone("menu"); %>
-
<% - Html.ZoneBody("primary"); - %>
-
<% - Html.Zone("secondary"); - %>
- +
+
<% + Html.ZoneBody("primary"); + %>
+
+
+ +
+ <%-- put outside of #main? --%> +
+ +
\ No newline at end of file diff --git a/src/Orchard.Web/Packages/Orchard.Blogs/Orchard.Blogs.csproj b/src/Orchard.Web/Packages/Orchard.Blogs/Orchard.Blogs.csproj index 1cb87290e..e7d917745 100644 --- a/src/Orchard.Web/Packages/Orchard.Blogs/Orchard.Blogs.csproj +++ b/src/Orchard.Web/Packages/Orchard.Blogs/Orchard.Blogs.csproj @@ -113,6 +113,8 @@ + + diff --git a/src/Orchard.Web/Packages/Orchard.Blogs/Scripts/archives.js b/src/Orchard.Web/Packages/Orchard.Blogs/Scripts/archives.js new file mode 100644 index 000000000..e4ceca036 --- /dev/null +++ b/src/Orchard.Web/Packages/Orchard.Blogs/Scripts/archives.js @@ -0,0 +1,14 @@ +/** archives **/ +$(function() { + $('.archives ul.years li.previous').each(function() { + $(this).click(function(ev) { + if (!ev || $(ev.target).not("a").size()) { + $(this).toggleClass("open"); + $(this).find("h4>span").toggle(); + $(this).children("ul").toggle(); + } + }); + + //$(this).hoverClassIfy(); + }); +}); \ No newline at end of file diff --git a/src/Orchard.Web/Packages/Orchard.Blogs/Styles/archives.css b/src/Orchard.Web/Packages/Orchard.Blogs/Styles/archives.css new file mode 100644 index 000000000..31e8653f0 --- /dev/null +++ b/src/Orchard.Web/Packages/Orchard.Blogs/Styles/archives.css @@ -0,0 +1,68 @@ +/* todo: (heskew) come up with some real style for this. pretty much a copy/paste from oxite */ + +/* ARCHIVES +----------------------------------------------------------*/ +.archives h3 { + margin-bottom:0; +} +.archives ul { + margin:0; + padding:0; +} +.archives ul +.archives li { + list-style-type:none; +} +.archives ul.years li { + list-style-type:none; + margin:.6em 0 0; + /*background:url(images/bullet_toggle_minus_onoff.png) no-repeat -9999px 0;*/ +} +.archives ul.archiveMonthList li +{ + margin:.2em 0; +} +.archives ul.archiveMonthList li.first { + margin-top:0; +} +.archives ul.archiveMonthList li.last { + margin-bottom:0; +} +.archives ul.years li.previous h4 span { + display:none; +} +/* todo: (heskew) style for "html.dyn" by default, target html.static for non-javascript */ +html.dyn .archives ul.years li.previous h4 span { + display:inline; +} +html.dyn .archives ul.years li h4, +html.dyn .archives ul.years li ul { + margin:.2em .2ex; +} +/* todo: (heskew) very, very, very temporary. do something like the commented-out background image past the :before selector */ +html.dyn .archives ul.years li.previous h4:before { + content:"⇓ "; +} +html.dyn .archives ul.years li.previous { + cursor:pointer; + padding:.1em .2ex .2em 2ex; + /*background:url(images/bullet_toggle_plus_onoff.png) no-repeat 0 -25px;*/ + margin:0 -2ex; +} +html.dyn .archives ul.years li.previous.hover { + background-position:0 6px; +} +/* todo: (heskew) very, very, very temporary. do something like the commented-out background image past the :before selector */ +html.dyn .archives ul.years li.previous.open h4:before { + content:"⇑ "; +} +html.dyn .archives ul.years li.previous.open { + /*background:url(images/bullet_toggle_minus_onoff.png) no-repeat -689px 6px;*/ +} +html.dyn .archives ul.years li.previous.open.hover { + background-position:0 6px; +} +html.dyn .archives ul.years li.previous ul { + display:none; + margin-left:2ex; +} \ No newline at end of file diff --git a/src/Orchard.Web/Packages/Orchard.Blogs/Views/Archives.ascx b/src/Orchard.Web/Packages/Orchard.Blogs/Views/Archives.ascx index 4a256c641..61c77a409 100644 --- a/src/Orchard.Web/Packages/Orchard.Blogs/Views/Archives.ascx +++ b/src/Orchard.Web/Packages/Orchard.Blogs/Views/Archives.ascx @@ -2,11 +2,13 @@ <%@ Import Namespace="Orchard.Blogs.ViewModels"%> <%@ Import Namespace="Orchard.Blogs.Extensions"%> <%@ Import Namespace="Orchard.Blogs.Models"%> -
+<% Html.RegisterStyle("archives.css"); %> +<% Html.RegisterFootScript("archives.js"); %> +

<%=_Encoded("Archives") %>

<% if (Model.Archives.Count() > 0) { if (Model.Archives.Count() > 20) { %> -
    <% +
      <% int lastYear = Model.Archives.First().Key.Year; int firstYear = Model.Archives.Last().Key.Year;