Skip to content

Commit

Permalink
[history/snapshot/shared/trash file view] modified 'view-hd'
Browse files Browse the repository at this point in the history
  • Loading branch information
llj committed Feb 22, 2017
1 parent 0599546 commit e228271
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 51 deletions.
5 changes: 4 additions & 1 deletion media/css/seahub.css
Original file line number Diff line number Diff line change
Expand Up @@ -2636,6 +2636,9 @@ button.sf-dropdown-toggle:focus {
.file-view-op {
margin-top:10px;
}
.file-view-meta-info {
margin:0;
}
#shared-link,
#shared-upload-link,
#shared-link-text,
Expand Down Expand Up @@ -3476,7 +3479,7 @@ button.sf-dropdown-toggle:focus {
}
.shared-file-op-btn {
padding:7px;
margin-top:11px;
margin-top:9px;
}
/*random password */
#share-popup .passwd-wrapper,
Expand Down
7 changes: 2 additions & 5 deletions seahub/templates/shared_file_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{% endif %}
<div id="shared-file-view-hd" class="ovhd">
<div class="fleft js-file-info">
<h2 class="ellipsis no-bold" title="{{ file_name }}">{{ file_name }}</h2>
<h2 class="file-view-hd ellipsis no-bold" title="{{ file_name }}">{{ file_name }}</h2>
{% if zipped %}
<p class="cur-path ellipsis">
{% trans "Current path: "%}
Expand Down Expand Up @@ -42,10 +42,7 @@ <h2 class="ellipsis no-bold" title="{{ file_name }}">{{ file_name }}</h2>
</div>
</div>

<div id="file">
{% include 'snippets/file_content_html.html' %}
</div>

{% include 'snippets/file_content_html.html' %}

<form id="file-save-form" action="{{save_to_link}}" method="post" class="file-choose-form hide">{% csrf_token %}
<h3>{% trans "Save To:" %}</h3>
Expand Down
2 changes: 1 addition & 1 deletion seahub/templates/snippets/file_content_html.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
content of files that can be viewed online shows here.
For details please refer to 'snippets/file_content_js.html'.
{% endcomment %}
<div id="file-view" {% if filetype == 'Image' %}class="image-file-view"{% endif %}>
<div id="file-view" {% if filetype == 'Image' and not err %}class="image-file-view"{% endif %}>
{% include 'snippets/file_encoding.html' %}
{% if not err %}
{% if filetype == 'Text' or filetype == 'Markdown' %}
Expand Down
2 changes: 1 addition & 1 deletion seahub/templates/view_file_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ <h3 class="right-side-panel-title">{% trans "Comments" %}</h3>
$(window).load(function() {
if (highlight_kw) {
// hl kw in file title
highlight_kw($('#view-hd')[0]);
highlight_kw($('.file-view-hd span')[0]);

// hl kw in file content
if ('{{filetype}}' == 'Markdown') {
Expand Down
32 changes: 10 additions & 22 deletions seahub/templates/view_history_file.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,18 @@
{% block main_css_class %}{% endblock %} {# remove the padding-top css #}

{% block main_content %}
<div id="view-hd">
{% block view_hd %}
<h2>
{{file_name}}
<span class="commit-time">({{ current_commit.props.ctime|tsstr_sec }})</span>
</h2>
{% endblock %}
</div>

<div id="file">
<div id="file-op" class="ovhd">
<p class="history-file-path fleft">
{% block file_path %}
{% trans "Current Path: "%}
{% for name, link in zipped %}
{% if not forloop.last %} {{ name }} / {% else %} {{ name }} {% endif %}
{% endfor %}
{% endblock %}
</p>

<a class="sf-btn-link fright" href="{% url 'download_file' repo.id obj_id%}?file_name={{ file_name|urlencode }}&p={{path|urlencode}}" id="download">{% trans "Download"%}</a>
<div id="view-hd" class="ovhd">
<div class="fleft">
<h2 class="file-view-hd">{{file_name}}</h2>
{% block file_path %}
<p class="file-view-meta-info">{{ current_commit.props.ctime|tsstr_sec }}</p>
{% endblock %}
</div>
{% include 'snippets/file_content_html.html' %}

<a class="file-view-op sf-btn-link fright" href="{% url 'download_file' repo.id obj_id%}?file_name={{ file_name|urlencode }}&p={{path|urlencode}}" id="download">{% trans "Download"%}</a>
</div>

{% include 'snippets/file_content_html.html' %}
{% endblock %}

{% block extra_script %}
Expand Down
16 changes: 0 additions & 16 deletions seahub/templates/view_snapshot_file.html
Original file line number Diff line number Diff line change
@@ -1,17 +1 @@
{% extends 'view_history_file.html' %}
{% load seahub_tags i18n %}
{% load url from future %}

{% block view_hd %}
<h2>
{{file_name}}
<span class="commit-time">({{ current_commit.props.ctime|tsstr_sec }})</span>
</h2>
{% endblock %}

{% block file_path %}
{% trans "Current Path: "%}
{% for name, link in zipped %}
{% if not forloop.last %} <a href="{% url 'repo_history_view' repo.id %}?commit_id={{ current_commit.id }}&p={{ link|urlencode }}">{{ name }}</a> / {% else %} {{ name }} {% endif %}
{% endfor %}
{% endblock %}
6 changes: 1 addition & 5 deletions seahub/templates/view_trash_file.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
{% load i18n %}
{% load url from future %}

{% block view_hd %}
<h2>{{file_name}}</h2>
{% endblock %}

{% block file_path %}
{% trans "Current Path: "%}{% trans "Trash" %}
<p class="file-view-meta-info">{% trans "Current Path: "%}{% trans "Trash" %}</p>
{% endblock %}

0 comments on commit e228271

Please sign in to comment.