page_alerts.html 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. <div id="redirected-alert"></div>
  34. {% endif %}
  35. {% if req.query.renamedFrom %}
  36. <div id="renamed-alert"></div>
  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 id="duplicated-alert"></div>
  50. {% endif %}
  51. {% if req.query.unlinked %}
  52. <div class="alert alert-info d-edit-none py-3 px-4">
  53. <strong>{{ t('Unlinked') }}: </strong> {{ t('page_page.notice.unlinked') }}
  54. </div>
  55. {% endif %}
  56. {% if page and not page.isLatestRevision() %}
  57. <div class="alert alert-warning">
  58. <strong>{{ t('Warning') }}: </strong> {{ t('page_page.notice.version') }}
  59. <a href="{{ encodeURI(page.path) }}"><i class="icon-fw icon-arrow-right-circle"></i>{{ t('Show latest') }}</a>
  60. </div>
  61. {% endif %}
  62. {% set dmessage = req.flash('dangerMessage') %}
  63. {% if dmessage.length %}
  64. <div class="alert alert-danger mb-4">
  65. {{ dmessage }}
  66. </div>
  67. {% endif %}
  68. {% if isTrashPage() %}
  69. <div id="trash-page-alert"></div>
  70. {% endif %}
  71. {% if !page %}
  72. <div id="not-found-alert"></div>
  73. {% endif %}
  74. </div>
  75. </div>