mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-05 00:43:53 +00:00
[help, system admin] redesigned 'side nav' for mobile
This commit is contained in:
@@ -907,6 +907,11 @@ textarea:-moz-placeholder {/* for FF */
|
|||||||
padding:0;
|
padding:0;
|
||||||
}
|
}
|
||||||
/**** side-tabnav ****/
|
/**** side-tabnav ****/
|
||||||
|
.logo-container {
|
||||||
|
padding: .5rem 1rem;
|
||||||
|
background: #f4f4f7;
|
||||||
|
border-bottom: 1px solid #e8e8e8;
|
||||||
|
}
|
||||||
.side-textnav .hd,
|
.side-textnav .hd,
|
||||||
.side-info .hd {
|
.side-info .hd {
|
||||||
padding-bottom:4px;
|
padding-bottom:4px;
|
||||||
@@ -915,13 +920,16 @@ textarea:-moz-placeholder {/* for FF */
|
|||||||
}
|
}
|
||||||
@media (max-width: 767px) {
|
@media (max-width: 767px) {
|
||||||
.side-nav {
|
.side-nav {
|
||||||
background: #f8f8f8;
|
background: #fff;
|
||||||
|
display:flex;
|
||||||
|
flex-direction:column;
|
||||||
width:300px;
|
width:300px;
|
||||||
|
max-width: calc(100% - 40px);
|
||||||
position:fixed;
|
position:fixed;
|
||||||
left:-300px;
|
left:-300px;
|
||||||
top:0;
|
top:0;
|
||||||
bottom:0;
|
bottom:0;
|
||||||
z-index:1;
|
z-index:1002;
|
||||||
box-shadow:0 0 4px #ccc;
|
box-shadow:0 0 4px #ccc;
|
||||||
-webkit-transition: all 0.3s ease;
|
-webkit-transition: all 0.3s ease;
|
||||||
-moz-transition: all 0.3s ease;
|
-moz-transition: all 0.3s ease;
|
||||||
@@ -932,7 +940,7 @@ textarea:-moz-placeholder {/* for FF */
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.side-nav {
|
.side-nav {
|
||||||
padding:20px;
|
padding:0;
|
||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
border-right:1px solid #eee;
|
border-right:1px solid #eee;
|
||||||
}
|
}
|
||||||
@@ -948,8 +956,13 @@ textarea:-moz-placeholder {/* for FF */
|
|||||||
border-right:1px solid #eee;
|
border-right:1px solid #eee;
|
||||||
}
|
}
|
||||||
.side-nav-con {
|
.side-nav-con {
|
||||||
overflow:hidden;
|
|
||||||
padding:20px;
|
padding:20px;
|
||||||
|
overflow:hidden;
|
||||||
|
}
|
||||||
|
@media (max-width: 767px) {
|
||||||
|
.side-nav-con {
|
||||||
|
overflow-y:auto;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.side-nav-con:hover {
|
.side-nav-con:hover {
|
||||||
overflow-y:auto;
|
overflow-y:auto;
|
||||||
|
@@ -1,27 +1,45 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block extra_style %}
|
||||||
|
<style type="text/css">
|
||||||
|
.side-nav-con .first-hd {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block main_class %}d-flex ovhd{% endblock %}
|
{% block main_class %}d-flex ovhd{% endblock %}
|
||||||
|
|
||||||
{% block main_content %}
|
{% block main_content %}
|
||||||
<div class="row flex-1 d-flex">
|
<div class="row flex-1 d-flex">
|
||||||
<div class="side-textnav col-md-3 side-nav">
|
<div class="side-textnav col-md-3 side-nav">
|
||||||
<a href="#" title="{% trans "Close" %}" aria-label="{% trans "Close" %}" class="sf2-icon-x1 sf-popover-close op-icon hidden-md-up js-close-side-nav fright"></a>
|
<div class="hidden-md-up logo-container">
|
||||||
<h3 class="hd">{% trans "Desktop Client and Syncing" %}</h3>
|
<a href="{{ SITE_ROOT }}">
|
||||||
<ul class="side-textnav-tabs">
|
{% if seacloud_mode %}
|
||||||
<li class="tab"><a href="{{ SITE_ROOT }}help/install/">{% trans "Install and sync Files" %}</a></li>
|
<img src="{{ MEDIA_URL }}img/seacloud_logo.png?t=1398068110" title="Seacloud" alt="logo" width="186" height="31" />
|
||||||
<li class="tab"><a href="{{ SITE_ROOT }}help/sync_existing/">{% trans "Syncing existing folders" %}</a></li>
|
{% else %}
|
||||||
<li class="tab"><a href="{{ SITE_ROOT }}help/selective_sync/">{% trans "Selective sync sub-folders" %}</a></li>
|
<img src="{{ MEDIA_URL }}{{ logo_path }}" title="{{ site_title }}" alt="logo" width="{{logo_width}}" height="{{logo_height}}" />
|
||||||
<li class="tab"><a href="{{ SITE_ROOT }}help/unsync_resync/">{% trans "Unsync and resync libraries" %}</a></li>
|
{% endif %}
|
||||||
<li class="tab"><a href="{{ SITE_ROOT }}help/sync_interval/">{% trans "Setting sync interval" %}</a></li>
|
</a>
|
||||||
<li class="tab"><a href="{{ SITE_ROOT }}help/desktop_proxy/">{% trans "Proxy settings" %}</a></li>
|
</div>
|
||||||
<li class="tab"><a href="{{ SITE_ROOT }}help/conflicts/">{% trans "File conflicts" %}</a></li>
|
<div class="side-nav-con">
|
||||||
<li class="tab"><a href="{{ SITE_ROOT }}help/ignore/">{% trans "Excluding files" %}</a></li>
|
<h3 class="hd first-hd">{% trans "Desktop Client and Syncing" %}</h3>
|
||||||
</ul>
|
<ul class="side-textnav-tabs">
|
||||||
<h3 class="hd">{% trans "Security and Encryption" %}</h3>
|
<li class="tab"><a href="{{ SITE_ROOT }}help/install/">{% trans "Install and sync Files" %}</a></li>
|
||||||
<ul class="side-textnav-tabs">
|
<li class="tab"><a href="{{ SITE_ROOT }}help/sync_existing/">{% trans "Syncing existing folders" %}</a></li>
|
||||||
<li class="tab"><a href="{{ SITE_ROOT }}help/encrypted_libraries/">{% trans "How to use encrypted libraries" %}</a></li>
|
<li class="tab"><a href="{{ SITE_ROOT }}help/selective_sync/">{% trans "Selective sync sub-folders" %}</a></li>
|
||||||
</ul>
|
<li class="tab"><a href="{{ SITE_ROOT }}help/unsync_resync/">{% trans "Unsync and resync libraries" %}</a></li>
|
||||||
|
<li class="tab"><a href="{{ SITE_ROOT }}help/sync_interval/">{% trans "Setting sync interval" %}</a></li>
|
||||||
|
<li class="tab"><a href="{{ SITE_ROOT }}help/desktop_proxy/">{% trans "Proxy settings" %}</a></li>
|
||||||
|
<li class="tab"><a href="{{ SITE_ROOT }}help/conflicts/">{% trans "File conflicts" %}</a></li>
|
||||||
|
<li class="tab"><a href="{{ SITE_ROOT }}help/ignore/">{% trans "Excluding files" %}</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3 class="hd">{% trans "Security and Encryption" %}</h3>
|
||||||
|
<ul class="side-textnav-tabs">
|
||||||
|
<li class="tab"><a href="{{ SITE_ROOT }}help/encrypted_libraries/">{% trans "How to use encrypted libraries" %}</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="help-con article col-md-9 ov-auto flex-1" id="right-panel">{% block help_con %}{% endblock %}</div>
|
<div class="help-con article col-md-9 ov-auto flex-1" id="right-panel">{% block help_con %}{% endblock %}</div>
|
||||||
|
@@ -239,17 +239,31 @@ $('#info-bar .close').on('click', function() {
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
if ($('.side-nav').length) {
|
if ($('.side-nav').length) {
|
||||||
$('#logo').addClass('hidden-sm-down');
|
$('#logo').addClass('hidden-sm-down');
|
||||||
$('#js-toggle-side-nav').removeClass('hide');
|
$('#js-toggle-side-nav').removeClass('hide');
|
||||||
}
|
}
|
||||||
$('#js-toggle-side-nav').on('click', function() {
|
$('#js-toggle-side-nav').on('click', function() {
|
||||||
$('.side-nav').addClass('side-nav-shown');
|
$('.side-nav').addClass('side-nav-shown');
|
||||||
|
$('').modal({
|
||||||
|
overlayClose: true,
|
||||||
|
onClose: function() {
|
||||||
|
$('.side-nav').removeClass('side-nav-shown');
|
||||||
|
$.modal.close();
|
||||||
|
}});
|
||||||
|
$('#simplemodal-container').css({'display':'none'});
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
$('.js-close-side-nav').on('click', function() {
|
$('.js-close-side-nav').on('click', function() {
|
||||||
$('.side-nav').removeClass('side-nav-shown');
|
$('.side-nav').removeClass('side-nav-shown');
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
$(window).on('resize', function() {
|
||||||
|
if ($(window).width() >= 768) {
|
||||||
|
$.modal.close();
|
||||||
|
} else {
|
||||||
|
$('.side-nav').removeClass('side-nav-shown');
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
{% block extra_script %}{% endblock %}
|
{% block extra_script %}{% endblock %}
|
||||||
</body>
|
</body>
|
||||||
|
@@ -1,7 +1,16 @@
|
|||||||
{% load avatar_tags i18n %}
|
{% load avatar_tags i18n %}
|
||||||
|
|
||||||
<script type="text/template" id="side-nav-tmpl">
|
<script type="text/template" id="side-nav-tmpl">
|
||||||
<a href="#" title="{% trans "Close" %}" aria-label="{% trans "Close" %}" class="sf2-icon-x1 sf-popover-close op-icon hidden-md-up js-close-side-nav fright"></a>
|
<div class="hidden-md-up logo-container">
|
||||||
|
<a href="{{ SITE_ROOT }}">
|
||||||
|
{% if seacloud_mode %}
|
||||||
|
<img src="{{ MEDIA_URL }}img/seacloud_logo.png?t=1398068110" title="Seacloud" alt="logo" width="186" height="31" />
|
||||||
|
{% else %}
|
||||||
|
<img src="{{ MEDIA_URL }}{{ logo_path }}" title="{{ site_title }}" alt="logo" width="{{logo_width}}" height="{{logo_height}}" />
|
||||||
|
{% endif %}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="side-nav-con">
|
||||||
<h3 class="hd">{% trans "System Admin" %}</h3>
|
<h3 class="hd">{% trans "System Admin" %}</h3>
|
||||||
<ul class="side-tabnav-tabs">
|
<ul class="side-tabnav-tabs">
|
||||||
|
|
||||||
@@ -137,6 +146,7 @@
|
|||||||
<input type="text" name="name" class="input" value="" placeholder="{% trans "Search groups by name..." %}" title="{% trans "Search groups by name..." %}" aria-label="{% trans "Search groups by name..." %}" />
|
<input type="text" name="name" class="input" value="" placeholder="{% trans "Search groups by name..." %}" title="{% trans "Search groups by name..." %}" aria-label="{% trans "Search groups by name..." %}" />
|
||||||
</form>
|
</form>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
</div>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/template" id="sysinfo-tmpl">
|
<script type="text/template" id="sysinfo-tmpl">
|
||||||
|
@@ -11,8 +11,17 @@
|
|||||||
{% block main_content %}
|
{% block main_content %}
|
||||||
<div class="row flex-1 d-flex">
|
<div class="row flex-1 d-flex">
|
||||||
<div id="side-nav" class="side-nav side-tabnav col-md-3">
|
<div id="side-nav" class="side-nav side-tabnav col-md-3">
|
||||||
<a href="#" title="{% trans "Close" %}" aria-label="{% trans "Close" %}" class="sf2-icon-x1 sf-popover-close op-icon hidden-md-up js-close-side-nav fright"></a>
|
<div class="hidden-md-up logo-container">
|
||||||
{% block left_panel %}
|
<a href="{{ SITE_ROOT }}">
|
||||||
|
{% if seacloud_mode %}
|
||||||
|
<img src="{{ MEDIA_URL }}img/seacloud_logo.png?t=1398068110" title="Seacloud" alt="logo" width="186" height="31" />
|
||||||
|
{% else %}
|
||||||
|
<img src="{{ MEDIA_URL }}{{ logo_path }}" title="{{ site_title }}" alt="logo" width="{{logo_width}}" height="{{logo_height}}" />
|
||||||
|
{% endif %}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="side-nav-con">
|
||||||
|
{% block left_panel %}
|
||||||
<h3 class="hd">{% trans "System Admin" %}</h3>
|
<h3 class="hd">{% trans "System Admin" %}</h3>
|
||||||
<ul class="side-tabnav-tabs">
|
<ul class="side-tabnav-tabs">
|
||||||
|
|
||||||
@@ -132,6 +141,7 @@
|
|||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="right-panel" class="col-md-9 ov-auto flex-1">
|
<div id="right-panel" class="col-md-9 ov-auto flex-1">
|
||||||
|
@@ -2,8 +2,9 @@ define([
|
|||||||
'jquery',
|
'jquery',
|
||||||
'underscore',
|
'underscore',
|
||||||
'backbone',
|
'backbone',
|
||||||
'common'
|
'common',
|
||||||
], function($, _, Backbone, Common) {
|
'simplemodal'
|
||||||
|
], function($, _, Backbone, Common, Simplemodal) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var sideNavView = Backbone.View.extend({
|
var sideNavView = Backbone.View.extend({
|
||||||
@@ -26,6 +27,8 @@ define([
|
|||||||
$(window).on('resize', function() {
|
$(window).on('resize', function() {
|
||||||
if ($(window).width() >= 768) {
|
if ($(window).width() >= 768) {
|
||||||
_this.show();
|
_this.show();
|
||||||
|
} else {
|
||||||
|
_this.hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -44,11 +47,25 @@ define([
|
|||||||
},
|
},
|
||||||
|
|
||||||
show: function() {
|
show: function() {
|
||||||
|
var _this = this;
|
||||||
this.$el.css({ 'left':'0px' });
|
this.$el.css({ 'left':'0px' });
|
||||||
|
if ($(window).width() < 768) {
|
||||||
|
$('').modal({
|
||||||
|
overlayClose: true,
|
||||||
|
onClose: function() {
|
||||||
|
_this.hide();
|
||||||
|
}});
|
||||||
|
$('#simplemodal-container').css({'display':'none'});
|
||||||
|
} else {
|
||||||
|
$.modal.close();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
hide: function() {
|
hide: function() {
|
||||||
this.$el.css({ 'left':'-300px' });
|
this.$el.css({ 'left':'-300px' });
|
||||||
|
if ($(window).width() < 768) {
|
||||||
|
$.modal.close();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
events: {
|
events: {
|
||||||
|
Reference in New Issue
Block a user