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 %} - {% 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 0000000000..51164615c3 Binary files /dev/null and b/media/img/fold.png differ diff --git a/media/img/folder-icon-24.png b/media/img/folder-icon-24.png index 805892221b..363253a549 100644 Binary files a/media/img/folder-icon-24.png and b/media/img/folder-icon-24.png differ diff --git a/media/img/unfold.png b/media/img/unfold.png new file mode 100644 index 0000000000..f5c5c1bdf3 Binary files /dev/null and b/media/img/unfold.png differ 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 @@