mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 07:01:12 +00:00
modified recommend
This commit is contained in:
@@ -1,13 +1,30 @@
|
||||
{% if groups %}
|
||||
var Bottom_bar = '<div id="bottom-bar"><button id="recommend">推荐到小组</button> <button>发送到私信</button></div>';
|
||||
{% else %}
|
||||
var Bottom_bar = '<div id="bottom-bar"><button>发送到私信</button></div>';
|
||||
{% endif %}
|
||||
|
||||
var Bottom_bar = '<div id="bottom-bar">{% if groups %}<button id="recommend">推荐到小组</button> {% endif %}<button>发送到私信</button></div>';
|
||||
$('#wrapper').append(Bottom_bar);
|
||||
$('#bottom-bar').css({'position':'fixed', 'bottom':0, 'left':$('#main').offset().left + $('#main').width() + 15});
|
||||
$('#recommend').click(function() {
|
||||
$('#recommend-form').modal({appendTo: '#main'});
|
||||
});
|
||||
$('#bottom-bar').css({'position':'fixed', 'bottom':0, 'right':'10px'});
|
||||
$('#main-panel').css('margin-bottom', '28px');
|
||||
$('#footer').addClass('hide');
|
||||
|
||||
{% if groups %}
|
||||
var group_list = []
|
||||
{% for group in groups %}
|
||||
group_list.push('{{ group.props.group_name }} <{{ group.props.creator_name }}>');
|
||||
{% endfor %}
|
||||
if (group_list.length == 1) {
|
||||
$('#recommend-groups').val(group_list[0]);
|
||||
}
|
||||
$('#recommend').click(function() {
|
||||
$('#recommend-form').modal({appendTo: '#main'});
|
||||
addAutocomplete('#recommend-groups', '#recommend-form', group_list);
|
||||
$('.ui-autocomplete').css({'max-height': window.innerHeight - $('.ui-autocomplete-input').offset().top - $('.ui-autocomplete-input').height() - 10, 'overflow': 'auto'});
|
||||
});
|
||||
$('#recommend-submit').click(function() {
|
||||
if (!$.trim($('#recommend-groups').val())) {
|
||||
apply_form_error('recommend-form', '小组名称不能为空。');
|
||||
return false;
|
||||
}
|
||||
if (!$.trim($('#recommend-msg').val())) {
|
||||
apply_form_error('recommend-form', '推荐语不能为空。');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
{% endif %}
|
||||
|
@@ -2,15 +2,14 @@
|
||||
<form action="{% url 'group_recommend' %}" method="post" id="recommend-form" class="hide">{% csrf_token %}
|
||||
<h3>推荐
|
||||
{% for name, link in zipped %}
|
||||
{% if not forloop.last %}
|
||||
{{ name }} /
|
||||
{% else %}
|
||||
{% if forloop.last %}
|
||||
{{ name }}
|
||||
{% endif %}
|
||||
{% endfor %} 到小组
|
||||
{% endfor %}
|
||||
到小组
|
||||
</h3>
|
||||
<label>小组名称:</label><br />
|
||||
<input type="input" name="groups" id="groups" value="" /><br />
|
||||
<input type="input" name="groups" id="recommend-groups" value="" /><br />
|
||||
<label>推荐语:</label><br />
|
||||
<textarea name="message" id="recommend-msg"></textarea><br />
|
||||
<input type="hidden" name="repo_id" value="{{ repo.id }}" />
|
||||
|
Reference in New Issue
Block a user