From 4ac14a25f4789de28eb044d049657451be0a337e Mon Sep 17 00:00:00 2001 From: llj Date: Fri, 15 Mar 2013 14:41:20 +0800 Subject: [PATCH] improved grp discuss; changed 'recommend' to 'discuss'; deleted 'file comment' --- group/templates/group/group_discuss.html | 42 +++---- group/templates/group/group_manage.html | 6 +- group/templates/group/group_wiki.html | 7 +- group/templates/group/msg_js.html | 48 ++++---- group/templates/group/new_msg_reply.html | 47 ++++---- group/views.py | 12 +- media/css/seahub.css | 47 ++++++-- media/img/fold.png | Bin 0 -> 247 bytes media/img/folder-icon-24.png | Bin 560 -> 560 bytes media/img/unfold.png | Bin 0 -> 257 bytes templates/myhome.html | 10 +- templates/snippets/bottom_bar.html | 32 +++--- templates/snippets/group_recommend_form.html | 34 +++--- templates/view_file_base.html | 112 +------------------ 14 files changed, 167 insertions(+), 230 deletions(-) create mode 100644 media/img/fold.png create mode 100644 media/img/unfold.png diff --git a/group/templates/group/group_discuss.html b/group/templates/group/group_discuss.html index 68c5141cef..2dc039ff89 100644 --- a/group/templates/group/group_discuss.html +++ b/group/templates/group/group_discuss.html @@ -96,30 +96,34 @@ {{ msg.from_email|email2nickname }} {{ msg.timestamp|translate_seahub_time }} -

- {% if msg.attachment.src == 'recommend' %} - {% trans "Recommended" %} - {% if msg.attachment.attach_type == 'file' %} - - {% else %} - - {% endif %} - {{ msg.attachment.name }} : - - {% endif %} +

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

