You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

notice.tmpl 2.2 kB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. {{template "base/head_home" .}}
  2. <style>
  3. .notice-container {
  4. }
  5. .notice-row {
  6. display: flex;
  7. justify-content: space-between;
  8. align-items: center;
  9. height: 52px;
  10. border-bottom: 1px solid rgba(157, 197, 226, 0.2);
  11. padding: 0 16px;
  12. }
  13. .notice-title {
  14. flex: 1;
  15. width: 100%;
  16. overflow: hidden;
  17. text-overflow: ellipsis;
  18. white-space: nowrap;
  19. }
  20. .notice-title a {
  21. font-size: 16px;
  22. color: rgb(16, 16, 16);
  23. }
  24. .notice-title a:hover {
  25. opacity: 0.8;
  26. }
  27. .notice-time {
  28. width: 150px;
  29. text-align: right;
  30. font-size: 14px;
  31. color: rgba(16, 16, 16, 0.6);
  32. }
  33. </style>
  34. <div class="ui container">
  35. <h3 class="ui center am-pt-30 am-pb-20">{{.i18n.Tr "notice_announcement"}}</h3>
  36. <div class="notice-container">
  37. </div>
  38. </div>
  39. {{template "base/footer" .}}
  40. <script>
  41. ;(function() {
  42. var isZh = document.documentElement.getAttribute('lang') == 'zh-CN';
  43. function getNotice() {
  44. $.ajax({
  45. type:"GET",
  46. url:"/dashboard/invitation",
  47. dataType:"json",
  48. data: {
  49. filename: 'notice/notice.json',
  50. },
  51. success:function(data){
  52. if (!data) return;
  53. try {
  54. var noticeList = JSON.parse(data).Notices || [];
  55. var noticeEl = $('.notice-container');
  56. for (var i = 0, iLen = noticeList.length; i < iLen; i++) {
  57. var noticeObj = noticeList[i];
  58. noticeEl.append(`<div class="notice-row">
  59. <div class="notice-title">
  60. <a class="_hm-notice" href="${noticeObj.Link}">
  61. <i class="ri-arrow-right-s-line" style="vertical-align:-2px;"></i>
  62. <span>${isZh ? noticeObj.Title : (noticeObj.Title_en || noticeObj.Title)}</span>
  63. </a>
  64. </div>
  65. <div class="notice-time">${noticeObj.Date || ''}</div>
  66. </div>`);
  67. }
  68. } catch (e) {
  69. console.info(e);
  70. }
  71. },
  72. error:function(err) {
  73. console.info(err);
  74. }
  75. });
  76. }
  77. getNotice();
  78. })();
  79. </script>