formatted html

This commit is contained in:
Suraj 2016-02-06 12:25:50 +05:30
parent ae736c93f3
commit b34d8e334c
5 changed files with 109 additions and 99 deletions

View File

@ -4,125 +4,131 @@
<head> <head>
<title>{{if eq .Navigation "pending"}} Tasks <title>{{if eq .Navigation "pending"}} Tasks {{ else if eq .Navigation "completed"}}Completed {{ else if eq .Navigation "deleted"}}Deleted
{{ else if eq .Navigation "completed"}}Completed {{ else if eq .Navigation "edit"}} Edit {{else }} {{.Navigation}} {{end}}
{{ else if eq .Navigation "deleted"}}Deleted </title>
{{ else if eq .Navigation "edit"}} Edit
{{else }} {{.Navigation}}
{{end}}
</title>
<!-- Mobile viewport optimized --> <!-- Mobile viewport optimized -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<!-- Bootstrap CSS --> <!-- Bootstrap CSS -->
<link href="/static/css/bootstrap.min.css" rel="stylesheet"> <link href="/static/css/bootstrap.min.css" rel="stylesheet">
<link href="/static/css/bootstrap-glyphicons.css" rel="stylesheet"> <link href="/static/css/bootstrap-glyphicons.css" rel="stylesheet">
<!-- Custom CSS --> <!-- Custom CSS -->
<link href="/static/css/styles.css" rel="stylesheet"> <link href="/static/css/styles.css" rel="stylesheet">
<link href="/static/css/sidebar.css" rel="stylesheet"> <link href="/static/css/sidebar.css" rel="stylesheet">
<link href="/static/css/sidebar-bootstrap.css" rel="stylesheet"> <link href="/static/css/sidebar-bootstrap.css" rel="stylesheet">
<link href="/static/css/font-awesome.min.css" rel="stylesheet"> <link href="/static/css/font-awesome.min.css" rel="stylesheet">
<!-- Include Modernizr in the head, before any other Javascript --> <!-- Include Modernizr in the head, before any other Javascript -->
<script src="/static/js/modernizr-2.6.2.min.js"></script> <!--<script src="/static/js/modernizr-2.6.2.min.js"></script>-->
<!-- All Javascript at the bottom of the page for faster page loading --> <!-- All Javascript at the bottom of the page for faster page loading -->
<script src="/static/js/jquery.min.js"></script> <script src="/static/js/jquery.min.js"></script>
<!-- If no online access, fallback to our hardcoded version of jQuery <!-- If no online access, fallback to our hardcoded version of jQuery
<script>window.jQuery || document.write('<script src="/static/js/jquery-1.8.2.min.js"><\/script>')</script> <script>window.jQuery || document.write('<script src="/static/js/jquery-1.8.2.min.js"><\/script>')</script>
--> -->
<!-- Bootstrap JS --> <!-- Bootstrap JS -->
<script src="/static/js/bootstrap.min.js"></script> <script src="/static/js/bootstrap.min.js"></script>
<!-- Custom JS --> <!-- Custom JS -->
<script src="/static/js/script.js"></script> <script src="/static/js/script.js"></script>
<script src="/static/js/hammer.min.js"></script> <script src="/static/js/hammer.min.js"></script>
<script src="/static/js/sidebar.js"></script> <script src="/static/js/sidebar.js"></script>
</head> </head>
<body> <body>
<!-- The navigation bar--> <!-- The navigation bar-->
<div class="notification" {{if eq .Message ""}} class="hidden" {{end}}><span id="message"><p id="actlMsg">{{.Message}} <button id="btnMessage" class="btn btn-default">OK</button></p> </span> </div> <div class='notification {{if eq .Message ""}} hidden {{end}}'><span id="message"><p id="actlMsg">{{.Message}} <button id="btnMessage" class="btn btn-default">OK</button></p> </span> </div>
<nav class="navbar navbar-default navbar-fixed-top mainHeader"> <nav class="navbar navbar-default navbar-fixed-top mainHeader">
<div class="container-fluid"> <div class="container-fluid">
<div class="navbar-header"> {{$url := ""}}
{{if .Search}} <a class="navbar-brand"> Results for: {{.Search}}</a> <div class="navbar-header">
{{else}} {{if .Search}} <a class="navbar-brand"> Results for: {{.Search}}</a> {{else}} {{ if eq .Navigation "pending"}}
<a class="navbar-brand" {{ $url:="" }} {{else if eq .Navigation "completed"}} {{ $url := "" }} {{else if eq .Navigation "deleted"}}
href='{{ if eq .Navigation "pending"}} / /{{$url := ""}} {{else if eq .Navigation "edit"}} /{{$url := ""}} {{else}} {{$url := "/category"}}{{end}}
{{else if eq .Navigation "completed"}} /{{.Navigation}}
{{else if eq .Navigation "deleted"}} /{{.Navigation}}
{{else if eq .Navigation "edit"}} /{{.Navigation}}
{{else}} /category/{{.Navigation}}
{{end}}'>
{{if eq .Navigation "pending"}} Pending
{{ else if eq .Navigation "completed"}}Completed
{{ else if eq .Navigation "deleted"}}Deleted
{{ else if eq .Navigation "edit"}} Edit
{{else }} {{.Navigation}}
{{end}}</a>
{{end}}
<span id="icons">
<form action="/search/" method="POST">
<input type="text" name="query" placeholder="Search" style="border:none;border-bottom:1px solid gray; box-shadow:none;">
<input type="submit" text="submit" class="btn btn-default"/>
</form>
</span>
</div>
</div>
</nav>
<!-- SIDEBAR -->
<div data-sidebar="true" class="sidebar-trigger">
<a class="sidebar-toggle" href=""> <p class="navbar-brand" href="{{$url}}/{{.Navigation}}">
<span class="glyphicon glyphicon-align-justify"></span> {{if eq .Navigation "pending"}} Pending {{ else if eq .Navigation "completed"}}Completed {{ else if eq .Navigation "deleted"}}Deleted
</a> {{ else if eq .Navigation "edit"}} Edit {{else }} {{.Navigation}} {{end}} {{end}}
</p>
<form action="/upd-category/{{.Navigation}}" method="POST" class="hidden" id="EditForm">
<input type="text" name="catname" placeholder="new cat name" style="border:none;border-bottom:1px solid gray; box-shadow:none;">
<input type="submit" value="submit" class="btn btn-default" />
</form>
<form action="/search/" method="POST" class="hidden" id="SearchForm">
<input type="text" name="query" placeholder="Search" style="border:none;border-bottom:1px solid gray; box-shadow:none;">
<input type="submit" value="submit" class="btn btn-default" />
</form>
<span id="icons">
{{if eq .Navigation "pending"}}
{{ else if eq .Navigation "completed"}}
{{ else if eq .Navigation "deleted"}}
{{ else if eq .Navigation "edit"}}
{{else }}
<a href="/del-category/{{.Navigation}}"> <button data-original-title="Delete Category" data-placement="bottom" data-toggle="tooltip" title="" class="btn btn-action glyphicon glyphicon-trash" type="button"></button></a>
<button data-original-title="Edit Category" data-placement="bottom" data-toggle="tooltip" id="editCatFrmBtn" title="" class="btn btn-action glyphicon glyphicon-edit" type="button"></button>
<button data-original-title="Search" data-placement="bottom" data-toggle="tooltip" title="" id="searchFormBtn" class="btn btn-action glyphicon glyphicon-search" type="button"></button>
{{end}}
</span>
</div>
</div>
</nav>
<!-- SIDEBAR -->
<div data-sidebar="true" class="sidebar-trigger">
<a class="sidebar-toggle" href="">
<span class="glyphicon glyphicon-align-justify"></span>
</a>
<div class="sidebar-wrapper sidebar-default">
<div class="sidebar-scroller">
<ul class="sidebar-menu">
<li class="sidebar-group"><span>Tasks</span>
<ul class="sidebar-group-menu">
<div class="sidebar-wrapper sidebar-default">
<div class="sidebar-scroller">
<ul class="sidebar-menu">
<li class="sidebar-group"><span>Tasks</span>
<ul class="sidebar-group-menu">
<li class="sidebar-item"> <li class="sidebar-item">
<a href="/" {{ if eq .Navigation "pending"}} class="active" {{end}} ><span class="glyphicon glyphicon-tasks"></span> <span class="nav-item">Pending</span></a> <a href="/" {{ if eq .Navigation "pending"}} class="active" {{end}}><span class="glyphicon glyphicon-tasks"></span> <span class="nav-item">Pending</span></a>
</li> </li>
<li class="sidebar-item"> <li class="sidebar-item">
<a href="/completed/" {{ if eq .Navigation "completed"}} class="active" {{end}}><span class="glyphicon glyphicon-check"></span> <span class="nav-item"> Completed</span></a> <a href="/completed/" {{ if eq .Navigation "completed"}} class="active" {{end}}><span class="glyphicon glyphicon-check"></span> <span class="nav-item"> Completed</span></a>
</li> </li>
<li class="sidebar-item"> <li class="sidebar-item">
<a href="/deleted/" {{ if eq .Navigation "deleted"}} class="active" {{end}}><span class="glyphicon glyphicon-trash"></span> <span class="nav-item"> Deleted</span></a> <a href="/deleted/" {{ if eq .Navigation "deleted"}} class="active" {{end}}><span class="glyphicon glyphicon-trash"></span> <span class="nav-item"> Deleted</span></a>
</li> </li>
<hr> <hr>
<li class="sidebar-item"> <li class="sidebar-item">
{{$nav := .Navigation}} {{$nav := .Navigation}}
<h5> Categories</h5> <h5> Categories</h5>
<!--<button title="New category" id="toggleCategoryForm" data-placement="left" data-toggle="tooltip" class="btn glyphicon glyphicon-plus" style="font-size:small; margin-left:120px;"></button>--> <!--<button title="New category" id="toggleCategoryForm" data-placement="left" data-toggle="tooltip" class="btn glyphicon glyphicon-plus" style="font-size:small; margin-left:120px;"></button>-->
<span id="categoryForm"> <span id="categoryForm">
<form action="/add-category/" method="POST"> <form action="/add-category/" method="POST">
<span> <span>
<input type="text" name="category" width="50px"> <input type="text" name="category" width="50px">
<input type="submit" text="submit" class="btn btn-primary" value="Submit"/> <input type="submit" text="submit" class="btn btn-primary" value="Submit"/>
</span> </span>
</form> </form>
</span> </span>
</li> </li>
{{ range $index, $cat := .Categories }} {{ range $index, $cat := .Categories }}
<li class="sidebar-item"> <li class="sidebar-item">
<a href="/category/{{$cat.Name}}" {{ if eq $cat.Name $nav }} class="active" {{end}}> <a href="/category/{{$cat.Name}}" {{ if eq $cat.Name $nav }} class="active" {{end}}>
<span class="nav-item"> {{$cat.Name}}</span> <span class="badge pull-right">{{$cat.Count}}</span></a> <span class="nav-item"> {{$cat.Name}}</span> <span class="badge pull-right">{{$cat.Count}}</span></a>
</li> </li>
{{end}} {{end}}
</ul> </ul>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,7 +1,8 @@
{{template "_head.html" .}} {{template "_head.html" .}}
<div class="timeline"> <div class="timeline">
{{ if .Tasks}} {{range .Tasks}} {{ if .Tasks}}
{{range .Tasks}}
<div class="note"> <div class="note">
<p class="noteHeading">{{.Title}}</p> <span class="toggle glyphicon glyphicon-resize-full"></span> <p class="noteHeading">{{.Title}}</p> <span class="toggle glyphicon glyphicon-resize-full"></span>
<span class="noteContent">{{.Content}}</span> <span class="noteContent">{{.Content}}</span>

