Skip to content
This repository has been archived by the owner on Sep 23, 2021. It is now read-only.

Commit

Permalink
Merge pull request #13 from ozgurOdun/master
Browse files Browse the repository at this point in the history
easy access to stash
  • Loading branch information
msoedov committed Nov 6, 2017
2 parents 0427681 + 19306b6 commit 8e9f736
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

log "github.com/Sirupsen/logrus"
haikunator "github.com/atrox/haikunatorgo"
"github.com/gin-gonic/contrib/sessions"
"github.com/gin-contrib/sessions"
"github.com/gin-gonic/gin"
)

Expand Down Expand Up @@ -113,8 +113,8 @@ func NewApp() *gin.Engine {
for _, file := range files {
stash = append(stash, file.Name())
}
c.JSON(200, gin.H{
"data": stash,
c.HTML(200, "stash.tmpl", gin.H{
"stash": stash,
})
})

Expand Down
33 changes: 33 additions & 0 deletions static/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,36 @@ body {
width: 100%;
border: none;
}
#stash-pane {
position: fixed;
top: 0;
width: 60%;
height: 100%;
font-size: 16px;
}
#stash-pane #controls {
color: #2e2e2e;
position: absolute;
right: 0;
top: 0;
z-index: 1;
margin: 5px 5px 0 0;
}
#stash-pane #controls a {
font-weight: bold;
text-decoration: none;
color: #2e2e2e;
}
th, td {
text-align: left;
padding: 8px;
border-bottom: 1px solid #ddd;
font-size: 16px;
}

tr:nth-child(even){background-color: #f2f2f2}

th {
background-color: #2e2e2e;
color: white;
}
1 change: 1 addition & 0 deletions templates/index.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<body>
<div id="edit-pane">
<div id="controls">
<a href="/stash" target="_blank" onclick="save();"> Stash</a> |
<a href="/published/{{ .pubTo}}" target="_blank" onclick="save();"> Present</a> |
<a href="/published/{{ .pubTo}}?print-pdf" target="_blank" onclick="save();"> Pdf</a>
</div>
Expand Down
45 changes: 45 additions & 0 deletions templates/stash.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{{ define "stash.tmpl"}}
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">

<title>Hacker Slides</title>

<link rel="stylesheet" href="/static/css/index.css">
</head>

<body>
<div id="stash-pane">
<div id="controls">
<a href="/stash" target="_blank" onclick="save();"> Stash</a> |
<a href="/published/{{ .pubTo}}" target="_blank" onclick="save();"> Present</a> |
<a href="/published/{{ .pubTo}}?print-pdf" target="_blank" onclick="save();"> Pdf</a>
</div>
<div></div>
<div id ="list">
<table>
<tr>
<th>Name</th>
<th>Action</th>
</tr>
{{range .stash}}
<tr>
<td><p>{{.}}</p></td>
<td><a href="/stash/edit/{{.}}" target ="_blank" onclick="save();">Edit</a></td>
</tr>
{{end}}
</table>
</div>
</div>

<script src="/static/revealjs/js/ace-1.1.8/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="/static/revealjs/js/jquery-2.1.3.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/static/revealjs/js/jquery-debounce-1.0.5.js" type="text/javascript" charset="utf-8"></script>
<script src="/static/js/save.js" type="text/javascript" charset="utf-8"></script>
<script src="/static/js/index.js" type="text/javascript" charset="utf-8"></script>
</body>
</html>

{{ end }}

0 comments on commit 8e9f736

Please sign in to comment.