Skip to content

Commit

Permalink
[icons] use icons instead of text for 'op'
Browse files Browse the repository at this point in the history
  • Loading branch information
llj committed Nov 5, 2014
1 parent 3e1373b commit 6251828
Show file tree
Hide file tree
Showing 23 changed files with 101 additions and 168 deletions.
Binary file added media/img/edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/img/link.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/img/rm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/img/share_20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions seahub/contacts/templates/contacts/contact_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ <h3 class="fleft">{% trans "Contacts"%}</h3>
<td>{{ contact.contact_name }}</td>
<td>{{ contact.note }}</td>
<td data-email="{{ contact.contact_email }}" data-name="{{ contact.contact_name }}" data-note="{{ contact.note }}">
<a href="#" data="{{ SITE_ROOT }}contacts/edit/?email={{ contact.contact_email }}" class="contact-edit op vh">{% trans "Edit"%}</a>
<a href="#" data-url="{{ SITE_ROOT }}contacts/delete/?email={{ contact.contact_email|urlencode}}" data-target="{{ contact.contact_email}}" class="contact-delete op vh">{% trans "Delete"%}</a>
<img src="{{MEDIA_URL}}img/edit.png" alt="" class="contact-edit op-icon vh" title="{% trans "Edit" %}" />
<img src="{{MEDIA_URL}}img/rm.png" alt="" data-url="{{ SITE_ROOT }}contacts/delete/?email={{ contact.contact_email|urlencode}}" data-target="{{ contact.contact_email}}" class="contact-delete op-icon vh" title="{% trans "Delete" %}" />
</td>
</tr>
{% endfor %}
Expand Down
10 changes: 1 addition & 9 deletions seahub/group/templates/group/group_info.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,8 @@
</td>
<td>{{ repo.owner|email2nickname }}</td>
<td data-id="{{ repo.props.id }}" data-owner="{{ repo.owner }}" data-name="{{ repo.props.name }}">
{% if show_repo_download_button %}
<span class="icon-cloud-download download op-icon vh" title="{% trans "Download and Sync" %}"></span>
{% endif %}
{% if is_staff or repo.share_from_me %}
<span class="icon-trash cancel-share op-icon vh" title="{% trans "Unshare" %}"></span>
<img src="{{MEDIA_URL}}img/rm.png" alt="" class="cancel-share op-icon vh" title="{% trans "Unshare" %}" />
{% endif %}
</td>
</tr>
Expand Down Expand Up @@ -152,11 +149,6 @@ <h3>{% trans 'Library' %} <span class="op-target"></span> {% trans 'is encrypted
'con': "{% trans "Are you sure you want to unshare %s ?" %}"
});

$('.download').click(function() {
var repo_id = $(this).parent().data('id');
window.open('{{ SITE_ROOT }}seafile_access_check/?repo_id=' + e(repo_id));
});

