1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-23 10:48:37 +00:00
This commit is contained in:
Unknwon
2015-11-17 02:18:05 -05:00
parent ab9411be2a
commit ff5f14431e
12 changed files with 194 additions and 53 deletions

View File

@@ -2510,6 +2510,35 @@ footer .container .links > *:first-child {
.repository.forks .list .item .link {
padding-top: 5px;
}
.repository.settings.collaboration .collaborator.list {
padding: 0;
}
.repository.settings.collaboration .collaborator.list .item {
padding: 10px 20px;
}
.repository.settings.collaboration .collaborator.list .item:not(:last-child) {
border-bottom: 1px solid #DDD;
}
.repository.settings.collaboration #repo-collab-form #search-user-box .results {
left: 7px;
}
.repository.settings.collaboration #repo-collab-form .ui.button {
margin-left: 5px;
margin-top: -3px;
}
#search-user-box .results {
padding: 0;
position: absolute;
}
#search-user-box .results .item {
padding: 10px 15px;
border-bottom: 1px solid #DDD;
cursor: pointer;
}
#search-user-box .results .item:hover {
background: rgba(0, 0, 0, 0.05) !important;
color: rgba(0, 0, 0, 0.95) !important;
}
.issue.list {
list-style: none;
padding-top: 15px;
@@ -2562,7 +2591,7 @@ footer .container .links > *:first-child {
.settings .content {
margin-top: 2px;
}
.settings .content .header,
.settings .content > .header,
.settings .content .segment {
box-shadow: 0 1px 2px 0 rgba(34, 36, 38, 0.15);
}
@@ -2748,6 +2777,9 @@ footer .container .links > *:first-child {
.user.profile .ui.card .extra.content ul li:not(:last-child) {
border-bottom: 1px solid #eaeaea;
}
.user.profile .ui.repository.list {
margin-top: 25px;
}
.dashboard {
padding-top: 15px;
padding-bottom: 80px;

View File

@@ -564,6 +564,64 @@ function buttonsClickOnEnter() {
});
}
function searchUsers() {
if (!$('#search-user-box .results').length) {
return;
}
var $search_user_box = $('#search-user-box');
var $result_list = $search_user_box.find('.results');
$search_user_box.keyup(function () {
var $this = $(this);
var keyword = $this.find('input').val();
if (keyword.length < 2) {
$result_list.hide();
return;
}
$.ajax({
url: suburl + '/api/v1/users/search?q=' + keyword,
dataType: "json",
success: function (response) {
var notEmpty = function (str) {
return str && str.length > 0;
};
$result_list.html('');
if (response.ok && response.data.length) {
var html = '';
$.each(response.data, function (i, item) {
html += '<div class="item"><img class="ui avatar image" src="' + item.avatar_url + '"><span class="username">' + item.username + '</span>';
if (notEmpty(item.full_name)) {
html += ' (' + item.full_name + ')';
}
html += '</div>';
});
$result_list.html(html);
$this.find('.results .item').click(function () {
$this.find('input').val($(this).find('.username').text());
$result_list.hide();
});
$result_list.show();
} else {
$result_list.hide();
}
}
});
});
$search_user_box.find('input').focus(function () {
$search_user_box.keyup();
});
$(document).click(function (e) {
var target = e.target;
if (!$(target).is('#search-user-box .results') && !$(target).parents().is('#search-user-box')) {
$('#search-user-box .results').hide();
}
});
}
$(document).ready(function () {
csrf = $('meta[name=_csrf]').attr("content");
suburl = $('meta[name=_suburl]').attr("content");
@@ -717,6 +775,8 @@ $(document).ready(function () {
});
buttonsClickOnEnter();
searchUsers();
initCommentForm();
initInstall();

View File

@@ -934,9 +934,55 @@
}
}
}
&.settings {
&.collaboration {
.collaborator.list {
padding: 0;
.item {
padding: 10px 20px;
&:not(:last-child) {
border-bottom: 1px solid #DDD;
}
}
}
#repo-collab-form {
#search-user-box {
.results {
left: 7px;
}
}
.ui.button {
margin-left: 5px;
margin-top: -3px;
}
}
}
}
}
// End of .repository
#search-user-box {
.results {
padding: 0;
position: absolute;
.item {
padding: 10px 15px;
border-bottom: 1px solid #DDD;
cursor: pointer;
&:hover {
background: rgba(0,0,0,.05)!important;
color: rgba(0,0,0,.95)!important;
}
}
}
}
.issue.list {
list-style: none;
padding-top: 15px;
@@ -994,7 +1040,7 @@
.settings {
.content {
margin-top: 2px;
.header,
>.header,
.segment {
box-shadow: 0 1px 2px 0 rgba(34,36,38,.15);
}

View File

@@ -42,5 +42,9 @@
}
}
}
.ui.repository.list {
margin-top: 25px;
}
}
}