From 4ac14a25f4789de28eb044d049657451be0a337e Mon Sep 17 00:00:00 2001
From: llj
- {% 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 }}
+ {{ ma.name }}
+ {% else %}
+
+ {{ 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 #}
+
+ {{ ma.name }}
+ {% endif %}
+
- {% 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 %} +{% 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`
{{ comment.message|seahub_urlize|find_at|linebreaksbr }}
-