Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion app/handler/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ func AuthSignUpPageHandler(ctx *golf.Context) {
if userNum == 0 {
ctx.Loader("admin").Render("signup.html", make(map[string]interface{}))
} else {
ctx.Abort(404)
ctx.Loader("default").Render("error_msg.html", map[string]interface{}{
"Reason": "New user accounts cannot be created for this blog at this time.",
})
// ctx.Abort(404)
return
}
}
Expand Down
1 change: 1 addition & 0 deletions app/handler/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func Initialize(app *golf.Application) *golf.Application {
theme := model.GetSettingValue("theme")
app.View.SetTemplateLoader("base", "view")
app.View.SetTemplateLoader("admin", filepath.Join("view", "admin"))
app.View.SetTemplateLoader("default", filepath.Join("view", "default"))
app.View.SetTemplateLoader("theme", filepath.Join("view", theme))
// static_dir, _ := app.Config.GetString("app/static_dir", "static")
app.Static("/upload/", upload_dir)
Expand Down
25 changes: 25 additions & 0 deletions view/default/error_msg.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{ extends "/default.html" }}

{{ define "content"}}
<div id="content">
<div id="article-container" class="clear container960">
<section id="main">
<article class="article article-type-page" itemscope="" itemprop="blogPost">

<div class="article-inner">
<header class="article-header">
<h1 class="article-title" itemprop="name">
Oops! An error occurred:
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<p>{{ .Reason }}</p>
<p>You can return to our homepage by clicking <a href="/">here</a>.</p>
</div>
</div>
</article>

</section>
</div>
</div>
{{end}}