add page titles
This commit is contained in:
parent
8c7ef09567
commit
7cc16047cb
@ -22,6 +22,7 @@ app:get("thread_create", "/create", function(self)
|
||||
return "how did you get here?"
|
||||
end
|
||||
self.all_topics = all_topics
|
||||
self.page_title = "creating thread"
|
||||
return {render = "threads.create"}
|
||||
end)
|
||||
|
||||
@ -91,6 +92,9 @@ app:get("thread", "/:slug", function(self)
|
||||
self.topic = Topics:find(thread.topic_id)
|
||||
self.user = util.get_logged_in_user_or_transient(self)
|
||||
self.posts = posts
|
||||
|
||||
self.page_title = thread.title
|
||||
|
||||
return {render = "threads.thread"}
|
||||
end)
|
||||
|
||||
|
@ -31,6 +31,8 @@ app:get("topic_create", "/create", function(self)
|
||||
return {status = 403}
|
||||
end
|
||||
|
||||
self.page_title = "creating topic"
|
||||
|
||||
return {render = "topics.create"}
|
||||
end)
|
||||
|
||||
@ -76,6 +78,8 @@ app:get("topic", "/:slug", function(self)
|
||||
self.thread_create_error = ThreadCreateError.TOPIC_LOCKED
|
||||
end
|
||||
|
||||
self.page_title = "all threads in " .. topic.name
|
||||
|
||||
return {render = "topics.topic"}
|
||||
end)
|
||||
|
||||
@ -91,6 +95,9 @@ app:get("topic_edit", "/:slug/edit", function(self)
|
||||
return {redirect_to = self:url_for("all_topics")}
|
||||
end
|
||||
self.topic = topic
|
||||
|
||||
self.page_title = "editing topic " .. topic.name
|
||||
|
||||
return {render = "topics.edit"}
|
||||
end)
|
||||
|
||||
|
@ -83,6 +83,9 @@ app:get("user", "/:username", function(self)
|
||||
return {status = 404}
|
||||
end
|
||||
end
|
||||
|
||||
self.page_title = user.username
|
||||
|
||||
return {render = "user.user"}
|
||||
end)
|
||||
|
||||
@ -129,6 +132,9 @@ app:get("user_delete_confirm", "/:username/delete_confirm", function(self)
|
||||
self.session.flash = {}
|
||||
end
|
||||
self.user = target_user
|
||||
|
||||
self.page_title = "confirm deletion"
|
||||
|
||||
return {render = "user.delete_confirm"}
|
||||
end)
|
||||
|
||||
@ -207,6 +213,9 @@ app:get("user_settings", "/:username/settings", function(self)
|
||||
end
|
||||
end
|
||||
self.user = target_user
|
||||
|
||||
self.page_title = "settings"
|
||||
|
||||
return {render = "user.settings"}
|
||||
end)
|
||||
|
||||
@ -245,6 +254,9 @@ app:get("user_login", "/login", function(self)
|
||||
self.err = self.session.flash.error
|
||||
self.session.flash = {}
|
||||
end
|
||||
|
||||
self.page_title = "log in"
|
||||
|
||||
return {render = "user.login"}
|
||||
end)
|
||||
|
||||
@ -287,6 +299,9 @@ app:get("user_signup", "/signup", function(self)
|
||||
self.err = self.session.flash.error
|
||||
self.session.flash = {}
|
||||
end
|
||||
|
||||
self.page_title = "sign up"
|
||||
|
||||
return {render = "user.signup"}
|
||||
end)
|
||||
|
||||
|
@ -2,7 +2,11 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Porom</title>
|
||||
<% if page_title then %>
|
||||
<title>Porom - <%= page_title %></title>
|
||||
<% else %>
|
||||
<title>Porom</title>
|
||||
<% end %>
|
||||
<link rel="stylesheet" href="/static/style.css">
|
||||
</head>
|
||||
<body>
|
||||
|
Loading…
Reference in New Issue
Block a user