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.renamed or req.query.redirectFrom %}
  29. <div class="alert alert-info d-edit-none py-3 px-4 d-flex align-items-center justify-content-between">
  30. <span>
  31. {% set fromPath = req.query.renamed 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.renamed %}
  36. <strong>{{ t('Moved') }}:</strong> {{ t('page_page.notice.moved', fromPath | preventXss) }}
  37. {% endif %}
  38. </span>
  39. {% if user and not page.isDeleted() %}
  40. <button type="button" id="unlink-page-button" class="btn btn-secondary btn-sm float-right">
  41. <i class="ti-unlink" aria-hidden="true"></i>
  42. Unlink
  43. </button>
  44. {% endif %}
  45. </div>
  46. {% endif %}
  47. {% if req.query.duplicated and not page.isDeleted() %}
  48. <div class="alert alert-success py-3 px-4">
  49. <span>
  50. <strong>{{ t('Duplicated') }}: </strong> {{ t('page_page.notice.duplicated', req.query.duplicated | preventXss) }}
  51. </span>
  52. </div>
  53. {% endif %}
  54. {% if req.query.unlinked %}
  55. <div class="alert alert-info d-edit-none py-3 px-4">
  56. <strong>{{ t('Unlinked') }}: </strong> {{ t('page_page.notice.unlinked') }}
  57. </div>
  58. {% endif %}
  59. {% if page and not page.isLatestRevision() %}
  60. <div class="alert alert-warning">
  61. <strong>{{ t('Warning') }}: </strong> {{ t('page_page.notice.version') }}
  62. <a href="{{ encodeURI(page.path) }}"><i class="icon-fw icon-arrow-right-circle"></i>{{ t('Show latest') }}</a>
  63. </div>
  64. {% endif %}
  65. {% set dmessage = req.flash('dangerMessage') %}
  66. {% if dmessage.length %}
  67. <div class="alert alert-danger mb-4">
  68. {{ dmessage }}
  69. </div>
  70. {% endif %}
  71. {% if isTrashPage() %}
  72. <div id="trash-page-alert"></div>
  73. {% endif %}
  74. </div>
  75. </div>