{% if user.permissions.can_add_repo %}
function repoCreateSuccessCallback() {
location.reload();
Expand Down
10 changes: 5 additions & 5 deletions seahub/group/templates/group/group_manage.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
<td>{% avatar member.user_name 20 %}</td>
<td>{{ member.user_name }}</td>
<td>
{% if member.user_name != request.user.username %}
<a href="#" data-url="{{ SITE_ROOT }}group/{{ group.id }}/member/{{ member.user_name|urlencode }}/?op=delete" data-target="{{ member.user_name }}" class="member-remove-btn op vh">{% trans "Delete"%}</a>
{% endif %}
{% if member.user_name != request.user.username %}
<img src="{{MEDIA_URL}}img/rm.png" alt="" data-url="{{ SITE_ROOT }}group/{{ group.id }}/member/{{ member.user_name|urlencode }}/?op=delete" data-target="{{ member.user_name }}" class="rm-member op-icon vh" title="{% trans "Delete" %}" />
{% endif %}
</td>
</tr>
{% endfor %}
Expand All @@ -55,7 +55,7 @@
<td>{{ member.user_name }}</td>
<td>
{% if member.user_name != request.user.username %}
<a href="#" data-url="{% url 'group_remove_admin' group.id %}?u={{ member.user_name|urlencode }}" data-target="{{ member.user_name }}" class="member-remove-btn op vh">{% trans "Delete"%}</a>
<img src="{{MEDIA_URL}}img/rm.png" alt="" data-url="{% url 'group_remove_admin' group.id %}?u={{ member.user_name|urlencode }}" data-target="{{ member.user_name }}" class="rm-member op-icon vh" title="{% trans "Delete"%}" />
{% endif %}
</td>
</tr>
Expand Down Expand Up @@ -142,7 +142,7 @@ <h3>{% trans "Rename Group To"%}</h3>
'title':"{% trans "Dismiss Group" %}",
'con':"{% trans "Really want to dismiss this group?" %}"
});
addConfirmTo($(".member-remove-btn"), {
addConfirmTo($(".rm-member"), {
'title':"{% trans "Delete Member" %}",
'con':"{% trans "Really want to delete %s ?" %}"
});
Expand Down
19 changes: 13 additions & 6 deletions seahub/share/templates/share/links.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
<td><a href="{{ SITE_ROOT }}repo/{{ fs.repo.id }}/">{{ fs.repo.name }}</a></td>
<td>{{ fs.view_cnt }}</td>
<td>
<a href="#" class="view-link op vh" data="{{ fs.shared_link }}">{% trans "View" %}</a>
<a class="op vh" href="{% url 'remove_shared_link' %}?t={{ fs.token }}">{% trans "Remove"%}</a>
<img src="{{ MEDIA_URL }}img/link.png" alt="" class="view-link op-icon vh" data-link="{{ fs.shared_link }}" title="{% trans "View"%}" />
<img src="{{ MEDIA_URL }}img/rm.png" alt="" class="rm-link op-icon vh" data-token="{{ fs.token }}" title="{% trans "Remove"%}" />
</td>
</tr>
{% endfor %}
Expand Down Expand Up @@ -65,8 +65,8 @@ <h2 class="alc">{% trans "You don't have any download link"%}</h2>
<td><a href="{{ SITE_ROOT }}repo/{{ link.repo.id }}/">{{ link.repo.name }}</a></td>
<td>{{ link.view_cnt }}</td>
<td>
<a href="#" class="view-link op vh" data="{{ link.shared_link }}">{% trans "View" %}</a>
<a class="op vh" href="{% url 'remove_shared_upload_link' %}?t={{ link.token }}">{% trans "Remove"%}</a>
<img src="{{ MEDIA_URL }}img/link.png" alt="" class="view-link op-icon vh" data-link="{{ link.shared_link }}" title="{% trans "View"%}" />
<img src="{{ MEDIA_URL }}img/rm.png" alt="" class="rm-upload-link op-icon vh" data-token="{{ link.token }}" title="{% trans "Remove"%}" />
</td>
</tr>
{% endfor %}
Expand All @@ -86,12 +86,19 @@ <h2 class="alc">{% trans "You don't have any upload link"%}</h2>
<script type="text/javascript">
{% if fileshares or uploadlinks %}
$(".view-link").click(function() {
var link = $(this).attr('data');
var link = $(this).attr('data-link');
$('#shared-link').before('<p class="hide">' + link + '</p>')
.val(link).css('width', $('#shared-link').prev().width() + 2)
.modal({focus:false});
$('#shared-link').prev().remove();
return false;
});
// rm shared_link
$('.rm-link').click(function() {
location.href = '{% url 'remove_shared_link' %}?t=' + $(this).attr('data-token');
});
// rm shared_upload_link
$('.rm-upload-link').click(function() {
location.href = '{% url 'remove_shared_upload_link' %}?t=' + $(this).attr('data-token');
});
$('#shared-link').click(function() {
$(this).select();
Expand Down
11 changes: 4 additions & 7 deletions seahub/share/templates/share/list_priv_shared_folders.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ <h3 class="hd">{% trans "Folders" %}</h3>
<td>{{ repo.props.repo_desc }}</td>
<td>
{% if repo.props.share_type == 'group' %}
<a href="#" data="{% url 'repo_remove_share' %}?repo_id={{ repo.props.repo_id }}&from={{ request.user.username|urlencode }}&gid={{ repo.props.group_id }}" class="cancel-share op vh">{% trans "Unshare"%}</a>
<a href="{% url 'repo_remove_share' %}?repo_id={{ repo.props.repo_id }}&from={{ request.user.username|urlencode }}&gid={{ repo.props.group_id }}" class="op-icon vh" title="{% trans "Unshare"%}"><img src="{{MEDIA_URL}}img/rm.png" alt="" /></a>
{% endif %}
{% if repo.props.share_type == 'personal' %}
<a href="#" data="{% url 'repo_remove_share' %}?repo_id={{ repo.props.repo_id }}&from={{ request.user.username|urlencode }}&to={{ repo.props.user|urlencode }}" class="cancel-share op vh">{% trans "Unshare"%}</a>
<a href="{% url 'repo_remove_share' %}?repo_id={{ repo.props.repo_id }}&from={{ request.user.username|urlencode }}&to={{ repo.props.user|urlencode }}" class="op-icon vh" title="{% trans "Unshare"%}"><img src="{{MEDIA_URL}}img/rm.png" alt="" /></a>
{% endif %}
{% if repo.props.share_type == 'public' %}
{% if not org %}
<a href="#" data="{% url 'unsetinnerpub' repo.repo_id %}" class="cancel-share op vh">{% trans "Unshare"%}</a>
<a href="{% url 'unsetinnerpub' repo.repo_id %}" class="op-icon vh" title="{% trans "Unshare"%}"><img src="{{MEDIA_URL}}img/rm.png" alt="" /></a>
{% else %}
<a href="#" data="{{ SITE_ROOT }}organizations/{{ org.url_prefix }}/innerpubrepo/unset/{{ repo.props.repo_id }}" class="cancel-share op vh">{% trans "Unshare"%}</a>
<a href="{{ SITE_ROOT }}organizations/{{ org.url_prefix }}/innerpubrepo/unset/{{ repo.props.repo_id }}" class="op-icon vh" title="{% trans "Unshare" %}"><img src="{{MEDIA_URL}}img/rm.png" alt="" /></a>
{% endif %}
{% endif %}
</td>
Expand Down Expand Up @@ -113,9 +113,6 @@ <h2 class="alc">{% trans "You have not shared any folder" %}</h2>
$('.share-permission-select').addClass('hide');
}
});
$('.cancel-share').click(function() {
location.href = $(this).attr('data');
});
{% endif %} // shared_repos

</script>
Expand Down
12 changes: 10 additions & 2 deletions seahub/share/templates/share/priv_shared_files.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@
{% endif %}
<td>--</td>
<td>{{e.from_user|email2nickname}}</td>
<td><a href="{% url 'rm_private_file_share' e.token %}" class="op vh">{% trans "Unshare" %}</a></td>
<td>
<a href="{% url 'rm_private_file_share' e.token %}" class="op-icon vh" title="{% trans "Unshare" %}">
<img src="{{MEDIA_URL}}img/rm.png" alt="" />
</a>
</td>
</tr>
{% endfor %}
</table>
Expand Down Expand Up @@ -69,7 +73,11 @@ <h2 class="alc">{% trans "No file is shared to you" %}</h2>
{% endif %}
<td><a href="{% url 'repo' e.repo_id %}">{{e.repo.name}}</a></td>
<td>{{e.to_user|email2nickname}}</td>
<td><a href="{% url 'rm_private_file_share' e.token %}" class="op vh">{% trans "Unshare" %}</a></td>
<td>
<a href="{% url 'rm_private_file_share' e.token %}" class="op-icon vh" title="{% trans "Unshare" %}">
<img src="{{MEDIA_URL}}img/rm.png" alt="" />
</a>
</td>
</tr>
{% endfor %}
</table>
Expand Down
6 changes: 3 additions & 3 deletions seahub/share/templates/share/repos.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ <h3 class="hd">{% trans "Libraries" %}</h3>
<td>{{ repo.props.repo_desc }}</td>
<td>
{% if repo.props.share_type == 'group' %}
<a href="{% url 'repo_remove_share' %}?repo_id={{ repo.props.repo_id }}&from={{ request.user.username|urlencode }}&gid={{ repo.props.group_id }}" class="cancel-share op vh">{% trans "Unshare"%}</a>
<a href="{% url 'repo_remove_share' %}?repo_id={{ repo.props.repo_id }}&from={{ request.user.username|urlencode }}&gid={{ repo.props.group_id }}" class="cancel-share op-icon vh" title="{% trans "Unshare"%}"><img src="{{MEDIA_URL}}img/rm.png" alt="" /></a>
{% endif %}
{% if repo.props.share_type == 'personal' %}
<a href="{% url 'repo_remove_share' %}?repo_id={{ repo.props.repo_id }}&from={{ request.user.username|urlencode }}&to={{ repo.props.user|urlencode }}" class="cancel-share op vh">{% trans "Unshare"%}</a>
<a href="{% url 'repo_remove_share' %}?repo_id={{ repo.props.repo_id }}&from={{ request.user.username|urlencode }}&to={{ repo.props.user|urlencode }}" class="cancel-share op-icon vh" title="{% trans "Unshare"%}"><img src="{{MEDIA_URL}}img/rm.png" alt="" /></a>
{% endif %}
{% if repo.props.share_type == 'public' %}
<a href="{% url 'unsetinnerpub' repo.repo_id %}" class="cancel-share op vh">{% trans "Unshare"%}</a>
<a href="{% url 'unsetinnerpub' repo.repo_id %}" class="cancel-share op-icon vh" title="{% trans "Unshare"%}"><img src="{{MEDIA_URL}}img/rm.png" alt="" /></a>
{% endif %}
</td>
</tr>
Expand Down
4 changes: 3 additions & 1 deletion seahub/templates/devices.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ <h3 class="hd">{% trans "Devices" %}</h3>
{% endif %}
</td>
<td>
<div><a href="#" class="unlink-device op vh">{% trans "Unlink" %}</a></div>
<div>
<a href="#" class="unlink-device op-icon vh" title="{% trans "Unlink" %}"><img src="{{MEDIA_URL}}img/rm.png" alt="" /></a>
</div>
</td>
</tr>
{% endfor %}
Expand Down
75 changes: 0 additions & 75 deletions seahub/templates/my_shared_repos.html

This file was deleted.

9 changes: 1 addition & 8 deletions seahub/templates/pubrepo.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,9 @@ <h3 class="fleft">{% trans "Libraries" %}</h3>
<td>{% if repo.props.last_modified %}{{ repo.props.last_modified|translate_seahub_time }}{% else %}--{% endif %}</td>
<td>{{ repo.props.user|email2nickname }}</td>
<td>
{% if show_repo_download_button %}
<span data-id="{{ repo.props.repo_id }}" class="icon-cloud-download download-btn op-icon vh" title="{% trans "Download and Sync"%}"></span>
{% endif %}
{% if request.user.is_staff or repo.share_from_me %}
<span data-href="{% url 'unsetinnerpub' repo.repo_id %}" class="icon-trash cancel-share op-icon vh" title="{% trans "Unshare" %}"></span>
<img src="{{MEDIA_URL}}img/rm.png" alt="" data-href="{% url 'unsetinnerpub' repo.repo_id %}" class="cancel-share op-icon vh" title="{% trans "Unshare" %}" />
{% endif %}

</td>
</tr>
{% endfor %}
Expand All @@ -59,9 +55,6 @@ <h2 class="alc">{% trans "No public library" %}</h2>

{% block extra_script %}
<script type="text/javascript">
$(".download-btn").click(function() {
window.open('{{ SITE_ROOT }}seafile_access_check/?repo_id=' + $(this).data('id'));
});
$(".cancel-share").click(function() {
location.href = $(this).data('href');
});
Expand Down
13 changes: 9 additions & 4 deletions seahub/templates/repo_history.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@

{% block sub_title %}{% trans "History" %} - {% endblock %}

{% block extra_style %}
<style type="text/css">
#main { position: relative; }
.go-back { top:-3px; }
</style>
{% endblock %}

{% block main_panel %}
<div class="w100 ovhd">
<h2 class="fleft"><span class="op-target">{{repo.props.name}}</span> {% trans "modification history" %}</h2>
<button data="{{ SITE_ROOT }}repo/{{ repo.props.id }}/" class="fright" id="back">{% trans "Back to Library"%}</button>
</div>
<h2><span class="op-target">{{repo.props.name}}</span> {% trans "modification history" %}</h2>
<a href="{{ SITE_ROOT }}repo/{{ repo.props.id }}/" class="go-back" title="{% trans "Back to Library"%}"><span class="icon-chevron-left"></span></a>

{% if user_perm == 'rw' %}
<p class="tip">{% trans "Tip: A snapshot will be generated after modification, which records the library state before this modification."%}<a href="{% url 'repo_view_snapshot' repo.props.id %}">{% trans "View Snapshot"%}</a></p>
Expand Down
15 changes: 11 additions & 4 deletions seahub/templates/repo_view_snapshot.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@
{% load seahub_tags avatar_tags i18n %}
{% load url from future %}

{% block extra_style %}
<style type="text/css">
#main { position: relative; }
.go-back { top:-3px; }
</style>
{% endblock %}

{% block main_panel %}
<div class="w100 ovhd">
<h2 class="fleft"><span class="op-target">{{repo.props.name}}</span> {% trans "snapshots"%}</h2>
<button data="{{ SITE_ROOT }}repo/history/{{ repo.props.id }}/" class="fright" id="back">{% trans "Back to modification history"%}</button>
</div>
<h2><span class="op-target">{{repo.props.name}}</span> {% trans "snapshots"%}</h2>
<a href="{{ SITE_ROOT }}repo/history/{{ repo.props.id }}/" class="go-back" title="{% trans "Back to modification history"%}">
<span class="icon-chevron-left"></span>
</a>

<div class="commit-list-outer-container">
<div class="commit-list-inner-container">
Expand Down
Loading

0 comments on commit 6251828

Please sign in to comment.