mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 02:38:35 +00:00
Finish new collaboration page
This commit is contained in:
@@ -198,6 +198,22 @@ img.avatar-48 {
|
||||
.main-wrapper {
|
||||
padding: 20px 0 40px;
|
||||
}
|
||||
.user-list {
|
||||
width: auto;
|
||||
min-width: 180px;
|
||||
max-width: 300px;
|
||||
}
|
||||
.user-list img {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
margin-right: 1em;
|
||||
margin-top: 1px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.user-list li {
|
||||
cursor: pointer;
|
||||
font-weight: bold;
|
||||
}
|
||||
.markdown {
|
||||
background-color: white;
|
||||
font-size: 16px;
|
||||
@@ -753,9 +769,24 @@ The dashboard page style
|
||||
margin-right: 6px;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
#dashboard-selection-menu {
|
||||
width: auto;
|
||||
max-width: 300px;
|
||||
}
|
||||
#dashboard-selection-menu > .drop-down {
|
||||
top: 56px;
|
||||
}
|
||||
#dashboard-selection-menu li {
|
||||
white-space: nowrap;
|
||||
}
|
||||
#dashboard-selection-menu li.checked .octicon {
|
||||
opacity: 1;
|
||||
}
|
||||
#dashboard-selection-menu li a {
|
||||
text-overflow: ellipsis;
|
||||
-o-text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
#dashboard-switch-menu {
|
||||
border-bottom-left-radius: .3em;
|
||||
border-bottom-right-radius: .3em;
|
||||
@@ -1155,32 +1186,26 @@ The register and sign-in page style
|
||||
#repo-create-cancel {
|
||||
margin-left: 4em;
|
||||
}
|
||||
#dashboard-switch-menu,
|
||||
#repo-create-owner-list {
|
||||
top: 30px;
|
||||
left: 0;
|
||||
width: auto;
|
||||
max-width: 300px;
|
||||
}
|
||||
#dashboard-switch-menu .octicon,
|
||||
#repo-create-owner-list .octicon {
|
||||
margin-right: 12px;
|
||||
opacity: 0;
|
||||
}
|
||||
#dashboard-switch-menu .avatar,
|
||||
#repo-create-owner-list .avatar {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
#dashboard-switch-menu li,
|
||||
#repo-create-owner-list li {
|
||||
white-space: nowrap;
|
||||
}
|
||||
#dashboard-switch-menu li.checked .octicon,
|
||||
#repo-create-owner-list li.checked .octicon {
|
||||
opacity: 1;
|
||||
}
|
||||
#dashboard-switch-menu li a,
|
||||
#repo-create-owner-list li a {
|
||||
text-overflow: ellipsis;
|
||||
-o-text-overflow: ellipsis;
|
||||
@@ -1244,6 +1269,34 @@ The register and sign-in page style
|
||||
.repo-setting-zone {
|
||||
padding: 30px;
|
||||
}
|
||||
#repo-collab-list {
|
||||
list-style: none;
|
||||
padding: 10px 0 5px 0;
|
||||
}
|
||||
#repo-collab-list li.collab {
|
||||
clear: both;
|
||||
height: 50px;
|
||||
padding: 0 15px 0 15px;
|
||||
}
|
||||
#repo-collab-list a.member {
|
||||
color: #444;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
}
|
||||
#repo-collab-list a.member:hover {
|
||||
color: #4183C4;
|
||||
}
|
||||
#repo-collab-list .avatar {
|
||||
margin-right: 1em;
|
||||
width: 40px;
|
||||
}
|
||||
#repo-collab-list .remove-collab {
|
||||
color: #DD4B39;
|
||||
}
|
||||
.repo-user-list-block {
|
||||
position: relative;
|
||||
top: 5px;
|
||||
}
|
||||
#setting-wrapper {
|
||||
padding-bottom: 100px;
|
||||
}
|
||||
|
@@ -59,7 +59,8 @@ audio:not([controls]) {
|
||||
height: 0;
|
||||
}
|
||||
[hidden],
|
||||
template .hidden {
|
||||
template,
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
.opacity {
|
||||
@@ -72,6 +73,7 @@ a,
|
||||
.text-link {
|
||||
color: #428bca;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
a:hover,
|
||||
.text-link:hover {
|
||||
@@ -604,6 +606,12 @@ ul.menu-down {
|
||||
box-shadow: 0 0 2px #666666;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
ul.menu-down-show {
|
||||
position: absolute;
|
||||
z-index: 99;
|
||||
box-shadow: 0 0 2px #666666;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
ul.menu-radius {
|
||||
border-radius: .3em;
|
||||
}
|
||||
|
@@ -52,6 +52,59 @@ var Gogs = {};
|
||||
}
|
||||
}
|
||||
});
|
||||
$.fn.extend({
|
||||
toggleHide: function () {
|
||||
$(this).addClass("hidden");
|
||||
},
|
||||
toggleShow: function () {
|
||||
$(this).removeClass("hidden");
|
||||
},
|
||||
toggleAjax: function (successCallback, errorCallback) {
|
||||
var url = $(this).data("ajax");
|
||||
var method = $(this).data('ajax-method') || 'get';
|
||||
var ajaxName = $(this).data('ajax-name');
|
||||
var data = {};
|
||||
|
||||
if (ajaxName.endsWith("preview")) {
|
||||
data["mode"] = "gfm";
|
||||
data["context"] = $(this).data('ajax-context');
|
||||
}
|
||||
|
||||
$('[data-ajax-rel=' + ajaxName + ']').each(function () {
|
||||
var field = $(this).data("ajax-field");
|
||||
var t = $(this).data("ajax-val");
|
||||
if (t == "val") {
|
||||
data[field] = $(this).val();
|
||||
return true;
|
||||
}
|
||||
if (t == "txt") {
|
||||
data[field] = $(this).text();
|
||||
return true;
|
||||
}
|
||||
if (t == "html") {
|
||||
data[field] = $(this).html();
|
||||
return true;
|
||||
}
|
||||
if (t == "data") {
|
||||
data[field] = $(this).data("ajax-data");
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
console.log("toggleAjax:", method, url, data);
|
||||
$.ajax({
|
||||
url: url,
|
||||
method: method.toUpperCase(),
|
||||
data: data,
|
||||
error: errorCallback,
|
||||
success: function (d) {
|
||||
if (successCallback) {
|
||||
successCallback(d);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}(jQuery));
|
||||
|
||||
(function ($) {
|
||||
@@ -145,6 +198,26 @@ var Gogs = {};
|
||||
}
|
||||
}).trigger('hashchange');
|
||||
};
|
||||
|
||||
// Search users by keyword.
|
||||
Gogs.searchUsers = function (val, $target) {
|
||||
$.ajax({
|
||||
url: '/api/v1/users/search?q=' + val,
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.ok && json.data.length) {
|
||||
var html = '';
|
||||
$.each(json.data, function (i, item) {
|
||||
html += '<li><a><img src="' + item.avatar + '">' + item.username + '</a></li>';
|
||||
});
|
||||
$target.html(html);
|
||||
$target.toggleShow();
|
||||
} else {
|
||||
$target.toggleHide();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})(jQuery);
|
||||
|
||||
function initCore() {
|
||||
@@ -175,6 +248,7 @@ function initRepoCreate() {
|
||||
}
|
||||
|
||||
function initRepoSetting() {
|
||||
// Options.
|
||||
// Confirmation of changing repository name.
|
||||
$('#repo-setting-form').submit(function (e) {
|
||||
var $reponame = $('#repo_name');
|
||||
@@ -189,6 +263,27 @@ function initRepoSetting() {
|
||||
$('#delete-button').click(function () {
|
||||
$('#delete-form').show();
|
||||
});
|
||||
|
||||
// Collaboration.
|
||||
$('#repo-collab-list hr:last-child').remove();
|
||||
var $ul = $('#repo-collaborator').next().next().find('ul');
|
||||
$('#repo-collaborator').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 () {
|
||||
$('#repo-collaborator').val($(this).text());
|
||||
$ul.toggleHide();
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
|
@@ -214,4 +214,20 @@ clear: both;
|
||||
}
|
||||
.main-wrapper {
|
||||
padding: 20px 0 40px;
|
||||
}
|
||||
.user-list {
|
||||
width: auto;
|
||||
min-width: 180px;
|
||||
max-width: 300px;
|
||||
img {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
margin-right: 1em;
|
||||
margin-top: 1px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
li {
|
||||
cursor: pointer;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
@@ -176,9 +176,24 @@ The dashboard page style
|
||||
}
|
||||
|
||||
#dashboard-selection-menu {
|
||||
> .drop-down {
|
||||
top: 56px;
|
||||
}
|
||||
width: auto;
|
||||
max-width: 300px;
|
||||
> .drop-down {
|
||||
top: 56px;
|
||||
}
|
||||
li {
|
||||
white-space: nowrap;
|
||||
&.checked {
|
||||
.octicon {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
a {
|
||||
text-overflow: ellipsis;
|
||||
-o-text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the drop-down menu of #dashboard-selection-menu
|
||||
|
@@ -357,7 +357,6 @@
|
||||
margin-left: 4em;
|
||||
}
|
||||
|
||||
#dashboard-switch-menu,
|
||||
#repo-create-owner-list {
|
||||
top: 30px;
|
||||
left: 0;
|
||||
@@ -442,4 +441,32 @@
|
||||
}
|
||||
.repo-setting-zone {
|
||||
padding: 30px;
|
||||
}
|
||||
#repo-collab-list {
|
||||
list-style: none;
|
||||
padding: 10px 0 5px 0;
|
||||
li.collab {
|
||||
clear: both;
|
||||
height: 50px;
|
||||
padding: 0 15px 0 15px;
|
||||
}
|
||||
a.member {
|
||||
color: #444;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
&:hover {
|
||||
color: #4183C4;
|
||||
}
|
||||
}
|
||||
.avatar {
|
||||
margin-right: 1em;
|
||||
width: 40px;
|
||||
}
|
||||
.remove-collab {
|
||||
color: #DD4B39;
|
||||
}
|
||||
}
|
||||
.repo-user-list-block {
|
||||
position: relative;
|
||||
top: 5px;
|
||||
}
|
@@ -94,12 +94,20 @@ ul.menu-down {
|
||||
}
|
||||
}
|
||||
|
||||
ul.menu-down {
|
||||
position: absolute;
|
||||
display: none;
|
||||
z-index: 99;
|
||||
box-shadow: 0 0 2px @menuShadowColor;
|
||||
background-color: @menuDownBgColor;
|
||||
ul {
|
||||
&.menu-down {
|
||||
position: absolute;
|
||||
display: none;
|
||||
z-index: 99;
|
||||
box-shadow: 0 0 2px @menuShadowColor;
|
||||
background-color: @menuDownBgColor;
|
||||
}
|
||||
&.menu-down-show {
|
||||
position: absolute;
|
||||
z-index: 99;
|
||||
box-shadow: 0 0 2px @menuShadowColor;
|
||||
background-color: @menuDownBgColor;
|
||||
}
|
||||
}
|
||||
|
||||
ul.menu-radius {
|
||||
|
@@ -81,17 +81,15 @@ audio:not([controls]) {
|
||||
// display hidden elements
|
||||
|
||||
[hidden],
|
||||
template
|
||||
template,
|
||||
.hidden {
|
||||
display: none;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.opacity {
|
||||
opacity: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.opacity-half {
|
||||
opacity: .5;
|
||||
opacity: .5;
|
||||
}
|
||||
|
||||
// links element
|
||||
@@ -100,6 +98,7 @@ a,
|
||||
.text-link {
|
||||
color: @linkColor;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
color: @linkHoverColor;
|
||||
text-decoration: none;
|
||||
|
Reference in New Issue
Block a user