loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix admin notice view-detail (#30450)

Fix https://github.com/go-gitea/gitea/issues/30434, regression from
https://github.com/go-gitea/gitea/pull/30115.

I also removed the date insertion into the modal which was also broken
since that date was switched to `absolute-date` because I see no real
purpose to putting that date into the modal.

Result:

<img width="1038" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/aa2eb8b4-73dc-4d98-9b80-3f276f89d9e5">

(cherry picked from commit 8fd8978b4934865c2b041216e84e923ad574a4c7)

authored by

silverwind and committed by
Gergely Nagy
86736193 6cc14151

+5 -8
+1 -4
templates/admin/notice.tmpl
··· 62 62 63 63 <div class="ui modal admin" id="detail-modal"> 64 64 <div class="header">{{ctx.Locale.Tr "admin.notices.view_detail_header"}}</div> 65 - <div class="content"> 66 - <div class="sub header"></div> 67 - <pre></pre> 68 - </div> 65 + <div class="content"><pre></pre></div> 69 66 </div> 70 67 71 68 {{template "admin/layout_footer" .}}
+4 -4
web_src/js/features/admin/common.js
··· 207 207 208 208 // Notice 209 209 if (document.querySelector('.admin.notice')) { 210 - const $detailModal = document.getElementById('detail-modal'); 210 + const detailModal = document.getElementById('detail-modal'); 211 211 212 212 // Attach view detail modals 213 213 $('.view-detail').on('click', function () { 214 - $detailModal.find('.content pre').text($(this).parents('tr').find('.notice-description').text()); 215 - $detailModal.find('.sub.header').text(this.closest('tr')?.querySelector('relative-time')?.getAttribute('title')); 216 - $detailModal.modal('show'); 214 + const description = this.closest('tr').querySelector('.notice-description').textContent; 215 + detailModal.querySelector('.content pre').textContent = description; 216 + $(detailModal).modal('show'); 217 217 return false; 218 218 }); 219 219