diff --git a/Thumbs.db b/Thumbs.db deleted file mode 100644 index 47072b3c770d1215521e9420628382c845231d64..0000000000000000000000000000000000000000 Binary files a/Thumbs.db and /dev/null differ diff --git a/bootstrap_barrio.info b/bootstrap_barrio.info index ba625cf6bd89cc27e1b3f5dc11574ca9626dc7ce..3119d47f911a7e0e361e7b06155c9e0832d0dfa8 100644 --- a/bootstrap_barrio.info +++ b/bootstrap_barrio.info @@ -6,6 +6,7 @@ base theme = bootstrap regions[top] = 'Top Header' regions[header] = 'Header' regions[navigation] = 'Navigation' +regions[yamm] = 'Yamm' regions[slider] = 'Slider' regions[highlighted] = 'Highlighted' regions[help] = 'Help' @@ -20,6 +21,7 @@ regions[postcript_bottom] = 'Postcript Bottom' regions[footer] = 'Footer' stylesheets[all][] = css/style.css +stylesheets[all][] = css/yamm.css scripts[] = js/script.js ; -------------------------------------------------------------------------------- diff --git a/css/style.css b/css/style.css index 9df666ac63e373b2c719bbd7f9e20504ccf0e7e3..8c6bee74d845f3e2103a4f0e272978223600abe1 100644 --- a/css/style.css +++ b/css/style.css @@ -234,3 +234,7 @@ e.g. multipage*/ .form-actions { clear: both; } +/* Override Dropdown Menu to allow on-hover behaviour */ +.dropdown-menu { + margin:0; +} \ No newline at end of file diff --git a/css/yamm.css b/css/yamm.css new file mode 100644 index 0000000000000000000000000000000000000000..6b934139e379dc6c455937ecfd85aa3d5187afb6 --- /dev/null +++ b/css/yamm.css @@ -0,0 +1,60 @@ +/*! + * Yamm! + * Yet another megamenu for Bootstrap + * http://geedmo.github.com/yamm + * + * https://github.com/geedmo + */ +.yamm .nav, +.yamm .dropup, +.yamm .dropdown, +.yamm .collapse { + position: static; +} +.yamm .navbar-inner, +.yamm .container { + position: relative; +} +.yamm .dropdown-menu { + left: auto; +} +.yamm .dropdown-menu > li { + display: block; +} +.yamm .nav.pull-right .dropdown-menu { + right: 0; +} +.yamm .yamm-content { + padding: 20px 30px; + *zoom: 1; +} +.yamm .yamm-content:before, +.yamm .yamm-content:after { + display: table; + content: ""; + line-height: 0; +} +.yamm .yamm-content:after { + clear: both; +} +.yamm.navbar .nav > li > .dropdown-menu:after, +.yamm.navbar .nav > li > .dropdown-menu:before { + display: none; +} +.yamm .dropdown.yamm-fullwidth .dropdown-menu { + width: 100%; + left: 0; + right: 0; +} +@media (max-width: 969px) { + .yamm .dropdown.yamm-fullwidth .dropdown-menu { + width: auto; + } + .yamm .yamm-content { + padding-left: 0; + padding-right: 0; + } + .yamm .dropdown-menu > li > ul { + display: block; + } +} diff --git a/js/script.js b/js/script.js index 61df9bccdd4166edf824c4f3757f32b4c5309cdd..212dfae2931263981c99772ddf38451668b80814 100644 --- a/js/script.js +++ b/js/script.js @@ -3,12 +3,23 @@ jQuery(document).ready(function() { // This triggers block as modal. jQuery('.barrio-modal').each(function () { var title = jQuery(this).children('h2').text(); - jQuery(this).after('<section id="btn-' + jQuery(this).attr('id') + '" class="sideral-corner after"><a href="#' + jQuery(this).attr('id') + '" role="button" class="btn" data-toggle="modal">' + title + '</a></section>'); + jQuery(this).after('<section id="btn-' + jQuery(this).attr('id') + '" class="sideral-corner after"><a class="btn btn-primary btn-lg" data-target="#' + jQuery(this).attr('id') + '" data-toggle="modal">' + title + '</a></section>'); }); - jQuery('.barrio-modal .block-content').addClass('modal-body'); + jQuery('.barrio-modal').attr("tabindex", "-1"); + jQuery('.barrio-modal').attr("role", "dialog"); + jQuery('.barrio-modal').attr("aria-hidden", "true"); jQuery('.barrio-modal h2').wrap('<div class="modal-header" />'); jQuery('.barrio-modal .modal-header').prepend('<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>'); + jQuery('.barrio-modal .block-content').addClass('modal-body'); jQuery('.barrio-modal').append('<div class="modal-footer"><button class="btn" data-dismiss="modal" aria-hidden="true">' + Drupal.t('Close') + '</button></div>'); + jQuery('.barrio-modal div').wrapAll('<div class="modal-dialog" />'); + jQuery('.modal-dialog div').wrapAll('<div class="modal-content" />'); jQuery('.barrio-modal').appendTo('body'); // End of modal block definition + + // Yamm code + jQuery(document).on('click', '.yamm .dropdown-menu', function(e) { + e.stopPropagation() + }) + }); diff --git a/less/responsive-navbar.less b/less/responsive-navbar.less new file mode 100644 index 0000000000000000000000000000000000000000..f5f5c4a157ae88a8e3242ea082d404bf505ffd2d --- /dev/null +++ b/less/responsive-navbar.less @@ -0,0 +1,193 @@ +// +// Responsive: Navbar +// -------------------------------------------------- + + +// TABLETS AND BELOW +// ----------------- +@media (max-width: @navbarCollapseWidth) { + + // UNFIX THE TOPBAR + // ---------------- + // Remove any padding from the body + body { + padding-top: 0; + } + // Unfix the navbars + .navbar-fixed-top, + .navbar-fixed-bottom { + position: static; + } + .navbar-fixed-top { + margin-bottom: @baseLineHeight; + } + .navbar-fixed-bottom { + margin-top: @baseLineHeight; + } + .navbar-fixed-top .navbar-inner, + .navbar-fixed-bottom .navbar-inner { + padding: 5px; + } + .navbar .container { + width: auto; + padding: 0; + } + // Account for brand name + .navbar .brand { + padding-left: 10px; + padding-right: 10px; + margin: 0 0 0 -5px; + } + + // COLLAPSIBLE NAVBAR + // ------------------ + // Nav collapse clears brand + .nav-collapse { + clear: both; + } + // Block-level the nav + .nav-collapse .nav { + float: none; + margin: 0 0 (@baseLineHeight / 2); + } + .nav-collapse .nav > li { + float: none; + } + .nav-collapse .nav > li > a { + margin-bottom: 2px; + } + .nav-collapse .nav > .divider-vertical { + display: none; + } + .nav-collapse .nav .nav-header { + color: @navbarText; + text-shadow: none; + } + // Nav and dropdown links in navbar + .nav-collapse .nav > li > a, + .nav-collapse .dropdown-menu > li > a { // increment specification for children a + padding: 9px 15px; + font-weight: bold; + color: @navbarLinkColor; + .border-radius(3px); + } + // restore dropdown link color + .nav-collapse .dropdown-menu > li > a:hover { + color: @dropdownLinkColorHover; + } + // Buttons + .nav-collapse .btn { + padding: 4px 10px 4px; + font-weight: normal; + .border-radius(@baseBorderRadius); + } + .nav-collapse .dropdown-menu li + li a { + margin-bottom: 2px; + } + .nav-collapse .nav > li > a:hover, + .nav-collapse .nav > li > a:focus, + .nav-collapse .dropdown-menu > li > a:hover, // increment specification for children a + .nav-collapse .dropdown-menu > li > a:focus { // increment specification for children a + background-color: @navbarBackground; + } + .navbar-inverse .nav-collapse .nav > li > a, + .navbar-inverse .nav-collapse .dropdown-menu > li > a { + color: @navbarInverseLinkColor; + } + .navbar-inverse .nav-collapse .nav > li > a:hover, + .navbar-inverse .nav-collapse .nav > li > a:focus, + .navbar-inverse .nav-collapse .dropdown-menu > li > a:hover, // increment specification for children a + .navbar-inverse .nav-collapse .dropdown-menu > li > a:focus { // increment specification for children a + background-color: @navbarInverseBackground; + } + // Buttons in the navbar + .nav-collapse.in .btn-group { + margin-top: 5px; + padding: 0; + } + // Dropdowns in the navbar + .nav-collapse .dropdown-menu { + position: static; + top: auto; + left: auto; + float: none; + display: none; + max-width: none; + margin: 0 15px; + padding: 0; + background-color: transparent; + border: none; + .border-radius(0); + .box-shadow(none); + } + .nav-collapse .open > .dropdown-menu { + display: block; + } + + .nav-collapse .dropdown-menu:before, + .nav-collapse .dropdown-menu:after { + display: none; + } + .nav-collapse .dropdown-menu .divider { + display: none; + } + .nav-collapse .nav > li > .dropdown-menu { + &:before, + &:after { + display: none; + } + } + // Forms in navbar + .nav-collapse .navbar-form, + .nav-collapse .navbar-search { + float: none; + padding: (@baseLineHeight / 2) 15px; + margin: (@baseLineHeight / 2) 0; + border-top: 1px solid @navbarBackground; + border-bottom: 1px solid @navbarBackground; + .box-shadow(~"inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1)"); + } + .navbar-inverse .nav-collapse .navbar-form, + .navbar-inverse .nav-collapse .navbar-search { + border-top-color: @navbarInverseBackground; + border-bottom-color: @navbarInverseBackground; + } + // Pull right (secondary) nav content + .navbar .nav-collapse .nav.pull-right { + float: none; + margin-left: 0; + } + // Hide everything in the navbar save .brand and toggle button */ + .nav-collapse, + .nav-collapse.collapse { + overflow: hidden; + height: 0; + } + // Navbar button + .navbar .btn-navbar { + display: block; + } + + // STATIC NAVBAR + // ------------- + .navbar-static .navbar-inner { + padding-left: 10px; + padding-right: 10px; + } + + +} + + +// DEFAULT DESKTOP +// --------------- + +@media (min-width: @navbarCollapseDesktopWidth) { + + // Required to make the collapsing navbar work on regular desktops + .nav-collapse.collapse { + height: auto !important; + overflow: visible !important; + } + +} diff --git a/less/yamm.less b/less/yamm.less new file mode 100644 index 0000000000000000000000000000000000000000..6e1f9d05a2127f37af554f4cecd2a619e1e7fece --- /dev/null +++ b/less/yamm.less @@ -0,0 +1,98 @@ +/*! + * Yamm! + * Yet another megamenu for Bootstrap + * http://geedmo.github.com/yamm + * + * https://github.com/geedmo + */ + +// standard bootstrap +@navbarCollapseWidth: 969px; + +//----------------------------- +// Main Styles +//----------------------------- + +.yamm { + + // reset positions + .nav, .dropup, .dropdown, .collapse { + position: static; + } + + // propagate menu position under navbar inner or container + .navbar-inner, .container { + position: relative; + } + + // by default aligns to menu item + .dropdown-menu { + left: auto; + > li { + display: block; + } + } + .nav.pull-right .dropdown-menu { + right: 0; + } + + // Content with padding + .yamm-content { + padding: 20px 30px; + .clearfix(); // acts as a span container + } + + // remove dropdown top arrows + &.navbar .nav > li > .dropdown-menu:after, + &.navbar .nav > li > .dropdown-menu:before { + display: none; + } + + // Fullwidth menu + .dropdown.yamm-fullwidth .dropdown-menu { + width: 100%; + left: 0; right: 0; + } + +} + +//----------------------------- +// Responsiveness +//----------------------------- + +@media (max-width: @navbarCollapseWidth) { + + .yamm { + // width auto to avoid overflow navbar + .dropdown.yamm-fullwidth .dropdown-menu { + width: auto; + } + // remove horizontal padding + .yamm-content { + padding-left: 0; + padding-right: 0; + } + + .dropdown-menu > li > ul { + display: block; + } + } +} + +// Clearfix +// -------- +// For clearing floats like a boss h5bp.com/q +.clearfix() { + *zoom: 1; + &:before, + &:after { + display: table; + content: ""; + // Fixes Opera/contenteditable bug: + // http://nicolasgallagher.com/micro-clearfix-hack/#comment-36952 + line-height: 0; + } + &:after { + clear: both; + } +} \ No newline at end of file diff --git a/skins/barrio_default/barrio_default.inc b/skins/barrio_default/barrio_default.inc index ff76d29e650d1a1062f4713748208eeb62e7d543..4529dece2b44be4e6c485f67915b2baf2cea639d 100644 --- a/skins/barrio_default/barrio_default.inc +++ b/skins/barrio_default/barrio_default.inc @@ -124,9 +124,9 @@ function bootstrap_barrio_skinr_group_info() { function bootstrap_barrio_skinr_skin_barrio_default_info() { $skins = array(); - $skins['bootstrap_barrio_span'] = array( - 'title' => t('Bootstrap Column Span'), - 'description' => t('Define the SPAN value for Bootstrap Columns.'), + $skins['bootstrap_barrio_col-sm'] = array( + 'title' => t('Bootstrap Column Small'), + 'description' => t('Define the value for Bootstrap Columns small screen devices.'), 'type' => 'select', 'theme hooks' => array('block','region'), 'group' => 'layout', @@ -134,58 +134,174 @@ function bootstrap_barrio_skinr_skin_barrio_default_info() { 'options' => array( 'option_1' => array( 'title' => t('Span 1'), - 'class' => array('span1'), + 'class' => array('col-sm-1'), ), 'option_2' => array( 'title' => t('Span 2'), - 'class' => array('span2'), + 'class' => array('col-sm-2'), ), 'option_3' => array( 'title' => t('Span 3'), - 'class' => array('span3'), + 'class' => array('col-sm-3'), ), 'option_4' => array( 'title' => t('Span 4'), - 'class' => array('span4'), + 'class' => array('col-sm-4'), ), 'option_5' => array( 'title' => t('Span 5'), - 'class' => array('span5'), + 'class' => array('col-sm-5'), ), 'option_6' => array( 'title' => t('Span 6'), - 'class' => array('span6'), + 'class' => array('col-sm-6'), ), 'option_7' => array( 'title' => t('Span 7'), - 'class' => array('span7'), + 'class' => array('col-sm-7'), ), 'option_8' => array( 'title' => t('Span 8'), - 'class' => array('span8'), + 'class' => array('col-sm-8'), ), 'option_9' => array( 'title' => t('Span 9'), - 'class' => array('span9'), + 'class' => array('col-sm-9'), ), 'option_10' => array( 'title' => t('Span 10'), - 'class' => array('span10'), + 'class' => array('col-sm-10'), ), 'option_11' => array( 'title' => t('Span 11'), - 'class' => array('span11'), + 'class' => array('col-sm-11'), ), 'option_12' => array( 'title' => t('Span 12'), - 'class' => array('span12'), + 'class' => array('col-sm-12'), + ), + ), + ); + $skins['bootstrap_barrio_col-md'] = array( + 'title' => t('Bootstrap Column Medium'), + 'description' => t('Define the value for Bootstrap Columns medium screen devices.'), + 'type' => 'select', + 'theme hooks' => array('block','region'), + 'group' => 'layout', + 'default status' => 1, + 'options' => array( + 'option_1' => array( + 'title' => t('Span 1'), + 'class' => array('col-md-1'), + ), + 'option_2' => array( + 'title' => t('Span 2'), + 'class' => array('col-md-2'), + ), + 'option_3' => array( + 'title' => t('Span 3'), + 'class' => array('col-md-3'), + ), + 'option_4' => array( + 'title' => t('Span 4'), + 'class' => array('col-md-4'), + ), + 'option_5' => array( + 'title' => t('Span 5'), + 'class' => array('col-md-5'), + ), + 'option_6' => array( + 'title' => t('Span 6'), + 'class' => array('col-md-6'), + ), + 'option_7' => array( + 'title' => t('Span 7'), + 'class' => array('col-md-7'), + ), + 'option_8' => array( + 'title' => t('Span 8'), + 'class' => array('col-md-8'), + ), + 'option_9' => array( + 'title' => t('Span 9'), + 'class' => array('col-md-9'), + ), + 'option_10' => array( + 'title' => t('Span 10'), + 'class' => array('col-md-10'), + ), + 'option_11' => array( + 'title' => t('Span 11'), + 'class' => array('col-md-11'), + ), + 'option_12' => array( + 'title' => t('Span 12'), + 'class' => array('col-md-12'), + ), + ), + ); + $skins['bootstrap_barrio_col-lg'] = array( + 'title' => t('Bootstrap Column Large'), + 'description' => t('Define the value for Bootstrap Columns large screen devices.'), + 'type' => 'select', + 'theme hooks' => array('block','region'), + 'group' => 'layout', + 'default status' => 1, + 'options' => array( + 'option_1' => array( + 'title' => t('Span 1'), + 'class' => array('col-lg-1'), + ), + 'option_2' => array( + 'title' => t('Span 2'), + 'class' => array('col-lg-2'), + ), + 'option_3' => array( + 'title' => t('Span 3'), + 'class' => array('col-lg-3'), + ), + 'option_4' => array( + 'title' => t('Span 4'), + 'class' => array('col-lg-4'), + ), + 'option_5' => array( + 'title' => t('Span 5'), + 'class' => array('col-lg-5'), + ), + 'option_6' => array( + 'title' => t('Span 6'), + 'class' => array('col-lg-6'), + ), + 'option_7' => array( + 'title' => t('Span 7'), + 'class' => array('col-lg-7'), + ), + 'option_8' => array( + 'title' => t('Span 8'), + 'class' => array('col-lg-8'), + ), + 'option_9' => array( + 'title' => t('Span 9'), + 'class' => array('col-lg-9'), + ), + 'option_10' => array( + 'title' => t('Span 10'), + 'class' => array('col-lg-10'), + ), + 'option_11' => array( + 'title' => t('Span 11'), + 'class' => array('col-lg-11'), + ), + 'option_12' => array( + 'title' => t('Span 12'), + 'class' => array('col-lg-12'), ), ), ); - $skins['bootstrap_barrio_offset'] = array( - 'title' => t('Bootstrap Column Offset'), - 'description' => t('Define the OFFSET value for Bootstrap Columns.'), + $skins['bootstrap_barrio_col-sm-offset'] = array( + 'title' => t('Bootstrap Column Offset Small'), + 'description' => t('Define the OFFSET value for Bootstrap Columns Small.'), 'type' => 'select', 'theme hooks' => array('block','region'), 'group' => 'layout', @@ -193,47 +309,155 @@ function bootstrap_barrio_skinr_skin_barrio_default_info() { 'options' => array( 'option_1' => array( 'title' => t('Offset 1'), - 'class' => array('offset1'), + 'class' => array('col-sm-offset-1'), ), 'option_2' => array( 'title' => t('Offset 2'), - 'class' => array('offset2'), + 'class' => array('col-sm-offset-2'), ), 'option_3' => array( 'title' => t('Offset 3'), - 'class' => array('offset3'), + 'class' => array('col-sm-offset-3'), ), 'option_4' => array( 'title' => t('Offset 4'), - 'class' => array('offset4'), + 'class' => array('col-sm-offset-4'), ), 'option_5' => array( 'title' => t('Offset 5'), - 'class' => array('offset5'), + 'class' => array('col-sm-offset-5'), ), 'option_6' => array( 'title' => t('Offset 6'), - 'class' => array('offset6'), + 'class' => array('col-sm-offset-6'), ), 'option_7' => array( 'title' => t('Offset 7'), - 'class' => array('offset'), + 'class' => array('col-sm-offset-'), ), 'option_8' => array( 'title' => t('Offset 8'), - 'class' => array('offset8'), + 'class' => array('col-sm-offset-8'), ), 'option_9' => array( 'title' => t('Offset 9'), - 'class' => array('offset9'), + 'class' => array('col-sm-offset-9'), ), 'option_10' => array( 'title' => t('Offset 10'), - 'class' => array('offset10'), + 'class' => array('col-sm-offset-10'), ), 'option_11' => array( 'title' => t('Offset 11'), - 'class' => array('offset11'), + 'class' => array('col-sm-offset-11'), + ), + ), + ); + $skins['bootstrap_barrio_col-md-offset'] = array( + 'title' => t('Bootstrap Column Offset Medium'), + 'description' => t('Define the OFFSET value for Bootstrap Columns Medium.'), + 'type' => 'select', + 'theme hooks' => array('block','region'), + 'group' => 'layout', + 'default status' => 1, + 'options' => array( + 'option_1' => array( + 'title' => t('Offset 1'), + 'class' => array('col-md-offset-1'), + ), + 'option_2' => array( + 'title' => t('Offset 2'), + 'class' => array('col-md-offset-2'), + ), + 'option_3' => array( + 'title' => t('Offset 3'), + 'class' => array('col-md-offset-3'), + ), + 'option_4' => array( + 'title' => t('Offset 4'), + 'class' => array('col-md-offset-4'), + ), + 'option_5' => array( + 'title' => t('Offset 5'), + 'class' => array('col-md-offset-5'), + ), + 'option_6' => array( + 'title' => t('Offset 6'), + 'class' => array('col-md-offset-6'), + ), + 'option_7' => array( + 'title' => t('Offset 7'), + 'class' => array('col-md-offset-'), + ), + 'option_8' => array( + 'title' => t('Offset 8'), + 'class' => array('col-md-offset-8'), + ), + 'option_9' => array( + 'title' => t('Offset 9'), + 'class' => array('col-md-offset-9'), + ), + 'option_10' => array( + 'title' => t('Offset 10'), + 'class' => array('col-md-offset-10'), + ), + 'option_11' => array( + 'title' => t('Offset 11'), + 'class' => array('col-md-offset-11'), + ), + ), + ); + $skins['bootstrap_barrio_col-lg-offset'] = array( + 'title' => t('Bootstrap Column Offset Large'), + 'description' => t('Define the OFFSET value for Bootstrap Columns Large.'), + 'type' => 'select', + 'theme hooks' => array('block','region'), + 'group' => 'layout', + 'default status' => 1, + 'options' => array( + 'option_1' => array( + 'title' => t('Offset 1'), + 'class' => array('col-lg-offset-1'), + ), + 'option_2' => array( + 'title' => t('Offset 2'), + 'class' => array('col-lg-offset-2'), + ), + 'option_3' => array( + 'title' => t('Offset 3'), + 'class' => array('col-lg-offset-3'), + ), + 'option_4' => array( + 'title' => t('Offset 4'), + 'class' => array('col-lg-offset-4'), + ), + 'option_5' => array( + 'title' => t('Offset 5'), + 'class' => array('col-lg-offset-5'), + ), + 'option_6' => array( + 'title' => t('Offset 6'), + 'class' => array('col-lg-offset-6'), + ), + 'option_7' => array( + 'title' => t('Offset 7'), + 'class' => array('col-lg-offset-'), + ), + 'option_8' => array( + 'title' => t('Offset 8'), + 'class' => array('col-lg-offset-8'), + ), + 'option_9' => array( + 'title' => t('Offset 9'), + 'class' => array('col-lg-offset-9'), + ), + 'option_10' => array( + 'title' => t('Offset 10'), + 'class' => array('col-lg-offset-10'), + ), + 'option_11' => array( + 'title' => t('Offset 11'), + 'class' => array('col-lg-offset-11'), ), ), ); @@ -241,7 +465,7 @@ function bootstrap_barrio_skinr_skin_barrio_default_info() { $skins['bootstrap_barrio_row'] = array( 'title' => t('Bootstrap Row'), 'type' => 'select', - 'description' => t('Define a DIV as row or row fluid.'), + 'description' => t('Define a DIV as row.'), 'theme hooks' => array('block', 'region'), 'group' => 'layout', 'default status' => 1, @@ -250,17 +474,13 @@ function bootstrap_barrio_skinr_skin_barrio_default_info() { 'title' => t('Row'), 'class' => array('row'), ), - 'option_2' => array( - 'title' => t('Row Fluid'), - 'class' => array('row-fluid'), - ), ), ); $skins['bootstrap_barrio_container'] = array( 'title' => t('Bootstrap Container'), 'type' => 'select', - 'description' => t('Define a DIV as container or container fluid.'), + 'description' => t('Define a DIV as container.'), 'theme hooks' => array('block', 'region'), 'group' => 'layout', 'default status' => 1, @@ -269,10 +489,6 @@ function bootstrap_barrio_skinr_skin_barrio_default_info() { 'title' => t('Container'), 'class' => array('container'), ), - 'option_2' => array( - 'title' => t('Container Fluid'), - 'class' => array('container-fluid'), - ), ), ); @@ -286,27 +502,35 @@ function bootstrap_barrio_skinr_skin_barrio_default_info() { 'options' => array( 'option_1' => array( 'title' => t('Visible Phone'), - 'class' => array('visible-phone'), + 'class' => array('visible-xs'), ), 'option_2' => array( 'title' => t('Visible Tablet'), - 'class' => array('visible-tablet'), + 'class' => array('visible-sm'), ), 'option_3' => array( 'title' => t('Visible Desktop'), - 'class' => array('visible-desktop'), + 'class' => array('visible-md'), ), 'option_4' => array( - 'title' => t('Hidden Phone'), - 'class' => array('hidden-phone'), + 'title' => t('Visible Large Screen'), + 'class' => array('visible-lg'), ), 'option_5' => array( - 'title' => t('Hidden Tablet'), - 'class' => array('hidden-tablet'), + 'title' => t('Hidden Phone'), + 'class' => array('hidden-xs'), ), 'option_6' => array( + 'title' => t('Hidden Tablet'), + 'class' => array('hidden-sm'), + ), + 'option_7' => array( 'title' => t('Hidden Desktop'), - 'class' => array('hidden-desktop'), + 'class' => array('hidden-md'), + ), + 'option_8' => array( + 'title' => t('Hidden Large Screen'), + 'class' => array('hidden-lg'), ), ), ); @@ -322,7 +546,7 @@ function bootstrap_barrio_skinr_skin_barrio_default_info() { 'options' => array( 'bootstrap_barrio_modal' => array( 'title' => t('Set as modal.'), - 'class' => array('modal', 'fade', 'hide', 'barrio-modal'), + 'class' => array('modal', 'fade', 'barrio-modal'), ), ), ); @@ -336,15 +560,15 @@ function bootstrap_barrio_skinr_skin_barrio_default_info() { 'default status' => 1, 'options' => array( 'option_1' => array( - 'title' => t('Visible Phone'), + 'title' => t('Fixed Top'), 'class' => array('navbar-fixed-top'), ), 'option_2' => array( - 'title' => t('Visible Tablet'), + 'title' => t('Fixed Bottom'), 'class' => array('navbar-fixed-bottom'), ), 'option_3' => array( - 'title' => t('Visible Desktop'), + 'title' => t('Static Top'), 'class' => array('navbar-static-top'), ), ), @@ -360,7 +584,7 @@ function bootstrap_barrio_skinr_skin_barrio_default_info() { 'options' => array( 'bootstrap_barrio_collapse_menu' => array( 'title' => t('Set as collapsible.'), - 'class' => array('nav-collapse', 'collapse'), + 'class' => array('nav-collapse'), ), ), ); diff --git a/template.php b/template.php index d5694a2f3c8e3f1db026bf3cbc6f8cc667fdbae1..28a69d013944c9d977e113c9b02062d292a6ee4c 100644 --- a/template.php +++ b/template.php @@ -31,28 +31,19 @@ function bootstrap_barrio_preprocess_html(&$variables) { */ function bootstrap_barrio_preprocess_page(&$variables) { $variables['content_width'] = _bootstrap_barrio_content_width(); - $variables['sidebar_first_width'] = 'span' . theme_get_setting('sidebar_first_width'); - $variables['sidebar_second_width'] = 'span' . theme_get_setting('sidebar_second_width'); - $variables['nav_style'] = _bootstrap_barrio_nav_style(theme_get_setting('nav_style')); - if (!theme_get_setting('print_content') && drupal_is_front_page()) { - $variables['print_content'] = FALSE; - } - else { - $variables['print_content'] = TRUE; - } + $variables['sidebar_first_width'] = 'col-md-' . theme_get_setting('sidebar_first_width'); + $variables['sidebar_second_width'] = 'col-md-' . theme_get_setting('sidebar_second_width'); if (theme_get_setting('collapse')) { - $variables['collapse'] = 'nav-collapse collapse'; + $variables['collapse'] = 'nav-collapse'; } else { $variables['collapse'] = 'not-collapse'; } - if (theme_get_setting('fluid') || (arg(0) == 'admin')) { - $variables['container'] = 'container-fluid'; - $variables['row'] = 'row-fluid'; + if (!theme_get_setting('print_content') && drupal_is_front_page()) { + $variables['print_content'] = FALSE; } else { - $variables['container'] = 'container'; - $variables['row'] = 'row'; + $variables['print_content'] = TRUE; } } @@ -65,7 +56,7 @@ function _bootstrap_barrio_content_width() { $sidebar_first_width = (_bootstrap_barrio_block_list('sidebar_first')) ? theme_get_setting('sidebar_first_width') : 0; $sidebar_second_width = (_bootstrap_barrio_block_list('sidebar_second')) ? theme_get_setting('sidebar_second_width') : 0; $content_width = 12 - $sidebar_first_width - $sidebar_second_width; - $content_width = ($content_width == 12) ? "container" : "span" . $content_width; + $content_width = ($content_width == 12) ? "row" : "col-md-" . $content_width; return $content_width; } @@ -88,26 +79,3 @@ function _bootstrap_barrio_block_list($region) { return $drupal_list; } -/** - * Returns style for main navigation bar. - */ -function _bootstrap_barrio_nav_style($theme_nav_style) { - switch ($theme_nav_style) { - case 0: - $nav_style = 'navbar navbar-static-top'; - break; - - case 1: - $nav_style = 'navbar navbar-fixed-top'; - break; - - case 2: - $nav_style = 'nav-collapse collapse'; - break; - - default: - $nav_style = 'navbar navbar-static-top'; - break; - } - return $nav_style; -} diff --git a/templates/block--yamm.tpl.php b/templates/block--yamm.tpl.php new file mode 100644 index 0000000000000000000000000000000000000000..078a5038f2e881b1a432efc4819cadf3d929fd14 --- /dev/null +++ b/templates/block--yamm.tpl.php @@ -0,0 +1,17 @@ +<?php + +/** + * @file + * Override of Bootstrap block.tpl.php. + */ +?> +<li id="<?php print $block_html_id; ?>" class="<?php print $classes; ?> dropdown"<?php print $attributes; ?>> + <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <?php print $title; ?> <b class="caret"></b> </a> + <ul class="dropdown-menu"> + <li> + <div class="yamm-content"> + <?php print $content ?> + </div> + </li> + </ul> +</li> <!-- /.block --> diff --git a/templates/html.tpl.php b/templates/html.tpl.php index b107ba247f01ba6f24a5428ec7c62c85198e8fc5..40a25762e26c6ecbcb6633be0d7a862439af07cd 100644 --- a/templates/html.tpl.php +++ b/templates/html.tpl.php @@ -6,8 +6,8 @@ */ ?> <!DOCTYPE html> -<html lang="<?php print $language->language; ?>"> -<head> +<html lang="<?php print $language->language; ?>" dir="<?php print $language->dir; ?>"<?php print $rdf_namespaces;?>> +<head profile="<?php print $grddl_profile; ?>"> <meta charset="utf-8"> <?php if ($mobile_friendly): ?> <meta name="viewport" content="width=device-width, initial-scale=1.0"> @@ -15,13 +15,16 @@ <?php print $head; ?> <title><?php print $head_title; ?></title> <?php print $styles; ?> - <?php print $scripts; ?> <!-- HTML5 element support for IE6-8 --> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> + <?php print $scripts; ?> </head> <body class="<?php print $classes; ?>" <?php print $attributes;?>> + <div id="skip-link"> + <a href="#main-content" class="element-invisible element-focusable"><?php print t('Skip to main content'); ?></a> + </div> <?php print $page_top; ?> <?php print $page; ?> <?php print $page_bottom; ?> diff --git a/templates/page.tpl.php b/templates/page.tpl.php index f37b9ca65491bbd8d92486865f5c18cc0e57a704..68d949301c532223d047bae4fd28ed892a1c81bc 100644 --- a/templates/page.tpl.php +++ b/templates/page.tpl.php @@ -2,41 +2,55 @@ /** * @file - * Override of Bootstrap html.tpl.php. + * Override of Bootstrap page.tpl.php. */ ?> -<header id="navbar" class="<?php print $nav_style; ?>" role="banner"> +<header id="navbar" class="<?php print $navbar_classes; ?>" role="banner"> <div class="navbar-inner"> - <div class="<?php print $container; ?>"> - <!-- .btn-navbar is used as the toggle for collapsed navbar content --> - <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - </a> - <?php if (!empty($secondary_nav) || !empty($page['top'])): ?> - <div id="top" class="row"> - <div class="<?php print $container; ?>"> - <?php print render($secondary_nav); ?> - <?php print render($page['top']); ?> - </div> + <div class="container"> + <div class="navbar-header"> + <?php if (!empty($logo)): ?> + <a class="logo pull-left" href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>"> + <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" /> + </a> + <?php endif; ?> + + <?php if (!empty($site_name)): ?> + <h1 id="site-name"> + <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" class="brand"><?php print $site_name; ?></a> + </h1> + <?php endif; ?> + <!-- .btn-navbar is used as the toggle for collapsed navbar content --> + <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </a> + <?php if (!empty($secondary_nav) || !empty($page['top'])): ?> + <div id="top" class="row"> + <div class="container"> + <?php print render($secondary_nav); ?> + <?php print render($page['top']); ?> + </div> + </div> + <?php endif; ?> </div> - <?php endif; ?> <div id="header"> - <div class="<?php print $container; ?>"> - <?php if (!empty($logo)): ?> - <a class="logo pull-left" href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>"> - <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" /> - </a> - <?php endif; ?> - - <?php if (!empty($site_name)): ?> - <h1 id="site-name"> - <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" class="brand"><?php print $site_name; ?></a> - </h1> - <?php endif; ?> + <div class="container"> <?php print render($page['header']); ?> + <?php if (!empty($page['yamm'])): ?> + <div class="navbar yamm"> + <a class="brand" href="#"> Yamm Megamenu </a> + <div class="nav-collapse" id="navyamm"> + <ul class="nav"> + <!-- Classic list --> + <?php print render($page['yamm']); ?> + </ul> + </div> + </div> + <?php endif; ?> <?php if (!empty($primary_nav) || !empty($page['navigation'])): ?> <div id="main-nav" class="<?php print $collapse; ?>"> <nav role="navigation"> @@ -61,18 +75,20 @@ </div> <?php endif; ?> -<div class="main-container <?php print $container; ?>"> +<div class="main-container container"> <header role="banner" id="page-header"> <?php if (!empty($site_slogan)): ?> <p class="lead"><?php print $site_slogan; ?></p> <?php endif; ?> + + <?php print render($page['header']); ?> </header> <!-- /#header --> - <div class="<?php print $row; ?>"> + <div class="row"> <?php if (!empty($page['preface'])): ?> - <div id="preface" class="<?php print $row; ?>"> + <div id="preface" class="row"> <?php print render($page['preface']); ?> </div> <!-- /#preface --> <?php endif; ?> @@ -109,7 +125,7 @@ <?php endif; ?> <?php if (!empty($page['content_top'])): ?> - <div id="page-top" class="<?php print $row; ?>"> + <div id="page-top" class="container"> <?php print render($page['content_top']); ?> </div> <!-- /#sidebar-second --> <?php endif; ?> @@ -121,7 +137,7 @@ <?php endif; ?> <?php if (!empty($page['content_bottom'])): ?> - <div id="page-bottom" class="<?php print $row; ?>"> + <div id="page-bottom" class="container"> <?php print render($page['content_bottom']); ?> </div> <!-- /#sidebar-second --> <?php endif; ?> @@ -135,19 +151,19 @@ <?php endif; ?> <?php if (!empty($page['postcript_top'])): ?> - <div id="postcript_top" class="<?php print $container; ?>"> + <div id="postcript_top" class="row"> <?php print render($page['postcript_top']); ?> </div> <!-- /#preface --> <?php endif; ?> <?php if (!empty($page['postcript_bottom'])): ?> - <div id="postcript_top" class="<?php print $row; ?>"> + <div id="postcript_bottom" class="row"> <?php print render($page['postcript_bottom']); ?> </div> <!-- /#preface --> <?php endif; ?> </div> - <footer class="footer <?php print $row; ?>"> + <footer class="footer container"> <?php print render($page['footer']); ?> </footer> </div> diff --git a/theme-settings.php b/theme-settings.php index 22afaaee8ebbbb79209cc36585152dad4070cc40..01fcd5546d72d1450f09ba1a9690de2c47b0df01 100644 --- a/theme-settings.php +++ b/theme-settings.php @@ -38,28 +38,12 @@ function bootstrap_barrio_form_system_theme_settings_alter(&$form, $form_state, '#default_value' => theme_get_setting('toggle_responsive'), '#description' => t('Insert meta viewport to make site responsive'), ); - $form['responsive']['nav_style'] = array( - '#type' => 'select', - '#title' => t('Header behaivor'), - '#default_value' => theme_get_setting('nav_style'), - '#options' => array( - 0 => t('Scroll with page'), - 1 => t('Fixed on top'), - ), - '#description' => t('Define the behaivor of the page header'), - ); $form['responsive']['collapse'] = array( '#type' => 'checkbox', '#title' => t('Collapse main menu'), '#default_value' => theme_get_setting('collapse'), '#description' => t('When responsive, make the main menu collapse.'), ); - $form['responsive']['fluid'] = array( - '#type' => 'checkbox', - '#title' => t('Makes layout fluid or fixed'), - '#default_value' => theme_get_setting('fluid'), - '#description' => t('The default state is fixed, if you check it will make fluid layout.'), - ); $form['span'] = array( '#type' => 'fieldset',