Skip to content

Commit

Permalink
Some layout updates to the manager and some draft fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
tidyui committed Feb 20, 2012
1 parent 976fe7b commit 5148dc5
Show file tree
Hide file tree
Showing 23 changed files with 161 additions and 89 deletions.
42 changes: 40 additions & 2 deletions Areas/Manager/Content/Css/Style.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
*/
body{min-width:960px}.container_12{margin-left:auto;margin-right:auto;width:960px}.grid_1,.grid_2,.grid_3,.grid_4,.grid_5,.grid_6,.grid_7,.grid_8,.grid_9,.grid_10,.grid_11,.grid_12{display:inline;float:left;margin-left:10px;margin-right:10px}.push_1,.pull_1,.push_2,.pull_2,.push_3,.pull_3,.push_4,.pull_4,.push_5,.pull_5,.push_6,.pull_6,.push_7,.pull_7,.push_8,.pull_8,.push_9,.pull_9,.push_10,.pull_10,.push_11,.pull_11{position:relative}.alpha{margin-left:0}.omega{margin-right:0}.container_12 .grid_1{width:60px}.container_12 .grid_2{width:140px}.container_12 .grid_3{width:220px}.container_12 .grid_4{width:300px}.container_12 .grid_5{width:380px}.container_12 .grid_6{width:460px}.container_12 .grid_7{width:540px}.container_12 .grid_8{width:620px}.container_12 .grid_9{width:700px}.container_12 .grid_10{width:780px}.container_12 .grid_11{width:860px}.container_12 .grid_12{width:940px}.container_12 .prefix_1{padding-left:80px}.container_12 .prefix_2{padding-left:160px}.container_12 .prefix_3{padding-left:240px}.container_12 .prefix_4{padding-left:320px}.container_12 .prefix_5{padding-left:400px}.container_12 .prefix_6{padding-left:480px}.container_12 .prefix_7{padding-left:560px}.container_12 .prefix_8{padding-left:640px}.container_12 .prefix_9{padding-left:720px}.container_12 .prefix_10{padding-left:800px}.container_12 .prefix_11{padding-left:880px}.container_12 .suffix_1{padding-right:80px}.container_12 .suffix_2{padding-right:160px}.container_12 .suffix_3{padding-right:240px}.container_12 .suffix_4{padding-right:320px}.container_12 .suffix_5{padding-right:400px}.container_12 .suffix_6{padding-right:480px}.container_12 .suffix_7{padding-right:560px}.container_12 .suffix_8{padding-right:640px}.container_12 .suffix_9{padding-right:720px}.container_12 .suffix_10{padding-right:800px}.container_12 .suffix_11{padding-right:880px}.container_12 .push_1{left:80px}.container_12 .push_2{left:160px}.container_12 .push_3{left:240px}.container_12 .push_4{left:320px}.container_12 .push_5{left:400px}.container_12 .push_6{left:480px}.container_12 .push_7{left:560px}.container_12 .push_8{left:640px}.container_12 .push_9{left:720px}.container_12 .push_10{left:800px}.container_12 .push_11{left:880px}.container_12 .pull_1{left:-80px}.container_12 .pull_2{left:-160px}.container_12 .pull_3{left:-240px}.container_12 .pull_4{left:-320px}.container_12 .pull_5{left:-400px}.container_12 .pull_6{left:-480px}.container_12 .pull_7{left:-560px}.container_12 .pull_8{left:-640px}.container_12 .pull_9{left:-720px}.container_12 .pull_10{left:-800px}.container_12 .pull_11{left:-880px}.clear{clear:both;display:block;overflow:hidden;visibility:hidden;width:0;height:0}.clearfix:before,.clearfix:after,.container_12:before,.container_12:after{content:'.';display:block;overflow:hidden;visibility:hidden;font-size:0;line-height:0;width:0;height:0}.clearfix:after,.container_12:after{clear:both}.clearfix,.container_12{zoom:1}

/**
* Base styling
*/
.top .home {
display: none;
}
.top .public-site {
display: none;
}

