diff --git a/media/css/seahub.css b/media/css/seahub.css index d59d92ef27..5b0fe3a788 100644 --- a/media/css/seahub.css +++ b/media/css/seahub.css @@ -650,7 +650,7 @@ textarea:-moz-placeholder {/* for FF */ position:fixed; top:52px; bottom:0; - z-index:1000; + z-index:1; padding:20px; overflow-x:hidden; overflow-y:auto; @@ -776,7 +776,7 @@ textarea:-moz-placeholder {/* for FF */ box-shadow: 0 2px 4px rgba(0,0,0,0.2); -moz-box-shadow: 0 2px 4px rgba(0,0,0,0.2); -webkit-box-shadow: 0 2px 4px rgba(0,0,0,0.2); - z-index:15; /* for repo.html: to show on top of fixed-hd */ + z-index:999; /* for repo.html: to show on top of fixed-hd */ } .messages .info { padding:5px; @@ -1302,15 +1302,16 @@ button.sf-dropdown-toggle:focus { } /********** container ***********/ #wrapper { - padding-top: 53px; + } #header { background:#f4f4f7; width:100%; + height:53px; font-size: 14px; border-bottom: 1px solid #e8e8e8; padding-bottom:4px; - z-index:1000; /* fix for: modal dialog z-index is 1001 */ + z-index:1; /* fix for: modal dialog z-index is 1001 */ } #header-inner { margin:0 auto; @@ -1319,6 +1320,12 @@ button.sf-dropdown-toggle:focus { min-height: 400px; _height: 400px; } +#main.top-padding { + padding-top:53px; +} +#wide-panel-noframe { + padding-top:16px; +} #right-panel { padding-top:16px; margin-bottom:20px; diff --git a/seahub/api2/templates/api2/base.html b/seahub/api2/templates/api2/base.html deleted file mode 100644 index f8e1353fc6..0000000000 --- a/seahub/api2/templates/api2/base.html +++ /dev/null @@ -1,42 +0,0 @@ -{% load i18n %} - - - - -{% block sub_title %}{% endblock %}{{ site_title }} - - - - - -{% block extra_style %}{% endblock %} - - - -
-
-
- {% block title_panel %}{% endblock %} -
-
- {% block left_panel %}{% endblock %} -
-
- {% block right_panel %}{% endblock %} -
-
- {% block main_panel %}{% endblock %} -
-
-
- - - - -{% block extra_script %}{% endblock %} - - diff --git a/seahub/api2/templates/api2/event_details.html b/seahub/api2/templates/api2/event_details.html deleted file mode 100644 index c9890e59b3..0000000000 --- a/seahub/api2/templates/api2/event_details.html +++ /dev/null @@ -1,54 +0,0 @@ -{% load seahub_tags avatar_tags i18n %} -{% load url from future %} -
- - {% if changes.new %} - - {% endif %} - - {% if changes.removed %} - - {% endif %} - - {% if changes.renamed %} - - {% endif %} - - {% if changes.modified %} - - {% endif %} - - {% if changes.newdir %} - - {% endif %} - - {% if changes.deldir %} - - {% endif %} - -
-
diff --git a/seahub/api2/templates/api2/events.html b/seahub/api2/templates/api2/events.html deleted file mode 100644 index 2685bea7fa..0000000000 --- a/seahub/api2/templates/api2/events.html +++ /dev/null @@ -1,30 +0,0 @@ -{% extends "api2/base.html" %} - -{% load seahub_tags avatar_tags i18n %} -{% load url from future %} - -{% block main_panel %} -{% if events and events|length > 0 %} -
-
- {% include "api2/events_body.html" %} -
- {% if events_more %} -
{% trans 'Loading...' %}
-

- {% endif %} -
- -{% else %} -

{% trans "No activity now or the function is not supported." %}

- -{% endif %} -{% endblock %} - -{% block extra_script %} - -{% endblock %} diff --git a/seahub/api2/templates/api2/events_body.html b/seahub/api2/templates/api2/events_body.html deleted file mode 100644 index eda96f3c6c..0000000000 --- a/seahub/api2/templates/api2/events_body.html +++ /dev/null @@ -1,29 +0,0 @@ -{% load seahub_tags avatar_tags i18n %} - -{% for e_group in event_groups %} -
    - {% for e in e_group.events %} -
  1. - {% avatar e.author 36 %} -
    - {% if e.etype == "repo-update" %} -

    - {{ e.repo.name }} - {{ e.desc|translate_commit_desc|safe }} -

    - {% endif %} - - {% if e.etype == "repo-create" %} -

    {% trans "Created library" %} {{ e.repo_name }}

    - {% endif %} - - {% if e.etype == "repo-delete" %} -

    {% blocktrans with library_name=e.repo_name %}Deleted library {{ library_name }}{% endblocktrans %}

    - {% endif %} - -

    {{ e.author|email2nickname }} {{ e.time|translate_seahub_time }}

    -
    -
  2. - {% endfor %} -
-{% endfor %} diff --git a/seahub/api2/templates/api2/events_js.html b/seahub/api2/templates/api2/events_js.html deleted file mode 100644 index a3358b0511..0000000000 --- a/seahub/api2/templates/api2/events_js.html +++ /dev/null @@ -1,106 +0,0 @@ -{% load i18n %} -var g_token; -var g_loading = false; -// "setToken" is called in mobile app to pass in the auth token -function setToken(token) { - g_token = token; -} -function reqEvents(start) { - var loading_icon = $('#loading-icon'); - if (g_loading) return; - g_loading = true; - $.ajax({ - url:'{% url 'more_events' %}?start=' + start, - dataType: 'json', - cache: false, - headers:{Authorization:'Token '+g_token}, - success: function(data) { - $('#events-body').append(data['html']); - - setCmtWidth(); - $('.event-item').unbind().click(itemClick); - - if (data['events_more']) { - $('#events').data('more', true).data('start', data['new_start']); - } else { - $('#events').data('more', false); - loading_icon.hide(); - } - g_loading = false; - }, - error: function(jqXHR, textStatus, errorThrown) { - loading_icon.hide(); - if (!jqXHR.responseText) { - $('#events-error').html("{% trans "Failed. Please check the network." %}").removeClass('hide'); - } - g_loading = false; - } - }); -} - -function setCmtWidth() { - $('.updated-repo').each(function() { - $(this).next().css({'margin-right':$(this).width() + 10}); - }); -} - -function itemClick() { - var item = $(this); - var url = item.data('url'); - - // 'delete repo' - if (!url) { - return; - } - - // modified more than 1 file - if ($('.cmt-desc', item).data('more')) { - - // if 'event-details' already exist - if ($('.event-details', item).length > 0) { - $('.event-details', item).toggleClass('hide'); - return; - } - - $.ajax({ - url: url, - dataType: 'json', - cache: false, - headers:{Authorization:'Token '+g_token}, - success: function(data) { - $('.txt', item).append(data['html']); - $('.event-details li').click(function(e) { - if ($('a', $(this)).length > 0) { - location.href = $('a', $(this)).attr('href'); - } - e.stopPropagation(); - }); - }, - error: function(jqXHR, textStatus, errorThrown) { - if (jqXHR.responseText) { - $('.txt', item).append('

' + $.parseJSON(jqXHR.responseText).err + '

'); - } else { - $('.txt', item).append('

' + "{% trans "Please check the network." %}" + '

'); - } - } - }); - } else { - location.href = url; - } -} - -setCmtWidth(); -$('.event-item').click(itemClick); - -{% if events_more %} - $('#events').data('more', true).data('start', {{events_more_offset}}); -{% else %} - $('#events').data('more', false); -{% endif %} -// get more events when scroll to the bottom -$(document).scroll(function() { - - if ($('#events').data('more') && $(window).height() + $(window).scrollTop() == $(document).height()) { - reqEvents($('#events').data('start')); - } -}); diff --git a/seahub/api2/templates/api2/user_msg.html b/seahub/api2/templates/api2/user_msg.html deleted file mode 100644 index 4692a93c41..0000000000 --- a/seahub/api2/templates/api2/user_msg.html +++ /dev/null @@ -1,15 +0,0 @@ -{% load seahub_tags avatar_tags i18n %} - -
  • - {% avatar msg.from_email 48 %} -
    -
    -
    - {{ msg.from_email|email2nickname }} - {{ msg.timestamp|translate_seahub_time }} -
    -

    {{ msg.message|seahub_urlize|find_at|linebreaksbr }}

    - -
    -
    -
  • diff --git a/seahub/api2/templates/api2/user_msg_body.html b/seahub/api2/templates/api2/user_msg_body.html deleted file mode 100644 index 6d21e593a3..0000000000 --- a/seahub/api2/templates/api2/user_msg_body.html +++ /dev/null @@ -1,34 +0,0 @@ - -{% load seahub_tags avatar_tags i18n %} -{% load url from future %} - -{% if person_msgs %} -{% for msg in person_msgs.object_list %} -
  • - {% avatar msg.from_email 48 %} -
    -
    -
    - {{ msg.from_email|email2nickname }} - {{ msg.timestamp|translate_seahub_time }} -
    -

    {{ msg.message|seahub_urlize|find_at|linebreaksbr }}

    - {% if msg.attachments %} -
      - {% for att in msg.attachments %} -
    • - {% trans - {{ att.name }} -
    • - {% endfor %} -
    - {% endif %} - -
    -
    -
  • -{% endfor %} -{% endif %} - - - diff --git a/seahub/api2/urls.py b/seahub/api2/urls.py index 186520bb76..0132707867 100644 --- a/seahub/api2/urls.py +++ b/seahub/api2/urls.py @@ -96,10 +96,6 @@ urlpatterns = patterns('', url(r'^groups/(?P\d+)/discussions/$', GroupDiscussions.as_view(), name="api2-group-discussions"), url(r'^groups/(?P\d+)/discussions/(?P\d+)/$', GroupDiscussion.as_view(), name="api2-group-discussion"), - url(r'^html/events/$', EventsHtml.as_view()), - url(r'^html/more_events/$', AjaxEvents.as_view(), name="more_events"), - url(r'^html/repo_history_changes/(?P[-0-9a-f]{36})/$', RepoHistoryChangeHtml.as_view(), name='api_repo_history_changes'), - # Deprecated url(r'^repos/(?P[-0-9-a-f]{36})/fileops/delete/$', OpDeleteView.as_view()), url(r'^repos/(?P[-0-9-a-f]{36})/fileops/copy/$', OpCopyView.as_view()), diff --git a/seahub/api2/views.py b/seahub/api2/views.py index 86fca1815f..04eb7883e5 100644 --- a/seahub/api2/views.py +++ b/seahub/api2/views.py @@ -3809,110 +3809,6 @@ class GroupAvatarView(APIView): "mtime": get_timestamp(date_uploaded)} return Response(ret) -# Html related code -def html_events(request): - if not EVENTS_ENABLED: - events = None - return render_to_response('api2/events.html', { - "events":events, - }, context_instance=RequestContext(request)) - - email = request.user.username - start = 0 - events_count = 15 - - if is_org_context(request): - org_id = request.user.org.org_id - events, events_more_offset = get_org_user_events(org_id, email, - start, events_count) - else: - events, events_more_offset = get_user_events(email, start, - events_count) - - events_more = True if len(events) == events_count else False - event_groups = group_events_data(events) - prepare_events(event_groups) - - return render_to_response('api2/events.html', { - "events": events, - "events_more_offset": events_more_offset, - "events_more": events_more, - "event_groups": event_groups, - "events_count": events_count, - }, context_instance=RequestContext(request)) - -def ajax_events(request): - events_count = 15 - username = request.user.username - start = int(request.GET.get('start', 0)) - - events, start = get_user_events(username, start, events_count) - events_more = True if len(events) == events_count else False - - event_groups = group_events_data(events) - - prepare_events(event_groups) - ctx = {'event_groups': event_groups} - html = render_to_string("api2/events_body.html", ctx) - - return HttpResponse(json.dumps({'html':html, 'events_more':events_more, - 'new_start': start}), - content_type=json_content_type) - - -def html_repo_history_changes(request, repo_id): - changes = {} - - repo = get_repo(repo_id) - if not repo: - return HttpResponse(json.dumps({"err": 'Library does not exist'}), status=400, content_type=json_content_type) - - if not check_folder_permission(request, repo_id, '/'): - return api_error(status.HTTP_403_FORBIDDEN, 'Permission denied.') - - if repo.encrypted and not is_passwd_set(repo_id, request.user.username): - return HttpResponse(json.dumps({"err": 'Library is encrypted'}), status=400, content_type=json_content_type) - - commit_id = request.GET.get('commit_id', '') - if not commit_id: - return HttpResponse(json.dumps({"err": 'Invalid argument'}), status=400, content_type=json_content_type) - - changes = get_diff(repo_id, '', commit_id) - - c = get_commit(repo_id, repo.version, commit_id) - if c.parent_id is None: - # A commit is a first commit only if its parent id is None. - changes['cmt_desc'] = repo.desc - elif c.second_parent_id is None: - # Normal commit only has one parent. - if c.desc.startswith('Changed library'): - changes['cmt_desc'] = 'Changed library name or description' - else: - # A commit is a merge only if it has two parents. - changes['cmt_desc'] = 'No conflict in the merge.' - for k in changes: - changes[k] = [f.replace ('a href="/', 'a class="normal" href="api://') for f in changes[k] ] - - html = render_to_string('api2/event_details.html', {'changes': changes}) - return HttpResponse(json.dumps({"html": html}), content_type=json_content_type) - - -class AjaxEvents(APIView): - authentication_classes = (TokenAuthentication, ) - permission_classes = (IsAuthenticated,) - throttle_classes = (UserRateThrottle, ) - - def get(self, request, format=None): - return ajax_events(request) - -class EventsHtml(APIView): - authentication_classes = (TokenAuthentication, ) - permission_classes = (IsAuthenticated,) - throttle_classes = (UserRateThrottle, ) - - def get(self, request, format=None): - return html_events(request) - class RepoHistoryChange(APIView): authentication_classes = (TokenAuthentication, ) permission_classes = (IsAuthenticated,) @@ -3944,13 +3840,6 @@ class RepoHistoryChange(APIView): return HttpResponse(json.dumps(details), content_type=json_content_type) -class RepoHistoryChangeHtml(APIView): - authentication_classes = (TokenAuthentication, ) - permission_classes = (IsAuthenticated,) - throttle_classes = (UserRateThrottle, ) - - def get(self, request, repo_id, format=None): - return html_repo_history_changes(request, repo_id) # based on views/file.py::office_convert_query_status class OfficeConvertQueryStatus(APIView): diff --git a/seahub/avatar/urls.py b/seahub/avatar/urls.py index dd418d8a8a..36d50f312f 100644 --- a/seahub/avatar/urls.py +++ b/seahub/avatar/urls.py @@ -2,8 +2,7 @@ from django.conf.urls import patterns, url urlpatterns = patterns('seahub.avatar.views', url('^add/$', 'add', name='avatar_add'), - url('^group/(?P\d+)/add/$', 'group_add', name='avatar_group_add'), # url('^change/$', 'change', name='avatar_change'), # url('^delete/$', 'delete', name='avatar_delete'), - url('^render_primary/(?P[^/]+)/(?P[\d]+)/$', 'render_primary', name='avatar_render_primary'), + url('^render_primary/(?P[^/]+)/(?P[\d]+)/$', 'render_primary', name='avatar_render_primary'), ) diff --git a/seahub/avatar/views.py b/seahub/avatar/views.py index 7dfb732eac..b373d6ecaf 100644 --- a/seahub/avatar/views.py +++ b/seahub/avatar/views.py @@ -14,15 +14,14 @@ from seahub.avatar.settings import AVATAR_MAX_AVATARS_PER_USER, AVATAR_DEFAULT_S from seahub.avatar.signals import avatar_updated from seahub.avatar.util import get_primary_avatar, get_default_avatar_url, \ invalidate_cache, invalidate_group_cache -from seahub.utils import render_error, render_permission_error, \ - check_and_get_org_by_group +from seahub.utils import render_error, render_permission_error from seahub.auth.decorators import login_required from seaserv import ccnet_threaded_rpc, check_group_staff def _get_next(request): """ - The part that's the least straightforward about views in this module is how they + The part that's the least straightforward about views in this module is how they determine their redirects after they have finished computation. In short, they will try and determine the next place to go in the following order: @@ -43,14 +42,14 @@ def _get_next(request): def _get_avatars(user): # Default set. Needs to be sliced, but that's it. Keep the natural order. avatars = Avatar.objects.filter(emailuser=user.email) - + # Current avatar primary_avatar = avatars.order_by('-primary')[:1] if primary_avatar: avatar = primary_avatar[0] else: avatar = None - + if AVATAR_MAX_AVATARS_PER_USER == 1: avatars = primary_avatar else: @@ -91,55 +90,13 @@ def add(request, extra_context=None, next_override=None, # extra_context, # context_instance = RequestContext( # request, - # { 'avatar': avatar, - # 'avatars': avatars, + # { 'avatar': avatar, + # 'avatars': avatars, # 'upload_avatar_form': upload_avatar_form, # 'next': next_override or _get_next(request), } # ) # ) -@login_required -def group_add(request, gid): - group_id_int = int(gid) # Checked by URL Conf - - if not check_group_staff(group_id_int, request.user.username): - raise Http404 - - group = ccnet_threaded_rpc.get_group(group_id_int) - if not group: - return HttpResponseRedirect(reverse('group_list', args=[])) - - # change navigator when user in diffent context - org, base_template = check_and_get_org_by_group(group_id_int, - request.user.username) - - form = GroupAvatarForm(request.POST or None, request.FILES or None) - - if request.method == 'POST' and 'avatar' in request.FILES: - if form.is_valid(): - image_file = request.FILES['avatar'] - avatar = GroupAvatar() - avatar.group_id = gid - avatar.avatar.save(image_file.name, image_file) - avatar.save() - # invalidate group avatar cache - invalidate_group_cache(gid) - - messages.success(request, _("Successfully uploaded a new group avatar.")) - else: - messages.error(request, form.errors['avatar']) - - return HttpResponseRedirect(_get_next(request)) - else: - # Only allow post request to change group avatar. - raise Http404 - - # return render_to_response('avatar/set_avatar.html', { - # 'group' : group, - # 'form' : form, - # 'org': org, - # 'base_template': base_template, - # }, context_instance=RequestContext(request)) @login_required def change(request, extra_context=None, next_override=None, @@ -172,7 +129,7 @@ def change(request, extra_context=None, next_override=None, extra_context, context_instance = RequestContext( request, - { 'avatar': avatar, + { 'avatar': avatar, 'avatars': avatars, 'upload_avatar_form': upload_avatar_form, 'primary_avatar_form': primary_avatar_form, @@ -200,11 +157,11 @@ def delete(request, extra_context=None, next_override=None, *args, **kwargs): break # NOTE: `Avatar.objects.filter(id__in=ids).delete()` will NOT work - # correctly. Sinct delete() on QuerySet will not call delete + # correctly. Sinct delete() on QuerySet will not call delete # method on avatar object. for a in Avatar.objects.filter(id__in=ids): a.delete() - + messages.success(request, _("Successfully deleted the requested avatars.")) return HttpResponseRedirect(next_override or _get_next(request)) return render_to_response( @@ -212,13 +169,13 @@ def delete(request, extra_context=None, next_override=None, *args, **kwargs): extra_context, context_instance = RequestContext( request, - { 'avatar': avatar, + { 'avatar': avatar, 'avatars': avatars, 'delete_avatar_form': delete_avatar_form, 'next': next_override or _get_next(request), } ) ) - + def render_primary(request, extra_context={}, user=None, size=AVATAR_DEFAULT_SIZE, *args, **kwargs): size = int(size) avatar = get_primary_avatar(user, size=size) @@ -232,4 +189,3 @@ def render_primary(request, extra_context={}, user=None, size=AVATAR_DEFAULT_SIZ else: url = get_default_avatar_url() return HttpResponseRedirect(url) - diff --git a/seahub/notifications/templates/notifications/user_notification_list.html b/seahub/notifications/templates/notifications/user_notification_list.html index 1b391be485..fad2cc0314 100644 --- a/seahub/notifications/templates/notifications/user_notification_list.html +++ b/seahub/notifications/templates/notifications/user_notification_list.html @@ -1,9 +1,9 @@ -{% extends "myhome_base.html" %} +{% extends "base_wide_page.html" %} {% load avatar_tags i18n seahub_tags %} {% block sub_title %}{% trans "Notices" %} - {% endblock %} -{% block title_panel %} +{% block wide_page_content %}
    -{% endblock %} -{% block main_panel %} {% if notices %} @@ -89,8 +87,8 @@ $('#notices-more-btn').click(function() { error: function(jqXHR, textStatus, errorThrown) { $('#notices-loading').addClass('hide'); if (!jqXHR.responseText && textStatus != 'abort') { - $('#notices-error').html("{% trans "Failed. Please check the network." %}").removeClass('hide'); - } + $('#notices-error').html("{% trans "Failed. Please check the network." %}").removeClass('hide'); + } } }); }); diff --git a/seahub/profile/templates/profile/set_ccnet_conf.html b/seahub/profile/templates/profile/set_ccnet_conf.html deleted file mode 100644 index 3b1c5ecebc..0000000000 --- a/seahub/profile/templates/profile/set_ccnet_conf.html +++ /dev/null @@ -1,14 +0,0 @@ -{% extends "profile/profile_base.html" %} - -{% block content %} - -{% csrf_token %} - {% if error_msg %} -

    {{ error_msg }}

    - {% endif %} -
    - - - - -{% endblock %} diff --git a/seahub/profile/templates/profile/set_profile.html b/seahub/profile/templates/profile/set_profile.html index f7f644e2ca..6d722f0776 100644 --- a/seahub/profile/templates/profile/set_profile.html +++ b/seahub/profile/templates/profile/set_profile.html @@ -118,6 +118,9 @@ {% block extra_script %} {% include 'snippets/avatar_upload_js.html' %} {% endblock %} diff --git a/seahub/templates/registration/password_reset_done.html b/seahub/templates/registration/password_reset_done.html index e50ab8bd5e..0d8ebc5ac2 100644 --- a/seahub/templates/registration/password_reset_done.html +++ b/seahub/templates/registration/password_reset_done.html @@ -3,7 +3,7 @@ {% block title %}{% trans "Password Reset" %}{% endblock %} -{% block main_panel %} +{% block main_content %}

    {% trans "We've sent a password reset email to your mailbox." %}

    diff --git a/seahub/templates/registration/password_reset_form.html b/seahub/templates/registration/password_reset_form.html index 671993c17b..af825c77df 100644 --- a/seahub/templates/registration/password_reset_form.html +++ b/seahub/templates/registration/password_reset_form.html @@ -2,7 +2,7 @@ {% load i18n %} {% block title %}{% trans "Password Reset" %}{% endblock %} -{% block main_panel %} +{% block main_content %}

    {% trans "Password Reset" %}

    {% csrf_token %} diff --git a/seahub/templates/registration/registration_complete.html b/seahub/templates/registration/registration_complete.html index 7f2273e265..5cc34c79b0 100644 --- a/seahub/templates/registration/registration_complete.html +++ b/seahub/templates/registration/registration_complete.html @@ -3,7 +3,7 @@ {% block title %}{% trans "Registration complete" %}{% endblock %} -{% block main_panel %} +{% block main_content %}
    {% if enable_signup %} {% if send_mail %} diff --git a/seahub/templates/registration/registration_form.html b/seahub/templates/registration/registration_form.html index ae0ce3f1bd..dce702c006 100644 --- a/seahub/templates/registration/registration_form.html +++ b/seahub/templates/registration/registration_form.html @@ -6,7 +6,7 @@ {% endblock %} -{% block main_panel %} +{% block main_content %}

    {% trans "Signup" %}

    diff --git a/seahub/templates/repo_dir_recycle_view.html b/seahub/templates/repo_dir_recycle_view.html index 1fdde495be..c3c5763baa 100644 --- a/seahub/templates/repo_dir_recycle_view.html +++ b/seahub/templates/repo_dir_recycle_view.html @@ -1,9 +1,9 @@ -{% extends base_template %} +{% extends 'base_wide_page.html' %} {% load seahub_tags avatar_tags i18n %} {% load url from future %} -{% block main_panel %} +{% block wide_page_content %}

    {% blocktrans %}{{repo_dir_name}} Trash{% endblocktrans %}

    diff --git a/seahub/templates/repo_history.html b/seahub/templates/repo_history.html index c8d88e2293..94901fd5a4 100644 --- a/seahub/templates/repo_history.html +++ b/seahub/templates/repo_history.html @@ -1,15 +1,15 @@ -{% extends base_template %} +{% extends "base_wide_page.html" %} {% load seahub_tags avatar_tags i18n %} {% load url from future %} {% block sub_title %}{% trans "History" %} - {% endblock %} -{% block main_panel %} -

    {% blocktrans with repo_name=repo.props.name %}{{repo_name}} Modification History{% endblocktrans %}

    +{% block wide_page_content %} +

    {% blocktrans with repo_name=repo.props.name %}{{repo_name}} Modification History{% endblocktrans %}

    -{% if user_perm == 'rw' %} -

    {% trans "Tip: a snapshot will be generated after modification, which records the library state after the modification."%}

    -{% endif %} + {% if user_perm == 'rw' %} +

    {% trans "Tip: a snapshot will be generated after modification, which records the library state after the modification."%}

    + {% endif %}
    diff --git a/seahub/templates/repo_history_view.html b/seahub/templates/repo_history_view.html index 8d2ca1c482..6e65bc82ca 100644 --- a/seahub/templates/repo_history_view.html +++ b/seahub/templates/repo_history_view.html @@ -1,4 +1,4 @@ -{% extends base_template %} +{% extends "base_wide_page.html" %} {% load seahub_tags avatar_tags i18n %} {% load url from future %} @@ -10,7 +10,7 @@ {% endblock %} -{% block main_panel %} +{% block wide_page_content %}

    {% blocktrans with repo_name=repo.props.name %}{{repo_name}} Snapshot{% endblocktrans %} ({{ current_commit.props.ctime|tsstr_sec }})

    diff --git a/seahub/templates/shared_file_view.html b/seahub/templates/shared_file_view.html index 6d5d3d50fb..b3faa593d3 100644 --- a/seahub/templates/shared_file_view.html +++ b/seahub/templates/shared_file_view.html @@ -11,16 +11,17 @@ {% endblock %} + {% block main_panel %}

    {{ file_name }}

    {% if zipped %}

    - {% trans "Current path: "%} + {% trans "Current path: "%} {% for name, link in zipped %} {% if not forloop.last %} - {{ name }} / + {{ name }} / {% else %} {{ name }} {% endif %} @@ -62,7 +63,7 @@ - + {% endblock %} {% block extra_script %} diff --git a/seahub/templates/view_file_base.html b/seahub/templates/view_file_base.html index a701e2ba07..6e1196df62 100644 --- a/seahub/templates/view_file_base.html +++ b/seahub/templates/view_file_base.html @@ -1,4 +1,4 @@ -{% extends base_template %} +{% extends 'base.html' %} {% load seahub_tags avatar_tags i18n %} {% load url from future %} @@ -8,6 +8,8 @@ {% endblock %} +{% block main_css_class %}{% endblock %} {# remove the padding-top css #} + {% block main_panel %}

    {{ filename }} diff --git a/seahub/templates/view_history_file.html b/seahub/templates/view_history_file.html index abace998e5..f48c20b36d 100644 --- a/seahub/templates/view_history_file.html +++ b/seahub/templates/view_history_file.html @@ -1,4 +1,4 @@ -{% extends base_template %} +{% extends 'base.html' %} {% load seahub_tags avatar_tags i18n %} {% load url from future %} @@ -6,6 +6,8 @@ {% include 'snippets/file_view_style.html' %} {% endblock %} +{% block main_css_class %}{% endblock %} {# remove the padding-top css #} + {% block main_panel %}
    {% block view_hd %} diff --git a/seahub/templates/view_shared_dir.html b/seahub/templates/view_shared_dir.html index 471025f9bd..d0f507f576 100644 --- a/seahub/templates/view_shared_dir.html +++ b/seahub/templates/view_shared_dir.html @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'base_wide_page.html' %} {% load seahub_tags i18n staticfiles %} {% load url from future %} @@ -7,7 +7,7 @@ {% endblock %} -{% block main_panel %} +{% block wide_page_content %}

    {{ dir_name }}

    {% trans "Shared by: " %}{{ username|email2nickname }}

    diff --git a/seahub/utils/__init__.py b/seahub/utils/__init__.py index 12e1456c14..b80d8a403a 100644 --- a/seahub/utils/__init__.py +++ b/seahub/utils/__init__.py @@ -472,42 +472,6 @@ def is_org_context(request): """ return request.cloud_mode and request.user.org is not None -# def check_and_get_org_by_repo(repo_id, user): -# """ -# Check whether repo is org repo, get org info if it is, and set -# base template. -# """ -# org_id = get_org_id_by_repo_id(repo_id) -# if org_id > 0: -# # this repo is org repo, get org info -# org = get_org_by_id(org_id) -# org._dict['is_staff'] = is_org_staff(org_id, user) -# org._dict['email'] = user -# base_template = 'org_base.html' -# else: -# org = None -# base_template = 'myhome_base.html' - -# return org, base_template - -def check_and_get_org_by_group(group_id, user): - """ - Check whether repo is org repo, get org info if it is, and set - base template. - """ - org_id = seaserv.get_org_id_by_group(group_id) - if org_id > 0: - # this repo is org repo, get org info - org = seaserv.get_org_by_id(org_id) - org._dict['is_staff'] = seaserv.is_org_staff(org_id, user) - org._dict['email'] = user - base_template = 'org_base.html' - else: - org = None - base_template = 'myhome_base.html' - - return org, base_template - # events related if EVENTS_CONFIG_FILE: parsed_events_conf = ConfigParser.ConfigParser()