Commits

Yang Zhang committed 4bf1d1b

make ui nicer

  • Participants
  • Parent commits 647498d

Comments (0)

Files changed (7)

File pybook/pybook.py

     id = request.args['id']
     content,title = Pybook.get_pybook_content_title_byid(id)
     import StringIO
-    strIO = StringIO.StringIO()
-    strIO.write(content)
-    strIO.seek(0)
+    strIO = StringIO.StringIO(content)
     return send_file(strIO,
                      attachment_filename=title+".pdf",
                      as_attachment=True)

File pybook/templates/booklist.html

     {%for book in books%}
         <tr><td class='book_td'>
                 <div class='bookcover'>
-                    <img src='/static/pybook_images/{{book.id}}.jpeg' width =100px height=120px />
+                    <a href='download?id={{book.id}}'>
+                        <img src='/static/pybook_images/{{book.id}}.jpeg' width =100px height=120px />
+                    </a>
                 </div>
             </td>
             <td class='book_td'>

File pybook/templates/showbook.html

 <table id='booklist'>
     <tr><td class='book_td'>
             <div class='bookcover'>
-                <img src='{{book.cover_image}}' width =100px height=120px />
+                <a href='download?id={{book.id}}'>
+                    <img src='{{book.cover_image}}' width =100px height=120px />
+                </a>
             </div>
         </td>
         <td class='book_td'>

File templates/newpost.html

     </table>
     </form>
 </div>
+{% endblock %}
+{% block extra_info %}
+<span class='span4 offset3' style='margin-top:10px'>
+<a href='/rule' class ='text-warning'>Post News Please Read Rule First</a>
+</span>
+
+{% endblock %}
+{% block script %}
+$(document).ready(function(){
+     $("#nav_news").addClass("active");
+     $("#{{news_type}}").addClass("active");
+});
 {% endblock %}

File templates/news.html

      $("#{{news_type}}").addClass("active");
 });
 
-
-
 {% endblock %}
 
 

File templates/showpost.html

 </div>
 {% endblock %}
 
+{% block script %}
+$(document).ready(function(){
+     $("#nav_news").addClass("active");
+});
+{% endblock %}

File usercontroller.py

         user.create_post_activity(2,post.id)
         return redirect('/latest')
 
-    return render_template('newpost.html')
+    return render_template('newpost.html', news_type='news_sn')
 
 @userapp.route('/addcommentforpost',methods =['POST'])
 def addcommentforpost():