Browse Source

Finish new organization members and invitation page

pull/371/head
Unknwon 11 years ago
parent
commit
78add502d7
  1. 2
      .gopmfile
  2. 8
      public/ng/css/gogs.css
  3. 25
      public/ng/js/gogs.js
  4. 8
      public/ng/less/gogs/organization.less
  5. 9
      templates/org/invite.tmpl

2
.gopmfile

@ -20,7 +20,7 @@ github.com/macaron-contrib/cache =
github.com/macaron-contrib/captcha = github.com/macaron-contrib/captcha =
github.com/macaron-contrib/csrf = github.com/macaron-contrib/csrf =
github.com/macaron-contrib/i18n = github.com/macaron-contrib/i18n =
github.com/macaron-contrib/session = github.com/macaron-contrib/session =
github.com/macaron-contrib/toolbox = github.com/macaron-contrib/toolbox =
github.com/nfnt/resize = github.com/nfnt/resize =

8
public/ng/css/gogs.css

@ -1823,8 +1823,12 @@ textarea#issue-add-content {
.invite-box { .invite-box {
padding: 50px 0; padding: 50px 0;
min-height: 130px; min-height: 130px;
text-align: center; margin: 0 auto;
width: 50%;
} }
.invite-box input { .invite-box input {
width: 250px; width: 300px;
}
#org-member-list-block {
padding-top: 2px;
} }

25
public/ng/js/gogs.js

@ -329,6 +329,28 @@ function initOrgSetting() {
}); });
} }
function initInvite() {
// Invitation.
var $ul = $('#org-member-invite-list');
$('#org-member-invite').on('keyup', function () {
var $this = $(this);
if (!$this.val()) {
$ul.toggleHide();
return;
}
Gogs.searchUsers($this.val(), $ul);
}).on('focus', function () {
if (!$(this).val()) {
$ul.toggleHide();
} else {
$ul.toggleShow();
}
}).next().next().find('ul').on("click", 'li', function () {
$('#org-member-invite').val($(this).text());
$ul.toggleHide();
});
}
$(document).ready(function () { $(document).ready(function () {
initCore(); initCore();
if ($('#user-profile-setting').length) { if ($('#user-profile-setting').length) {
@ -343,6 +365,9 @@ $(document).ready(function () {
if ($('#org-setting').length) { if ($('#org-setting').length) {
initOrgSetting(); initOrgSetting();
} }
if ($('#invite-box').length) {
initInvite();
}
Tabs('#dashboard-sidebar-menu'); Tabs('#dashboard-sidebar-menu');

8
public/ng/less/gogs/organization.less

@ -150,8 +150,12 @@
.invite-box { .invite-box {
padding: 50px 0; padding: 50px 0;
min-height: 130px; min-height: 130px;
text-align: center; margin: 0 auto;
width: 50%;
input { input {
width: 250px; width: 300px;
} }
}
#org-member-list-block {
padding-top: 2px;
} }

9
templates/org/invite.tmpl

@ -2,13 +2,16 @@
{{template "ng/base/header" .}} {{template "ng/base/header" .}}
{{template "org/header" .}} {{template "org/header" .}}
<div class="container"> <div class="container">
<div class="invite-box"> <div class="invite-box" id="invite-box">
{{template "ng/base/alert" .}} {{template "ng/base/alert" .}}
<h3>{{.i18n.Tr "org.members.invite_desc" .Org.FullName}}</h3> <h3>{{.i18n.Tr "org.members.invite_desc" .Org.FullName}}</h3>
<form action="{{.OrgLink}}/invitations/new" method="post"> <form id="invite-member-form" action="{{.OrgLink}}/invitations/new" method="post">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
<input class="ipt ipt-large ipt-radius" name="uname" required> <input class="ipt ipt-large ipt-radius" id="org-member-invite" name="uname" autocomplete="off" required>
<button class="btn btn-blue btn-large btn-radius">{{.i18n.Tr "org.members.invite_now"}}</button> <button class="btn btn-blue btn-large btn-radius">{{.i18n.Tr "org.members.invite_now"}}</button>
<div id="org-member-list-block">
<ul class="menu-down-show menu-vertical menu-radius switching-list user-list" id="org-member-invite-list"></ul>
</div>
</form> </form>
</div> </div>
</div> </div>

Loading…
Cancel
Save