page_alerts.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <div class="row row-alerts">
  2. <div class="col-xs-12">
  3. {% if page && page.grant && page.grant > 1 %}
  4. <p class="alert alert-inverse alert-grant">
  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 alert-moved 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', req.sanitize(fromPath)) }}
  34. {% endif %}
  35. {% if req.query.renamed %}
  36. <strong>{{ t('Moved') }}:</strong> {{ t('page_page.notice.moved', req.sanitize(fromPath)) }}
  37. {% endif %}
  38. </span>
  39. {% if user and not page.isDeleted() %}
  40. <form role="form" id="unlink-page-form" onsubmit="return false;">
  41. <input type="hidden" name="_csrf" value="{{ csrf() }}">
  42. <input type="hidden" name="path" value="{{ path }}">
  43. <button type="submit" class="btn btn-default btn-sm pull-right">
  44. <i class="ti-unlink" aria-hidden="true"></i>
  45. Unlink
  46. </button>
  47. </form>
  48. {% endif %}
  49. </div>
  50. {% endif %}
  51. {% if req.query.duplicated and not page.isDeleted() %}
  52. <div class="alert alert-success alert-moved">
  53. <span>
  54. <strong>{{ t('Duplicated') }}: </strong> {{ t('page_page.notice.duplicated', req.sanitize(req.query.duplicated)) }}
  55. </span>
  56. </div>
  57. {% endif %}
  58. {% if req.query.unlinked %}
  59. <div class="alert alert-info alert-unlinked">
  60. <strong>{{ t('Unlinked') }}: </strong> {{ t('page_page.notice.unlinked') }}
  61. </div>
  62. {% endif %}
  63. {% if page and not page.isLatestRevision() %}
  64. <div class="alert alert-warning">
  65. <strong>{{ t('Warning') }}: </strong> {{ t('page_page.notice.version') }}
  66. <a href="{{ page.path }}"><i class="icon-fw icon-arrow-right-circle"></i>{{ t('Show latest') }}</a>
  67. </div>
  68. {% endif %}
  69. {% set dmessage = req.flash('dangerMessage') %}
  70. {% if dmessage.length %}
  71. <div class="alert alert-danger m-b-15">
  72. {{ dmessage }}
  73. </div>
  74. {% endif %}
  75. {% if isTrashPage() %}
  76. <div class="alert alert-warning alert-trash d-flex align-items-center justify-content-between">
  77. <div>
  78. This page is in the trash <i class="icon-trash" aria-hidden="true"></i>.
  79. {% if page.isDeleted() %}
  80. <br>Deleted by <img src="{{ page.lastUpdateUser|picture }}" class="picture picture-sm img-circle"> {{ page.lastUpdateUser.name }} at {{ page.updatedAt|datetz('Y-m-d H:i:s') }}
  81. {% endif %}
  82. </div>
  83. <ul class="list-inline">
  84. {% if user and user.admin and req.path == '/trash' and pages.length > 0 %}
  85. <li>
  86. <button href="#" class="btn btn-danger btn-rounded btn-sm" data-target="#emptyTrash" data-toggle="modal"><i class="icon-trash" aria-hidden="true"></i>{{ t('modal_empty.empty_the_trash') }}</button>
  87. </li>
  88. {% endif %}
  89. {% if page.isDeleted() and user %}
  90. <li>
  91. <button href="#" class="btn btn-default btn-rounded btn-sm" data-target="#putBackPage" data-toggle="modal"><i class="icon-action-undo" aria-hidden="true"></i> {{ t('Put Back') }}</button>
  92. </li>
  93. <li>
  94. <button href="#" class="btn btn-danger btn-rounded btn-sm" {% if !user.canDeleteCompletely(page.creator._id) %} disabled="disabled" {% endif %} data-target="#deletePage" data-toggle="modal"><i class="icon-fire" aria-hidden="true"></i> {{ t('Delete Completely') }}</button>
  95. </li>
  96. {% endif %}
  97. </ul>{# /.pull-right #}
  98. </div>
  99. {% endif %}
  100. </div>
  101. </div>