mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-15 23:00:57 +00:00
improved grp discuss; changed 'recommend' to 'discuss'; deleted 'file comment'
This commit is contained in:
@@ -1,29 +1,33 @@
|
||||
{% load i18n %}
|
||||
{% load url from future %}
|
||||
var Bottom_bar = '<div id="bottom-bar">{% if groups %}<button id="recommend">{% trans "Recommend" %}</button><button id="click-into-group">{% trans "Back to group" %}</button>{% endif %}</div>';
|
||||
var Bottom_bar = '<div id="bottom-bar">{% if groups %}<button id="discuss">{% trans "Discuss" %}</button><button id="click-into-group">{% trans "To group" %}</button>{% endif %}</div>';
|
||||
$('#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()});
|
||||
});
|
||||
|
@@ -1,14 +1,7 @@
|
||||
{% load i18n %}
|
||||
{% load seahub_tags i18n %}
|
||||
{% load url from future %}
|
||||
<form action="{% url 'group_recommend' %}" method="post" id="recommend-to-group-form" class="hide">{% csrf_token %}
|
||||
<h3>{% trans "Recommend" %}
|
||||
{% for name, link in zipped %}
|
||||
{% if forloop.last %}
|
||||
<span class="op-target">{{ name }}</span>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% trans "to group:"%}
|
||||
</h3>
|
||||
<form action="{% url 'group_recommend' %}" method="post" id="discuss-to-group-form" class="hide">{% csrf_token %}
|
||||
<h3>{% trans "Post a discussion to group" %}</h3>
|
||||
<div class="groups">
|
||||
{% for group in groups %}
|
||||
<label for="{{ group.id }}" class="checkbox-label">
|
||||
@@ -17,15 +10,28 @@
|
||||
</label>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<label>{% trans "Recommend Message"%}</label>
|
||||
<textarea name="message"></textarea>
|
||||
<textarea name="message" placeholder="{% trans 'discussion' %}" class="input"></textarea>
|
||||
<div class="attachment">
|
||||
{% if attach_type == 'dir' %}
|
||||
<img src="{{ MEDIA_URL }}img/folder-icon-24.png" alt="{% trans 'Directory icon' %}" height="20" class="vam" />
|
||||
{% endif %}
|
||||
|
||||
{% for name,link in zipped %}
|
||||
{% if forloop.last %}
|
||||
{% if attach_type == 'file' %}
|
||||
<img src="{{ MEDIA_URL }}img/file/{{ ma.name|file_icon_filter }}" alt="{% trans 'File' %}" height="18" class="vam" />
|
||||
{% endif %}
|
||||
<span class="vam">{{ name }}</span>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<input type="hidden" name="repo_id" value="{{ repo.id }}" />
|
||||
<input type="hidden" name="path" value="{{ path }}" />
|
||||
<input type="hidden" name="attach_type" value="{{ attach_type }}" />
|
||||
<p class="error hide"></p>
|
||||
<input type="submit" id="recommend-submit" class="submit" value="{% trans "Submit"%}" />
|
||||
<input type="submit" id="discuss-submit" class="submit" value="{% trans "Submit"%}" />
|
||||
</form>
|
||||
<div id="recommend-to-group-caret" class="hide">
|
||||
<div id="discuss-to-group-caret" class="hide">
|
||||
<div class="outer-caret">
|
||||
<div class="inner-caret"></div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user