1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-07-31 22:57:47 +00:00

Merge pull request #1060 from haiwen/clean-css

Clean code
This commit is contained in:
llj 2016-03-21 21:01:18 +08:00
commit cb1224233f
9 changed files with 25 additions and 280 deletions

View File

@ -9,8 +9,7 @@
#view-hd,
#shared-file-view-hd,
#view-path-op,
#file-op,
#sf-commit-op {
#file-op {
width:950px;
margin:0 auto;
}
@ -44,7 +43,6 @@
border:1px solid #ededed;
margin-top:12px;
}
#sf,
#md-view,
.CodeMirror,
#file-view-tip {
@ -52,7 +50,6 @@
margin:0 auto;
box-shadow:0 0 6px #ccc;
}
#sf,
#md-view {
min-height:400px;
}

View File

@ -1085,7 +1085,6 @@ textarea:-moz-placeholder {/* for FF */
.article p {
margin:0.8em 0;
}
#md-edit-help ul,
.article ul {
list-style-type:disc;
padding-left:2em;
@ -1408,8 +1407,7 @@ textarea:-moz-placeholder {/* for FF */
#notice-popup a {
font-weight:normal;
}
#notice-popup .close,
#discuss-to-group .close {
#notice-popup .close {
position:absolute;
top:.5em;
right:10px;
@ -1482,15 +1480,13 @@ textarea:-moz-placeholder {/* for FF */
white-space:nowrap;
z-index:10; /* for shared dir grid view */
}
#lang-context-selector a,
#to-group a {
#lang-context-selector a {
color:#000;
display:block;
padding:1px 5px;
font-weight:normal;
}
#lang-context-selector a:hover,
#to-group a:hover {
#lang-context-selector a:hover {
background:#eee;
text-decoration:none;
}
@ -1619,22 +1615,6 @@ textarea:-moz-placeholder {/* for FF */
margin:3px 0 0;
}
/*myhome*/
.home-profile .pic {
margin-left:9px;
}
.home-profile .txt {
width:135px;
}
.home-profile .a {
font-weight:normal;
color:#999;
font-size:12px;
display:inline-block;
margin-top:5px;
}
.home-profile .a:hover {
color:#333;
}
#quota-bar {
display:block;
height:1em;
@ -1673,16 +1653,14 @@ textarea:-moz-placeholder {/* for FF */
#repo-create-form .checkbox-label { /* for "Encrypt" */
margin:10px 0 0;
}
.activity-group-hd,
.event-group-hd {
.activity-group-hd {
padding: 8px;
color: #444;
font-size:16px;
border-bottom: 1px solid #e5e5e5;
margin:0;
}
.activity-group-bd,
.event-group-bd {
.activity-group-bd {
list-style-type: none;
font-size:15px;
line-height:21px;
@ -1740,8 +1718,7 @@ textarea:-moz-placeholder {/* for FF */
margin-top: -20px;
}
/* avatar */
.avatar-op .avatar,
.home-profile .avatar {
.avatar-op .avatar {
border-radius: 4px;
-moz-border-radius: 4px;
}
@ -1929,15 +1906,7 @@ textarea:-moz-placeholder {/* for FF */
display:inline;
margin-right:5px;
}
.displayed-op .dir-download,
.displayed-op .file-download {
margin-right:5px;
}
.displayed-op .op:hover {
text-decoration:none;
}
.audit-item .audit-select-hidden,
.repo-file-list .hidden-op {
.audit-item .audit-select-hidden {
position:absolute;
background:#fff;
padding:6px 1px;
@ -1945,14 +1914,10 @@ textarea:-moz-placeholder {/* for FF */
border-radius:5px;
z-index:10;
}
.audit-select-hidden li a,
.hidden-op a {
.audit-select-hidden li a {
display:block;
padding:0 12px;
}
.hidden-op a:hover {
background: #eee;
}
.file-choose-form {
width:500px;
padding:10px 20px;
@ -2019,18 +1984,6 @@ textarea:-moz-placeholder {/* for FF */
color:#666;
margin-left:5px;
}
#dirents-op {
position:fixed;
}
#dirents-op .op-icon-btn {
display:block;
margin-bottom:6px;
}
#dirents-op .op-icon-btn .icon-trash {
display:inline-block;
width:14px;
text-align:center;
}
.lsch,
.lsch-encrypted,
.file-diff {
@ -2287,12 +2240,6 @@ textarea:-moz-placeholder {/* for FF */
#repo-transfer-form .op-target {
max-width:200px;
}
/* group-join-form */
/* group-join-form */
#id_group_join_msg {
width:260px;
height:80px;
}
/* group, org */
.user-list {
margin-top:30px;
@ -2322,29 +2269,11 @@ textarea:-moz-placeholder {/* for FF */
.member .name {
vertical-align:middle;
}
.grp-profile {
margin-top:2px;
}
.grp-profile .name {
font-size:16px;
font-weight:bold;
margin:0 6px;
}
.grp-profile .avatar,
.grp-profile .name {
vertical-align:middle;
}
#grp-member-add {
margin-top:2px;
}
/* notification admin */
.cur-note { color: red; font-size: 75%; }
/* group message and replies */
#grp-repos-commits td {
padding:6px 3px;
}
.msg-panel {
width:640px;
margin-top:10px;
@ -2599,7 +2528,6 @@ textarea:-moz-placeholder {/* for FF */
background-position:0 -207px;
}
#user-avatar-input,
#grp-avatar-input,
#upload-file-form .files-add input {
cursor:pointer;
position: absolute;
@ -2608,8 +2536,7 @@ textarea:-moz-placeholder {/* for FF */
opacity: 0;
filter: alpha(opacity=0);
}
#user-avatar-input,
#grp-avatar-input {
#user-avatar-input {
right:0;
}
#upload-file-form .MultiFile-label {
@ -2798,18 +2725,9 @@ textarea:-moz-placeholder {/* for FF */
#file-edit-cancel {
vertical-align:middle; /* for ie 7 */
}
#sf {
width:624px;
/*font-size:15px;*/
font-size:medium;
background:#fff;
}
#sf, #md-view {
#md-view {
padding:40px 96px;
}
#md-edit-help {
width:550px;
}
/* for repo, file_view page. */
#side-toolbar {
position:fixed;
@ -2851,87 +2769,6 @@ textarea:-moz-placeholder {/* for FF */
border:1px solid #ddd;
border-radius:2px;
}
#to-group,
#discuss-to-group {
width:400px;
padding:0 15px;
position:fixed;
right:0;
border-radius:5px 0 0 5px;
background:#fff;
border:1px solid #cbcbcb;
box-shadow: 0 2px 4px rgba(0,0,0,.2);
-moz-box-shadow: -1px 1px 1px rgba(0,0,0,.2);
-webkit-box-shadow: 0 2px 4px rgba(0,0,0,.2);
}
#discuss-to-group {
padding-bottom:10px;
}
#discussions-to-grp {
height:auto;
overflow:auto;
position:relative;/*for ie7*/
}
#discussions-to-grp .msg {
width:380px;
}
#discussions-to-grp .msg-main {
width:282px;/*for ie7*/
}
#discussions-to-grp .reply-input {
width:270px;
}
#to-group,
#discuss-to-group {
z-index:12; /* to be on top of 'fixed-hd' in repo.html*/
}
/*to-group*/
#to-group {
width:auto;
min-width:250px;
padding:0 12px 10px;
right:78px;
}
#to-group .outer-caret {
position:absolute;
top: 15px;
right: -15px;
}
#to-group .outer-caret,
#to-group .inner-caret {
border-color:transparent #cbcbcb;
border-right-width:0;
}
#to-group .inner-caret {
border-left-color:#fff;
top:-15px;
left:-16px;
}
#to-group ul {
padding-left: 20px;
list-style-type: disc;
}
#to-group a {
padding:1px 3px;
}
/*discuss to group*/
#discuss-to-group-form .checkbox-label {
display:inline-block;
white-space:nowrap;
padding-right:3px;
margin-right:10px;
margin-top:0;
}
#discuss-to-group-form .input {
padding:5px;
width:388px;
height:5em;
resize:none;
vertical-align:top;
}
#discuss-to-group-form .attachment {
margin-left:5px;
}
/* text file diff */
.file-modification-hd .modifier,
.file-modification-hd .time {
@ -2986,29 +2823,6 @@ textarea:-moz-placeholder {/* for FF */
.diff-chg {
color: #c3f;
}
.pubinfo-item {
display:inline-block;
min-width:66px;
}
.pubinfo-item {
*display:inline;
}
.ru .pubinfo-item {
min-width:64px;
}
.de .pubinfo-item {
min-width:63px;
}
.pubinfo-item .amount {
font-size:28px;
line-height:1;
font-weight:bold;
color:#222;
}
.pubinfo-item .obj {
font-size:11px;
color:#999;
}
.video-container {
margin: auto;
width: 800px;
@ -3295,6 +3109,8 @@ textarea:-moz-placeholder {/* for FF */
color:#f93;
text-decoration:underline;
}
/* client list */
.client-list .lib-num {
cursor:pointer;
}
@ -3321,14 +3137,6 @@ textarea:-moz-placeholder {/* for FF */
#set-quota-form {
min-width:255px;
}
/* lib setting */
.lib-setting .input,
.lib-setting .textarea {
width:320px;
}
.lib-setting .form {
margin-bottom:30px;
}
/* org reg */
#org-url {
@ -3629,10 +3437,6 @@ textarea:-moz-placeholder {/* for FF */
#user-profile .nickname {
font-size: 18px;
}
#user-profile .intro {
color: #888;
padding-top: 0;
}
#user-profile .info {
border-top: 1px solid #eee;
}

View File

@ -10,7 +10,7 @@ from seahub.options.models import UserOptions, CryptoOptionNotSetError
from seahub.base.sudo_mode import sudo_mode_check
from seahub.utils import render_error
from django.utils.translation import ugettext as _
from seahub.settings import FORCE_SERVER_CRYPTO, ENABLE_SUDO_MODE
from seahub.settings import ENABLE_SUDO_MODE
def sys_staff_required(func):
"""
@ -65,7 +65,6 @@ def repo_passwd_set_required(func):
return render_to_response('decrypt_repo_form.html', {
'repo': repo,
'next': request.get_full_path(),
'force_server_crypto': FORCE_SERVER_CRYPTO,
}, context_instance=RequestContext(request))
if repo.enc_version == 2 and not server_crypto:

View File

@ -10,12 +10,6 @@
<li class="tab"><a href="#user-basic-info">{% trans "Profile" %}</a></li>
<li class="tab"><a href="#lang-setting">{% trans "Language" %}</a></li>
{% if user.permissions.can_add_repo %}
{% if not force_server_crypto %}
<li class="tab"><a href="#enc-lib-setting">{% trans "Encrypted Libraries" %}</a></li>
{% endif %}
{% if not is_pro %}
<li class="tab"><a href="#sub-lib-setting">{% trans "Sub-library" %}</a></li>
{% endif %}
<li class="tab"><a href="#default-lib">{% trans "Default Library" %}</a></li>
{% endif %}
<li class="tab"><a href="#del-account">{% trans "Delete Account" %}</a></li>
@ -87,34 +81,6 @@
{% if user.permissions.can_add_repo %}
{% if not force_server_crypto %}
<div class="setting-item" id="enc-lib-setting">
<h3>{% trans "Encrypted Libraries Setting" %}</h3>
<form method="post" action="{% url 'options_save' %}">{% csrf_token %}
<label>{% trans "How to view encrypted libraries online:"%}</label><br />
<input type="radio" name="repo-enc" value="server-crypto" {% if server_crypto %}checked="checked"{% endif %} class="vam" />
<span class="vam bold">{% trans "Send passwords to the server." %}</span> <span class="vam">{% trans "Files will be decrypted in the server before being sent to you." %}</span><br />
<input type="radio" name="repo-enc" value="client-crypto" {% if not server_crypto %}checked="checked"{% endif %} class="vam" />
<span class="vam bold">{% trans "Save passwords in your browser." %}</span> <span class="vam">{% trans "Files will be decrypted in your browser when you download them." %}</span>
<p>{% trans "Tip: the latter way is more secure, but it is not supported well by all browsers. We advise you to use the latest version of Chrome or Firefox." %}</p>
<input type="submit" value="{% trans "Submit" %}" class="submit" />
</form>
</div>
{% endif %}
{% if not is_pro %}
<div class="setting-item" id="sub-lib-setting">
<h3>{% trans "Sub-library Setting" %}</h3>
<form method="post" action="{% url 'sub_lib_enable_set' %}">{% csrf_token %}
<input type="checkbox" name="enable-sub-lib" class="vam" {% if sub_lib_enabled %}checked="checked"{% endif %} /> <span class="vam">{% trans "Enable sub-library" %}</span>
<p>{% trans "This feature enables you to selectively sync a folder inside a library. A sub-library can be created from any folder. After being created, it will be listed in your desktop client, and you can download it just like downloading a normal library. It will be automatically kept in sync with its origin library." %}</p>
<p>{% trans "Sub-library is also used when sharing a folder to a group or another user. Without this option on, a hidden sub-library will be created automatically in such case. With this option on, those hidden sub-libraries will also be listed, which enables you to manage them." %}</p>
<input type="submit" value="{% trans "Submit" %}" class="submit" />
</form>
</div>
{% endif %}
<div class="setting-item" id="default-lib">
<h3>{% trans "Default Library Setting" %}</h3>
{% if default_repo %}

View File

@ -116,9 +116,6 @@
</div>
<div id="main" class="clear">
<div id="title-panel" class="w100 ovhd">
{% block title_panel %}{% endblock %}
</div>
<div id="left-panel">
{% block left_panel %}{% endblock %}
</div>

View File

@ -10,11 +10,6 @@
<input type="password" name="password" autofocus />
<input type="submit" value="{% trans "Submit" %}" />
<p class="error hide"></p>
{% if not force_server_crypto %}
{% url 'edit_profile' as profile_edit_url %}
<p class="tip" style="margin-top:3em;">{% blocktrans %}You can change how to view encrypted libraries online <a class="normal" href="{{ profile_edit_url }}#enc-lib-setting">here</a>.{% endblocktrans %}</p>
{% endif %}
</form>
</div>
{% endblock %}

View File

@ -207,7 +207,7 @@
</div>
<% if (dirent.perm == 'rw') { %>
<span class="more-op-icon sf2-icon-caret-down op-icon" title="{% trans "More operations" %}"></span>
<ul class="hidden-op dirent-hidden-op hide">
<ul class="hidden-op dirent-hidden-op hide dropdown-menu">
<li><a class="op rename" href="#">{% trans "Rename" %}</a></li>
<li><a class="op mv" href="#">{% trans "Move" %}</a></li>
<li><a class="op cp" href="#">{% trans "Copy" %}</a></li>
@ -218,7 +218,7 @@
</ul>
<% } else if (dirent.perm == 'r' && !repo_encrypted) { %>
<span class="more-op-icon sf2-icon-caret-down op-icon" title="{% trans "More operations" %}"></span>
<ul class="hidden-op hide">
<ul class="hidden-op dirent-hidden-op hide dropdown-menu">
<li><a class="op cp" href="#">{% trans "Copy" %}</a></li>
</ul>
<% } %>
@ -286,7 +286,7 @@
</div>
<% if (dirent.perm == 'rw') { %>
<span class="more-op-icon sf2-icon-caret-down op-icon" title="{% trans "More Operations"%}"></span>
<ul class="hidden-op dirent-hidden-op hide">
<ul class="hidden-op dirent-hidden-op hide dropdown-menu">
<li><a class="op rename" href="#">{% trans "Rename" %}</a></li>
<li><a class="op mv" href="#">{% trans "Move" %}</a></li>
<li><a class="op cp" href="#">{% trans "Copy" %}</a></li>
@ -308,7 +308,7 @@
</ul>
<% } else if (dirent.perm == 'r' && !repo_encrypted) { %>
<span class="more-op-icon sf2-icon-caret-down op-icon" title="{% trans "More operations" %}"></span>
<ul class="hidden-op hide">
<ul class="hidden-op dirent-hidden-op hide dropdown-menu">
<li><a class="op cp" href="#">{% trans "Copy" %}</a></li>
</ul>
<% } %>

View File

@ -24,8 +24,8 @@ from seahub.views import gen_path_link, get_repo_dirents, \
from seahub.utils import gen_file_upload_url, gen_dir_share_link, \
gen_shared_upload_link, user_traffic_over_limit, render_error, \
get_file_type_and_ext
from seahub.settings import FORCE_SERVER_CRYPTO, \
ENABLE_UPLOAD_FOLDER, ENABLE_RESUMABLE_FILEUPLOAD, ENABLE_THUMBNAIL, \
from seahub.settings import ENABLE_UPLOAD_FOLDER, \
ENABLE_RESUMABLE_FILEUPLOAD, ENABLE_THUMBNAIL, \
THUMBNAIL_ROOT, THUMBNAIL_DEFAULT_SIZE, THUMBNAIL_SIZE_FOR_GRID
from seahub.utils import gen_file_get_url
from seahub.utils.file_types import IMAGE
@ -145,7 +145,6 @@ def repo_history_view(request, repo_id):
return render_to_response('decrypt_repo_form.html', {
'repo': repo,
'next': get_next_url_from_request(request) or reverse("view_common_lib_dir", args=[repo_id, '']),
'force_server_crypto': FORCE_SERVER_CRYPTO,
}, context_instance=RequestContext(request))
commit_id = request.GET.get('commit_id', None)

View File

@ -17,18 +17,6 @@
padding-left:30px;
width:120px;
}
.repo-file-list .hidden-op {
min-width: 100px;
white-space:nowrap;
}
.hidden-op a {
color:#444;
}
.hidden-op a:hover {
color:#fff;
text-decoration:none;
background:#feaa7c;
}
/* custom select2 */
.select2-container-multi .select2-choices {
border-color: #ddd;