mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
Style site selector dropdown
Made dropdown receive chzn, and applied a dark style to the dropdown to match the ui of the cms
This commit is contained in:
parent
fbddc076b8
commit
1a8122ea89
@ -85,7 +85,8 @@ class LeftAndMainSubsites extends Extension {
|
||||
$currentSubsiteID = Subsite::currentSubsiteID();
|
||||
|
||||
if($list->Count() > 1) {
|
||||
$output = '<select id="SubsitesSelect">';
|
||||
$output = '<div class="field dropdown">';
|
||||
$output .= '<select id="SubsitesSelect">';
|
||||
|
||||
foreach($list as $subsite) {
|
||||
$selected = $subsite->ID == $currentSubsiteID ? ' selected="selected"' : '';
|
||||
@ -93,13 +94,14 @@ class LeftAndMainSubsites extends Extension {
|
||||
$output .= "\n<option value=\"{$subsite->ID}\"$selected>". Convert::raw2xml($subsite->Title) . "</option>";
|
||||
}
|
||||
|
||||
$output .= '</select>';
|
||||
$output .= '</select></div>';
|
||||
|
||||
Requirements::javascript('subsites/javascript/LeftAndMain_Subsites.js');
|
||||
return $output;
|
||||
} else if($list->Count() == 1) {
|
||||
if($list->First()->DefaultSite==false) {
|
||||
$output = '<select id="SubsitesSelect">';
|
||||
$output = '<div class="field dropdown">';
|
||||
$output .= '<select id="SubsitesSelect">';
|
||||
$output .= "\n<option value=\"0\">". _t('LeftAndMainSubsites.DEFAULT_SITE', '_Default Site') . "</option>";
|
||||
foreach($list as $subsite) {
|
||||
$selected = $subsite->ID == $currentSubsiteID ? ' selected="selected"' : '';
|
||||
@ -107,7 +109,7 @@ class LeftAndMainSubsites extends Extension {
|
||||
$output .= "\n<option value=\"{$subsite->ID}\"$selected>". Convert::raw2xml($subsite->Title) . "</option>";
|
||||
}
|
||||
|
||||
$output .= '</select>';
|
||||
$output .= '</select></div>';
|
||||
|
||||
Requirements::javascript('subsites/javascript/LeftAndMain_Subsites.js');
|
||||
return $output;
|
||||
|
@ -24,18 +24,38 @@
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
.cms-login-status.subsites {
|
||||
padding-bottom: 7px;
|
||||
.cms-menu .cms-subsites{
|
||||
padding:3px 0px 15px;
|
||||
}
|
||||
.cms-menu .cms-subsites .field.dropdown{
|
||||
padding-bottom:0;
|
||||
margin-bottom:0;
|
||||
}
|
||||
|
||||
#SubsitesSelect,
|
||||
#SubsitesSelect option {
|
||||
font-size: 12px;
|
||||
/* Custom chzn styles for dark blue background */
|
||||
.cms-subsites .chzn-container-single .chzn-single,
|
||||
.cms-subsites .chzn-container-active .chzn-single {
|
||||
border: 1px solid #152338;
|
||||
background:#213557;
|
||||
-webkit-box-shadow: inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
|
||||
box-shadow: inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
|
||||
}
|
||||
#SubsitesSelect {
|
||||
width: 145px;
|
||||
padding: 3px;
|
||||
}
|
||||
.cms-menu .cms-subsites .dropdown span{
|
||||
padding-left:5px;
|
||||
}
|
||||
.cms-subsites .chzn-container-single .chzn-single div b{
|
||||
background: url(../images/chosen-sprite-light.png) 3px 0 no-repeat;
|
||||
}
|
||||
.cms-subsites .chzn-container .chzn-drop{
|
||||
padding-left:5px;
|
||||
background:#213557;
|
||||
border: 1px solid #152338;
|
||||
border-top:0;
|
||||
color:#fff;
|
||||
-webkit-box-shadow: inset 1px 0 0 rgba(255,255,255,.125);
|
||||
box-shadow: inset 1px 0 0 rgba(255,255,255,.125);
|
||||
}
|
||||
|
||||
|
||||
#AddSubsiteLink {
|
||||
display: block;
|
||||
|
BIN
images/chosen-sprite-light.png
Normal file
BIN
images/chosen-sprite-light.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.5 KiB |
@ -19,7 +19,7 @@
|
||||
<% end_with %>
|
||||
</div>
|
||||
|
||||
<div class="cms-login-status subsites">
|
||||
<div class="cms-subsites">
|
||||
$SubsiteList
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user