-
{% 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." %}
{% trans "Submit" %}
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 @@
{% 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 %}{% trans "Recommend" %} {% trans "Back to group" %} {% endif %}
';
+var Bottom_bar = '{% if groups %}{% trans "Discuss" %} {% trans "To group" %} {% 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 %}
-
-
+
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 %}
-
-
- {% 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 %}
{{ comment.message|seahub_urlize|find_at|linebreaksbr }}
-