未完成

pull/6/head
guanghongwei 2015-03-01 23:34:00 +08:00
parent a50d3ba692
commit 458ca42f22
4 changed files with 12 additions and 6 deletions

View File

@ -125,6 +125,6 @@ def to_role_name(role_id):
return role_dict.get(str(role_id), '未知')
@register.filter(name='to_avatar')
def to_avatar(role_id):
def to_avatar(role_id='0'):
role_dict = {'0': 'user', '1': 'admin', '2': 'root'}
return role_dict.get(str(role_id), 'user')

View File

@ -107,3 +107,9 @@ function move_all(from, to){
});
}
//function commit_select(form_array){
// $('#{0} option'.format(form_array)).each(function(){
// $(this).prop('selected', true)
// })
//}

View File

@ -87,7 +87,7 @@
<div class="form-group">
<div class="col-sm-4 col-sm-offset-2">
<button class="btn btn-white" type="reset">取消</button>
<button id="submit_button" class="btn btn-primary" type="submit">确认保存</button>
<button id="submit_button" class="btn btn-primary" type="submit">确认保存</button>
</div>
</div>
</form>
@ -120,9 +120,9 @@ $('#groupForm').validator({
}
});
$(document).ready(function(){
$("#submit_button").click(function(){
$('#users_selected option').each(function(){
$(document).ready(function() {
$("#submit_button").click(function () {
$('#users_selected option').each(function () {
$(this).prop('selected', true)
})
})

View File

@ -86,7 +86,7 @@
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<label for="groups" class="col-lg-2 control-label">用户</label>
<label for="groups" class="col-lg-2 control-label"></label>
<div class="col-sm-8">
<select id="groups" name="groups" class="form-control m-b" multiple size="12">
{% for group in auth_groups %}