styling for scenario where tabs run onto multiple lines

This commit is contained in:
Dave Cranwell 2014-06-17 16:37:22 +01:00
parent 4788144c86
commit 9efb6a38d7
4 changed files with 49 additions and 23 deletions

View file

@ -447,7 +447,7 @@ class BaseObjectList(BaseCompositeEditHandler):
template = "wagtailadmin/edit_handlers/object_list.html"
def ObjectList(children, heading="", classes=None):
def ObjectList(children, heading="", classes=""):
return type('_ObjectList', (BaseObjectList,), {
'children': children,
'heading': heading,

View file

@ -96,7 +96,6 @@
.icon-unlocked:before {
content: "p";
}
.icon-doc-full-inverse:before {
content: "r";
}

View file

@ -1,13 +1,15 @@
.tab-nav{
@include clearfix();
padding:0;
background:$color-grey-4;
li{
list-style-type:none;
width:48%;
width:50%;
float:left;
padding:0;
position:relative;
margin-bottom:-1px;
&:before,&:after{
display:none;
@ -18,13 +20,12 @@
@include box-shadow(inset 0px -2px 3px 0 rgba(0,0,0,0.1));
background-color:$color-grey-4;
outline:none;
line-height:3em;
text-transform:uppercase;
font-weight:700;
font-size:1.2em;
text-decoration:none;
display:block;
padding:0 20px;
padding:0.7em $mobile-nice-padding;
color:$color-grey-2;
border-top:0.3em solid $color-grey-4;
border-bottom:1px solid transparent;
@ -57,6 +58,20 @@
}
}
li.settings a{
padding-left:30px;
padding-right:30px;
&:before{
font-family:wagtail;
vertical-align:middle;
text-transform:none;
content:"w";
margin-right:0.5em;
font-size:1.2em;
}
}
li.active a{
@include box-shadow(none);
color:$color-grey-1;
@ -66,7 +81,6 @@
/* For cases where tab-nav should merge with header */
&.merged{
background-color:$color-header-bg;
margin-top:0;
}
}
@ -82,14 +96,27 @@
}
@media screen and (min-width: $breakpoint-mobile){
.tab-nav li{
width:auto;
padding:0;
margin-left:0.7em;
}
.tab-nav{
/* For cases where tab-nav should merge with header */
&.merged{
background-color:$color-header-bg;
}
.tab-nav a{
padding:0 50px;
li{
width:auto;
padding:0;
margin-left:0.7em;
&.tab-right{
float:right;
margin-right:0.7em;
}
}
a{
padding-left:$desktop-nice-padding - 10;
padding-right:$desktop-nice-padding - 10;
}
}
.modal-content .tab-nav li{

View file

@ -531,40 +531,40 @@ PAGE_EDIT_HANDLERS = {}
def get_default_panels(page_class):
panels = []
handlers = []
try:
panels.append(ObjectList(page_class.content_panels, heading='Content'))
handlers.append(ObjectList(page_class.content_panels, heading='Content'))
except AttributeError:
pass
try:
panels.append(ObjectList(page_class.promote_panels, heading='Promote'))
handlers.append(ObjectList(page_class.promote_panels, heading='Promote'))
except AttributeError:
pass
try:
panels.append(ObjectList(page_class.settings_panels, heading='Settings', classes='settings'))
handlers.append(ObjectList(page_class.settings_panels, heading='Settings', classes='tab-right settings'))
except AttributeError:
pass
return panels
return handlers
def get_panels(page_class):
def get_which_page_edit_handler(page_class):
try:
return page_class.panels
return page_class.handlers
except AttributeError:
return get_default_panels(page_class)
def set_panels(page_class, panels):
page_class.panels = panels
def set_page_edit_handler(page_class, handlers):
page_class.handlers = handlers
def get_page_edit_handler(page_class):
if page_class not in PAGE_EDIT_HANDLERS:
PAGE_EDIT_HANDLERS[page_class] = TabbedInterface(get_panels(page_class))
PAGE_EDIT_HANDLERS[page_class] = TabbedInterface(get_which_page_edit_handler(page_class))
return PAGE_EDIT_HANDLERS[page_class]