Add some css
This commit is contained in:
@@ -4,7 +4,9 @@ import io.javalin.Javalin
|
||||
|
||||
class Server(private val views: Views, private val conf: StarterConfig) {
|
||||
fun run() {
|
||||
val app = Javalin.create().start(7000)
|
||||
val app = Javalin.create {
|
||||
it.addStaticFiles("/assets")
|
||||
}.start(7000)
|
||||
|
||||
app.get("/") { ctx ->
|
||||
ctx.result(views.index(conf.dependencies, conf.inputs))
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,20 @@
|
||||
{% macro dependency(dependency) %}
|
||||
<label class="m-2">
|
||||
<input name="{{ dependency.name }}"
|
||||
type="checkbox"{% if dependency.default %} checked{% endif %}>
|
||||
<span>{{ dependency.name }}</span>
|
||||
</label>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro input(input) %}
|
||||
<div class="md:flex md:items-center mb-6">
|
||||
<div class="md:w-1/3">
|
||||
<label class="input-label" for="{{ input.name }}">
|
||||
{{ input.display }}
|
||||
</label>
|
||||
</div>
|
||||
<div class="md:w-2/3">
|
||||
<input name="{{ input.name }}" id="{{ input.name }}" class="input"{% if input.value %} value="{{ input.value }}"{% endif %}>
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
@@ -3,10 +3,13 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="/styles.css">
|
||||
<title>Kotlin Starter</title>
|
||||
</head>
|
||||
<body>
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
<main class="container mx-auto">
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,30 +1,19 @@
|
||||
{% extends "views/@base" %}
|
||||
|
||||
{% macro dependency(dependency) %}
|
||||
<label>
|
||||
<input name="{{ dependency.name }}" type="checkbox"{% if dependency.default %} checked{% endif %}>
|
||||
<span>{{ dependency.name }}</span>
|
||||
</label>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro input(input) %}
|
||||
<label>
|
||||
<span>{{ input.display }}</span>
|
||||
<input name="{{ input.name }}" type="text"{% if input.value %} value="{{ input.value }}"{% endif %}>
|
||||
</label>
|
||||
{% endmacro %}
|
||||
{% import "views/#macros" %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Kotlin Starter</h1>
|
||||
<form method="post">
|
||||
<h1 class="text-2xl font-bold text-purple-800 mb-4">Kotlin Starter</h1>
|
||||
<form method="post" class="w-full max-w-sm mx-auto">
|
||||
{% for input in inputs %}
|
||||
{{ input(input) }}
|
||||
{% endfor %}
|
||||
<br>
|
||||
{% for dependency in dependencies %}
|
||||
{{ dependency(dependency) }}
|
||||
{% endfor %}
|
||||
<br>
|
||||
<button type="submit">Submit</button>
|
||||
<hr>
|
||||
<div class="flex flex-wrap">
|
||||
{% for dependency in dependencies %}
|
||||
{{ dependency(dependency) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<button type="submit" class="w-full btn btn-purple">Submit</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user