Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
aceberg committed Feb 19, 2024
1 parent 8776aad commit 511643d
Show file tree
Hide file tree
Showing 32 changed files with 69 additions and 92 deletions.
34 changes: 4 additions & 30 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,8 @@
# Change Log
All notable changes to this project will be documented in this file.

## [0.1.5] - 2024-01-
## [0.2.0] - 2024-02-20
### Added
- Horizontal scroll for heatmap on mobile
- Heatmap and weight in two different cards

## [0.1.4] - 2024-01-22
### Added
- Statistics page

## [0.1.3] - 2024-01-07
### Added
- Version on Config page

### Changed
- Better mobile view

## [0.1.2] - 2024-01-04
### Added
- Weight page

### Fixed
- Small bugs

## [0.1.1] - 2023-12-27
### Added
- Local JS and Themes
- BodyWeight Chart

## [0.1.0] - 2023-12-23
### Added
- Config: HeatMap color
- Add/Edit plan
- Button width in config
- Sort groups and tasks
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ FROM golang:alpine AS builder

RUN apk add build-base
COPY . /src
RUN cd /src/cmd/CheckList/ && CGO_ENABLED=0 go build -o /CheckList .
RUN cd /src/cmd/ClickAHabit/ && CGO_ENABLED=0 go build -o /ClickAHabit .


FROM scratch

WORKDIR /data/CheckList
WORKDIR /data/ClickAHabit
WORKDIR /app

COPY --from=builder /CheckList /app/
COPY --from=builder /ClickAHabit /app/

