page_alerts.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <div class="row row-alerts d-edit-none">
  2. <div class="col-sm-12">
  3. {% if page && page.grant && page.grant > 1 %}
  4. <p class="alert alert-primary py-3 px-4">
  5. {% if page.grant == 2 %}
  6. <i class="icon-fw icon-link"></i><strong>{{ consts.pageGrants[page.grant] }}</strong> ({{ t('Browsing of this page is restricted') }})
  7. {% elseif page.grant == 4 %}
  8. <i class="icon-fw icon-lock"></i><strong>{{ consts.pageGrants[page.grant] }}</strong> ({{ t('Browsing of this page is restricted') }})
  9. {% elseif page.grant == 5 %}
  10. <i class="icon-fw icon-organization"></i><strong>'{{ page.grantedGroup.name | preventXss }}' only</strong> ({{ t('Browsing of this page is restricted') }})
  11. {% endif %}
  12. </p>
  13. {% endif %}
  14. {% if getConfig('crowi', 'customize:isEnabledStaleNotification') %}
  15. {% if page && page.updatedAt && page.getContentAge() > 0 %}
  16. {% if page.getContentAge() == 1 %}
  17. <div class="alert alert-info">
  18. {% elseif page.getContentAge() == 2 %}
  19. <div class="alert alert-warning">
  20. {% else %}
  21. <div class="alert alert-danger">
  22. {% endif %}
  23. <i class="icon-fw icon-hourglass"></i>
  24. <strong>{{ t('page_page.notice.stale', { count: page.getContentAge() }) }}</strong>
  25. </div>
  26. {% endif %}
  27. {% endif %}
  28. {% if redirectFrom or req.query.renamedFrom or req.query.redirectFrom %}
  29. <div class="alert alert-pink d-edit-none py-3 px-4 d-flex align-items-center justify-content-between">
  30. <span>
  31. {% set fromPath = req.query.renamedFrom or req.query.redirectFrom %}
  32. {% if redirectFrom or req.query.redirectFrom %}
  33. <strong>{{ t('Redirected') }}:</strong> {{ t('page_page.notice.redirected', fromPath | preventXss) }}
  34. {% endif %}
  35. {% if req.query.renamedFrom %}
  36. <strong>{{ t('Moved') }}:</strong> {{ t('page_page.notice.moved', fromPath | preventXss) }}
  37. {% endif %}
  38. </span>
  39. {% set hasRedirectLink = redirectFrom or req.query.redirectFrom or req.query.withRedirect %}
  40. {% if user and not page.isDeleted() and hasRedirectLink %}
  41. <button type="button" id="unlink-page-button" class="btn btn-outline-dark btn-sm float-right">
  42. <i class="ti-unlink" aria-hidden="true"></i>
  43. Unlink redirection
  44. </button>
  45. {% endif %}
  46. </div>
  47. {% endif %}
  48. {% if req.query.duplicated and not page.isDeleted() %}
  49. <div class="alert alert-success py-3 px-4">
  50. <span>
  51. <strong>{{ t('Duplicated') }}: </strong> {{ t('page_page.notice.duplicated', req.query.duplicated | preventXss) }}
  52. </span>
  53. </div>
  54. {% endif %}
  55. {% if req.query.unlinked %}
  56. <div class="alert alert-info d-edit-none py-3 px-4">
  57. <strong>{{ t('Unlinked') }}: </strong> {{ t('page_page.notice.unlinked') }}
  58. </div>
  59. {% endif %}
  60. {% if page and not page.isLatestRevision() %}
  61. <div class="alert alert-warning">
  62. <strong>{{ t('Warning') }}: </strong> {{ t('page_page.notice.version') }}
  63. <a href="{{ encodeURI(page.path) }}"><i class="icon-fw icon-arrow-right-circle"></i>{{ t('Show latest') }}</a>
  64. </div>
  65. {% endif %}
  66. {% set dmessage = req.flash('dangerMessage') %}
  67. {% if dmessage.length %}
  68. <div class="alert alert-danger mb-4">
  69. {{ dmessage }}
  70. </div>
  71. {% endif %}
  72. {% if isTrashPage() %}
  73. <div id="trash-page-alert"></div>
  74. {% endif %}
  75. {% if !page %}
  76. <div id="not-found-alert"></div>
  77. {% endif %}
  78. </div>
  79. </div>