View File

@ -7,7 +7,8 @@
{{end}} {{end}}
<div class="timeline"> <div class="timeline">
{{ if .Tasks}} {{range .Tasks}} {{ if .Tasks}}
{{range .Tasks}}
<div class="note"> <div class="note">
<p class="noteHeading">{{.Title}}</p> <span class="toggle glyphicon glyphicon-resize-full"></span> <p class="noteHeading">{{.Title}}</p> <span class="toggle glyphicon glyphicon-resize-full"></span>
<span class="noteContent">{{.Content}}</span> <span class="noteContent">{{.Content}}</span>

View File

@ -31,7 +31,8 @@
Category: Category:
<select name="category" class="dropdown"> <select name="category" class="dropdown">
<option>---</option> <option>---</option>
{{$navigation := .Navigation}} {{$categories := .Categories}} {{range $cat := $categories}} {{$navigation := .Navigation}} {{$categories := .Categories}}
{{range $cat := $categories}}
<option value="{{$cat.Name}}" {{if eq $cat.Name $navigation }} checked="checked" {{end}}> {{$cat.Name}} </option> <option value="{{$cat.Name}}" {{if eq $cat.Name $navigation }} checked="checked" {{end}}> {{$cat.Name}} </option>
{{end}} {{end}}
</select> </select>

View File

@ -1,6 +1,7 @@
{{template "_head.html" .}} {{template "_head.html" .}}
<div class="timeline"> <div class="timeline">
{{ if .Tasks}} {{range .Tasks}} {{ if .Tasks}}
{{range .Tasks}}
<div class="note"> <div class="note">
<p class="noteHeading">{{.Title}}</p> <span class="toggle glyphicon glyphicon-resize-full"></span> <p class="noteHeading">{{.Title}}</p> <span class="toggle glyphicon glyphicon-resize-full"></span>
<span class="noteContent">{{.Content}}</span> <span class="noteContent">{{.Content}}</span>