/**
* Form elements
*/
Expand Down Expand Up @@ -46,13 +56,19 @@ p input[type="radio"] {
margin: 0;
}
.btn {
background: #336ca7;
color: #fff;
cursor: pointer;
border: none 0px;
font-size: 14px;
padding: 7px 10px;
border-radius: 4px;
margin-right: 10px;
}
.btn.active {
background: #f68030;
color: #fff;
}
a.btn {
text-decoration: none;
padding: 5px 10px;
Expand Down Expand Up @@ -266,6 +282,12 @@ em { font-style: italic; }
.expandable h2.expanded {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAh0lEQVR42u3UsQqCUBhA4SbD1hDEB2hwUWoWfARBwQcQRHAVIyL53/x2BmkR1FvXQLjDN5/tHJRSm7IBG/h/IMJ1q4CPB54ITAdcNJBRi5PJQAEBPkpTgQQCTKS/Bi4YIDPCbwNndJAFPTzdgIMKslKNo04gg2jK1wZivHDXNOBmX2QDOwy8AQ+R3/urUjdKAAAAAElFTkSuQmCC) 97% 60% no-repeat;
}
.box .title {
padding: 14px 14px 0;
}
.box .title h2 {
margin: 0;
}
.inner {
padding: 14px;
}
Expand Down Expand Up @@ -340,8 +362,6 @@ table.list tbody tr.draft {
color: #a2a2a2;
font-style: italic;
}
table.list .even {
}
table.list td {
padding: 10px 20px;
}
Expand Down Expand Up @@ -389,6 +409,12 @@ table.list .thumb img {
width: 50px;
height: 50px;
}
.box table.list {
border: solid 1px #999;
}
.box table.list th {
border-bottom: solid 1px #ccc;
}

