socialforge/app/views/users/_user_group_attr.html.erb

49 lines
2.6 KiB
Plaintext
Raw Normal View History

2016-09-13 16:18:57 +08:00
<div id="groupHomework">
<div> <span class="f14 mt5 fl fontGrey3 mr10">分组设置:</span>
<div class="mr50 fl"> <span class="f14 fontGrey3 mr5">每组最小人数:</span>
2016-09-30 16:32:12 +08:00
<input id="min_num" type="text" name="min_num" class="markInput" value="<%=(edit_mode && homework.is_group_homework?) ? homework.homework_detail_group.min_num : 2 %>" <%=(not_allow_select && homework.is_group_homework?) ? "onchange = regex_scope(#{homework.homework_detail_group.min_num}, 1)" : '' %>/>人
2016-09-13 16:18:57 +08:00
</div>
<div class="fl"> <span class="f14 fontGrey3 mr5">每组最大人数:</span>
2016-09-30 16:32:12 +08:00
<input id="max_num" type="text" name="max_num" class="markInput" value="<%=(edit_mode && homework.is_group_homework?) ? homework.homework_detail_group.max_num : 10 %>" <%=(not_allow_select && homework.is_group_homework?) ? "onchange = regex_scope(#{homework.homework_detail_group.max_num}, 2)" : '' %>/>人
2016-09-13 16:18:57 +08:00
</div>
<span class="c_red undis ml20 mt7 fl" id="min_max_num_notice"></span>
<div class="cl"></div>
<div class="ml80">
<label>
<input type="checkbox" class="mr5" name="base_on_project" value="<%=(edit_mode && homework.is_group_homework?) ? homework.homework_detail_group.base_on_project : 1 %>" id="base_on_project" <%=not_allow_select ? 'disabled' : '' %>/>
<span class="f14 fontGrey3 mr10">基于项目实施</span>
</label>
<p class="c_red">提醒勾选后各小组必须在Trustie平台创建项目教师可随时观察平台对各小组最新进展的实时统计</p>
</div>
<div class="cl"></div>
</div>
2015-12-02 11:14:46 +08:00
</div>
2016-09-13 16:18:57 +08:00
<div class="cl"></div>
<script>
$(function () {
if($.trim($("#base_on_project").val()) == 1) {
$("#base_on_project").attr('checked','checked');
}
2016-09-30 16:32:12 +08:00
<% if not_allow_select && homework.is_group_homework? %>
$("#min_num").on('change', function() {
var min_num = <%=homework.homework_detail_group.min_num %>;
if(parseInt($(this).val()) > min_num) {
$(this).val(min_num);
$("#min_max_num_notice").html('分组范围不可缩小').show();
} else {
$("#min_max_num_notice").html('').hide();
}
});
$("#max_num").on('change', function() {
var max_num = <%=homework.homework_detail_group.max_num %>;
if(parseInt($(this).val()) < max_num) {
$(this).val(max_num);
$("#min_max_num_notice").html('分组范围不可缩小').show();
} else {
$("#min_max_num_notice").html('').hide();
}
});
<% end %>
});
2016-09-13 16:18:57 +08:00
</script>