Browse Source

Replace new post/thread buttons with messages for guests.

Ralfp 12 years ago
parent
commit
4f47793ef9

+ 2 - 0
static/cranefly/css/cranefly.css

@@ -1078,7 +1078,9 @@ a.btn-link:hover,a.btn-link:active,a.btn-link:focus{opacity:0.9;filter:alpha(opa
 .forum-threads-list table th.check-cell input{right:2px;}
 .forum-threads-list table th.check-cell input{right:2px;}
 .forum-threads-list .threads-actions{background-color:#fbfbfb;border-top:1px solid #d5d5d5;border-radius:0px 0px 2px 2px;overflow:auto;padding:4px;color:#999999;font-size:11.9px;}.forum-threads-list .threads-actions form{margin-bottom:0px;}
 .forum-threads-list .threads-actions{background-color:#fbfbfb;border-top:1px solid #d5d5d5;border-radius:0px 0px 2px 2px;overflow:auto;padding:4px;color:#999999;font-size:11.9px;}.forum-threads-list .threads-actions form{margin-bottom:0px;}
 .forum-threads-extra{overflow:auto;}.forum-threads-extra.extra-top{margin-bottom:20px;}
 .forum-threads-extra{overflow:auto;}.forum-threads-extra.extra-top{margin-bottom:20px;}
+.forum-threads-extra .threads-signin-message{float:right;}.forum-threads-extra .threads-signin-message a:link,.forum-threads-extra .threads-signin-message a:visited{color:#333333;}
 .thread-buttons{overflow:auto;}.thread-buttons .pull-right{margin-left:14px;}
 .thread-buttons{overflow:auto;}.thread-buttons .pull-right{margin-left:14px;}
+.thread-buttons .thread-signin-message{float:right;}.thread-buttons .thread-signin-message a:link,.thread-buttons .thread-signin-message a:visited{color:#333333;}
 .thread-body .post-wrapper .post-body{margin-bottom:20px;overflow:auto;}.thread-body .post-wrapper .post-body .user-avatar{border-radius:5px;float:left;width:100px;height:100px;}
 .thread-body .post-wrapper .post-body{margin-bottom:20px;overflow:auto;}.thread-body .post-wrapper .post-body .user-avatar{border-radius:5px;float:left;width:100px;height:100px;}
 .thread-body .post-wrapper .post-body .post-content{background-color:#ffffff;border:1px solid #e7e7e7;border-radius:5px;margin-left:121px;min-height:100px;position:relative;}.thread-body .post-wrapper .post-body .post-content:after,.thread-body .post-wrapper .post-body .post-content:before{right:100%;border:solid transparent;content:"";height:0;width:0;position:absolute;pointer-events:none;}
 .thread-body .post-wrapper .post-body .post-content{background-color:#ffffff;border:1px solid #e7e7e7;border-radius:5px;margin-left:121px;min-height:100px;position:relative;}.thread-body .post-wrapper .post-body .post-content:after,.thread-body .post-wrapper .post-body .post-content:before{right:100%;border:solid transparent;content:"";height:0;width:0;position:absolute;pointer-events:none;}
 .thread-body .post-wrapper .post-body .post-content:after{border-color:transparent;border-right-color:#ffffff;border-width:10.5px;top:14px;margin-top:0px;}
 .thread-body .post-wrapper .post-body .post-content:after{border-color:transparent;border-right-color:#ffffff;border-width:10.5px;top:14px;margin-top:0px;}

+ 8 - 0
static/cranefly/css/cranefly/forum.less

@@ -303,4 +303,12 @@
   &.extra-top {
   &.extra-top {
     margin-bottom: @baseLineHeight;
     margin-bottom: @baseLineHeight;
   }
   }
+
+  .threads-signin-message {
+    float: right;
+
+    a:link, a:visited {
+      color: @textColor;
+    }
+  }
 }
 }

+ 8 - 0
static/cranefly/css/cranefly/thread.less

@@ -7,6 +7,14 @@
   .pull-right {
   .pull-right {
     margin-left: @baseFontSize;
     margin-left: @baseFontSize;
   }
   }
+
+  .thread-signin-message {
+    float: right;
+
+    a:link, a:visited {
+      color: @textColor;
+    }
+  }
 }
 }
 
 
 // Thread body styles
 // Thread body styles

+ 2 - 0
templates/cranefly/threads/list.html

@@ -160,6 +160,8 @@
     {{ pager() }}
     {{ pager() }}
     {% if user.is_authenticated() and acl.threads.can_start_threads(forum) %}
     {% if user.is_authenticated() and acl.threads.can_start_threads(forum) %}
     <a href="{% url 'thread_new' forum=forum.pk, slug=forum.slug %}" class="btn btn-inverse pull-right"><i class="icon-plus"></i> {% trans %}New Thread{% endtrans %}</a>
     <a href="{% url 'thread_new' forum=forum.pk, slug=forum.slug %}" class="btn btn-inverse pull-right"><i class="icon-plus"></i> {% trans %}New Thread{% endtrans %}</a>
+    {% elif not user.is_authenticated() and not user.is_crawler() %}
+    <p class="lead threads-signin-message"><a href="{% url 'sign_in' %}">{% trans %}Sign in or register to start threads.{% endtrans %}</a></p>
     {% endif %}
     {% endif %}
   </div>
   </div>
 
 

+ 2 - 0
templates/cranefly/threads/thread.html

@@ -391,6 +391,8 @@
     {{ pager(false) }}
     {{ pager(false) }}
     {% if user.is_authenticated() and acl.threads.can_reply(forum, thread) %}
     {% if user.is_authenticated() and acl.threads.can_reply(forum, thread) %}
     <a href="{% url 'thread_reply' thread=thread.pk, slug=thread.slug %}" class="btn btn-inverse pull-right"><i class="icon-pencil"></i> {% trans %}Reply{% endtrans %}</a>
     <a href="{% url 'thread_reply' thread=thread.pk, slug=thread.slug %}" class="btn btn-inverse pull-right"><i class="icon-pencil"></i> {% trans %}Reply{% endtrans %}</a>
+    {% elif not user.is_authenticated() and not user.is_crawler() %}
+    <p class="lead thread-signin-message"><a href="{% url 'sign_in' %}">{% trans %}Sign in or register to reply.{% endtrans %}</a></p>
     {% endif %}
     {% endif %}
   </div>
   </div>