Initial commit of Todoizer web application
Build and Validate / build-and-test (push) Failing after 1m23s
Build and Validate / build-and-test (push) Failing after 1m23s
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8 col-lg-6">
|
||||
<div class="card glass-card shadow-lg border-0 mb-4">
|
||||
<div class="card-body p-4">
|
||||
<h2 class="mb-4 fw-bold text-center">What needs to be done?</h2>
|
||||
|
||||
<form action="/todos" method="post" class="mb-4">
|
||||
<div class="input-group input-group-lg shadow-sm rounded-pill overflow-hidden">
|
||||
<input type="text" name="content" class="form-control border-0 bg-dark-subtle px-4" placeholder="Add a new task..." required autofocus>
|
||||
<button class="btn btn-primary px-4 fw-bold add-btn" type="submit">Add</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="todo-list">
|
||||
<% if @todos.empty? %>
|
||||
<div class="text-center text-muted py-5">
|
||||
<p class="fs-5 mb-0">You're all caught up!</p>
|
||||
<small>Add a task above to get started.</small>
|
||||
</div>
|
||||
<% else %>
|
||||
<% @todos.each do |todo| %>
|
||||
<div class="todo-item d-flex justify-content-between align-items-center p-3 mb-2 rounded-3 <%= todo.is_completed ? 'completed bg-dark-subtle opacity-75' : 'bg-dark text-light border border-secondary border-opacity-25' %>">
|
||||
<div class="d-flex align-items-center flex-grow-1">
|
||||
<form action="/todos/<%= todo.id %>/toggle" method="post" class="me-3 m-0">
|
||||
<button type="submit" class="toggle-btn p-0 border-0 bg-transparent">
|
||||
<div class="checkbox-custom <%= todo.is_completed ? 'checked' : '' %>"></div>
|
||||
</button>
|
||||
</form>
|
||||
<span class="todo-text fs-5 <%= 'text-decoration-line-through text-muted' if todo.is_completed %>"><%= Rack::Utils.escape_html(todo.content) %></span>
|
||||
</div>
|
||||
<form action="/todos/<%= todo.id %>/delete" method="post" class="m-0 ms-2">
|
||||
<button type="submit" class="btn btn-sm btn-outline-danger delete-btn rounded-circle" title="Delete">✕</button>
|
||||
</form>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if current_user&.is_temporary %>
|
||||
<div class="alert alert-warning shadow-sm border-0 rounded-4 d-flex align-items-center justify-content-between p-4 temp-warning">
|
||||
<div>
|
||||
<h5 class="alert-heading fw-bold mb-1">Temporary Session</h5>
|
||||
<p class="mb-0 text-dark opacity-75">Your tasks will be lost if you clear your cookies. Create a free account to save them!</p>
|
||||
</div>
|
||||
<a href="/signup" class="btn btn-dark fw-bold px-4 rounded-pill">Sign Up Now</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" data-bs-theme="dark">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Todoizer - Get Things Done</title>
|
||||
<meta name="description" content="A simple and premium todo application.">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="/css/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-transparent mb-4">
|
||||
<div class="container">
|
||||
<a class="navbar-brand fw-bold fs-3 text-gradient" href="/">✓ Todoizer</a>
|
||||
<div class="d-flex align-items-center">
|
||||
<% if current_user %>
|
||||
<% if current_user.is_temporary %>
|
||||
<a href="/signup" class="btn btn-outline-warning btn-sm me-2 fw-semibold glow-effect">Sign up to save permanently</a>
|
||||
<a href="/login" class="btn btn-link text-light text-decoration-none btn-sm">Log In</a>
|
||||
<% else %>
|
||||
<span class="text-light me-3">Hello, <strong><%= current_user.username %></strong></span>
|
||||
<form action="/logout" method="post" class="d-inline">
|
||||
<button type="submit" class="btn btn-outline-light btn-sm">Log Out</button>
|
||||
</form>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="container main-container">
|
||||
<% if @error %>
|
||||
<div class="alert alert-danger" role="alert"><%= @error %></div>
|
||||
<% end %>
|
||||
<%= yield %>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,25 @@
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6 col-lg-5">
|
||||
<div class="card glass-card shadow-lg border-0 mt-5">
|
||||
<div class="card-body p-5">
|
||||
<h2 class="fw-bold mb-4 text-center">Welcome Back</h2>
|
||||
|
||||
<form action="/login" method="post">
|
||||
<div class="mb-3">
|
||||
<label for="username" class="form-label text-light">Username</label>
|
||||
<input type="text" class="form-control form-control-lg bg-dark text-light border-secondary" id="username" name="username" required autofocus>
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
<label for="password" class="form-label text-light">Password</label>
|
||||
<input type="password" class="form-control form-control-lg bg-dark text-light border-secondary" id="password" name="password" required>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary btn-lg w-100 rounded-pill fw-bold glow-effect">Log In</button>
|
||||
</form>
|
||||
|
||||
<div class="mt-4 text-center">
|
||||
<a href="/" class="text-decoration-none text-muted">← Back to home</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,26 @@
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6 col-lg-5">
|
||||
<div class="card glass-card shadow-lg border-0 mt-5">
|
||||
<div class="card-body p-5">
|
||||
<h2 class="fw-bold mb-4 text-center">Save Your Progress</h2>
|
||||
<p class="text-muted text-center mb-4">Create an account to securely save your current tasks and access them from anywhere.</p>
|
||||
|
||||
<form action="/signup" method="post">
|
||||
<div class="mb-3">
|
||||
<label for="username" class="form-label text-light">Username</label>
|
||||
<input type="text" class="form-control form-control-lg bg-dark text-light border-secondary" id="username" name="username" required autofocus>
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
<label for="password" class="form-label text-light">Password</label>
|
||||
<input type="password" class="form-control form-control-lg bg-dark text-light border-secondary" id="password" name="password" required>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary btn-lg w-100 rounded-pill fw-bold glow-effect">Create Account</button>
|
||||
</form>
|
||||
|
||||
<div class="mt-4 text-center">
|
||||
<a href="/" class="text-decoration-none text-muted">← Back to my tasks</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user