forked from Ruderverein-Donau-Linz/rowt
		
	add faq route
This commit is contained in:
		
							
								
								
									
										13
									
								
								src/rest/faq.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								src/rest/faq.rs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,13 @@
 | 
			
		||||
use rocket::{get, routes, Route};
 | 
			
		||||
use rocket_dyn_templates::{context, Template};
 | 
			
		||||
 | 
			
		||||
use crate::model::user::User;
 | 
			
		||||
 | 
			
		||||
#[get("/")]
 | 
			
		||||
async fn index(user: User) -> Template {
 | 
			
		||||
    Template::render("faq", context!(loggedin_user: user))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pub fn routes() -> Vec<Route> {
 | 
			
		||||
    routes![index]
 | 
			
		||||
}
 | 
			
		||||
@@ -22,6 +22,7 @@ use crate::model::{
 | 
			
		||||
mod admin;
 | 
			
		||||
mod auth;
 | 
			
		||||
mod cox;
 | 
			
		||||
mod faq;
 | 
			
		||||
 | 
			
		||||
fn amount_days_to_show(is_cox: bool) -> i64 {
 | 
			
		||||
    if is_cox {
 | 
			
		||||
@@ -138,6 +139,7 @@ pub fn start(db: SqlitePool) -> Rocket<Build> {
 | 
			
		||||
        .mount("/auth", auth::routes())
 | 
			
		||||
        .mount("/cox", cox::routes())
 | 
			
		||||
        .mount("/admin", admin::routes())
 | 
			
		||||
        .mount("/faq", faq::routes())
 | 
			
		||||
        .mount("/public", FileServer::from("static/"))
 | 
			
		||||
        .register("/", catchers![unauthorized_error])
 | 
			
		||||
        .attach(Template::fairing())
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10
									
								
								templates/faq.html.tera
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								templates/faq.html.tera
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
			
		||||
{% import "includes/macros" as macros %}
 | 
			
		||||
 | 
			
		||||
{% extends "base" %}
 | 
			
		||||
 | 
			
		||||
{% block content %}
 | 
			
		||||
FAQ
 | 
			
		||||
 | 
			
		||||
{{ loggedin_user.name }}
 | 
			
		||||
 | 
			
		||||
{% endblock content %}
 | 
			
		||||
		Reference in New Issue
	
	Block a user