mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-05 17:02:47 +00:00
Improve group discussion
This commit is contained in:
@@ -985,7 +985,7 @@
|
|||||||
<img src="<%= avatar_url %>" alt="" width="32" class="msg-avatar avatar-circle" />
|
<img src="<%= avatar_url %>" alt="" width="32" class="msg-avatar avatar-circle" />
|
||||||
<div class="msg-body">
|
<div class="msg-body">
|
||||||
<div class="msg-header">
|
<div class="msg-header">
|
||||||
<div class="msg-ops">
|
<div class="msg-ops hide">
|
||||||
<span class="msg-op js-reply-msg">{% trans "Reply" %}</span>
|
<span class="msg-op js-reply-msg">{% trans "Reply" %}</span>
|
||||||
<span class="msg-op js-del-msg">{% trans "Delete" %}</span>
|
<span class="msg-op js-del-msg">{% trans "Delete" %}</span>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -163,19 +163,19 @@
|
|||||||
<div class="no-discussion-tip" style="display:none;">
|
<div class="no-discussion-tip" style="display:none;">
|
||||||
<p>{% blocktrans %}No discussion in this group yet.{% endblocktrans %}</p>
|
<p>{% blocktrans %}No discussion in this group yet.{% endblocktrans %}</p>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
<form id="group-message-form" action="" method="post" class="msg-form">{% csrf_token %}
|
|
||||||
<img src="{% avatar_url request.user 64 %}" alt="" width="32" class="msg-avatar avatar-circle" />
|
|
||||||
<div class="msg-body">
|
|
||||||
<textarea name="message" id="add-discussion" placeholder="{% trans "Add a discussion..." %}" class="msg-input"></textarea>
|
|
||||||
<div class="ops">
|
|
||||||
<button type="submit" class="submit">{% trans "Submit" %}</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<p class="error hide"></p>
|
<p class="error hide"></p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="popover-footer">
|
||||||
|
<form id="group-message-form" action="" method="post" class="msg-form">{% csrf_token %}
|
||||||
|
<img src="{% avatar_url request.user 64 %}" alt="" width="32" class="msg-avatar avatar-circle" />
|
||||||
|
<div class="msg-body">
|
||||||
|
<textarea name="message" id="add-discussion" placeholder="{% trans "Add a discussion..." %}" class="msg-input"></textarea>
|
||||||
|
<div class="ops">
|
||||||
|
<button type="submit" class="submit">{% trans "Submit" %}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@@ -46,10 +46,12 @@ define([
|
|||||||
|
|
||||||
highlight: function() {
|
highlight: function() {
|
||||||
this.$el.addClass('hl');
|
this.$el.addClass('hl');
|
||||||
|
this.$('.msg-ops').show();
|
||||||
},
|
},
|
||||||
|
|
||||||
rmHighlight: function() {
|
rmHighlight: function() {
|
||||||
this.$el.removeClass('hl');
|
this.$el.removeClass('hl');
|
||||||
|
this.$('.msg-ops').hide();
|
||||||
},
|
},
|
||||||
|
|
||||||
reply: function() {
|
reply: function() {
|
||||||
|
@@ -18,6 +18,7 @@ define([
|
|||||||
|
|
||||||
this.$loadingTip = this.$('.loading-tip');
|
this.$loadingTip = this.$('.loading-tip');
|
||||||
this.$listContainer = this.$('#group-discussion-list');
|
this.$listContainer = this.$('#group-discussion-list');
|
||||||
|
this.$content = this.$('.popover-con');
|
||||||
this.$emptyTip = this.$('.no-discussion-tip');
|
this.$emptyTip = this.$('.no-discussion-tip');
|
||||||
this.$error = this.$('.error');
|
this.$error = this.$('.error');
|
||||||
|
|
||||||
@@ -66,6 +67,7 @@ define([
|
|||||||
this.collection.each(this.addOne, this);
|
this.collection.each(this.addOne, this);
|
||||||
this.$listContainer.removeClass('hide');
|
this.$listContainer.removeClass('hide');
|
||||||
this.$listContainer.show();
|
this.$listContainer.show();
|
||||||
|
this.$content.scrollTop(9999);
|
||||||
} else {
|
} else {
|
||||||
this.$emptyTip.show();
|
this.$emptyTip.show();
|
||||||
this.$listContainer.hide();
|
this.$listContainer.hide();
|
||||||
@@ -102,7 +104,14 @@ define([
|
|||||||
|
|
||||||
// set max-height for '.popover-con'
|
// set max-height for '.popover-con'
|
||||||
setConMaxHeight: function() {
|
setConMaxHeight: function() {
|
||||||
this.$('.popover-con').css({'max-height': $(window).height() - this.$el.offset().top - this.$('.popover-hd').outerHeight(true) - 2}); // 2: top, bottom border width of $el
|
this.$('.popover-con').css({
|
||||||
|
'max-height': $(window).height() - this.$el.offset().top
|
||||||
|
- this.$('.popover-hd').outerHeight(true)
|
||||||
|
- this.$('.popover-footer').outerHeight(true)
|
||||||
|
- 2
|
||||||
|
- 10
|
||||||
|
}); // 2: top, bottom border width of $el,
|
||||||
|
// 10: leave some margin at the bottom
|
||||||
},
|
},
|
||||||
|
|
||||||
show: function(options) {
|
show: function(options) {
|
||||||
|
Reference in New Issue
Block a user