mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-17 07:41:26 +00:00
[invitations] bugfix & improvment
This commit is contained in:
@@ -158,6 +158,7 @@
|
|||||||
.sf2-icon-copy:before { content: "\e028"; }
|
.sf2-icon-copy:before { content: "\e028"; }
|
||||||
.sf2-icon-move:before { content: "\e029"; }
|
.sf2-icon-move:before { content: "\e029"; }
|
||||||
.sf2-icon-reply:before { content: "\e02a"; }
|
.sf2-icon-reply:before { content: "\e02a"; }
|
||||||
|
.sf2-icon-invite:before { content: "\e02b"; }
|
||||||
|
|
||||||
/******* tags **********/
|
/******* tags **********/
|
||||||
body,
|
body,
|
||||||
|
Binary file not shown.
@@ -50,4 +50,5 @@
|
|||||||
<glyph glyph-name="copy241" unicode="" d="M160 382l273 0 0-333-273 0z m-79 83l0-333 53 0 0 278 218 0 0 55z"/>
|
<glyph glyph-name="copy241" unicode="" d="M160 382l273 0 0-333-273 0z m-79 83l0-333 53 0 0 278 218 0 0 55z"/>
|
||||||
<glyph glyph-name="move241" unicode="" d="M256 386l0 51-203 0 0-362 406 0 0 311z m55-226l0 53-181 0 0 52 184 0 0 53 76-77z"/>
|
<glyph glyph-name="move241" unicode="" d="M256 386l0 51-203 0 0-362 406 0 0 311z m55-226l0 53-181 0 0 52 184 0 0 53 76-77z"/>
|
||||||
<glyph glyph-name="reply" unicode="" d="M235 326c108 0 207-98 213-217-53 47-119 77-192 77-6 0-15 0-21 0l0-94c0-7-5-9-9-5l-158 160c-4 5-4 11 0 15l158 163c4 4 9 2 9-5z"/>
|
<glyph glyph-name="reply" unicode="" d="M235 326c108 0 207-98 213-217-53 47-119 77-192 77-6 0-15 0-21 0l0-94c0-7-5-9-9-5l-158 160c-4 5-4 11 0 15l158 163c4 4 9 2 9-5z"/>
|
||||||
|
<glyph glyph-name="invite" unicode="" d="M303 286l177 0 0-43-177 0z m68 72l39 0 0-189-39 0z m-170-125c53 0 85 87 85 136 0 49-39 92-85 92-47 0-86-41-86-92 0-51 32-136 86-136z m0-184c147 0 168 0 168 45 0 64-75 115-168 115-94 0-169-51-169-115 0-45 21-45 169-45z"/>
|
||||||
</font></defs></svg>
|
</font></defs></svg>
|
||||||
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Binary file not shown.
Binary file not shown.
@@ -9,7 +9,7 @@
|
|||||||
<p style="color:#121214;font-size:14px;">{% trans "Hi," %}</p>
|
<p style="color:#121214;font-size:14px;">{% trans "Hi," %}</p>
|
||||||
|
|
||||||
<p style="font-size:14px;color:#434144;">
|
<p style="font-size:14px;color:#434144;">
|
||||||
{% blocktrans %}{{ inviter }} invites you to join {{ site_name }}. Please click the link below:{% endblocktrans %}
|
{% blocktrans %}{{ inviter }} invited you to join {{ site_name }}. Please click the link below:{% endblocktrans %}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<a href="{{ url_base }}{% url 'invitations:token_view' token %}" target="_blank">{{ url_base }}{% url 'invitations:token_view' token %}</a>
|
<a href="{{ url_base }}{% url 'invitations:token_view' token %}" target="_blank">{{ url_base }}{% url 'invitations:token_view' token %}</a>
|
||||||
|
@@ -1 +1 @@
|
|||||||
{% load i18n%}{% blocktrans %}{{ inviter }} invite you to join {{ site_name}}{% endblocktrans %}
|
{% load i18n%}{% blocktrans %}{{ inviter }} invited you to join {{ site_name}}{% endblocktrans %}
|
||||||
|
@@ -1,31 +1,31 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% block sub_title %}{% trans "Create Account" %}{% endblock %}
|
{% block sub_title %}{% trans "Create Account" %} - {% endblock %}
|
||||||
|
|
||||||
{% block extra_style %}
|
{% block main_content %}
|
||||||
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/bootstrap.popover.min.css" />
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block main_panel %}
|
|
||||||
<div class="new-narrow-panel">
|
<div class="new-narrow-panel">
|
||||||
<h2 class="hd">{% trans "Set your password" %}</h2>
|
<h2 class="hd">{% trans "Set your password" %}</h2>
|
||||||
<form action="" method="post" class="con">{% csrf_token %}
|
<form action="" method="post" class="con">{% csrf_token %}
|
||||||
<label for="id_email">{% trans "Email address" %} {{ iv.accepter }}</label><br/>
|
<label>{% trans "Email" %} </label><br />
|
||||||
|
<input type="text" disabled="disabled" value="{{ iv.accepter }}" class="input input-disabled" /><br />
|
||||||
|
|
||||||
<label for="id_new_password1">{% trans "Password" %}</label>
|
<label for="password">{% trans "Password" %}</label>
|
||||||
<input type="password" name="password" id="password" value="" class="input" autocomplete="off" />
|
<input type="password" name="password" id="password" value="" class="input" autocomplete="off" />
|
||||||
|
|
||||||
<p class="error hide"></p>
|
<p class="error hide"></p>
|
||||||
<input type="submit" value="{% trans "Submit" %}" class="submit" />
|
<input type="submit" value="{% trans "Submit" %}" class="submit" />
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block extra_script %}
|
{% block extra_script %}
|
||||||
<script type="text/javascript" src="{{MEDIA_URL}}js/bootstrap.min.js"></script>
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$('[type="password"]').addClass('input');
|
$('form').submit(function() {
|
||||||
|
if (!$.trim($('[name="password"]', $(this)).val())) {
|
||||||
|
$('.error').html("{% trans "It is required." %}").show();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@@ -45,6 +45,11 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<li class="tab"><a href="{{ SITE_ROOT }}#devices/" class="ellipsis" title="{% trans "Linked Devices" %}"><span class="sf2-icon-monitor" aria-hidden="true"></span>{% trans "Linked Devices" %}</a></li>
|
<li class="tab"><a href="{{ SITE_ROOT }}#devices/" class="ellipsis" title="{% trans "Linked Devices" %}"><span class="sf2-icon-monitor" aria-hidden="true"></span>{% trans "Linked Devices" %}</a></li>
|
||||||
|
{% if user.permissions.can_invite_guest %}
|
||||||
|
<li class="tab">
|
||||||
|
<a href="{{ SITE_ROOT }}#invitations/"><span aria-hidden="true" class="sf2-icon-invite"></span>{% trans "Invite People" %}</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h3 class="hd">{% trans "Share Admin" %}</h3>
|
<h3 class="hd">{% trans "Share Admin" %}</h3>
|
||||||
|
@@ -56,6 +56,9 @@
|
|||||||
<a href="{{ SITE_ROOT }}sys/virus_scan_records/"><span class="sf2-icon-security"></span>{% trans "Virus Scan" %}</a>
|
<a href="{{ SITE_ROOT }}sys/virus_scan_records/"><span class="sf2-icon-security"></span>{% trans "Virus Scan" %}</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<li class="tab">
|
||||||
|
<a href="{{ SITE_ROOT }}sys/invitationadmin/"><span class="sf2-icon-invite"></span>{% trans "Invitations" %}</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<% if (cur_tab == 'libraries') { %>
|
<% if (cur_tab == 'libraries') { %>
|
||||||
<% if (option == 'all') { %>
|
<% if (option == 'all') { %>
|
||||||
|
@@ -696,7 +696,7 @@
|
|||||||
</li>
|
</li>
|
||||||
{% if user.permissions.can_invite_guest %}
|
{% if user.permissions.can_invite_guest %}
|
||||||
<li class="tab<% if (cur_tab == 'invitations') { %> tab-cur<% } %>">
|
<li class="tab<% if (cur_tab == 'invitations') { %> tab-cur<% } %>">
|
||||||
<a href="{{ SITE_ROOT }}#invitations/"><span aria-hidden="true" class="sf2-icon-clock"></span>{% trans "Invite People" %}</a>
|
<a href="{{ SITE_ROOT }}#invitations/"><span aria-hidden="true" class="sf2-icon-invite"></span>{% trans "Invite People" %}</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
@@ -1688,20 +1688,20 @@
|
|||||||
<h3 class="fleft">{% trans "Invite People" %}</h3>
|
<h3 class="fleft">{% trans "Invite People" %}</h3>
|
||||||
<button id="invite-people" class="btn-white fright"><span aria-hidden="true" class="icon-plus-square add vam"></span><span class="vam">{% trans "Invite People" %}</span></button>
|
<button id="invite-people" class="btn-white fright"><span aria-hidden="true" class="icon-plus-square add vam"></span><span class="vam">{% trans "Invite People" %}</span></button>
|
||||||
</div>
|
</div>
|
||||||
|
<span class="loading-icon loading-tip"></span>
|
||||||
<table class="hide">
|
<table class="hide">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th width="35%">{% trans "Email" %}</th>
|
<th width="35%">{% trans "Email" %}</th>
|
||||||
<th width="20%">{% trans "Invite at" %}</th>
|
<th width="20%">{% trans "Invite Time" %}</th>
|
||||||
<th width="20%">{% trans "Expiration" %}</th>
|
<th width="20%">{% trans "Expiration" %}</th>
|
||||||
<th width="17%">{% trans "Accpted" %}</th>
|
<th width="18%">{% trans "Accepted" %}</th>
|
||||||
<th width="8%"><!--Operations--></th>
|
<th width="7%"><!--Operations--></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<span class="loading-icon loading-tip"></span>
|
|
||||||
<div class="empty-tips hide">
|
<div class="empty-tips hide">
|
||||||
<h2 class="alc">{% trans "You have not invited any people." %}</h2>
|
<h2 class="alc">{% trans "You have not invited any people." %}</h2>
|
||||||
</div>
|
</div>
|
||||||
@@ -1710,10 +1710,10 @@
|
|||||||
|
|
||||||
<script type="text/template" id="invitation-item-tmpl">
|
<script type="text/template" id="invitation-item-tmpl">
|
||||||
<td><%- accepter %></td>
|
<td><%- accepter %></td>
|
||||||
<td><time title='<%- invite_time_format %>'><%- invite_time_from_now %></time></td>
|
<td><time title='<%= invite_time_format %>'><%= invite_time_from_now %></time></td>
|
||||||
<td><time title='<%- expire_time_format %>'><%- expire_time_from_now %></time></td>
|
<td><time title='<%= expire_time_format %>'><%= expire_time_from_now %></time></td>
|
||||||
<% if (accept_time) { %>
|
<% if (accept_time) { %>
|
||||||
<td><span class="sf2-icon-tick tick-yes"></span></td>
|
<td><span class="sf2-icon-tick tick-green"></span></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
<td></td>
|
<td></td>
|
||||||
@@ -1723,10 +1723,11 @@
|
|||||||
|
|
||||||
<script type="text/template" id="invitation-form-tmpl">
|
<script type="text/template" id="invitation-form-tmpl">
|
||||||
<form id="invitation-form" action="" method="post">{% csrf_token %}
|
<form id="invitation-form" action="" method="post">{% csrf_token %}
|
||||||
<h3 id="dialogTitle">{% trans "Invite People"%}</h3>
|
<h3 id="dialogTitle">{% trans "Invite People" %}</h3>
|
||||||
<label for="accepter">{% trans "email"%}</label><br/>
|
<label for="accepter">{% trans "Email" %}</label><br/>
|
||||||
<input type="text" name="accepter" value="" class="input" /><br />
|
<input id="accepter" type="text" name="accepter" value="" class="input" /><br />
|
||||||
<p class="error hide"></p>
|
<p class="error hide"></p>
|
||||||
<input type="submit" value="{% trans "Submit"%}" class="submit" />
|
<input type="submit" value="{% trans "Submit" %}" class="submit vam" />
|
||||||
|
<span class="loading-icon vam" style="margin-left:5px;display:none;"></span>
|
||||||
</form>
|
</form>
|
||||||
</script>
|
</script>
|
||||||
|
@@ -63,7 +63,7 @@
|
|||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<li class="tab {% block cur_invitations %}{% endblock %}">
|
<li class="tab {% block cur_invitations %}{% endblock %}">
|
||||||
<a href="{{ SITE_ROOT }}sys/invitationadmin/"><span class="sf2-icon-security"></span>{% trans "Invitations" %}</a>
|
<a href="{{ SITE_ROOT }}sys/invitationadmin/"><span class="sf2-icon-invite"></span>{% trans "Invitations" %}</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
@@ -18,7 +18,11 @@
|
|||||||
{% for invitation in invitations %}
|
{% for invitation in invitations %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{% url 'user_info' invitation.inviter %}">{{ invitation.inviter }}</a></td>
|
<td><a href="{% url 'user_info' invitation.inviter %}">{{ invitation.inviter }}</a></td>
|
||||||
|
{% if invitation.accept_time %}
|
||||||
<td><a href="{% url 'user_info' invitation.accepter %}">{{ invitation.accepter }}</a></td>
|
<td><a href="{% url 'user_info' invitation.accepter %}">{{ invitation.accepter }}</a></td>
|
||||||
|
{% else %}
|
||||||
|
<td>{{ invitation.accepter }}</td>
|
||||||
|
{% endif %}
|
||||||
<td>{{ invitation.invite_type }}</td>
|
<td>{{ invitation.invite_type }}</td>
|
||||||
<td>{{ invitation.invite_time|translate_seahub_time }} </td>
|
<td>{{ invitation.invite_time|translate_seahub_time }} </td>
|
||||||
{% if invitation.accept_time %}
|
{% if invitation.accept_time %}
|
||||||
@@ -32,7 +36,9 @@
|
|||||||
|
|
||||||
{% include "snippets/admin_paginator.html" %}
|
{% include "snippets/admin_paginator.html" %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>{% trans "Empty" %}</p>
|
<div class="empty-tips">
|
||||||
|
<p>{% trans "There is no invitation yet." %}</p>
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
@@ -8,7 +8,7 @@ define([
|
|||||||
|
|
||||||
var Invitations = Backbone.Collection.extend({
|
var Invitations = Backbone.Collection.extend({
|
||||||
model: Invitation,
|
model: Invitation,
|
||||||
url: function () {
|
url: function() {
|
||||||
return Common.getUrl({name: 'invitations'});
|
return Common.getUrl({name: 'invitations'});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -18,7 +18,7 @@ define([
|
|||||||
},
|
},
|
||||||
|
|
||||||
events: {
|
events: {
|
||||||
'click .rm-invitation': 'removeInvitation',
|
'click .rm-invitation': 'removeInvitation'
|
||||||
},
|
},
|
||||||
|
|
||||||
removeInvitation: function() {
|
removeInvitation: function() {
|
||||||
@@ -30,6 +30,7 @@ define([
|
|||||||
'token': this.model.get('token')
|
'token': this.model.get('token')
|
||||||
}),
|
}),
|
||||||
type: 'DELETE',
|
type: 'DELETE',
|
||||||
|
cache: false,
|
||||||
beforeSend: Common.prepareCSRFToken,
|
beforeSend: Common.prepareCSRFToken,
|
||||||
success: function() {
|
success: function() {
|
||||||
_this.remove();
|
_this.remove();
|
||||||
|
@@ -4,7 +4,7 @@ define([
|
|||||||
'backbone',
|
'backbone',
|
||||||
'common',
|
'common',
|
||||||
'app/views/invitation',
|
'app/views/invitation',
|
||||||
'app/collections/invitations',
|
'app/collections/invitations'
|
||||||
], function($, _, Backbone, Common, InvitedPeopleView,
|
], function($, _, Backbone, Common, InvitedPeopleView,
|
||||||
InvitedPeopleCollection) {
|
InvitedPeopleCollection) {
|
||||||
|
|
||||||
@@ -12,83 +12,105 @@ define([
|
|||||||
|
|
||||||
var InvitationsView = Backbone.View.extend({
|
var InvitationsView = Backbone.View.extend({
|
||||||
|
|
||||||
id: 'invited_peoples',
|
id: 'invitations',
|
||||||
|
|
||||||
template: _.template($('#invitations-tmpl').html()),
|
template: _.template($('#invitations-tmpl').html()),
|
||||||
invitePeopleFormTemplate: _.template($('#invitation-form-tmpl').html()),
|
inviteFormTemplate: _.template($('#invitation-form-tmpl').html()),
|
||||||
|
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
this.invitedPeoples = new InvitedPeopleCollection();
|
this.collection = new InvitedPeopleCollection();
|
||||||
this.listenTo(this.invitedPeoples, 'reset', this.reset);
|
this.listenTo(this.collection, 'add', this.addOne);
|
||||||
|
this.listenTo(this.collection, 'reset', this.reset);
|
||||||
this.render();
|
this.render();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
render: function() {
|
||||||
|
this.$el.html(this.template());
|
||||||
|
this.$loadingTip = this.$('.loading-tip');
|
||||||
|
this.$table = this.$('table');
|
||||||
|
this.$tableBody = $('tbody', this.$table);
|
||||||
|
this.$emptyTip = this.$('.empty-tips');
|
||||||
|
this.$error = this.$('.error');
|
||||||
|
},
|
||||||
|
|
||||||
events: {
|
events: {
|
||||||
'click #invite-people': 'invitePeople'
|
'click #invite-people': 'invitePeople'
|
||||||
},
|
},
|
||||||
|
|
||||||
invitePeople: function() {
|
invitePeople: function() {
|
||||||
var form = $(this.invitePeopleFormTemplate()),
|
var _this = this;
|
||||||
form_id = form.attr('id'),
|
var $form = $(this.inviteFormTemplate());
|
||||||
_this = this;
|
var form_id = $form.attr('id');
|
||||||
|
|
||||||
form.modal({appendTo:'#main'});
|
$form.modal({appendTo:'#main'});
|
||||||
$('#simplemodal-container').css({'height':'auto'});
|
$('#simplemodal-container').css({'height':'auto'});
|
||||||
|
|
||||||
form.submit(function() {
|
$form.submit(function() {
|
||||||
var accepter = $.trim($('input[name="accepter"]', form).val());
|
var accepter = $.trim($('input[name="accepter"]', $form).val());
|
||||||
|
var $error = $('.error', $form);
|
||||||
|
var $submitBtn = $('[type="submit"]', $form);
|
||||||
|
var $loading = $('.loading-icon', $form);
|
||||||
if (!accepter) {
|
if (!accepter) {
|
||||||
Common.showFormError(form_id, gettext("It is required."));
|
$error.html(gettext("It is required.")).show();
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
var post_data = {'type': 'guest', 'accepter': accepter},
|
$error.hide();
|
||||||
post_url = Common.getUrl({name: "invitations"});
|
Common.disableButton($submitBtn);
|
||||||
|
$loading.show();
|
||||||
var after_op_success = function(data) {
|
_this.collection.create({
|
||||||
$.modal.close();
|
'type': 'guest',
|
||||||
var new_people_invited = _this.invitedPeoples.add({
|
'accepter': accepter
|
||||||
'accepter': data['accepter'],
|
}, {
|
||||||
'type': data['type'],
|
wait: true,
|
||||||
'accept_time': '',
|
prepend: true,
|
||||||
'invite_time': data['invite_time'],
|
success: function() {
|
||||||
'expire_time': data['expire_time']
|
if (_this.collection.length == 1) {
|
||||||
}, {silent:true});
|
_this.reset();
|
||||||
|
}
|
||||||
var view = new InvitedPeopleView({model: new_people_invited});
|
$.modal.close();
|
||||||
_this.$tableBody.prepend(view.render().el);
|
},
|
||||||
};
|
error: function(collection, response, options) {
|
||||||
|
var err_msg;
|
||||||
Common.ajaxPost({
|
if (response.responseText) {
|
||||||
'form': form,
|
err_msg = response.responseJSON.error_msg;
|
||||||
'post_url': post_url,
|
} else {
|
||||||
'post_data': post_data,
|
err_msg = gettext('Please check the network.');
|
||||||
'after_op_success': after_op_success,
|
}
|
||||||
'form_id': form_id
|
$error.html(err_msg).show();
|
||||||
|
Common.enableButton($submitBtn);
|
||||||
|
},
|
||||||
|
complete: function() {
|
||||||
|
$loading.hide();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
addOne: function(invitedPeople) {
|
addOne: function(item, collection, options) {
|
||||||
var view = new InvitedPeopleView({model: invitedPeople});
|
var view = new InvitedPeopleView({model: item});
|
||||||
this.$tableBody.append(view.render().el);
|
if (options.prepend) {
|
||||||
|
this.$tableBody.prepend(view.render().el);
|
||||||
|
} else {
|
||||||
|
this.$tableBody.append(view.render().el);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
initPage: function() {
|
initPage: function() {
|
||||||
|
this.$loadingTip.show();
|
||||||
this.$table.hide();
|
this.$table.hide();
|
||||||
this.$tableBody.empty();
|
this.$tableBody.empty();
|
||||||
this.$loadingTip.show();
|
|
||||||
this.$emptyTip.hide();
|
this.$emptyTip.hide();
|
||||||
|
this.$error.hide();
|
||||||
},
|
},
|
||||||
|
|
||||||
reset: function() {
|
reset: function() {
|
||||||
this.$tableBody.empty();
|
this.$error.hide();
|
||||||
this.$loadingTip.hide();
|
if (this.collection.length) {
|
||||||
this.invitedPeoples.each(this.addOne, this);
|
this.$tableBody.empty();
|
||||||
if (this.invitedPeoples.length) {
|
this.collection.each(this.addOne, this);
|
||||||
this.$emptyTip.hide();
|
this.$emptyTip.hide();
|
||||||
this.$table.show();
|
this.$table.show();
|
||||||
} else {
|
} else {
|
||||||
@@ -97,31 +119,22 @@ define([
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
|
||||||
this.$el.html(this.template());
|
|
||||||
this.$tip = this.$('.tip');
|
|
||||||
this.$table = this.$('table');
|
|
||||||
this.$tableBody = $('tbody', this.$table);
|
|
||||||
this.$loadingTip = this.$('.loading-tip');
|
|
||||||
this.$emptyTip = this.$('.empty-tips');
|
|
||||||
},
|
|
||||||
|
|
||||||
show: function() {
|
show: function() {
|
||||||
if (!this.attached) {
|
if (!this.attached) {
|
||||||
this.attached = true;
|
this.attached = true;
|
||||||
$("#right-panel").html(this.$el);
|
$("#right-panel").html(this.$el);
|
||||||
}
|
}
|
||||||
this.showInvitedPeoples();
|
this.showContent();
|
||||||
},
|
},
|
||||||
|
|
||||||
showInvitedPeoples: function() {
|
showContent: function() {
|
||||||
this.initPage();
|
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
||||||
this.invitedPeoples.fetch({
|
this.initPage();
|
||||||
|
this.collection.fetch({
|
||||||
cache: false,
|
cache: false,
|
||||||
reset: true,
|
reset: true,
|
||||||
error: function (collection, response, opts) {
|
error: function(collection, response, opts) {
|
||||||
var err_msg;
|
var err_msg;
|
||||||
if (response.responseText) {
|
if (response.responseText) {
|
||||||
if (response['status'] == 401 || response['status'] == 403) {
|
if (response['status'] == 401 || response['status'] == 403) {
|
||||||
@@ -132,8 +145,10 @@ define([
|
|||||||
} else {
|
} else {
|
||||||
err_msg = gettext("Failed. Please check the network.");
|
err_msg = gettext("Failed. Please check the network.");
|
||||||
}
|
}
|
||||||
|
_this.$error.html(err_msg).show();
|
||||||
Common.feedback(err_msg, 'error');
|
},
|
||||||
|
complete: function() {
|
||||||
|
_this.$loadingTip.hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user