Project

General

Profile

Feature #21808 » 0001-Make-sidebar-collapsible-r15348.patch

Re-based on top of r15348 - Daniel Ritz, 2016-04-23 18:33

View differences:

app/views/layouts/base.html.erb
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" />
<meta property="rails-url-root" content="<%= Redmine::Utils.relative_url_root.presence || "/" %>" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.11.0', 'application', 'responsive', :media => 'all' %>
......
</div>
<div id="main" class="<%= sidebar_content? ? '' : 'nosidebar' %>">
<div id="sidebar">
<div id="sidebar" class="<%= cookies['sidebar_collapse'] == 'true' ? 'hidden' : '' %>">
<a id="sidebar-toggle" href="#"></a>
<div class="sidebar-wrapper">
<%= yield :sidebar %>
<%= view_layouts_base_sidebar_hook_response %>
</div>
</div>
<div id="content">
public/javascripts/application.js
$(document).ready(addFormObserversForDoubleSubmit);
$(document).ready(defaultFocus);
$(document).ready(setupTabs);
$(document).ready(function () {
$('#sidebar-toggle').click(function () {
$('#sidebar').toggleClass('hidden');
document.cookie = 'sidebar_collapse=' + $('#sidebar').hasClass('hidden') +
'; path=' + $('meta[property="rails-url-root"]').attr('content');
return false;
});
});
public/stylesheets/application.css
#main {background-color:#EEEEEE;}
#sidebar{ float: right; width: 22%; position: relative; z-index: 9; padding: 0; margin: 0;}
#sidebar{
position: relative;
float: right;
width: 22%;
z-index: 9;
padding: 0 0 0 16px;
transition-duration: 0.5s;
margin: 0;
}
#sidebar .sidebar-wrapper {
padding-left: 10px;
transition-duration: 0;
}
* html #sidebar{ width: 22%; }
#sidebar h3{ font-size: 14px; margin-top:14px; color: #666; }
#sidebar hr{ width: 100%; margin: 0 auto; height: 1px; background: #ccc; border: 0; }
......
#sidebar .contextual { margin-right: 1em; }
#sidebar ul, ul.flat {margin: 0; padding: 0;}
#sidebar ul li, ul.flat li {list-style-type:none;margin: 0px 2px 0px 0px; padding: 0px 0px 0px 0px;}
#sidebar.hidden { margin-right: -22%; }
#sidebar a#sidebar-toggle {
position: absolute;
top: 0;
left: -6px;
width: 20px;
height: 30px;
font-size: 1em;
font-weight: bold;
border: 1px solid #ccc;
border-radius: 0 0 3px 3px;
background: #eee url(../images/bullet_arrow_right.png) no-repeat 50% 50%;
}
#sidebar a#sidebar-toggle:focus {
outline: 0;
}
#sidebar.hidden a#sidebar-toggle {
background: #eee url(../images/bullet_arrow_left.png) no-repeat 50% 50%;
}
#sidebar a#sidebar-toggle:hover {
background-color: #f5f5f5;
}
#content { width: 75%; background-color: #fff; margin: 0px; border-right: 1px solid #ddd; padding: 6px 10px 10px 10px; z-index: 10; }
#content { overflow: hidden; background-color: #fff; margin: 0px; border-right: 1px solid #ddd; padding: 6px 10px 10px 10px; z-index: 10; }
* html #content{ width: 75%; padding-left: 0; margin-top: 0px; padding: 6px 10px 10px 10px;}
html>body #content { min-height: 600px; }
* html body #content { height: 600px; } /* IE */
public/themes/alternate/stylesheets/application.css
#content, #main.nosidebar #content { background: #fff; border-right: 1px solid #bbb; border-bottom: 1px solid #bbb; border-left: 1px solid #d7d7d7; border-top: 1px solid #d7d7d7; }
#footer { background-color:#EEEEEE; border: 0px; }
#sidebar.hidden .sidebar-wrapper { padding-left: 15px; }
/* Headers */
h2, h3, h4, .wiki h1, .wiki h2, .wiki h3 {border-bottom: 0px;}
public/themes/classic/stylesheets/application.css
#content { background: #fff; }
#content .tabs ul { bottom:-1px; }
#sidebar.hidden .sidebar-wrapper { padding-left: 15px; }
h2, h3, h4, .wiki h1, .wiki h2, .wiki h3 { border-bottom: 0px; color:#606060; font-family: Trebuchet MS,Georgia,"Times New Roman",serif; }
h2, .wiki h1 { letter-spacing:-1px; }
h4 { border-bottom: dotted 1px #c0c0c0; }
(4-4/22)