aboutsummaryrefslogtreecommitdiffstats
path: root/web_src
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-06-02 21:24:18 +0100
committerGitHub <noreply@github.com>2020-06-02 16:24:18 -0400
commitfe2cacf5ea2e371c4e74f003ee594767c16028fa (patch)
treeceec01f10f6ee51310af0736b4f634cc886b31b2 /web_src
parent3af51f1ab728aedae1bb9501e2357d82edd522a6 (diff)
downloadgitea-fe2cacf5ea2e371c4e74f003ee594767c16028fa.tar.gz
gitea-fe2cacf5ea2e371c4e74f003ee594767c16028fa.zip
Properly truncate system notices (#11714)
* Properly truncate system notices As noted in #11658 the system notifications list will always suffix system notices with ... even when the notice is longer than 120 characters. Instead we should use .text.truncate to auto truncate and make the notices clickable to view their details. Signed-off-by: Andrew Thornton <art27@cantab.net> * As per @CirnoT make table cell clickable * ensure that pre wraps Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'web_src')
-rw-r--r--web_src/js/index.js3
-rw-r--r--web_src/less/_admin.less17
2 files changed, 19 insertions, 1 deletions
diff --git a/web_src/js/index.js b/web_src/js/index.js
index 32265748a5..fa32c64c33 100644
--- a/web_src/js/index.js
+++ b/web_src/js/index.js
@@ -1862,7 +1862,8 @@ function initAdmin() {
// Attach view detail modals
$('.view-detail').on('click', function () {
- $detailModal.find('.content pre').text($(this).data('content'));
+ $detailModal.find('.content pre').text($(this).parents('tr').find('.notice-description').text());
+ $detailModal.find('.sub.header').text($(this).parents('tr').find('.notice-created-time').text());
$detailModal.modal('show');
return false;
});
diff --git a/web_src/less/_admin.less b/web_src/less/_admin.less
index 5fb0712368..9184ed76ef 100644
--- a/web_src/less/_admin.less
+++ b/web_src/less/_admin.less
@@ -75,4 +75,21 @@
white-space: pre-wrap;
word-wrap: break-word;
}
+
+ #notice-table {
+ .notice-description {
+ @media only screen and (max-width: 767px) {
+ max-width: 80vw;
+ }
+ @media only screen and (max-width: 991px) and (min-width: 768px) {
+ max-width: 360px;
+ }
+ @media only screen and (min-width: 992px) and (max-width: 1199.98px) {
+ max-width: 510px;
+ }
+ @media only screen and (min-width: 1200px) {
+ max-width: 640px;
+ }
+ }
+ }
}