Commit 4ebba8c94981dcbd83451ea6e69b63b8e38066da

Authored by Sergio Oliveira
1 parent a90968f9

Adding button to go to reply textarea

src/static/css/screen.css
@@ -216,6 +216,10 @@ ul.unstyled-list .glyphicon-chevron-right { @@ -216,6 +216,10 @@ ul.unstyled-list .glyphicon-chevron-right {
216 margin-top: 1em; 216 margin-top: 1em;
217 } 217 }
218 218
  219 +.reply.btn {
  220 + margin-left: 1em;
  221 +}
  222 +
219 .email-message pre { 223 .email-message pre {
220 border: 0; 224 border: 0;
221 background-color: #fff; 225 background-color: #fff;
src/super_archives/templates/message-thread.html
@@ -68,6 +68,17 @@ @@ -68,6 +68,17 @@
68 $ajax.fail(vote_fail_callback); 68 $ajax.fail(vote_fail_callback);
69 } 69 }
70 70
  71 + function scrollToAnchor(aid){
  72 + var aTag = $(aid);
  73 + console.log(aTag);
  74 + $('html, body').animate({scrollTop: aTag.offset().top}, 800);
  75 + }
  76 +
  77 + function focus_reply(event) {
  78 + scrollToAnchor('#msg-reply');
  79 + $('textarea', '#msg-reply').focus();
  80 + }
  81 +
71 // Binding functions 82 // Binding functions
72 $(function() { 83 $(function() {
73 $(".panel-heading").on('click', function(event) { 84 $(".panel-heading").on('click', function(event) {
@@ -82,6 +93,7 @@ @@ -82,6 +93,7 @@
82 }); 93 });
83 94
84 $('.vote.btn', this).on('click', vote); 95 $('.vote.btn', this).on('click', vote);
  96 + $('.reply.btn', this).on('click', focus_reply);
85 }); 97 });
86 98
87 </script> 99 </script>
src/super_archives/templates/superarchives/includes/message.html
1 {% load gravatar superarchives i18n %} 1 {% load gravatar superarchives i18n %}
2 <li> 2 <li>
3 {% spaceless %} 3 {% spaceless %}
4 - <div class="email-message" id="msg-{{ email.id }}"> 4 + <div class="email-message" id="msg-{% firstof email.id 'reply' %}">
5 <div class="panel panel-default"> 5 <div class="panel panel-default">
6 <div class="panel-heading clearfix"> 6 <div class="panel-heading clearfix">
7 <div class="col-lg-6 col-md-6 col-sm-6"> 7 <div class="col-lg-6 col-md-6 col-sm-6">
@@ -34,6 +34,10 @@ @@ -34,6 +34,10 @@
34 <span class="glyphicon glyphicon-thumbs-up"></span> 34 <span class="glyphicon glyphicon-thumbs-up"></span>
35 </button> 35 </button>
36 </div> 36 </div>
  37 +
  38 + <button class="btn btn-default reply" title="{% trans 'Reply' %}">
  39 + <span class="glyphicon glyphicon-share"></span>
  40 + </button>
37 </div> 41 </div>
38 </div> 42 </div>
39 {% endif %} 43 {% endif %}