Skip to content

Commit 0e46106

Browse files
committed
correct the frontend and back end admin navbars display and back end widths
1 parent 6194ba2 commit 0e46106

11 files changed

Lines changed: 2058 additions & 147 deletions

Component/Menu/AdminMenuBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public function createAdminMenu(Request $request)
173173
'uri' => $editPath,
174174
)
175175
);
176-
$this->addIcon($menu['Edit'], array('icon' => 'pencil icon-white', 'append' => false));
176+
$this->addIcon($menu['Edit'], array('icon' => 'pencil', 'append' => false));
177177
}
178178

179179
if (!$sonataAdmin && $request->get('_route') != 'sonata_admin_dashboard') {

Resources/public/less/admin.less

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,12 +1034,6 @@ li.table-row-style .menu-item-link {
10341034
}
10351035
}
10361036

1037-
@media (max-width: 620px) {
1038-
.nav-admin {
1039-
display: none;
1040-
}
1041-
}
1042-
10431037

10441038
.navbar-inverse .navbar-btn {
10451039
background: initial;

Resources/public/less/icons.less

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.navbar-initcms{
2+
@import "fontawesome/font-awesome";
3+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//
2+
// Responsive: Tablet to desktop
3+
// --------------------------------------------------
4+
5+
6+
@media (min-width: 768px) and (max-width: 991px) {
7+
8+
// Fixed grid
9+
#grid > .core(@gridColumnWidth768, @gridGutterWidth768);
10+
11+
// Fluid grid
12+
#grid > .fluid(@fluidGridColumnWidth768, @fluidGridGutterWidth768);
13+
14+
// Input grid
15+
#grid > .input(@gridColumnWidth768, @gridGutterWidth768);
16+
17+
// No need to reset .thumbnails here since it's the same @gridGutterWidth
18+
19+
}
Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
//
2+
// Responsive: Landscape phone to desktop/tablet
3+
// --------------------------------------------------
4+
5+
6+
@media (max-width: 768px) {
7+
8+
// Padding to set content in a bit
9+
body {
10+
padding-left: 20px;
11+
padding-right: 20px;
12+
}
13+
// Negative indent the now static "fixed" navbar
14+
.navbar-fixed-top,
15+
.navbar-fixed-bottom,
16+
.navbar-static-top {
17+
margin-left: -20px;
18+
margin-right: -20px;
19+
}
20+
// Remove padding on container given explicit padding set on body
21+
.container-fluid {
22+
padding: 0;
23+
}
24+
25+
// TYPOGRAPHY
26+
// ----------
27+
// Reset horizontal dl
28+
.dl-horizontal {
29+
dt {
30+
float: none;
31+
clear: none;
32+
width: auto;
33+
text-align: left;
34+
}
35+
dd {
36+
margin-left: 0;
37+
}
38+
}
39+
40+
// GRID & CONTAINERS
41+
// -----------------
42+
// Remove width from containers
43+
.container {
44+
width: auto;
45+
}
46+
// Fluid rows
47+
.row-fluid {
48+
width: 100%;
49+
}
50+
// Undo negative margin on rows and thumbnails
51+
.row,
52+
.thumbnails {
53+
margin-left: 0;
54+
}
55+
.thumbnails > li {
56+
float: none;
57+
margin-left: 0; // Reset the default margin for all li elements when no .span* classes are present
58+
}
59+
// Make all grid-sized elements block level again
60+
[class*="span"],
61+
.uneditable-input[class*="span"], // Makes uneditable inputs full-width when using grid sizing
62+
.row-fluid [class*="span"] {
63+
float: none;
64+
display: block;
65+
width: 100%;
66+
margin-left: 0;
67+
.box-sizing(border-box);
68+
}
69+
.span12,
70+
.row-fluid .span12 {
71+
width: 100%;
72+
.box-sizing(border-box);
73+
}
74+
.row-fluid [class*="offset"]:first-child {
75+
margin-left: 0;
76+
}
77+
78+
// FORM FIELDS
79+
// -----------
80+
// Make span* classes full width
81+
.input-large,
82+
.input-xlarge,
83+
.input-xxlarge,
84+
input[class*="span"],
85+
select[class*="span"],
86+
textarea[class*="span"],
87+
.uneditable-input {
88+
.input-block-level();
89+
}
90+
// But don't let it screw up prepend/append inputs
91+
.input-prepend input,
92+
.input-append input,
93+
.input-prepend input[class*="span"],
94+
.input-append input[class*="span"] {
95+
display: inline-block; // redeclare so they don't wrap to new lines
96+
width: auto;
97+
}
98+
.controls-row [class*="span"] + [class*="span"] {
99+
margin-left: 0;
100+
}
101+
102+
// Modals
103+
.modal {
104+
position: fixed;
105+
top: 20px;
106+
left: 20px;
107+
right: 20px;
108+
width: auto;
109+
margin: 0;
110+
&.fade { top: -100px; }
111+
&.fade.in { top: 20px; }
112+
}
113+
114+
}
115+
116+
117+
118+
// UP TO LANDSCAPE PHONE
119+
// ---------------------
120+
121+
@media (max-width: 480px) {
122+
123+
// Smooth out the collapsing/expanding nav
124+
.nav-collapse {
125+
-webkit-transform: translate3d(0, 0, 0); // activate the GPU
126+
}
127+
128+
// Block level the page header small tag for readability
129+
.page-header h1 small {
130+
display: block;
131+
line-height: @baseLineHeight;
132+
}
133+
134+
// Update checkboxes for iOS
135+
input[type="checkbox"],
136+
input[type="radio"] {
137+
border: 1px solid #ccc;
138+
}
139+
140+
// Remove the horizontal form styles
141+
.form-horizontal {
142+
.control-label {
143+
float: none;
144+
width: auto;
145+
padding-top: 0;
146+
text-align: left;
147+
}
148+
// Move over all input controls and content
149+
.controls {
150+
margin-left: 0;
151+
}
152+
// Move the options list down to align with labels
153+
.control-list {
154+
padding-top: 0; // has to be padding because margin collaspes
155+
}
156+
// Move over buttons in .form-actions to align with .controls
157+
.form-actions {
158+
padding-left: 10px;
159+
padding-right: 10px;
160+
}
161+
}
162+
163+
// Medias
164+
// Reset float and spacing to stack
165+
.media .pull-left,
166+
.media .pull-right {
167+
float: none;
168+
display: block;
169+
margin-bottom: 10px;
170+
}
171+
// Remove side margins since we stack instead of indent
172+
.media-object {
173+
margin-right: 0;
174+
margin-left: 0;
175+
}
176+
177+
// Modals
178+
.modal {
179+
top: 10px;
180+
left: 10px;
181+
right: 10px;
182+
}
183+
.modal-header .close {
184+
padding: 10px;
185+
margin: -10px;
186+
}
187+
188+
// Carousel
189+
.carousel-caption {
190+
position: static;
191+
}
192+
193+
}

Resources/public/less/responsive.less

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@
3434
// Large desktops
3535
@import "../../../../../../../twbs/bootstrap/less/responsive-1200px-min.less";
3636

37-
// Tablets to regular desktops
38-
@import "../../../../../../../twbs/bootstrap/less/responsive-768px-979px.less";
37+
//// Tablets to regular desktops
38+
@import "responsive-768px-979px.less";
3939

4040
// Phones to portrait tablets and narrow desktops
41-
@import "../../../../../../../twbs/bootstrap/less/responsive-767px-max.less";
41+
@import "responsive-767px-max.less";
4242

4343

4444
// RESPONSIVE NAVBAR

Resources/public/less/variables.less

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178

179179
// Navbar
180180
// -------------------------
181-
@navbarCollapseWidth: 979px;
181+
@navbarCollapseWidth: 768px;
182182
@navbarCollapseDesktopWidth: @navbarCollapseWidth + 1;
183183

184184
@navbarHeight: 40px;
@@ -284,7 +284,7 @@
284284

285285
// 768px-979px
286286
@gridColumnWidth768: 42px;
287-
@gridGutterWidth768: 20px;
287+
@gridGutterWidth768: 10px;
288288
@gridRowWidth768: (@gridColumns * @gridColumnWidth768) + (@gridGutterWidth768 * (@gridColumns - 1));
289289

290290

@@ -299,4 +299,5 @@
299299

300300
// 768px-979px
301301
@fluidGridColumnWidth768: percentage(@gridColumnWidth768/@gridRowWidth768);
302-
@fluidGridGutterWidth768: percentage(@gridGutterWidth768/@gridRowWidth768);
302+
@fluidGridGutterWidth768: percentage(@gridGutterWidth768/@gridRowWidth768);
303+
//@fluidGridGutterWidth768: percentage(@gridGutterWidth768/@gridRowWidth768);

Resources/views/Admin/esi_admin_navbar.html.twig

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,28 @@
55
<div class="initnavbar initnavbar-fixed-top navbar-initcms initnavbar-inverse">
66
<div class="initnavbar-inner">
77
<div class="container">
8-
<div class="row">
9-
<div class="span6">
10-
<div class="pull-left">
11-
<a href="{{ url('sonata_admin_dashboard') }}" class="pull-left">
12-
<img id="initcms-logo" src="{{ asset('bundles/networkinginitcms/img/logo_initcms.png') }}" width="77">
13-
</a>
14-
{% if admin_pool is defined %}
15-
<a href="{{ url('sonata_admin_dashboard') }}" class="brand">
16-
{{ admin_pool.title }}
17-
</a>
18-
{% endif %}
19-
</div>
20-
<div class="pull-right">
21-
{% if admin_pool is defined %}
22-
{% include admin_pool.getTemplate('user_block') %}
23-
{% endif %}
24-
</div>
25-
</div>
26-
<div class="span6">
27-
{% if admin_pool is defined %}
28-
{{ knp_menu_render('AdminMenu',
29-
{'currentClass': 'active',
30-
'ancestorClass': 'active',
31-
'allow_safe_labels': true
32-
}) }}
33-
{% endif %}
34-
</div>
8+
<div class="pull-left">
9+
<a href="{{ url('sonata_admin_dashboard') }}" class="pull-left">
10+
<img id="initcms-logo" src="{{ asset('bundles/networkinginitcms/img/logo_initcms.png') }}"
11+
width="77">
12+
</a>
13+
{% if admin_pool is defined %}
14+
<a href="{{ url('sonata_admin_dashboard') }}" class="brand">
15+
{{ admin_pool.title }}
16+
</a>
17+
{% endif %}
18+
</div>
19+
<div class="pull-right nav-admin">
20+
{% if admin_pool is defined %}
21+
{% include admin_pool.getTemplate('user_block') %}
22+
{% endif %}
23+
{% if admin_pool is defined %}
24+
{{ knp_menu_render('AdminMenu',
25+
{'currentClass': 'active',
26+
'ancestorClass': 'active',
27+
'allow_safe_labels': true
28+
}) }}
29+
{% endif %}
3530
</div>
3631
</div>
3732
</div>

0 commit comments

Comments
 (0)