Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
invinoveritas
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gbe
invinoveritas
Commits
92848538
Commit
92848538
authored
4 years ago
by
gbe
Browse files
Options
Downloads
Patches
Plain Diff
Unify things a bit
parent
b69e3c11
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
static/style.css
+16
-12
16 additions, 12 deletions
static/style.css
templates/details.tpl
+32
-24
32 additions, 24 deletions
templates/details.tpl
templates/index.tpl
+38
-34
38 additions, 34 deletions
templates/index.tpl
with
86 additions
and
70 deletions
static/style.css
+
16
−
12
View file @
92848538
.pure-g
>
div
{
box-sizing
:
border-box
;
/*
box-sizing: border-box;
*/
}
div
.box
{
...
...
@@ -10,6 +10,10 @@ div.pad-bottom {
padding-bottom
:
0.2em
;
}
div
.pad-right
{
padding-right
:
1em
;
}
.button-warning
{
color
:
white
;
border-radius
:
4px
;
...
...
@@ -30,12 +34,11 @@ th.fill, td.fill {
div
.content
{
position
:
absolute
;
top
:
0
;
bottom
:
8em
;
overflow
:
auto
;
padding-left
:
1em
;
padding-right
:
1em
;
padding-top
:
1em
;
bottom
:
8em
;
}
footer
{
...
...
@@ -47,9 +50,14 @@ footer {
box-sizing
:
border-box
;
border-top
:
1px
solid
#cbcbcb
;
}
padding-left
:
1em
;
padding-right
:
1em
;
div
.smallfooter
{
bottom
:
4.5em
;
}
footer
.small
{
height
:
4.5em
;
}
input
.rating
{
...
...
@@ -80,10 +88,6 @@ input.name {
opacity
:
0
;
}
div
.pad-right
{
padding-right
:
1em
;
}
button
.round
{
border-radius
:
100%
;
height
:
3em
;
...
...
@@ -99,7 +103,7 @@ div.centered {
display
:
flex
;
}
.maxwidth
{
max-width
:
70em
;
img
.foto
{
margin
:
auto
;
max-width
:
40%
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
templates/details.tpl
+
32
−
24
View file @
92848538
...
...
@@ -3,32 +3,40 @@
{{ define "title" }}Details for {{ .Wine.Name }}{{ end }}
{{ define "content" }}
<div
class=
"content pure-u-1"
>
{{ with .Wine }}
<form
class=
"pure-form"
method=
"POST"
>
<input
type=
"hidden"
name=
"id"
value=
"{{ .ID }}"
>
<div
class=
"pure-control-group"
>
<table
class=
"pure-table"
>
<tr><td>
ID
</td><td>
{{ .ID }}
</td></tr>
<tr><td>
Name
</td><td><input
type=
"text"
name=
"name"
value=
"{{ .Name }}"
placeholder=
"Name"
></td></tr>
<tr><td>
Rating
</td><td><input
type=
"number"
name=
"rating"
value=
"{{ .Rating }}"
placeholder=
"Rating"
></td></tr>
</table>
</div>
<form
class=
"pure-form pure-form-aligned"
method=
"POST"
>
<div
class=
"content smallfooter pure-u-1"
>
<div
class=
"box"
>
<input
type=
"hidden"
name=
"id"
value=
"{{ .Wine.ID }}"
>
<fieldset>
<div
class=
"pure-control-group"
>
<label
for=
"form-id"
>
ID
</label>
<input
type=
"text"
id=
"form-id"
value=
"{{ .Wine.ID }}"
disabled
>
</div>
<button
type=
"submit"
class=
"pure-button pure-button-primary"
>
Save
</button>
</form>
<div
class=
"pure-control-group"
>
<label
for=
"form-name"
>
Name
</label>
<input
id=
"form-name"
type=
"text"
name=
"name"
value=
"{{ .Wine.Name }}"
placeholder=
"Name"
>
</div>
<p>
And here's a picture:
<br/>
<div
class=
"pure-control-group"
>
<label
for=
"form-rating"
>
Rating
</label>
<input
id=
"form-rating"
type=
"number"
name=
"rating"
value=
"{{ .Wine.Rating }}"
placeholder=
"Rating"
>
</div>
</fieldset>
<img
class=
"pure-img"
src=
"/details/img?id={{ .ID }}"
/>
</div>
<p>
And here's a picture:
<br/>
<footer
class=
"box pure-u-1"
>
<form
class=
"pure-form"
method=
"POST"
action=
"/delete"
>
<input
type=
"hidden"
name=
"id"
value=
"{{ .ID }}"
>
<button
type=
"submit"
class=
"right pure-button button-warning"
>
Delete
</button>
</form>
</footer>
{{ end }}
<img
class=
"foto pure-img"
src=
"/details/img?id={{ .Wine.ID }}"
/>
</div>
</div>
<footer
class=
"small pure-u-1"
>
<div
class=
"box"
>
<!-- TODO: give these buttons values so that the Go code can decide what to do -->
<button
type=
"submit"
class=
"pure-button pure-button-primary"
>
Save Changes
</button>
<button
type=
"submit"
class=
"right pure-button button-warning"
>
Delete
</button>
</div>
</footer>
</form>
{{ end }}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
templates/index.tpl
+
38
−
34
View file @
92848538
...
...
@@ -4,44 +4,48 @@
{{ define "content" }}
<div
class=
"content pure-u-1"
>
<table
class=
"maxwidth box pure-table"
>
<thead><tr><th>
#
</th><th>
Rating
</th><th
class=
"fill"
>
Name
</th></tr></thead>
<tbody>
{{ range .Wines }}
<tr>
<td>
{{ .ID }}
</td>
<td>
{{ .Rating }}
</td>
<td><a
href=
"/details?id={{ .ID }}"
>
{{ .Name }}
</a></td>
</tr>
{{ end }}
</tbody>
</table>
<div
class=
"box"
>
<table
class=
"pure-table"
>
<thead><tr><th>
#
</th><th>
Rating
</th><th
class=
"fill"
>
Name
</th></tr></thead>
<tbody>
{{ range .Wines }}
<tr>
<td>
{{ .ID }}
</td>
<td>
{{ .Rating }}
</td>
<td><a
href=
"/details?id={{ .ID }}"
>
{{ .Name }}
</a></td>
</tr>
{{ end }}
</tbody>
</table>
</div>
</div>
<footer
class=
"box pure-u-1"
>
<form
class=
"maxwidth pure-form"
method=
"POST"
enctype=
"multipart/form-data"
action=
"/add"
>
<fieldset>
<div
class=
"pure-g"
>
<div
class=
"pad-right pure-u-3-4"
>
<div
class=
"pad-bottom"
>
<input
class=
"name"
type=
"text"
name=
"name"
placeholder=
"Name"
required
>
<footer
class=
"pure-u-1"
>
<div
class=
"box"
>
<form
class=
"pure-form"
method=
"POST"
enctype=
"multipart/form-data"
action=
"/add"
>
<fieldset>
<div
class=
"pure-g"
>
<div
class=
"pure-u-3-4"
>
<div
class=
"pad-bottom pad-right"
>
<input
class=
"name"
type=
"text"
name=
"name"
placeholder=
"Name"
required
>
</div>
<div
class=
"upload-btn-wrapper"
>
<button
class=
"pure-button"
>
Select Picture
</button>
<input
type=
"file"
name=
"picture"
accept=
"image/png, image/jpeg"
>
</div>
</div>
<div
class=
"upload-btn-wrapper"
>
<button
class=
"pure-button"
>
Select Picture
</button>
<input
type=
"file"
name=
"picture"
accept=
"image/png, image/jpeg"
>
</div>
</div>
<div
class=
"pure-u-1-4"
>
<div
class=
"pad-bottom"
>
<input
class=
"rating"
type=
"number"
name=
"rating"
placeholder=
"Rating"
>
</div>
<div
class=
"centered"
>
<button
type=
"submit"
class=
"round pure-button pure-button-primary"
>
+
</button>
<div
class=
"pure-u-1-4"
>
<div
class=
"pad-bottom"
>
<input
class=
"rating"
type=
"number"
name=
"rating"
placeholder=
"Rating"
>
</div>
<div
class=
"centered"
>
<button
type=
"submit"
class=
"round pure-button pure-button-primary"
>
+
</button>
</div>
</div>
</
div
>
</
table
>
</f
ieldset
>
</
form
>
</
table
>
</
fieldset
>
</f
orm
>
</
div
>
</footer>
{{ end }}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment