mirror of
https://github.com/taigrr/shorturl
synced 2025-01-18 04:03:16 -08:00
Refactored. New UI Design
This commit is contained in:
22
templates/base.html
Normal file
22
templates/base.html
Normal file
@@ -0,0 +1,22 @@
|
||||
{{define "base"}}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<link rel="stylesheet" href="/css/spectre-icons.min.css">
|
||||
<link rel="stylesheet" href="/css/spectre.min.css">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>ShortURL</title>
|
||||
</head>
|
||||
<body>
|
||||
<section class="container grid-960 mt-10">
|
||||
<header class="navbar">
|
||||
<section class="navbar-section">
|
||||
<a href="/" class="navbar-brand mr-10">ShortURL</a>
|
||||
</section>
|
||||
<section class="navbar-section"></section>
|
||||
</header>
|
||||
{{template "content" .}}
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
@@ -1,14 +1,17 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>shorturl</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p>Enter your long URL here:</p>
|
||||
<form method="POST" action="">
|
||||
<input type="text" name="url">
|
||||
<input type="submit">
|
||||
</form>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
{{define "content"}}
|
||||
<section class="container">
|
||||
<div class="columns">
|
||||
<div class="column">
|
||||
<form action="" method="POST">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="input-url"></label>
|
||||
<input class="form-input" id="input-url" type="text" name="url" placeholder="Enter long url here...">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button class="btn btn-sm btn-primary" type="submit">Shorten</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{end}}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>shorturl</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p>Your short url is: <a href="/{{.ID}}">{{.ID}}</a></p>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
10
templates/view.html
Normal file
10
templates/view.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{{define "content"}}
|
||||
<section class="container">
|
||||
<div class="columns">
|
||||
<div class="column">
|
||||
<p>Your short url is: <a href="/r/{{.ID}}">{{.ID}}</a></p>
|
||||
<code>{{.URL}}</code>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user