page_alerts.html 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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>{{ t('Anyone with the link') }}</strong> ({{ t('Browsing of this page is restricted') }})
  7. {% elseif page.grant == 4 %}
  8. <i class="icon-fw icon-lock"></i><strong>{{ t('Only me') }}</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.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.redirectFrom %}
  32. {% if redirectFrom or req.query.redirectFrom %}
  33. <div id="redirected-alert"></div>
  34. {% endif %}
  35. </span>
  36. {% set hasRedirectLink = redirectFrom or req.query.redirectFrom or req.query.withRedirect %}
  37. {% if user and not page.isDeleted() and hasRedirectLink %}
  38. <button type="button" id="unlink-page-button" class="btn btn-outline-dark btn-sm float-right">
  39. <i class="ti-unlink" aria-hidden="true"></i>
  40. Unlink redirection
  41. </button>
  42. {% endif %}
  43. </div>
  44. {% endif %}
  45. {% if req.query.unlinked %}
  46. <div class="alert alert-info d-edit-none py-3 px-4">
  47. <strong>{{ t('Unlinked') }}: </strong> {{ t('page_page.notice.unlinked') }}
  48. </div>
  49. {% endif %}
  50. {% set dmessage = req.flash('dangerMessage') %}
  51. {% if dmessage.length %}
  52. <div class="alert alert-danger mb-4">
  53. {{ dmessage }}
  54. </div>
  55. {% endif %}
  56. {% if isTrashPage(page.path) %}
  57. <div id="trash-page-alert"></div>
  58. {% endif %}
  59. <div id="fix-page-grant-alert"></div>
  60. </div>
  61. </div>