2014-10-28 14:48:22 +08:00
|
|
|
<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">×</button>
|
|
|
|
<h4 class="modal-title" id="modalTitle">{{msg . "share"}} <b>{{.title}}</b></h4>
|
|
|
|
</div>
|
|
|
|
{{$noteOrNotebookId := .noteOrNotebookId}}
|
|
|
|
|
|
|
|
<div class="modal-body">
|
|
|
|
<button class="btn btn-default" id="addShareNotebookBtn">{{msg . "addShare"}}</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>{{msg . "friendEmail"}}</th>
|
|
|
|
<th>{{msg . "permission"}}</th>
|
|
|
|
<th width="150px">{{msg . "delete"}}</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr id="tr1">
|
|
|
|
<td>#</td>
|
|
|
|
<td>
|
|
|
|
<input id="friendsEmail" type="text" class="form-control" placeholder="{{msg . "friendEmail"}}">
|
|
|
|
</td>
|
|
|
|
<td>
|
2014-11-09 16:24:19 +08:00
|
|
|
<label for="readPerm1"><input type="radio" name="perm1" checked="checked" value="0" id="readPerm1"> {{msg $ "readOnly"}}</label>
|
|
|
|
<label for="writePerm1"><input type="radio" name="perm1" value="1" id="writePerm1"> {{msg $ "writable"}}</label>
|
2014-10-28 14:48:22 +08:00
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<button class="btn btn-success" onclick="addShareNoteOrNotebook(1)">{{msg . "share"}}</button>
|
|
|
|
<button class="btn btn-warning" onclick="deleteShareNoteOrNotebook(1)">{{msg . "delete"}}</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}}
|
2014-11-09 16:24:19 +08:00
|
|
|
<a href="#" noteOrNotebookId="{{$noteOrNotebookId}}" perm="{{$v.Perm}}" toUserId="{{$toUserId}}" title="点击改变权限" class="btn btn-default change-perm">{{msg $ "readOnly"}}</a>
|
2014-10-28 14:48:22 +08:00
|
|
|
{{else}}
|
2014-11-09 16:24:19 +08:00
|
|
|
<a href="#" noteOrNotebookId="{{$noteOrNotebookId}}" perm="{{$v.Perm}}" toUserId="{{$toUserId}}" title="点击改变权限" class="btn btn-default change-perm">{{msg $ "writable"}}</a>
|
2014-10-28 14:48:22 +08:00
|
|
|
{{end}}
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<a href="#" noteOrNotebookId="{{$noteOrNotebookId}}" toUserId="{{$toUserId}}" class="btn btn-warning delete-share">{{msg . "delete"}}</a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{end}}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="modal-footer">
|
|
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">{{msg . "close"}}</button>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div><!-- /.modal-content -->
|
|
|
|
</div><!-- /.modal-dialog -->
|
|
|
|
<script>
|
|
|
|
Share.dialogIsNote = {{.isNote}};
|
|
|
|
Share.dialogNoteOrNotebookId = '{{.noteOrNotebookId}}';
|
|
|
|
$(function() {
|
|
|
|
setTimeout(function() {
|
|
|
|
$("#tr1 #friendsEmail").focus();
|
|
|
|
}, 500);
|
|
|
|
});
|
|
|
|
</script>
|