Getting a search box hooked up on the Contoso theme and giving it and the search page some rough style

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-07-24 02:34:54 -07:00
parent e6ff7cc711
commit cac6d855fd
7 changed files with 54 additions and 14 deletions

View File

@@ -99,8 +99,9 @@
<Content Include="Default.aspx" />
<Content Include="Global.asax" />
<Content Include="Refresh.html" />
<Content Include="Themes\Contoso\Views\DisplayTemplates\Items\Contents.Item.ascx" />
<Content Include="Themes\Contoso\Styles\search.css" />
<Content Include="Themes\Contoso\Views\DisplayTemplates\Parts\Blogs.BlogPost.Metadata.ascx" />
<Content Include="Themes\Contoso\Views\Orchard.Search\Search\Index.ascx" />
<Content Include="Themes\Corporate\Views\DisplayTemplates\Parts\Blogs.BlogPost.Metadata.ascx" />
<Content Include="Themes\TheAdmin\Scripts\admin.js" />
<Content Include="Themes\TheAdmin\Styles\ie.css" />

View File

@@ -0,0 +1,24 @@
form.search {
float:left;
}
form.search input {
display:inline;
width:20em;
}
.search-summary {
float:right;
font-style:italic;
margin-top:0;
}
.search-summary em {
font-weight:bold;
}
.search-results {
clear:both;
}
/* theme modifications */
/*- Search (Page) -*/
.search-results { margin: 0; padding-top: 1em; }
.search-results li { list-style: none; }
.search-results h3 { margin-bottom: 0; }
.search-results .content { padding-top:0; }

View File

@@ -265,8 +265,8 @@ body { background: #f3f4f4 url('../Content/Images/bkg.jpg') repeat-x; }
/*- Page Navigation -*/
#nav { background: transparent url('../Content/Images/menu-left.png') no-repeat left top; margin: 0px 0px 20px 0px; }
#nav .menu { margin: 0px; padding: 0px; height: 40px; background: transparent url('../Content/Images/menu-right.png') no-repeat right top; }
#nav { background: transparent url('../Content/Images/menu-right.png') no-repeat right top; margin: 0px 0px 20px 0px; }
#nav .menu { margin: 0px; padding: 0px; height: 40px; width:725px; background: transparent url('../Content/Images/menu-left.png') no-repeat left top; }
#nav .menu li { float:left; list-style: none; background: transparent url('../Content/Images/menu-divider.png') repeat-y right top; }
#nav .menu li a { display:block; margin: 0px 2px 1px 0px; padding: 11px 39px 4px 39px; height: 24px; color: #FFF; font-size: 1.2em; text-decoration: none; text-shadow: 0px -1px 0px #535550; }
#nav .menu li a:hover { background: #9dc975 url('../Content/Images/menu-hover.png') repeat-x right top; }
@@ -279,7 +279,11 @@ body { background: #f3f4f4 url('../Content/Images/bkg.jpg') repeat-x; }
.admin li { float:left; list-style: none; padding: 0px 0px 5px 20px; }
.admin li a {}
/*- Search -*/
#nav .search { display: inline; float: right; height: 40px; margin: -40px 8px 0 0; }
#nav .search input { border-color: #87B7CB; }
#nav .search input, #nav .search button { font-size: 1.2em; height:17px; padding: 3px; }
#nav .search button { background: #87B7CB; border: none; color: #FFF; float: right; height:25px; line-height: 1.5em; margin:7px 0; padding: 2px 6px 5px; text-shadow: 0px -1px 0px #A6A6A6; }
/*========= Footer =========*/
@@ -387,6 +391,7 @@ body { background: #f3f4f4 url('../Content/Images/bkg.jpg') repeat-x; }
margin-left:.5em;
padding: 3px;
border: 1px solid #CCC;
list-style: none;
}
.content-localization .content-localizations li:hover {

View File

@@ -1,8 +0,0 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ContentItemViewModel>" %>
<%@ Import Namespace="Orchard.Security"%>
<%@ Import Namespace="Orchard.Mvc.Html"%>
<%@ Import Namespace="Orchard.Mvc.ViewModels" %>
<h1 class="page-title"><%:Html.ItemDisplayText(Model.Item)%></h1>
<% Html.Zone("metadata");
Html.Zone("primary", ":manage :metadata");
Html.ZonesAny(); %>

View File

@@ -15,7 +15,8 @@
<%-- Main Menu --%>
<div id="nav">
<% Html.Zone("menu"); %>
<% Html.Zone("menu");
Html.Zone("search"); %>
</div>
<%-- Home Hero --%>

View File

@@ -15,7 +15,8 @@
<%-- Main Menu --%>
<div id="nav">
<% Html.Zone("menu"); %>
<% Html.Zone("menu");
Html.Zone("search"); %>
</div>
<%-- Main Content Area --%>

View File

@@ -0,0 +1,16 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.Search.ViewModels.SearchViewModel>" %>
<% Html.RegisterStyle("search.css"); %>
<h1 class="page-title"><%:Html.TitleForPage(T("Search").Text)%></h1><%
Html.Zone("search");
if (!string.IsNullOrWhiteSpace(Model.Query)) {
if (Model.PageOfResults.Count() == 0) { %>
<p class="search-summary"><%=T.Plural("the <em>one</em> result", "<em>zero</em> results", Model.PageOfResults.Count()) %></p><%
}
else { %>
<p class="search-summary"><%=T.Plural("the <em>one</em> result", "<em>{1} - {2}</em> of <em>{0}</em> results", Model.PageOfResults.TotalItemCount, Model.PageOfResults.StartPosition, Model.PageOfResults.EndPosition)%></p><%
}
}
if (Model.PageOfResults != null && Model.PageOfResults.Count() > 0) { %>
<%=Html.UnorderedList(Model.PageOfResults, (r, i) => Html.DisplayForItem(r.Content) , "search-results contentItems") %>
<%=Html.Pager(Model.PageOfResults, Model.PageOfResults.PageNumber, Model.DefaultPageSize, new {q = Model.Query}) %><%
} %>