Commits

Yang Zhang committed 4755950

make basic framework fro message center
and basic logic for notify message

  • Participants
  • Parent commits de81860

Comments (0)

Files changed (5)

File templates/message_center.html

+{%extends 'base.html'%}
+
+{% block content %}
+
+<div id='message_center' class='container'>
+    <div class='row-fluid'>
+        <div class='offset2 span8 row-fluid'>
+
+        </div>
+
+
+    </div>
+
+</div><!-- end of container-->
+
+
+
+
+{% endblock %}

File templates/widgets.html

 <div class='container-box'>
 {%include "widgets/user.html"%}
-{%include "widgets/unread_message.html"%}
+{%if user and user.unreaded_counter!=0%}
+    {%include "widgets/unread_message.html"%}
+{%endif%}
 {%include "widgets/website_counter.html"%}
 </div>

File templates/widgets/unread_message.html

             <div class='span12'><small>谁谁谁回复了你谁谁谁回复了你谁谁谁回复了你</small></div>
         </div>
         <div class='span12' style='margin-top:10px;text-align: center;'>
-            <small><a href=''>查看更多</a></small>
+            <small><a href='/ua/message_center'>查看更多</a></small>
         </div>
         
     </div>

File templates/widgets/user.html

         <span style='padding:0 3px'></span>
         <a href="#" title='荣誉度'><i class="icon-heart"></i> <small>{{user.reputation}}</small></a>
         <span style='padding:0 3px'></span>
-        <a href="#" title='未读信息'><i class="icon-envelope"></i> <small>20</small></a>
+        <a href="/ua/message_center" title='未读信息'><i class="icon-envelope"></i> <small>20</small></a>
         <br/>
         <a href="/ua/new_topic" onclick="$('#topic-post-title').focus();" title='发布新主题'><i class="icon-pencil"></i> <small>发布新主题</small></a>
     </div>

File views/user_action.py

     us.update()
     session['message'] = Message(u"保存成功!")
     return redirect(url_for('setting'))
-    
+
 @user_action.route('/setting/password', methods=['POST'])
 def change_password():
     original_pw, changed_pw = request.form['original_pw'], request.form['changed_pw']
     session['user'].toggle_star_topicid(topicid)
     return jsonify(result = True)
 
+@user_action.route('/message_center')
+def message_center():
+    return render_template('message_center.html', user = session['user'])