mirror of
https://github.com/haiwen/seahub.git
synced 2025-05-12 09:55:53 +00:00
update (#7631)
This commit is contained in:
parent
feab625130
commit
24c7b0da74
frontend/src
@ -37,14 +37,13 @@ class NoticeItem extends React.Component {
|
||||
let groupStaff = detail.group_staff_name;
|
||||
|
||||
// group name does not support special characters
|
||||
let userHref = siteRoot + 'profile/' + detail.group_staff_email + '/';
|
||||
let userHref = siteRoot + 'profile/' + encodeURIComponent(detail.group_staff_email) + '/';
|
||||
let groupHref = siteRoot + 'group/' + detail.group_id + '/';
|
||||
let groupName = detail.group_name;
|
||||
|
||||
let notice = gettext('User {user_link} has added you to {group_link}');
|
||||
let userLink = '<a href=' + userHref + '>' + groupStaff + '</a>';
|
||||
let groupLink = '<a href=' + groupHref + '>' + groupName + '</a>';
|
||||
|
||||
let userLink = '<a href=' + userHref + '>' + Utils.HTMLescape(groupStaff) + '</a>';
|
||||
let groupLink = '<a href=' + groupHref + '>' + Utils.HTMLescape(groupName) + '</a>';
|
||||
notice = notice.replace('{user_link}', userLink);
|
||||
notice = notice.replace('{group_link}', groupLink);
|
||||
|
||||
|
@ -72,7 +72,7 @@ class ActivityItem extends Component {
|
||||
}
|
||||
} else if (item.obj_type == 'files') {
|
||||
let fileURL = `${siteRoot}lib/${item.repo_id}/file${Utils.encodePath(item.path)}`;
|
||||
let fileLink = `<a href=${fileURL} target="_blank">${item.name}</a>`;
|
||||
let fileLink = `<a href=${fileURL} target="_blank">${Utils.HTMLescape(item.name)}</a>`;
|
||||
let fileCount = item.createdFilesCount - 1;
|
||||
let firstLine = gettext('{file} and {n} other files')
|
||||
.replace('{file}', fileLink)
|
||||
|
@ -136,15 +136,15 @@ class Item extends Component {
|
||||
detailText = gettext('Created library {library_name} with {owner} as its owner')
|
||||
.replace('{owner}', '<a href="' + ownerPageUrl + '">' + detail.owner + '</a>');
|
||||
if (isPro && enableSysAdminViewRepo) {
|
||||
detailText = detailText.replace('{library_name}', '<a href="' + repoPageUrl + '">' + detail.name + '</a>');
|
||||
detailText = detailText.replace('{library_name}', '<a href="' + repoPageUrl + '">' + Utils.HTMLescape(detail.name) + '</a>');
|
||||
} else {
|
||||
detailText = detailText.replace('{library_name}', '<span class="font-weight-bold">' + detail.name + '</span>');
|
||||
detailText = detailText.replace('{library_name}', '<span class="font-weight-bold">' + Utils.HTMLescape(detail.name) + '</span>');
|
||||
}
|
||||
return detailText;
|
||||
|
||||
case 'repo_delete':
|
||||
detailText = gettext('Deleted library {library_name}')
|
||||
.replace('{library_name}', '<span class="font-weight-bold">' + detail.name + '</span>');
|
||||
.replace('{library_name}', '<span class="font-weight-bold">' + Utils.HTMLescape(detail.name) + '</span>');
|
||||
return detailText;
|
||||
|
||||
case 'repo_transfer':
|
||||
@ -152,9 +152,9 @@ class Item extends Component {
|
||||
.replace('{user_from}', '<span class="font-weight-bold">' + detail.from + '</span>')
|
||||
.replace('{user_to}', '<span class="font-weight-bold">' + detail.to+ '</span>');
|
||||
if (isPro && enableSysAdminViewRepo) {
|
||||
detailText = detailText.replace('{library_name}', '<a href="' + repoPageUrl + '">' + detail.name + '</a>');
|
||||
detailText = detailText.replace('{library_name}', '<a href="' + repoPageUrl + '">' + Utils.HTMLescape(detail.name) + '</a>');
|
||||
} else {
|
||||
detailText = detailText.replace('{library_name}', '<span class="font-weight-bold">' + detail.name + '</span>');
|
||||
detailText = detailText.replace('{library_name}', '<span class="font-weight-bold">' + Utils.HTMLescape(detail.name) + '</span>');
|
||||
}
|
||||
return detailText;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user