1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-10-20 18:32:41 +00:00

new dir/file icon

This commit is contained in:
lian
2015-03-20 11:52:04 +08:00
committed by Daniel Pan
parent 8ba4fe28c9
commit 6aecc53750
10 changed files with 83 additions and 130 deletions

View File

@@ -1877,6 +1877,7 @@ textarea:-moz-placeholder {/* for FF */
border:1px solid #eee;
border-radius:5px;
z-index:10;
width:100px;
}
.audit-select-hidden li a,
.hidden-op a {

BIN
media/img/delete-orange.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 B

BIN
media/img/share-orange.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

View File

@@ -138,21 +138,10 @@ define([
popup = this.$('.hidden-op');
if (popup.hasClass('hide')) { // the popup is not shown
if (icon.position().left + icon.width() + popup.outerWidth() < icon.parent().width()) {
popup.css({'left': icon.position().left + icon.width() + 5});
if (icon.offset().top + popup.height() <= $('#main').offset().top + $('#main').height()) {
popup.css('top', 6);
} else {
popup.css('bottom', 2);
}
} else {
popup.css({'right':0});
if (icon.offset().top + popup.height() <= $('#main').offset().top + $('#main').height()) {
popup.css('top', icon.position().top + icon.height() + 6);
} else {
popup.css('bottom', icon.position().top + icon.height() + 3);
}
if (icon.offset().top + popup.height() > $('#main').offset().top + $('#main').height()) {
popup.css('bottom', 20);
}
popup.css({'left': icon.position().left});
popup.removeClass('hide');
app.globalState.noFileOpPopup = false;
app.globalState.popup_tr = icon.parents('tr');

View File

@@ -144,30 +144,7 @@
<button class="simplemodal-close">{% trans 'Cancel' %}</button>
</form>
<div id="dir-view" class="hide">
<div class="repo-file-list-topbar">
<p class="path"></p>
<div class="repo-op"></div>
</div>
<table class="repo-file-list">
<thead>
<tr>
<th class="select">
<span class="checkbox"><input type="checkbox" class="checkbox-orig" /></span>
</th>
<th class="star"></th>
<th class="dirent-icon"></th>
<th><span class="dirent-name">{% trans "Name"%} <span id="by-name" class="icon-caret-up cspt"></span></span></th>
<th class="dirent-size">{% trans "Size"%}</th>
<th class="dirent-update">{% trans "Last Update" %} <span id="by-time" class="icon-caret-down cspt"></span></th>
<th class="dirent-op">{% trans "Operations"%}</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<img class="loading-tip" src="{{MEDIA_URL}}img/loading-icon.gif" alt="{% trans 'Loading...' %}" />
</div>
{% include "js/dir-view.html" %}
{% endblock %}

View File

@@ -0,0 +1,26 @@
{% load i18n %}
<div id="dir-view" class="hide">
<div class="repo-file-list-topbar">
<p class="path"></p>
<div class="repo-op"></div>
</div>
<table class="repo-file-list">
<thead>
<tr>
<th class="select">
<span class="checkbox"><input type="checkbox" class="checkbox-orig" /></span>
</th>
<th class="star"></th>
<th class="dirent-icon"></th>
<th><span class="dirent-name">{% trans "Name"%} <span id="by-name" class="icon-caret-up cspt"></span></span></th>
<th class="dirent-op"></th>
<th class="dirent-size">{% trans "Size"%}</th>
<th class="dirent-update">{% trans "Last Update" %} <span id="by-time" class="icon-caret-down cspt"></span></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<img class="loading-tip" src="{{MEDIA_URL}}img/loading-icon.gif" alt="{% trans 'Loading...' %}" />
</div>

View File

@@ -12,6 +12,27 @@
<span class="dirent-name"><a href="#lib/<%= repo_id %><% print(dirent_path); %>" class="dir-link normal"><%- dirent.obj_name %></a></span>
<% } %>
</td>
<td class="dirent-op">
<div class="repo-file-op vh">
<div class="displayed-op">
<a class="op download" href="{{ SITE_ROOT }}repo/download_dir/<%= repo_id %>/?p=<% print(dirent_path); %>" title="{% trans "Download" %}"><img src="{{ MEDIA_URL }}img/download-orange.png" alt="" /></a>
<% if (!repo_encrypted) { %>
<a class="op share" href="#" title="{% trans "Share" %}"><img src="{{ MEDIA_URL }}img/share-orange.png" alt="" /></a>
<% } %>
<% if (user_perm == 'rw') { %>
<a class="op delete" href="#" title="{% trans "Delete" %}"><img src="{{ MEDIA_URL }}img/delete-orange.png" alt="" /></a>
<% } %>
</div>
<% if (user_perm == 'rw') { %>
<img src="{{ MEDIA_URL }}img/dropdown-arrow.png" title="{% trans "More operations" %}" alt="{% trans "More operations" %}" class="more-op-icon cspt" />
<ul class="hidden-op hide">
<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>
</ul>
<% } %>
</div>
</td>
<td class="dirent-size"></td>
<td class="dirent-update">
<% if (dirent.last_modified) { %>
@@ -20,25 +41,6 @@
<% print(""); %>
<% } %>
</td>
<td class="dirent-op">
<div class="repo-file-op vh">
<div class="displayed-op">
<a class="op download" href="{{ SITE_ROOT }}repo/download_dir/<%= repo_id %>/?p=<% print(dirent_path); %>" title="{% trans "Download" %}"><img src="{{ MEDIA_URL }}img/download.png" alt="" /></a>
<% if (!repo_encrypted) { %>
<a class="op share" href="#" title="{% trans "Share" %}"><img src="{{ MEDIA_URL }}img/share_20.png" alt="" /></a>
<% } %>
</div>
<% if (user_perm == 'rw') { %>
<img src="{{ MEDIA_URL }}img/dropdown-arrow.png" title="{% trans "More operations" %}" alt="{% trans "More operations" %}" class="more-op-icon cspt" />
<ul class="hidden-op hide">
<li><a class="op del" href="#">{% trans "Delete" %}</a></li>
<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>
</ul>
<% } %>
</div>
</td>
<% } else { %>
<td class="select">
<span class="checkbox"><input type="checkbox" class="checkbox-orig" /></span>
@@ -64,6 +66,28 @@
<td>
<span class="dirent-name"><a class="normal" href="{{ SITE_ROOT }}lib/<%= repo_id %>/file<% print(dirent_path); %>" target="_blank"><%- dirent.obj_name %></a></span>
</td>
<td class="dirent-op">
<div class="repo-file-op vh">
<div class="displayed-op">
<a class="op download" href="{{ SITE_ROOT }}repo/<%= repo_id %>/<%= dirent.obj_id %>/download/?p=<% print(dirent_path); %>" title="{% trans "Download" %}"><img src="{{ MEDIA_URL }}img/download-orange.png" alt="" /></a>
<% if (!repo_encrypted) { %>
<a class="op share" href="#" title="{% trans "Share" %}"><img src="{{ MEDIA_URL }}img/share-orange.png" alt="" /></a>
<% } %>
<% if (user_perm == 'rw') { %>
<a class="op delete" href="#" title="{% trans "Delete" %}"><img src="{{ MEDIA_URL }}img/delete-orange.png" alt="" /></a>
<% } %>
</div>
<% if (user_perm == 'rw') { %>
<img src="{{ MEDIA_URL }}img/dropdown-arrow.png" title="{% trans "More Operations"%}" alt="{% trans "More Operations"%}" class="more-op-icon cspt" />
<ul class="hidden-op hide">
<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>
<li><a class="op file-history" href="{{ SITE_ROOT }}repo/file_revisions/<%= repo_id %>/?p=<% print(dirent_path); %>" target="_blank">{% trans "History" %}</a></li>
</ul>
<% } %>
</div>
</td>
<td class="dirent-size"><%= dirent.file_size %></td>
<td class="dirent-update">
<% if (dirent.last_modified) { %>
@@ -72,25 +96,4 @@
<% print("{% trans "Fetch failed" %}"); %>
<% } %>
</td>
<td class="dirent-op">
<div class="repo-file-op vh">
<div class="displayed-op">
<a class="op download" href="{{ SITE_ROOT }}repo/<%= repo_id %>/<%= dirent.obj_id %>/download/?p=<% print(dirent_path); %>" title="{% trans "Download" %}"><img src="{{ MEDIA_URL }}img/download.png" alt="" /></a>
<% if (!repo_encrypted) { %>
<a class="op share" href="#" title="{% trans "Share" %}"><img src="{{ MEDIA_URL }}img/share_20.png" alt="" /></a>
<% } %>
</div>
<% if (user_perm == 'rw') { %>
<img src="{{ MEDIA_URL }}img/dropdown-arrow.png" title="{% trans "More Operations"%}" alt="{% trans "More Operations"%}" class="more-op-icon cspt" />
<ul class="hidden-op hide">
<li><a class="op del" href="#">{% trans "Delete" %}</a></li>
<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>
<li><a class="op file-update" href="#">{% trans "Update"%}</a></li>
<li><a class="op file-history" href="{{ SITE_ROOT }}repo/file_revisions/<%= repo_id %>/?p=<% print(dirent_path); %>" target="_blank">{% trans "History" %}</a></li>
</ul>
<% } %>
</div>
</td>
<% } %>

View File

@@ -21,7 +21,7 @@
{% endif %}
/* lib view */
.repo-file-list .dirent-name {
width:260px;
width:220px;
}
.repo-file-list .dirent-size {
width:114px;
@@ -30,7 +30,12 @@
width:123px;
}
.repo-file-list .dirent-op {
width:110px;
width:150px;
}
.displayed-op .download,
.displayed-op .share,
.displayed-op .delete {
margin-left:5px;
}
/* custom select2 */
.select2-container-multi .select2-choices {
@@ -205,32 +210,7 @@
</form>
{% endif %}
<div id="dir-view" class="hide">
<div class="repo-file-list-topbar">
<p class="path"></p>
<div class="repo-op"></div>
</div>
<table class="repo-file-list">
<thead>
<tr>
<th class="select">
<span class="checkbox"><input type="checkbox" class="checkbox-orig" /></span>
</th>
<th class="star"></th>
<th class="dirent-icon"></th>
<th><span class="dirent-name">{% trans "Name"%} <span id="by-name" class="icon-caret-up cspt"></span></span></th>
<th class="dirent-size">{% trans "Size"%}</th>
<th class="dirent-update">{% trans "Last Update" %} <span id="by-time" class="icon-caret-down cspt"></span></th>
<th class="dirent-op">{% trans "Operations"%}</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<img class="loading-tip" src="{{MEDIA_URL}}img/loading-icon.gif" alt="{% trans 'Loading...' %}" />
</div>
{% include "js/dir-view.html" %}
{% endblock %}

View File

@@ -61,30 +61,7 @@
</div>
</div>
<div id="dir-view" class="hide">
<div class="repo-file-list-topbar">
<p class="path"></p>
<div class="repo-op"></div>
</div>
<table class="repo-file-list">
<thead>
<tr>
<th class="select">
<span class="checkbox"><input type="checkbox" class="checkbox-orig" /></span>
</th>
<th class="star"></th>
<th class="dirent-icon"></th>
<th><span class="dirent-name">{% trans "Name"%} <span id="by-name" class="icon-caret-up cspt"></span></span></th>
<th class="dirent-size">{% trans "Size"%}</th>
<th class="dirent-update">{% trans "Last Update" %} <span id="by-time" class="icon-caret-down cspt"></span></th>
<th class="dirent-op">{% trans "Operations"%}</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<img class="loading-tip" src="{{MEDIA_URL}}img/loading-icon.gif" alt="{% trans 'Loading...' %}" />
</div>
{% include "js/dir-view.html" %}
{% endblock %}