Files
leanote/app/views/Share/note_notebook_share_user_infos.html
2014-05-07 13:06:24 +08:00

72 lines
2.8 KiB
HTML

<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="modalTitle">分享 <b>{{.title}}</b></h4>
</div>
{{$noteOrNotebookId := .noteOrNotebookId}}
<div class="modal-body">
<button class="btn btn-default" id="addShareNotebookBtn">添加分享</button>
<div id="shareMsg" class="alert alert-danger" style="display: none; margin: 5px 0 0 0;"></div>
<table class="table table-hover" id="shareNotebookTable">
<thead>
<tr>
<th>#</th>
<th>好友邮箱</th>
<th>权限</th>
<th>删除分享</th>
</tr>
</thead>
<tbody>
<tr id="tr1">
<td>#</td>
<td>
<input id="friendsEmail" type="text" class="form-control" style="width: 200px" placeholder="好友邮箱">
</td>
<td>
<label for="readPerm1"><input type="radio" name="perm1" checked="checked" value="0" id="readPerm1"> 只读</label>
<label for="writePerm1"><input type="radio" name="perm1" value="1" id="writePerm1"> 可编辑</label>
</td>
<td>
<button class="btn btn-success" onclick="addShareNoteOrNotebook(1)">分享</button>
<button class="btn btn-warning" onclick="deleteShareNoteOrNotebook(1)">删除</button>
</td>
</tr>
{{range $i, $v := .noteOrNotebookShareUserInfos}}
{{$toUserId := $v.ToUserId.Hex}}
<tr>
<td>{{add $i}}</td>
<td>{{$v.Email}}</td>
<td>
{{if eq $v.Perm 0}}
<a href="#" noteOrNotebookId="{{$noteOrNotebookId}}" perm="{{$v.Perm}}" toUserId="{{$toUserId}}" title="点击改变权限" class="btn btn-default change-perm">只读</a>
{{else}}
<a href="#" noteOrNotebookId="{{$noteOrNotebookId}}" perm="{{$v.Perm}}" toUserId="{{$toUserId}}" title="点击改变权限" class="btn btn-default change-perm">可编辑</a>
{{end}}
</td>
<td>
<a href="#" noteOrNotebookId="{{$noteOrNotebookId}}" toUserId="{{$toUserId}}" class="btn btn-warning delete-share">删除</a>
</td>
</tr>
{{end}}
</tbody>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
<script>
Share.dialogIsNote = {{.isNote}};
Share.dialogNoteOrNotebookId = '{{.noteOrNotebookId}}';
$(function() {
setTimeout(function() {
$("#tr1 #friendsEmail").focus();
}, 500);
});
</script>