+ {% if msg.attachment %} + {% with ma=msg.attachment %} +
+ {% if ma.src == 'recommend' %} + {% if ma.attach_type == 'file' %} + {% trans + {{ ma.name }} + {% else %} + {% trans + {{ ma.name }} + {% endif %} + {% endif %} - {% if msg.attachment.src == 'filecomment' %} - {% trans "File " %} {{ msg.attachment.name }} {% trans "has a new comment:"%} + {% if ma.src == 'filecomment' %} {# compatible with comments already exist #} + {% trans + {{ ma.name }} + {% endif %} +
+ {% endwith %} {% endif %} - - {{ msg.message|seahub_urlize|find_at|linebreaksbr }} -

-
- {% blocktrans with amount=msg.reply_cnt %}{{ amount }} replies{% endblocktrans %} - {% trans "Hide replies" %} +
+ {% blocktrans with amount=msg.reply_cnt %}{{ amount }} replies{% endblocktrans %} + {% trans "Hide replies" %} +
{% if msg.reply_cnt == 0 %}
    diff --git a/group/templates/group/group_manage.html b/group/templates/group/group_manage.html index 9beebbd742..6fb36eb66c 100644 --- a/group/templates/group/group_manage.html +++ b/group/templates/group/group_manage.html @@ -6,15 +6,15 @@ {% block title_panel %}
    +
    + {% grp_avatar group.props.id 24 %}{{ group.group_name }} +
    -
    - {% grp_avatar group.props.id 24 %} {{ group.group_name }} -
    {% endblock %} diff --git a/group/templates/group/group_wiki.html b/group/templates/group/group_wiki.html index fe6623c977..40b27d2bce 100644 --- a/group/templates/group/group_wiki.html +++ b/group/templates/group/group_wiki.html @@ -9,6 +9,9 @@
    +
    + {% grp_avatar group.props.id 24 %}{{ group.group_name }} +
    -
    - {% grp_avatar group.props.id 24 %} {{ group.group_name }} -
    {% if not wiki_exists %} diff --git a/group/templates/group/msg_js.html b/group/templates/group/msg_js.html index a55ffb24a0..3bc0e19564 100644 --- a/group/templates/group/msg_js.html +++ b/group/templates/group/msg_js.html @@ -15,7 +15,7 @@ $('.msg .op').hover( $(this).css({'text-decoration':'none'}); } ); -$('.reply-cnt-op').hover( +$('.replies-op').hover( function() { $(this).children().css({'text-decoration':'underline'}); }, @@ -23,24 +23,28 @@ $('.reply-cnt-op').hover( $(this).children().css({'text-decoration':'none'}); } ).click(function() { - var cnt_op = $(this); - var r_cnt = cnt_op.children('.reply-cnt'); - var url = r_cnt.data('url'); - var h_r = cnt_op.children('.hide-reply'); - var p = cnt_op.parent(); - var r_list = p.find('.reply-list'); + var op = $(this); + var uf_r = op.children('.unfold-replies'); + var f_r = op.children('.fold-replies'); + var r_list = op.parent().find('.reply-list'); + var loading = op.children('.replies-loading-icon'); + loading.css({'left': uf_r.outerWidth() - 7}); - if (cnt_op.data('rstatus') == 'hide') { + if (op.data('rstatus') == 'hide') { + uf_r.addClass('unfold-replies-nobg'); + loading.removeClass('hide'); $.ajax({ - url: url, + url: uf_r.data('url'), dataType: 'json', cache: true, success: function(data) { + loading.addClass('hide'); + uf_r.removeClass('unfold-replies-nobg'); r_list.html(data['html']); - r_cnt.addClass('hide'); - h_r.removeClass('hide') - cnt_op.data('rstatus', 'show').data('cnt', data['r_num']); - p.find('.reply').hover( + uf_r.addClass('hide'); + f_r.removeClass('hide') + op.data('rstatus', 'show').data('r_num', data['r_num']); + r_list.children().hover( function() { $(this).find('.op').removeClass('vh'); }, @@ -48,7 +52,7 @@ $('.reply-cnt-op').hover( $(this).find('.op').addClass('vh'); } ); - p.find('.reply-at').hover( + r_list.find('.reply-at').hover( function() { $(this).css({'text-decoration':'underline'}); }, @@ -59,12 +63,12 @@ $('.reply-cnt-op').hover( } }); } else { - h_r.addClass('hide'); - r_cnt.removeClass('hide'); - r_list.children(':lt(' + parseInt(cnt_op.data('cnt')-1) + ')').each(function(index) { + f_r.addClass('hide'); + uf_r.removeClass('hide'); + r_list.children(':lt(' + parseInt(op.data('r_num')-1) + ')').each(function(index) { $(this).remove(); }); - cnt_op.data('rstatus', 'hide'); + op.data('rstatus', 'hide'); } }); $('.reply-input').focus(function() { @@ -111,14 +115,14 @@ $('.reply-submit').click(function() { success: function(data) { r_list.html(data['html']).removeClass('hide'); if (data['r_num'] > 3) { - var r_cnt = p.find('.reply-cnt'); + var r_cnt = p.find('.unfold-replies'); r_cnt.html(r_cnt.html().replace(/\d+/, data['r_num'])); - p.find('.reply-cnt-op').removeClass('hide'); + p.find('.replies-op').removeClass('hide'); } enable(sm); r_input.val('').height(20); p.find('.reply-submit, .reply-cancel').addClass('hide'); - p.find('.reply').hover( + r_list.children().hover( function(){ $(this).find('.op').removeClass('vh'); }, @@ -126,7 +130,7 @@ $('.reply-submit').click(function() { $(this).find('.op').addClass('vh'); } ); - p.find('.reply-at').hover( + r_list.find('.reply-at').hover( function() { $(this).css({'text-decoration':'underline'}); }, diff --git a/group/templates/group/new_msg_reply.html b/group/templates/group/new_msg_reply.html index e8cbe2dd0d..4bedf60d1f 100644 --- a/group/templates/group/new_msg_reply.html +++ b/group/templates/group/new_msg_reply.html @@ -17,35 +17,35 @@ {{ msg.timestamp|translate_seahub_time }} {% trans "Group: " %}{{ msg.group_name }}
    -

    - {% if msg.attachment.src == 'recommend' %} - {% trans "Recommended" %} - {% if msg.attachment.attach_type == 'file' %} - - {% else %} - - {% endif %} - {{ msg.attachment.name }} : - - {% endif %} +

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

    + {% if msg.attachment %} + {% with ma=msg.attachment %} +
    + {% if ma.src == 'recommend' %} + {% if ma.attach_type == 'file' %} + {% trans + {{ ma.name }} + {% else %} + {% trans + {{ ma.name }} + {% endif %} + {% endif %} - {% if msg.attachment.src == 'filecomment' %} - {% trans "File " %} {{ msg.attachment.name }} {% trans "has a new comment:"%} + {% if ma.src == 'filecomment' %} {# compatible with comments already exist #} + {% trans + {{ ma.name }} + {% endif %} +
    + {% endwith %} {% endif %} - - {{ msg.message|seahub_urlize|find_at|linebreaksbr }} - -

    -
    - {% blocktrans with amount=msg.reply_cnt %}{{ amount }} replies{% endblocktrans %} - {% trans "Hide replies" %} +
    + {% blocktrans with amount=msg.reply_cnt %}{{ amount }} replies{% endblocktrans %} + {% trans "Hide replies" %} +
    - {% if msg.reply_cnt == 0 %} -
      - {% else %}
        {% for r in msg.replies %}
      • @@ -59,7 +59,6 @@
      • {% endfor %}
      - {% endif %}

      {% trans "It can not be blank and should be no more than 150 characters." %}

      diff --git a/group/views.py b/group/views.py index 411b1433bd..35868c45f3 100644 --- a/group/views.py +++ b/group/views.py @@ -372,9 +372,12 @@ def msg_reply_new(request): # get message replies reply_list = MessageReply.objects.filter(reply_to=m) - - m.replies = reply_list m.reply_cnt = reply_list.count() + if m.reply_cnt > 3: + m.replies = reply_list[m.reply_cnt - 3:] + else: + m.replies = reply_list + group_msgs.append(m) # remove new group msg reply notification @@ -665,6 +668,7 @@ def group_unshare_repo(request, repo_id, group_id, from_email): def group_recommend(request): """ Recommend a file or directory to a group. + now changed to 'post a discussion' """ if request.method != 'POST': raise Http404 @@ -714,8 +718,8 @@ def group_recommend(request): src='recommend') ma.save() - group_url = reverse('group_info', args=[group_id]) - msg = _(u'Successfully recommended to %(name)s.') %\ + group_url = reverse('group_discuss', args=[group_id]) + msg = _(u'Successfully posted to %(name)s.') %\ {'url':group_url, 'name':group.group_name} messages.add_message(request, messages.INFO, msg) diff --git a/media/css/seahub.css b/media/css/seahub.css index 8d8205e241..a0cce7b0d2 100644 --- a/media/css/seahub.css +++ b/media/css/seahub.css @@ -148,6 +148,7 @@ p { .label { color:#333; font-size:12px; font-style:normal; } .w100 { width: 100%; } .vh { visibility:hidden; } +.vam { vertical-align:middle; } .notification { padding:5px; background:#FDF; @@ -1497,6 +1498,11 @@ textarea:-moz-placeholder {/* for FF */ .msg-main .say { background-image:url('../img/say_white.png'); } +.msg-attachment { + padding-top:10px; + border-top:1px solid #e9e9e9; + margin-top:12px; +} .msg-hd .author { font-weight:bold; } @@ -1522,6 +1528,7 @@ textarea:-moz-placeholder {/* for FF */ margin-bottom:0; } .msg-op { + color:#444; padding:10px 16px; background:#f8f8f8; border:1px solid #d5d5d5; @@ -1529,17 +1536,34 @@ textarea:-moz-placeholder {/* for FF */ border-bottom-left-radius:3px; border-bottom-right-radius:3px; } -.reply-cnt-op { +.replies-op { font-weight:bold; cursor:pointer; margin-bottom:10px; + position:relative; +} +.unfold-replies, +.fold-replies { + padding-right:14px; + background:transparent scroll no-repeat right center; +} +.unfold-replies { + background-image:url('../img/unfold.png'); +} +.fold-replies { + background-image:url('../img/fold.png'); +} +.unfold-replies-nobg { + background-image:none; +} +.replies-loading-icon { + position:absolute; + top:0; } -.msg .recommend, .msg .at { color:#808; } .reply { - color:#444; line-height:1.2; margin-bottom:15px; } @@ -1547,7 +1571,9 @@ textarea:-moz-placeholder {/* for FF */ width: 93%; } .reply-con { - margin:0; + font-size:12px; + line-height:1.3; + margin:4px 0 0; } .reply-input { width:530px; @@ -1842,7 +1868,7 @@ textarea:-moz-placeholder {/* for FF */ /* File comment */ #file-comment, #to-group, -#recommend-to-group-form { +#discuss-to-group-form { width:400px; padding:0 15px; position:fixed; @@ -1875,7 +1901,7 @@ textarea:-moz-placeholder {/* for FF */ } #comment-caret, #to-group-caret, -#recommend-to-group-caret { +#discuss-to-group-caret { width:28px; position:fixed; } @@ -1892,12 +1918,13 @@ textarea:-moz-placeholder {/* for FF */ #to-group a:hover { text-decoration:none; } -/*recommend to group*/ -#recommend-to-group-form { +/*discuss to group*/ +#discuss-to-group-form { padding-bottom:10px; } -#recommend-to-group-form textarea { - width:100%; +#discuss-to-group-form .input { + padding:5px; + width:388px; height:5em; } /* text file diff */ diff --git a/media/img/fold.png b/media/img/fold.png new file mode 100644 index 0000000000000000000000000000000000000000..51164615c354cbb1f5895ec3f7e3d528ef0198b1 GIT binary patch literal 247 zcmeAS@N?(olHy`uVBq!ia0vp^Y(UJ;0V1_0*t`W&jKx9jP7LeL$-D%~CV9KNF#HF> z1$&oI28wVNctjR6FmMZlFeAgPITAoY_7YEDSN6Niylm>)OT7$E1BJ>xT^vI=uKS+Z z$jRg=;qoy5D%&>3gGZ%$cv!d%b_MvXV{$Yw-6WxG9C&8UWBrGEf-H^(kq1vc`~A0-2``tI?|E6SpC2FJ zeK?)cjOD<#Yhh2F3EWQ`}`$; z1NbNjVc!Mxx(meJOXi$bp6K`aa=GyQa7H>sKlPZs?xX2G;o7_ATU->b%ays5;>v>L zv@`4(z(mqJNObYNYh!>GYAMdkQdCPtq_nbFK}XVd%k|)yQM4h&7M4<-S*t4R%owu^ zT4EFA_H29X4idpynM-Yq)5!R?A-(v2TkSF1!+blqw4( zl}SnzkPIKH^r7;DC2!7ULlUzjOM)Y%vfh4Ux(cB?&3!(d}AyAKwG= zJazymf?~~*tv>I^=KWuiaW2<4Wr$KHX^KO$+?%zr>cFwj#L;NZzii6bCn80oyA<5BZlFYLD3-24tbs!c0;WJK$~O5Zh(l7f0}+R9PUY zOj4qNWcW~}50xJ*d2=osl9(k~5*%sua!d_0Zm0WR7lsOKh*Xv+Nk}n|Zr8f|_#Tkw zu>(L66l<1j^?5%w@86P)bGg1LLzFT}QyiM*-mHyP2abIvj?N220BVexYvn~P5@ML1 s#_{M?9HgGc1a|ufNiJ{yNdNKr3xIxo?L&fzXaE2J07*qoM6N<$f;KtX;s5{u diff --git a/media/img/unfold.png b/media/img/unfold.png new file mode 100644 index 0000000000000000000000000000000000000000..f5c5c1bdf3e6ae57a71fa6c6d723f8382e0724f7 GIT binary patch literal 257 zcmeAS@N?(olHy`uVBq!ia0vp^Y(UJ;0V1_0*t`W&jKx9jP7LeL$-D%~CV9KNF#HF> z1$&oI28wVNctjR6FmMZlFeAgPITAoY_7YEDSN6Niyle{cr}qc#1PV2Jx;Tb#TsJ+d z*wvIM;`Z?QbuH%Ws&|q~8S@TXI0{VWzOZ)(<3=eKK{XzpGg4339DCwTIH%qJQN;IL zHtm_BlHA&@(kahOl*(e$&J`Sx@t4{7qUtqsd_>sQm8Z{`ew&fdV!wv%?~j9`|92$( u@yz{jw|>s*EbEqQxAI+T9>#@6S1>cSsXVAZ_3;SMF$|urelF{r5}E*_ms;Qe literal 0 HcmV?d00001 diff --git a/templates/myhome.html b/templates/myhome.html index 929498c310..c711248113 100644 --- a/templates/myhome.html +++ b/templates/myhome.html @@ -22,20 +22,20 @@
        {% if grpmsg_list %}
      • - {% for grp in grpmsg_list %}{{ grp.group_name }} {% endfor %} + {% for grp in grpmsg_list %}{{ grp.group_name }} {% endfor %} {% blocktrans count counter=grpmsg_list|length %} - has new message + has new discussion {% plural %} - have new messages + have new discussions {% endblocktrans %}
      • {% endif %} {% if grpmsg_reply_list %}
      • {% blocktrans count counter=grpmsg_reply_list|length %} - one group message has new reply + one group discussion has new reply {% plural %} - {{ counter }} group messages have new replies + {{ counter }} group discussions have new replies {% endblocktrans %}
      • {% endif %} diff --git a/templates/snippets/bottom_bar.html b/templates/snippets/bottom_bar.html index d52d02f51a..3ff0674be7 100644 --- a/templates/snippets/bottom_bar.html +++ b/templates/snippets/bottom_bar.html @@ -1,29 +1,33 @@ {% load i18n %} {% load url from future %} -var Bottom_bar = '
        {% if groups %}{% endif %}
        '; +var Bottom_bar = '
        {% if groups %}{% endif %}
        '; $('#wrapper').append(Bottom_bar); -$('#main-panel').css('margin-bottom', $('#bottom-bar button').outerHeight() + 2); +$('#main-panel').css('margin-bottom', $('#bottom-bar').outerHeight() + 2); $('#footer').addClass('hide'); {% if groups %} -$('#recommend').click(function() { - if ($('#recommend-to-group-form').hasClass('hide')) { - $('#recommend-to-group-form, #recommend-to-group-caret').removeClass('hide'); - $('#recommend-to-group-caret').css('left', $('#recommend').offset().left); +$('#discuss').click(function() { + var form = $('#discuss-to-group-form'); + var caret = $('#discuss-to-group-caret'); + if (form.hasClass('hide')) { + form.removeClass('hide'); + caret.removeClass('hide'); + caret.css({'left': $(this).offset().left}); } else { - $('#recommend-to-group-form, #recommend-to-group-caret').addClass('hide'); + form.addClass('hide'); + caret.addClass('hide'); } }); $(document).click(function(e) { var target = e.target || event.srcElement; - if (!$('#recommend, #recommend-to-group-form, #recommend-to-group-caret').is(target) && !($('#recommend-to-group-form, #recommend-to-group-caret').find('*').is(target))) { - $('#recommend-to-group-form, #recommend-to-group-caret').addClass('hide'); + if (!$('#discuss, #discuss-to-group-form, #discuss-to-group-caret').is(target) && !($('#discuss-to-group-form, #discuss-to-group-caret').find('*').is(target))) { + $('#discuss-to-group-form, #discuss-to-group-caret').addClass('hide'); } }); -$('#recommend-submit').click(function() { - if (!$.trim($('#recommend-to-group-form [name="message"]').val())) { - apply_form_error('recommend-to-group-form', '{% trans "Please input recommend message." %}'); +$('#discuss-submit').click(function() { + if (!$.trim($('#discuss-to-group-form .input').val())) { + apply_form_error('discuss-to-group-form', '{% trans "Please input a discussion." %}'); return false; } }); @@ -59,6 +63,6 @@ $(document).click(function(e) { $(function() { var btn_height = $('#bottom-bar button').outerHeight(); - $('#recommend-to-group-caret, #to-group-caret, #comment-caret').css({'bottom': btn_height + 1}); - $('#file-comment, #to-group, #recommend-to-group-form').css({'bottom': btn_height + 1 + $('.outer-caret').outerHeight()}); + $('#discuss-to-group-caret, #to-group-caret, #comment-caret').css({'bottom': btn_height + 1}); + $('#file-comment, #to-group, #discuss-to-group-form').css({'bottom': btn_height + 1 + $('.outer-caret').outerHeight()}); }); diff --git a/templates/snippets/group_recommend_form.html b/templates/snippets/group_recommend_form.html index 7e64112654..4850a56e36 100644 --- a/templates/snippets/group_recommend_form.html +++ b/templates/snippets/group_recommend_form.html @@ -1,14 +1,7 @@ -{% load i18n %} +{% load seahub_tags i18n %} {% load url from future %} -
        {% csrf_token %} -

        {% trans "Recommend" %} - {% for name, link in zipped %} - {% if forloop.last %} - {{ name }} - {% endif %} - {% endfor %} - {% trans "to group:"%} -

        + {% csrf_token %} +

        {% trans "Post a discussion to group" %}

        {% for group in groups %} {% endfor %}
        - - + +
        + {% if attach_type == 'dir' %} + {% trans 'Directory icon' %} + {% endif %} + + {% for name,link in zipped %} + {% if forloop.last %} + {% if attach_type == 'file' %} + {% trans 'File' %} + {% endif %} + {{ name }} + {% endif %} + {% endfor %} +

        - +
        -
        +
        diff --git a/templates/view_file_base.html b/templates/view_file_base.html index 94f67f9d75..5e4e74b281 100644 --- a/templates/view_file_base.html +++ b/templates/view_file_base.html @@ -105,41 +105,6 @@ {% include "snippets/group_recommend_form.html" %} {% endwith %} - {% if request.user.is_authenticated %} -
        -
        -
        - {% avatar request.user.username 48 %} -
        -
        -

        - -
        -
        -
        - -
        -
        -
        -
        -
        -
        - {% endif %} {% endblock %} {% block extra_script %} @@ -281,81 +246,6 @@ $('#file-op .history').click(function () { //bottom bar {% include "snippets/bottom_bar.html" %} -{% if request.user.is_authenticated %} -$('#main-panel').css({'margin-bottom':0}); -$('#bottom-bar').append(''); -$('#file-comment').css({'max-height':$(window).height() * 0.7 - $('#bottom-bar').height() - $('#comment-caret').height()}); -{% if groups %} -var gids = ''; -{% for g in groups %} -gids += '{{ g.id }}_'; -{% endfor %} -addAtAutocomplete('#comment-input', '#comment-container', gids, "{% url 'group_attention' %}", {'width':'315px','padding-left':'1px','height':'36px','margin':'0','font-size':'13px', 'font-family':'Arial, Helvetica, sans-serif', 'line-height': '1.5em', 'border':'1px solid #ddd'}); -{% endif %} -$('#comment-input').bind('autocompleteopen', function(e, ui) { - var menu = $(this).autocomplete('widget'); - if (parseInt(menu.css('top')) > 0) { - menu.css('max-height', $('#file-comment').height() - parseInt(menu.css('top'))); - } else { - menu.css('max-height', $('#file-comment').offset().top); - } -}); -{% if comment_open %} -$('#file-comment, #comment-caret').removeClass('hide'); -$(function() { $('#comment-caret').css({'left': $('#comment').offset().left}); }); -$('#comment-list').css({'max-height':parseInt($('#file-comment').css('max-height')) - $('#file-comment-form').outerHeight(true), 'overflow':'auto'}); -{% endif %} -$('#comment').click(function() { - if ($('#file-comment').hasClass('hide')) { - $('#file-comment, #comment-caret').removeClass('hide'); - $('#comment-caret').css({'left':$('#comment').offset().left}); - $('#comment-list').css({'max-height':parseInt($('#file-comment').css('max-height')) - $('#file-comment-form').outerHeight(true), 'overflow':'auto'}); - } else { - $('#file-comment, #comment-caret').addClass('hide'); - } -}); -$(document).click(function(e) { - var target = e.target || event.srcElement; - if (!$('#comment, #file-comment, #comment-caret').is(target) && !($('#file-comment, #comment-caret').find('*').is(target))) { - $('#file-comment, #comment-caret').addClass('hide'); - } -}); - -var comment_input_pre_text = $('#comment-input').val(); -$('#comment-input').css('color', '#999').click(function() { - if ($(this).val() == comment_input_pre_text) { - $(this).val('').css('color', '#000'); - $('#file-comment-form .submit').removeClass('hide'); - $('#comment-list').css({'max-height':parseInt($('#file-comment').css('max-height')) - $('#file-comment-form').outerHeight(true), 'overflow':'auto'}); - } -}); -$('#file-comment-form .submit').click(function() { - if (!$.trim($('#comment-input').val())) { - $('#file-comment-form .error').html('{% trans "Please input a message." %}').removeClass('hide'); - return false; - } - $.ajax({ - url: '{% url 'views.file_comment' %}' + '?p={{path}}', - type: 'POST', - dataType: 'json', - contentType: 'application/json; charset=utf-8', - beforeSend: prepareCSRFToken, - data: { - 'repo_id': '{{ repo.id }}', - 'file_path': '{{ path|urlencode }}', - 'message': $('#comment-input').val() - }, - success: function(data) { - $('#comment-input').val(comment_input_pre_text).css('color', '#999'); - $('#file-comment-form .submit, #file-comment-form .error').addClass('hide'); - $('#comment-list').html(data.html); - }, - error: function() { - $('#file-comment-form .error').html('{% trans "Failed. Please check the network." %}').removeClass('hide'); - } - }); - return false; -}); -{% endif %} +$('#main-panel').css('margin-bottom',0); {% endblock %}