Rough simple status template.
This commit is contained in:
		
							
								
								
									
										7
									
								
								app.py
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								app.py
									
									
									
									
									
								
							@@ -1,5 +1,5 @@
 | 
				
			|||||||
#!flask/bin/python
 | 
					#!flask/bin/python
 | 
				
			||||||
from flask import Flask, jsonify, abort, make_response, request
 | 
					from flask import Flask, jsonify, abort, make_response, request, render_template
 | 
				
			||||||
from flask_httpauth import HTTPBasicAuth
 | 
					from flask_httpauth import HTTPBasicAuth
 | 
				
			||||||
import datetime
 | 
					import datetime
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -53,6 +53,11 @@ def create_status():
 | 
				
			|||||||
def get_statuses():
 | 
					def get_statuses():
 | 
				
			||||||
    return jsonify({'statuses': statuses[::-1]})
 | 
					    return jsonify({'statuses': statuses[::-1]})
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
 | 
					@app.route('/list', methods=['GET'])
 | 
				
			||||||
 | 
					def list():
 | 
				
			||||||
 | 
					    return render_template("list.html", statuses = statuses[::-1])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
@app.errorhandler(404)
 | 
					@app.errorhandler(404)
 | 
				
			||||||
def not_found(error):
 | 
					def not_found(error):
 | 
				
			||||||
    return make_response(jsonify({'error': 'Not found'}), 404)
 | 
					    return make_response(jsonify({'error': 'Not found'}), 404)
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										6
									
								
								templates/list.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								templates/list.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
				
			|||||||
 | 
					<ul class="statuses">
 | 
				
			||||||
 | 
					  {% for status in statuses %}
 | 
				
			||||||
 | 
					  <li> {{ status.title }}
 | 
				
			||||||
 | 
					  </li>
 | 
				
			||||||
 | 
					    {% endfor %}
 | 
				
			||||||
 | 
					</ul>
 | 
				
			||||||
		Reference in New Issue
	
	Block a user