/**
* Colors
Expand Down Expand Up @@ -525,3 +551,15 @@ div.login {
.floatbox h2 {
text-align: center;
}

/**
* Dropbox
*/
.dropbox {
background: #f8f8f8;
width: 48px;
height: 48px;
border: dashed 1px #999;
border-radius: 4px;
cursor: pointer;
}
16 changes: 9 additions & 7 deletions Areas/Manager/Content/Js/jquery.manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -740,10 +740,10 @@ $(document).ready(function () {
//
// Toggle optional content
//
$(".expandable h2").click(function () {
var h2 = $(this);
h2.siblings(".optional").slideToggle("fast", function () {
h2.toggleClass("expanded");
$(".expandable .title").click(function () {
var title = $(this);
title.siblings(".inner").find(".optional").slideToggle("fast", function () {
title.toggleClass("expanded");
});
});

Expand Down Expand Up @@ -860,7 +860,7 @@ $(document).ready(function () {

hideEditors();
$("#pageregions #" + id).show();
$(this).removeClass("blue").addClass("orange");
$(this).addClass("active");
$(".edit td").removeClass("active");
$(".edit #" + id).addClass("active");

Expand All @@ -871,15 +871,17 @@ $(document).ready(function () {
// Event hander for attachments.
$("#btn_attachments").click(function () {
hideEditors();
$(this).removeClass("blue").addClass("orange");
$(this).addClass("active");
$("#attachments").show();
return false;
});

//
// Hides all editors on the page.
function hideEditors() {
$("#pageregions .input, #globalregions .input").hide();
$("#regionbuttons button").removeClass("orange").addClass("blue");
$("#regionbuttons button").removeClass("active");
$("#attachments").hide();
}
});

Expand Down
10 changes: 7 additions & 3 deletions Areas/Manager/Controllers/PageController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,13 @@ public ActionResult Insert(InsertModel im) {
public ActionResult Delete(string id) {
EditModel pm = EditModel.GetById(new Guid(id), true) ;

if (pm.DeleteAll())
ViewBag.Message = "Din sida har raderats." ;
else ViewBag.Message = "Ett internt fel har uppstått och sidan kunde inte raderas." ;
try {
if (pm.DeleteAll())
ViewBag.Message = "Din sida har raderats." ;
else ViewBag.Message = "Ett internt fel har uppstått och sidan kunde inte raderas." ;
} catch (Exception e) {
ViewBag.Message = e.ToString() ;
}

return Index() ;
}
Expand Down
4 changes: 2 additions & 2 deletions Areas/Manager/Views/Account/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<body>
<div class="container_12">
<div class="grid_4 box login">
<div class="title"><h2>Logga in</h2></div>
<div class="inner">
<h2>Logga in</h2>
@{ Html.BeginForm("Login", "Account") ; }
@Html.Hidden("returnaction", "index")
@Html.Hidden("returncontroller", "page")
Expand All @@ -36,8 +36,8 @@
<div class="input"><input id="login" name="login" type="text" /></div></li>
<li><label>Lösenord:</label>
<div class="input"><input name="password" type="password" /></div></li>
<li><button class="btn blue right">Logga in</button></li>
</ul>
<button class="btn right">Logga in</button>
@{ Html.EndForm() ; }
<div class="clear"></div>
</div>
Expand Down
11 changes: 2 additions & 9 deletions Areas/Manager/Views/Category/Edit.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
@Html.HiddenFor(m => m.Permalink.Name)
@Html.HiddenFor(m => m.Permalink.Created)
@Html.HiddenFor(m => m.Permalink.CreatedBy)
<div class="grid_9">
<div class="grid_12">
<div class="box">
<div class="title"><h2>Information</h2></div>
<div class="inner">
<h2>Information</h2>
<ul class="form">
<li>
@Html.LabelFor(m => m.Category.Name)
Expand All @@ -62,11 +62,4 @@
</div>
</div>
</div>
<div class="grid_3">
<div class="box">
<div class="inner">
<h2>Filinformation</h2>
</div>
</div>
</div>
@{ Html.EndForm() ; }
6 changes: 3 additions & 3 deletions Areas/Manager/Views/Content/Edit.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
@Html.HiddenFor(m => m.Content.Type)
<div class="grid_9">
<div class="box">
<div class="title"><h2>Information</h2></div>
<div class="inner">
<h2>Information</h2>
<ul class="form">
<li>
<label>Ladda upp</label>
Expand Down Expand Up @@ -65,8 +65,8 @@
</div>
@if (!Model.Content.IsNew) {
<div class="box">
<div class="title"><h2>Filinformation</h2></div>
<div class="inner">
<h2>Filinformation</h2>
<ul class="form">
<li>@Html.LabelFor(m => m.Content.Filename)
<p>@Model.Content.Filename</p>
Expand All @@ -89,8 +89,8 @@
</div>
<div class="grid_3">
<div class="box">
<div class="title"><h2>Tumnagel</h2></div>
<div class="inner">
<h2>Tumnagel</h2>
@if (!Model.Content.IsNew) {
<img style="max-width:190px" alt="@Model.Content.AlternateText" src="@Url.Content("~/thumb/" + Model.Content.Id + "/190")" />
} else {
Expand Down
2 changes: 1 addition & 1 deletion Areas/Manager/Views/Install/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
<body>
<div class="container_12">
<div class="grid_4 box login">
<div class="title"><h2>Ny webbplats</h2></div>
<div class="inner">
<h2>Ny webbplats</h2>
@{ Html.BeginForm("Create", "Install") ; }
<ul class="form">
<li><label>Inloggning:</label>
Expand Down
2 changes: 1 addition & 1 deletion Areas/Manager/Views/Install/Update.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
<body>
<div class="container_12">
<div class="grid_4 box login">
<div class="title"><h2>Uppdatera webbplats</h2></div>
<div class="inner">
<h2>Uppdatera webbplats</h2>
<p>Din databas är av version @Piranha.Data.Database.InstalledVersion och måste uppdateras
till version @Piranha.Data.Database.CurrentVersion. Se till att du har tagit backup på din
databas innan du fortsätter med uppdateringen.</p>
Expand Down
37 changes: 19 additions & 18 deletions Areas/Manager/Views/Page/Edit.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
</div>
<div class="grid_9">
<div class="box expandable">
<div class="title"><h2>Information</h2></div>
<div class="inner">
<h2>Information</h2>
<ul class="form">
<li>@Html.LabelFor(m => m.Page.Title)
<div class="input">
Expand Down Expand Up @@ -93,11 +93,6 @@
@Html.ValidationMessageFor(m => m.Page.PageRedirect)
</li>
}
<li>@Html.LabelFor(m => m.Page.Keywords)
<div class="input">
@Html.TextBoxFor(m => m.Page.Keywords, new { @placeholder = "Ej obligatorisk" })</div>
@Html.ValidationMessageFor(m => m.Page.Keywords)
</li>
</ul>
<ul class="form optional">
<li>@Html.LabelFor(m => m.Page.NavigationTitle)
Expand All @@ -114,6 +109,11 @@
@Html.LabelFor(m => m.Page.IsHidden)
<p>@Html.CheckBoxFor(m => m.Page.IsHidden) (Sidan kommer fortfarande vara åtkomlig med inte synas i menyn)</p>
</li>
<li>@Html.LabelFor(m => m.Page.Keywords)
<div class="input">
@Html.TextBoxFor(m => m.Page.Keywords, new { @placeholder = "Ej obligatorisk" })</div>
@Html.ValidationMessageFor(m => m.Page.Keywords)
</li>
<li>@Html.LabelFor(m => m.Page.Description)
<div class="input">
@Html.TextAreaFor(m => m.Page.Description, new { @rows = 3, @placeholder = "Ej obligatorisk" })</div>
Expand All @@ -125,23 +125,24 @@

@if (Model.PageRegions.Count > 0) {
<div class="box">
<div class="inner">
<div class="title">
<h2>Innehåll</h2>
<div id="regionbuttons" class="section">
<div class="left">
@for (int n = 0; n < Model.PageRegions.Count; n++) {
<button id="@Html.Raw("btn_" + Model.PageRegions[n].Name)" class="btn @(n > 0 ? "blue" : "orange") pageregion">@Model.PageRegions[n].Name</button>
}
</div>
<div class="right">
<button id="btn_attachments" class="btn blue hidden">Bifogade filer</button>
</div>
<div id="regionbuttons" class="buttons">
@for (int n = 0; n < Model.PageRegions.Count; n++) {
<button id="@Html.Raw("btn_" + Model.PageRegions[n].Name)" class="btn@(n > 0 ? "" : " active") pageregion">@Model.PageRegions[n].Name</button>
}
<button id="btn_attachments" class="btn hidden">Bifogade filer</button>
</div>
</div>
<div class="inner">
<div id="pageregions">
@Html.EditorFor(m => m.PageRegions)
</div>
<div id="attachments" style="display:none">
@if (false) {
<!-- This is currently under development -->
@Html.Partial("Partial/PageAttachments")
}
</div>
</div>
</div>
Expand All @@ -150,8 +151,8 @@
</div>
<div class="grid_3">
<div class="box pagetemplate">
<div class="title"><h2>@Model.Template.Name.Singular</h2></div>
<div class="inner">
<h2>@Model.Template.Name.Singular</h2>
<div class="edit" style="width:120px;height:120px;margin:0 auto 10px">
@Model.Template.Preview
</div>
Expand All @@ -160,8 +161,8 @@
</div>
@if (Model.Properties.Count > 0) {
<div class="box">
<div class="title"><h2>Egenskaper</h2></div>
<div class="inner">
<h2>Egenskaper</h2>
<ul class="form">
@for (int n = 0; n < Model.Properties.Count; n++) {
<li>@Html.LabelFor(m => m.Properties[n], Model.Properties[n].Name)
Expand Down
32 changes: 29 additions & 3 deletions Areas/Manager/Views/Page/Partial/PageAttachments.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,37 @@
<th>Namn</th>
<th>Typ</th>
<th>Uppdaterad</th>
<th></th>
</tr>
</thead>
<tfoot>
<tbody>
<tr>
<td><div class="dropbox"></div></td>
<td colspan="4"><i>Dra en bild eller ett dokument hit för att bifoga den till sidan.</i></td>
</tr>
<tr>
<td><img src="@Url.Content("~/thumb/81002c9f-3a7c-4080-892a-c3e4840f811d/50")" /></td>
<td>me-120313.jpg</td>
<td>image/jpeg</td>
<td>2012-02-19</td>
<td class="buttons one">
<a class="icon delete"></a></td>
</tr>
<tr>
<td><img src="@Url.Content("~/thumb/81002c9f-3a7c-4080-892a-c3e4840f811d/50")" /></td>
<td>me-120313.jpg</td>
<td>image/jpeg</td>
<td>2012-02-19</td>
<td class="buttons one">
<a class="icon delete"></a></td>
</tr>
<tr>
<td colspan="4"></td>
<td><img src="@Url.Content("~/thumb/81002c9f-3a7c-4080-892a-c3e4840f811d/50")" /></td>
<td>me-120313.jpg</td>
<td>image/jpeg</td>
<td>2012-02-19</td>
<td class="buttons one">
<a class="icon delete"></a></td>
</tr>
</tfoot>
</tbody>
</table>
Loading

0 comments on commit 5148dc5

Please sign in to comment.