404 page added
This commit is contained in:
		
							parent
							
								
									d6c600628b
								
							
						
					
					
						commit
						c1d8408cc6
					
				
					 6 changed files with 44 additions and 18 deletions
				
			
		
							
								
								
									
										8
									
								
								game.py
									
										
									
									
									
								
							
							
						
						
									
										8
									
								
								game.py
									
										
									
									
									
								
							|  | @ -60,6 +60,12 @@ def log_the_request(response): | |||
| 
 | ||||
|     return response | ||||
| 
 | ||||
| @app.errorhandler(404) | ||||
| def page_not_found(e): | ||||
|     lang = config.get('i18n', 'lang') | ||||
|     title = config.get('i18n', 'title') | ||||
|     return render_template('404.html', title=title, lang=lang), 404 | ||||
| 
 | ||||
| @app.route("/") | ||||
| def hello(): | ||||
|     lang = config.get('i18n', 'lang') | ||||
|  | @ -103,6 +109,8 @@ def getContent(): | |||
| 
 | ||||
|     return result | ||||
| 
 | ||||
| app.register_error_handler(404, page_not_found) | ||||
| 
 | ||||
| if __name__ == "__main__": | ||||
|     from waitress import serve | ||||
|     bind = config.get('main', 'bind') | ||||
|  |  | |||
|  | @ -156,6 +156,11 @@ input[type="radio"] { | |||
|     cursor: pointer; | ||||
| } | ||||
| 
 | ||||
| .empty { | ||||
|     width: 45%; | ||||
|     float: left; | ||||
| } | ||||
| 
 | ||||
| @media only screen and (max-width:1600px) { | ||||
|     #content { | ||||
|         min-width: 75%; | ||||
|  | @ -269,6 +274,7 @@ input[type="radio"] { | |||
| 
 | ||||
| .toggle { | ||||
|     width: 10%; | ||||
|     height: 64px; | ||||
|     float: left; | ||||
|     display: none; | ||||
| } | ||||
|  |  | |||
							
								
								
									
										12
									
								
								templates/404.html
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								templates/404.html
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,12 @@ | |||
| {% extends 'base.html' %} | ||||
| 
 | ||||
| {% block main %} | ||||
|         <div class="ab"> | ||||
|             <div class="a">404 - Page not found.</div> | ||||
|         </div> | ||||
|         <div id="footer"> | ||||
|             <div class="empty"> </div> | ||||
| {% include 'toggle.html' %}             | ||||
|             <div class="empty"> </div>         | ||||
|         </div> | ||||
| {% endblock %} | ||||
|  | @ -32,8 +32,8 @@ | |||
|     <div id="content"> | ||||
|         <div id="header">{{ title }}</div> | ||||
|         <hr> | ||||
|         {% block main %} | ||||
|         {% endblock %} | ||||
| {%- block main %} | ||||
| {%- endblock %} | ||||
|     </div> | ||||
|     <script type="text/javascript"> | ||||
|         initToggle(); | ||||
|  |  | |||
|  | @ -19,7 +19,7 @@ | |||
|                 <br> | ||||
|                 <a href="mailto:{{ mailto }}">Einreichen!</a> | ||||
|             </div> | ||||
|             {% include 'toggle.html' %}             | ||||
| {% include 'toggle.html' %}             | ||||
|             <form action="/" method="get"> | ||||
|                 <input type="hidden" name="t" value="{{ epoch }}"> | ||||
|                 <button id="next" type="submit">{{ more }}</button> | ||||
|  |  | |||
|  | @ -1,15 +1,15 @@ | |||
| <div class="spacer"> </div> | ||||
| <div class="toggle"> | ||||
|     {%- if theme == "light" %} | ||||
|     <input type="checkbox" id="toggle_checkbox"> | ||||
|     {%- else %} | ||||
|     <input type="checkbox" id="toggle_checkbox" checked="checked"> | ||||
|     {%- endif %} | ||||
|     <label for="toggle_checkbox" class="toggle_label"> | ||||
|         <div id="star"> | ||||
|             <div class="star" id="star-1">★</div> | ||||
|             <div class="star" id="star-2">★</div> | ||||
|         </div> | ||||
|         <div id="moon"></div> | ||||
|     </label> | ||||
| </div> | ||||
|             <div class="spacer"> </div> | ||||
|             <div class="toggle"> | ||||
|                 {%- if theme == "light" %} | ||||
|                 <input type="checkbox" id="toggle_checkbox"> | ||||
|                 {%- else %} | ||||
|                 <input type="checkbox" id="toggle_checkbox" checked="checked"> | ||||
|                 {%- endif %} | ||||
|                 <label for="toggle_checkbox" class="toggle_label"> | ||||
|                     <div id="star"> | ||||
|                         <div class="star" id="star-1">★</div> | ||||
|                         <div class="star" id="star-2">★</div> | ||||
|                     </div> | ||||
|                     <div id="moon"></div> | ||||
|                 </label> | ||||
|             </div> | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue