2023-08-05 14:54:37 (UTC-03:00)
Marcel Rodrigues <marcelgmr@gmail.com>
use unified template for boards
diff --git a/skopos.lua b/skopos.lua index 98735a5..e51e8f7 100644 --- a/skopos.lua +++ b/skopos.lua @@ -51,7 +51,7 @@ function App:routes() local states = self.model.states local columns = self.model:get_board(user.id) local env = {title=self.title, user=user, states=states, columns=columns} - return lud.template.render_file("view/home.html", env) + return lud.template.render_file("view/board.html", env) end}, {"GET", "/join", function (req) @@ -161,7 +161,7 @@ function App:routes() title=self.title, user=user, proj=proj, states=states, columns=columns } - return lud.template.render_file("view/proj.html", env) + return lud.template.render_file("view/board.html", env) end}, {"POST", "/p", function (req) diff --git a/view/board.html b/view/board.html new file mode 100644 index 0000000..7cde62f --- /dev/null +++ b/view/board.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<html> +<head> + <meta charset="utf-8"> + <title>{{$title}}</title> + <style> + .centered { text-align: center; } + .menu a { margin: 7px; } + % include view/board.css + </style> +</head> +<body> + <div class="centered menu"> + % if $proj == nil then + % set proj_name = "Global" + <a href="/p">projects</a> + <a href="/i">invites</a> + % else + % set proj_name = $proj.name + <a href="/p/{{$proj.name}}/t/new">new ticket</a> + % end + </div> + <br> + <h1 class="centered">{{$proj_name}} Board</h1> + <div class="kanban-board"> + % set state_id = 1 + % for column in $columns do + <div class="kanban-column"> + <h2>{{$states[$state_id]}}</h2> + % for card in $column do + <div class="kanban-card"> + <p>{{$card.title}}</p> + <div class="buttons"> + <button disabled>←</button> + <button>→</button> + </div> + </div> + % end + </div> + % set state_id = $state_id + 1 + % end + </div> +</body> +</html> diff --git a/view/home.html b/view/home.html deleted file mode 100644 index ca64feb..0000000 --- a/view/home.html +++ /dev/null @@ -1,38 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta charset="utf-8"> - <title>{{$title}}</title> - <style> - .centered { text-align: center; } - .menu a { margin: 7px; } - % include view/board.css - </style> -</head> -<body> - <div class="centered menu"> - <a href="/p">projects</a> - <a href="/i">invites</a> - </div> - <br> - <h1 class="centered">Global Board</h1> - <div class="kanban-board"> - % set state_id = 1 - % for column in $columns do - <div class="kanban-column"> - <h2>{{$states[$state_id]}}</h2> - % for card in $column do - <div class="kanban-card"> - <p>{{$card.title}}</p> - <div class="buttons"> - <button disabled>←</button> - <button>→</button> - </div> - </div> - % end - </div> - % set state_id = $state_id + 1 - % end - </div> -</body> -</html> diff --git a/view/proj.html b/view/proj.html deleted file mode 100644 index 6a63fc1..0000000 --- a/view/proj.html +++ /dev/null @@ -1,37 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta charset="utf-8"> - <title>{{$title}}</title> - <style> - .centered { text-align: center; } - .menu a { margin: 7px; } - % include view/board.css - </style> -</head> -<body> - <div class="centered menu"> - <a href="/p/{{$proj.name}}/t/new">new ticket</a> - </div> - <br> - <h1 class="centered">{{$proj.name}} Board</h1> - <div class="kanban-board"> - % set state_id = 1 - % for column in $columns do - <div class="kanban-column"> - <h2>{{$states[$state_id]}}</h2> - % for card in $column do - <div class="kanban-card"> - <p>{{$card.title}}</p> - <div class="buttons"> - <button disabled>←</button> - <button>→</button> - </div> - </div> - % end - </div> - % set state_id = $state_id + 1 - % end - </div> -</body> -</html>