ENTRYPOINT ["./CheckList"]
ENTRYPOINT ["./ClickAHabit"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PKG_NAME=CheckList
PKG_NAME=ClickAHabit
USR_NAME=aceberg

mod:
Expand Down
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
[![Main-Docker](https://github.com/aceberg/exercisediary/actions/workflows/main-docker.yml/badge.svg)](https://github.com/aceberg/exercisediary/actions/workflows/main-docker.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/aceberg/exercisediary)](https://goreportcard.com/report/github.com/aceberg/exercisediary)
[![Maintainability](https://api.codeclimate.com/v1/badges/e8f67994120fc7936aeb/maintainability)](https://codeclimate.com/github/aceberg/CheckList/maintainability)
[![Maintainability](https://api.codeclimate.com/v1/badges/e8f67994120fc7936aeb/maintainability)](https://codeclimate.com/github/aceberg/ClickAHabit/maintainability)
![Docker Image Size (latest semver)](https://img.shields.io/docker/image-size/aceberg/exercisediary)

<h1><a href="https://github.com/aceberg/exercisediary">
<img src="https://raw.githubusercontent.com/aceberg/exercisediary/main/assets/logo.png" width="35" />
</a>Exercise Diary</h1>
</a>Click A Habit</h1>

Workout diary with GitHub-style year visualization

- [Quick start](https://github.com/aceberg/exercisediary#quick-start)
- [Config](https://github.com/aceberg/exercisediary#config)
- [Options](https://github.com/aceberg/exercisediary#options)
- [Local network only](https://github.com/aceberg/exercisediary#local-network-only)
- [Roadmap](https://github.com/aceberg/CheckList/blob/main/docs/ROADMAP.md)
- [Roadmap](https://github.com/aceberg/ClickAHabit/blob/main/docs/ROADMAP.md)
- [Thanks](https://github.com/aceberg/exercisediary#thanks)


![Screenshot](https://raw.githubusercontent.com/aceberg/CheckList/main/assets/Screenshot%202023-12-25%20at%2023-19-08%20Exercise%20Diary.png)
![Screenshot](https://raw.githubusercontent.com/aceberg/ClickAHabit/main/assets/Screenshot%202023-12-25%20at%2023-19-08%20Exercise%20Diary.png)

## Quick start

```sh
docker run --name exdiary \
-e "TZ=Asia/Novosibirsk" \
-v ~/.dockerdata/CheckList:/data/CheckList \
-v ~/.dockerdata/ClickAHabit:/data/ClickAHabit \
-p 8851:8851 \
aceberg/exercisediary
```
Expand All @@ -39,18 +39,17 @@ Configuration can be done through config file or environment variables
| Variable | Description | Default |
| -------- | ----------- | ------- |
| HOST | Listen address | 0.0.0.0 |
| PORT | Port for web GUI | 8851 |
| PORT | Port for web GUI | 8852 |
| THEME | Any theme name from https://bootswatch.com in lowcase or [additional](https://github.com/aceberg/aceberg-bootswatch-fork) (emerald, grass, sand)| grass |
| COLOR | Background color: light or dark | light |
| HEATCOLOR | HeatMap color | #03a70c |
| PAGESTEP | Items on one page | 10 |
| BTNWIDTH | Adjust buttons to theme | 185px |
| TZ | Set your timezone for correct time | "" |

## Options

| Key | Description | Default |
| -------- | ----------- | ------- |
| -d | Path to config dir | /data/CheckList |
| -d | Path to config dir | /data/ClickAHabit |
| -n | Path to local JS and Themes ([node-bootstrap](https://github.com/aceberg/my-dockerfiles/tree/main/node-bootstrap)) | "" |

## Local network only
Expand All @@ -63,7 +62,7 @@ docker run --name node-bootstrap \
```
```sh
docker run --name exdiary \
-v ~/.dockerdata/CheckList:/data/CheckList \
-v ~/.dockerdata/ClickAHabit:/data/ClickAHabit \
-p 8851:8851 \
aceberg/exercisediary -n "http://$YOUR_IP:8850"
```
Expand Down
Binary file removed assets/checklist.png
Binary file not shown.
Binary file added assets/checklist1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions cmd/CheckList/main.go → cmd/ClickAHabit/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (

_ "time/tzdata"

"github.com/aceberg/CheckList/internal/web"
"github.com/aceberg/ClickAHabit/internal/web"
)

const dirPath = "/data/CheckList"
const dirPath = "/data/ClickAHabit"
const nodePath = ""

func main() {
Expand Down
2 changes: 1 addition & 1 deletion docker-compose-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ services:
depends_on:
- node-bootstrap
volumes:
- ~/.dockerdata/CheckList:/data/CheckList # app data (set your own path instead of dockerdata)
- ~/.dockerdata/ClickAHabit:/data/ClickAHabit # app data (set your own path instead of dockerdata)
environment:
TZ: Asia/Novosibirsk # required, default ""
HOST: "0.0.0.0" # optional, default: 0.0.0.0
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
ports:
- 8851:8851
volumes:
- ~/.dockerdata/CheckList:/data/CheckList
- ~/.dockerdata/ClickAHabit:/data/ClickAHabit
environment:
TZ: Asia/Novosibirsk # required, default: ""
HOST: "0.0.0.0" # optional, default: 0.0.0.0
Expand Down
4 changes: 2 additions & 2 deletions docs/ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
## MAYBE

- [ ] Add exercise group with 1 button
- [ ] Sets [#1](https://github.com/aceberg/CheckList/issues/1)
- [ ] Weight field take decimals [#4](https://github.com/aceberg/CheckList/issues/4)
- [ ] Sets [#1](https://github.com/aceberg/ClickAHabit/issues/1)
- [ ] Weight field take decimals [#4](https://github.com/aceberg/ClickAHabit/issues/4)
- [ ] Multiple users

## NOT DOING
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/aceberg/CheckList
module github.com/aceberg/ClickAHabit

go 1.21.7

Expand Down
8 changes: 4 additions & 4 deletions internal/conf/getconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package conf
import (
"github.com/spf13/viper"

"github.com/aceberg/CheckList/internal/check"
"github.com/aceberg/CheckList/internal/models"
"github.com/aceberg/ClickAHabit/internal/check"
"github.com/aceberg/ClickAHabit/internal/models"
)

// Get - read config from file or env
Expand All @@ -13,9 +13,9 @@ func Get(path string) models.Conf {

viper.SetDefault("HOST", "0.0.0.0")
viper.SetDefault("PORT", "8852")
viper.SetDefault("THEME", "journal")
viper.SetDefault("THEME", "united")
viper.SetDefault("COLOR", "light")
viper.SetDefault("BTNWIDTH", "185px")
viper.SetDefault("BTNWIDTH", "195px")

viper.SetConfigFile(path)
viper.SetConfigType("yaml")
Expand Down
2 changes: 1 addition & 1 deletion internal/db/edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package db
import (
"fmt"

"github.com/aceberg/CheckList/internal/models"
"github.com/aceberg/ClickAHabit/internal/models"
)

// Create - create table if not exists
Expand Down
4 changes: 2 additions & 2 deletions internal/db/sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
// Import module for SQLite DB
_ "modernc.org/sqlite"

"github.com/aceberg/CheckList/internal/check"
"github.com/aceberg/CheckList/internal/models"
"github.com/aceberg/ClickAHabit/internal/check"
"github.com/aceberg/ClickAHabit/internal/models"
)

var mu sync.Mutex
Expand Down
2 changes: 1 addition & 1 deletion internal/web/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"net/http"
"strconv"

"github.com/aceberg/CheckList/internal/db"
"github.com/aceberg/ClickAHabit/internal/db"
"github.com/gin-gonic/gin"
)

Expand Down
6 changes: 3 additions & 3 deletions internal/web/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (

"github.com/gin-gonic/gin"

"github.com/aceberg/CheckList/internal/check"
"github.com/aceberg/CheckList/internal/conf"
"github.com/aceberg/CheckList/internal/models"
"github.com/aceberg/ClickAHabit/internal/check"
"github.com/aceberg/ClickAHabit/internal/conf"
"github.com/aceberg/ClickAHabit/internal/models"
)

func configHandler(c *gin.Context) {
Expand Down
2 changes: 1 addition & 1 deletion internal/web/const-var.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package web
import (
"embed"

"github.com/aceberg/CheckList/internal/models"
"github.com/aceberg/ClickAHabit/internal/models"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion internal/web/date.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"time"

"github.com/gin-gonic/gin"
// "github.com/aceberg/CheckList/internal/models"
// "github.com/aceberg/ClickAHabit/internal/models"
)

func dateHandler(c *gin.Context) {
Expand Down
4 changes: 2 additions & 2 deletions internal/web/history.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (

"github.com/gin-gonic/gin"

"github.com/aceberg/CheckList/internal/db"
"github.com/aceberg/CheckList/internal/models"
"github.com/aceberg/ClickAHabit/internal/db"
"github.com/aceberg/ClickAHabit/internal/models"
)

func histHandler(c *gin.Context) {
Expand Down
2 changes: 1 addition & 1 deletion internal/web/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/gin-gonic/gin"

"github.com/aceberg/CheckList/internal/models"
"github.com/aceberg/ClickAHabit/internal/models"
)

func indexHandler(c *gin.Context) {
Expand Down
7 changes: 2 additions & 5 deletions internal/web/plan-edit.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package web

import (
"log"
"net/http"
"strconv"

"github.com/gin-gonic/gin"

"github.com/aceberg/CheckList/internal/models"
"github.com/aceberg/CheckList/internal/yaml"
"github.com/aceberg/ClickAHabit/internal/models"
"github.com/aceberg/ClickAHabit/internal/yaml"
)

func editHandler(c *gin.Context) {
Expand Down Expand Up @@ -53,8 +52,6 @@ func savePlanHandler(c *gin.Context) {
plan.ID, _ = strconv.Atoi(id)
plan.Place, _ = strconv.Atoi(place)

log.Println("NOCOL:", nocolor)

if plan.ID > 0 {
deletePlan(plan.ID)
}
Expand Down
4 changes: 2 additions & 2 deletions internal/web/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (

"github.com/gin-gonic/gin"

"github.com/aceberg/CheckList/internal/models"
"github.com/aceberg/CheckList/internal/yaml"
"github.com/aceberg/ClickAHabit/internal/models"
"github.com/aceberg/ClickAHabit/internal/yaml"
)

func planHandler(c *gin.Context) {
Expand Down
Binary file modified internal/web/public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion internal/web/public/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ function getGroupMap(checks) {
tmpChecks.push(checks[i]);
groupMap.set(checks[i].Group, tmpChecks);
}
return groupMap

let mapAsc = new Map([...groupMap.entries()].sort());

return mapAsc
}

async function createView(date) {
Expand Down
2 changes: 1 addition & 1 deletion internal/web/templates/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<div class="card border-primary">
<div class="card-header">Version</div>
<div class="card-body">
<a href="https://github.com/aceberg/CheckList/releases/tag/{{ .Version }}" target="_blank">{{ .Version }}</a>
<a href="https://github.com/aceberg/ClickAHabit/releases/tag/{{ .Version }}" target="_blank">{{ .Version }}</a>
</div>
</div>
<br>
Expand Down
4 changes: 2 additions & 2 deletions internal/web/templates/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!DOCTYPE html>
<html lang="en" data-bs-theme="{{ .Config.Color }}">
<head>
<title>CheckList</title>
<title>Click A Habit</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--Favicon-->
Expand Down Expand Up @@ -51,7 +51,7 @@
</ul>
<!-- <ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link active fs-3 ms-md-2" target="_blank" href="https://github.com/aceberg/CheckList"><i class="bi bi-github"></i></a>
<a class="nav-link active fs-3 ms-md-2" target="_blank" href="https://github.com/aceberg/ClickAHabit"><i class="bi bi-github"></i></a>
</li>
</ul> -->
</div>
Expand Down
12 changes: 8 additions & 4 deletions internal/web/templates/history.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,25 @@
<table class="table table-striped table-hover">
<thead>
<th>Date</th>
<th>Icon</th>
<th>Color</th>
<th>Group</th>
<th>Name</th>
<th>Color</th>
<th>Place</th>
<th>Count</th>
<th>Del</th>
</thead>
<tbody>
{{ range .Checks }}
<tr>
<td>{{ .Date }}</td>
<td>{{ .Group }}</td>
<td>{{ .Name }}</td>
<td><img src="{{ .Icon }}" style="height:1.3em;"/></td>
<td>
<i class="bi bi-circle-fill" style="color: {{ .Color }};"></i>
<i class="bi bi-square-fill" style="color: {{ .Color }};"></i>
</td>
<td>{{ .Group }}</td>
<td>{{ .Name }}</td>
<td>{{ .Place }}</td>
<td>{{ .Count }}</td>
<td>
<a href="/histdel/{{ .ID }}"><i class="bi bi-x-square"></i></a>
Expand Down
Loading

0 comments on commit 511643d

Please sign in to comment.