Simple news implementation

Is missing some proper design and to show up the news on the front page.
This commit is contained in:
Las Zenow 2013-07-17 01:08:44 +02:00
parent bf0480868d
commit 5f612a36ad
8 changed files with 101 additions and 1 deletions

9
templates/edit_news.html Normal file
View file

@ -0,0 +1,9 @@
{{template "header.html" .S}}
<h4>Add News:</h4>
<form method="POST" action="/news/edit">
<textarea name="text" rows="3"></textarea>
<button type="submit" class="btn">Add</button>
</form>
{{template "footer.html"}}

View file

@ -52,7 +52,8 @@
<ul class="nav">
<li {{if .Home}}class="active"{{end}}><a href="/">Home</a></li>
<li {{if .About}}class="active"{{end}}><a href="/about/">About</a></li>
<li {{if .Upload}}class="active"{{end}}><a href="/upload/">Upload your epub</a></li>
<li {{if .News}}class="active"{{end}}><a href="/news/">News</a></li>
<li {{if .Upload}}class="active"{{end}}><a href="/upload/">Upload</a></li>
<li {{if .Stats}}class="active"{{end}}><a href="/stats/">Statistics</a></li>
</ul>
@ -65,6 +66,8 @@
</a>
<ul class="dropdown-menu">
<li><a href="/new/"><i class="icon-book"></i> New books</a></li>
<li><a href="/news/edit"><i class="icon-certificate"></i> Edit news</a></li>
<li class="divider"></li>
<li><a href="/settings/"><i class="icon-wrench"></i> Settings</a></li>
<li class="divider"></li>
<li><a href="/logout/"><i class="icon-off"></i> Log Out</a></li>

10
templates/news.html Normal file
View file

@ -0,0 +1,10 @@
{{template "header.html" .S}}
<dl class="dl-horizontal">
{{range .News}}
<dt>{{.Date}}</dt>
<dd>{{.Text}}</dd>
{{end}}
</dl>
{{template "footer.html"}}