Skip to content

Commit

Permalink
Add tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvel committed Mar 3, 2024
1 parent 0b1f7ff commit 6e74cad
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 13 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
*.sqlite3-shm
*.sqlite3-wal
certs/
.DS_Store
.DS_Store

.byebug_history
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ GEM
activerecord (>= 4.1)
sinatra (>= 1.0)
sqlite3 (1.6.8-arm64-darwin)
sqlite3 (1.6.8-x86_64-linux)
tilt (2.3.0)
timeout (0.4.1)
tzinfo (2.0.6)
Expand All @@ -94,6 +95,7 @@ GEM

PLATFORMS
arm64-darwin-22
x86_64-linux

DEPENDENCIES
bcrypt
Expand Down
3 changes: 2 additions & 1 deletion app.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'sinatra'
require 'sinatra/activerecord'
require 'securerandom'
require 'byebug'

require './app/models/user'
require './app/models/area'
Expand Down Expand Up @@ -103,7 +104,7 @@ def url_without_tag
end

get '/inbox' do
@tasks = current_user.tasks.incomplete.where(project_id: nil).where(due_date: nil).order(:name)
@tasks = current_user.tasks.incomplete.where(project_id: nil, due_date: nil).order('tasks.created_at DESC')

erb :inbox
end
2 changes: 1 addition & 1 deletion app/routes/tasks_routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def update_task_tags(task, tags_json)
@tasks = @tasks.where(id: tagged_task_ids)
end

@tasks = @tasks.distinct
@tasks = @tasks.joins(:tags).distinct

erb :'tasks/index'
end
Expand Down
8 changes: 4 additions & 4 deletions app/views/projects/show.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<% end %>
<div class="mx-3 mb-2">
<% if @project.tasks.incomplete.any? %>
<% @project.tasks.incomplete.each do |task| %>
<% @project.tasks.incomplete.order('created_at DESC').each do |task| %>
<div id="edit_task_form_<%= task.id %>" class="d-none">
<%= partial :'tasks/_form', locals: { task: task } %>
</div>
Expand All @@ -48,13 +48,13 @@
</div>
<% end %>
<% else %>
<div class="rounded px-4 py-2 mb-4 bg-secondary-subtle fw-light opacity-50">
<div class="rounded px-4 py-2 mb-4 bg-secondary-subtle fw-light blank-slate opacity-50">
No tasks have been created yet for this project
</div>
<% end %>
</div>
<h4 class="mt-5 ms-4 fw-bold">Notes</h4>
<div class="rounded py-2 px-3 mx-3 d-flex align-items-center border border-black"
<div class="rounded py-2 px-3 mx-3 d-flex align-items-center note-form-toggler"
data-bs-toggle="collapse"
data-bs-target="#newNoteForm"
aria-expanded="false"
Expand All @@ -77,7 +77,7 @@
<%= partial :'notes/_note', locals: {note: note} %>
<% end %>
<% else %>
<div class="rounded px-4 py-2 mb-4 bg-secondary-subtle fw-light opacity-50">
<div class="rounded px-4 py-2 mb-4 bg-secondary-subtle fw-light blank-slate opacity-50">
No notes have been created yet for this project
</div>
<% end %>
Expand Down
6 changes: 3 additions & 3 deletions app/views/sidebar.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</a>
</li>
<li class="nav-item">
<a href="/tasks?type=next" class="<%= nav_link('/tasks', 'type' => 'next') %>">
<a href="/tasks?type=next&order_by=created_at:desc" class="<%= nav_link('/tasks', 'type' => 'next') %>">
<i class="bi bi-arrow-right-circle-fill me-1"></i> Next Actions
</a>
</li>
Expand All @@ -43,7 +43,7 @@
</li>
<li class="border-top my-3"></li>
<li class="nav-item d-flex justify-content-between align-items-center w-100 <%= nav_link('/projects') %>">
<a href="/projects" class="text-decoration-none flex-grow-1 <%= nav_link_active?('/projects') ? 'link-light' : 'link-dark' %>">
<a href="/projects" class="text-decoration-none flex-grow-1 <%= nav_link_active?('/projects') ? 'text-light' : 'link-dark' %>">
<i class="bi bi-hexagon-fill me-1"></i> Areas & Projects
</a>
<button class="btn btn-link text-secondary p-0 ms-2" type="button" id="addNewDropdown" data-bs-toggle="dropdown" aria-expanded="false">
Expand All @@ -61,7 +61,7 @@
</li>
<li class="border-top my-3"></li>
<li class="nav-item d-flex justify-content-between align-items-center <%= nav_link('/notes') %>">
<a href="/notes" class="text-decoration-none flex-grow-1 <%= nav_link_active?('/notes') ? 'link-light' : 'link-dark' %>">
<a href="/notes" class="text-decoration-none flex-grow-1 <%= nav_link_active?('/notes') ? 'text-light' : 'link-dark' %>">
<i class="bi bi-journal-text me-1"></i> Notes
</a>
<a class="text-no-decoration link-secondary btn-outline-dark" href="#" data-bs-toggle="modal" data-bs-target="#newNoteModal">
Expand Down
2 changes: 1 addition & 1 deletion app/views/tasks/_minimal_form.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="row">
<div class="col-md-12">
<div class="input-group">
<input type="text" id="task_name_<%= task.id %>" name="name" value="<%= task.name %>" class="form-control mb-2 mx-3 px-3 py-2 new-task-input task-name-input " placeholder="+ Add New Task" required>
<input type="text" id="task_name_<%= task.id %>" name="name" value="<%= task.name %>" class="form-control mb-2 mx-3 px-3 py-2 new-task-input task-name-input rounded" placeholder="+ Add New Task" required>
<% if @project %>
<input type="hidden" name="project_id" value="<%= @project.id %>">
<% end %>
Expand Down
27 changes: 25 additions & 2 deletions public/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ h6 {

/* tasks, notes */

.task-item, .note-item {
.task-item,
.note-item {
background: var(--bs-white);
}

Expand Down Expand Up @@ -243,7 +244,7 @@ a.project-card .card:hover {
}

.panel {
background-color: var(--bs-light);
background-color: #eee;
}

.dark-mode .panel {
Expand All @@ -257,4 +258,26 @@ a.project-card .card:hover {
.dark-mode #newNoteForm .card {
background-color: var(--bs-gray-dark) !important;
color: var(--bs-light) !important;
}

.blank-slate {
background-color: #eee !important;
color: var(--bs-dark) !important;
}

.dark-mode .blank-slate {
background-color: var(--bs-gray-dark) !important;
color: var(--bs-light) !important;
}

.note-form-toggler {
border: 1px solid #ddd !important;
background-color: #f4f4f4 !important;
color: #ccc !important;
}

.dark-mode .note-form-toggler {
border: 1px solid #000 !important;
background-color: var(--bs-dark) !important;
color: var(--bs-light) !important;
}
4 changes: 4 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#! /bin/bash

export TUDUDI_SESSION_SECRET=7e9ca5868791e1e2da76b46deb760e7536967de380984ae30836433d212a94d362b500507e07f9c9f6e7e99cba0befd02925e378546565783de3c1648503aaf9
puma -C app/config/puma.rb

0 comments on commit 6e74cad

Please sign in to comment.