فهرست منبع

BugFix: Internal Server Error has occurred when a guest user visited the page someone added "liked"

Yuki Takei 8 سال پیش
والد
کامیت
ead14b82b4
5فایلهای تغییر یافته به همراه12 افزوده شده و 4 حذف شده
  1. 4 0
      CHANGES.md
  2. 2 1
      lib/views/crowi-plus/widget/header.html
  3. 2 1
      lib/views/page.html
  4. 2 1
      lib/views/page_list.html
  5. 2 1
      lib/views/widget/page_side_header.html

+ 4 - 0
CHANGES.md

@@ -1,6 +1,10 @@
 CHANGES
 ========
 
+## 1.2.4
+
+* Fix: Internal Server Error has occurred when a guest user visited the page someone added "liked"
+
 ## 1.2.3
 
 * Improvement: Ensure to be enabled to use Presentation Mode even when not logged in

+ 2 - 1
lib/views/crowi-plus/widget/header.html

@@ -18,12 +18,13 @@
         {% endif %}
       </div>
       <div class="flex-item-action visible-xs visible-sm">
+        {% if user %}
         <button
             data-csrftoken="{{ csrf() }}"
             data-liked="{% if page.isLiked(user) %}1{% else %}0{% endif %}"
             class="like-button btn btn-default btn-sm {% if page.isLiked(user) %}active{% endif %}"
-            {% if not user %}disabled{% endif %}
         ><i class="fa fa-thumbs-o-up"></i></button>
+        {% endif %}
       </div>
 
       <ul class="authors visible-md visible-lg">

+ 2 - 1
lib/views/page.html

@@ -24,12 +24,13 @@
         {% endif %}
       </div>
       <div class="flex-item-action visible-xs visible-sm">
+        {% if user %}
         <button
             data-csrftoken="{{ csrf() }}"
             data-liked="{% if page.isLiked(user) %}1{% else %}0{% endif %}"
             class="like-button btn btn-default btn-sm {% if page.isLiked(user) %}active{% endif %}"
-            {% if not user %}disabled{% endif %}
         ><i class="fa fa-thumbs-o-up"></i></button>
+        {% endif %}
       </div>
       {% endif %}
     </div>

+ 2 - 1
lib/views/page_list.html

@@ -38,12 +38,13 @@
         {% endif %}
       </div>
       <div class="flex-item-action visible-xs visible-sm">
+        {% if user %}
         <button
             data-csrftoken="{{ csrf() }}"
             data-liked="{% if page.isLiked(user) %}1{% else %}0{% endif %}"
             class="like-button btn btn-default btn-sm {% if page.isLiked(user) %}active{% endif %}"
-            {% if not user %}disabled{% endif %}
         ><i class="fa fa-thumbs-o-up"></i></button>
+        {% endif %}
       </div>
       {% endif %}
     </div>

+ 2 - 1
lib/views/widget/page_side_header.html

@@ -32,12 +32,13 @@
       <dd>
         <p class="liker-count">
         <span id="like-count">{{ page.liker.length }}</span>
+        {% if user %}
         <button
           data-csrftoken="{{ csrf() }}"
           data-liked="{% if page.isLiked(user) %}1{% else %}0{% endif %}"
           class="like-button btn btn-default btn-sm {% if page.isLiked(user) %}active{% endif %}"
-          {% if not user %}disabled{% endif %}
           ><i class="fa fa-thumbs-o-up"></i> {{ t('Like!') }}</button>
+        {% endif %}
         </p>
         <p id="liker-list" class="liker-list" data-likers="{{ page.liker|default([])|join(',') }}">
         </p>