Compare commits

...

3 Commits

Author SHA1 Message Date
Dozens B. McCuzzins a47a0d7e95 change Recent Updates to show recent updates
Before was showing recently created games. Now showing recently updated
games.
2024-02-03 15:03:05 -07:00
Dozens B. McCuzzins 6712f8b1db add Date to update procedure
sometimes i add the session log after the session has happened!
2024-02-03 14:50:24 -07:00
Dozens B. McCuzzins b8a5be6b7e add pretty css anchors 2024-02-03 14:45:14 -07:00
4 changed files with 79 additions and 10 deletions

View File

@ -94,11 +94,11 @@ See `justfile` for more examples
- [x] Add types/enums - [x] Add types/enums
- [x] ~~tui?~~ run `just new` - [x] ~~tui?~~ run `just new`
- [x] add Update to CLI - [x] add Update to CLI
- [x] add Date to update menu. sometimes i add the session log after the session has happened!
- [x] refactor edit/update search functions
- [x] change Recent Games from 'recently created' to 'recently updated' ?
- [ ] CLI flags mode - [ ] CLI flags mode
- [ ] refactor edit/update search functions
- [ ] rename Update to Log or Session Log? - [ ] rename Update to Log or Session Log?
- [ ] change Recent Games from 'recently created' to 'recently updated' ?
- [ ] add Date to update menu. sometimes i add the session log after the session has happened!
## Resources ## Resources

View File

@ -13,6 +13,8 @@
db="db/games.rec" db="db/games.rec"
function main_menu { function main_menu {
cat<<EOF cat<<EOF
@ -25,6 +27,8 @@ EOF
read -p "> " selection; read -p "> " selection;
} }
function new_game () { function new_game () {
read -p "System: " system read -p "System: " system
read -p "Module: " module read -p "Module: " module
@ -68,6 +72,8 @@ recins $db --verbose -t Game \
gamemenutmpl="{{Id}}. {{Module}} ({{System}}) gamemenutmpl="{{Id}}. {{Module}} ({{System}})
" "
function edit_game () { function edit_game () {
id="$1" id="$1"
shift shift
@ -87,21 +93,31 @@ case $selection in
esac esac
} }
function update () { function update () {
id="$1" id="$1"
shift shift
read -p "Date> " created
tmp=$(mktemp) tmp=$(mktemp)
$EDITOR "$tmp" $EDITOR "$tmp"
Text=$(< "$tmp") Text=$(< "$tmp")
recins --verbose $db -t Update -f Game -v "$id" -f Text -v "$Text" recins --verbose $db -t Update -f Game -v "$id" -f Text -v "$Text" -f Created -v "$created"
recsel $db -t Update -q "$Text" recsel $db -t Update -q "$Text"
main_menu main_menu
} }
function recent_games_update () {
count=`recsel -t Game $db -c`
function recent_updates () {
count=`recsel -t Update $db -c`
recent="$((count - 7))" recent="$((count - 7))"
recsel $db -t Game -e "Id > ${recent}" | recfmt "${gamemenutmpl}" recsel $db \
-t Update \
-e "Id > ${recent}" \
-j Game \
-p Game_Id:Id,Game_Module:Module,Game_System:System \
| recfmt "${gamemenutmpl}"
read -p "Number> " id read -p "Number> " id
case $id in case $id in
"" | "b" | "B" | "x" | "X" | "q" | "Q") "" | "b" | "B" | "x" | "X" | "q" | "Q")
@ -111,7 +127,9 @@ case $id in
esac esac
} }
function search_games_update () {
function search_updates () {
read -p "Query> " q read -p "Query> " q
recsel $db -t Game -i -q "${q}" | recfmt "${gamemenutmpl}" recsel $db -t Game -i -q "${q}" | recfmt "${gamemenutmpl}"
read -p "Number> " id read -p "Number> " id
@ -123,6 +141,8 @@ case id in
esac esac
} }
function recent_games () { function recent_games () {
count=`recsel -t Game $db -c` count=`recsel -t Game $db -c`
recent="$((count - 7))" recent="$((count - 7))"
@ -136,6 +156,8 @@ case $id in
esac esac
} }
function search_games () { function search_games () {
read -p "Query> " q read -p "Query> " q
recsel $db -t Game -i -q "${q}" | recfmt "${gamemenutmpl}" recsel $db -t Game -i -q "${q}" | recfmt "${gamemenutmpl}"
@ -148,6 +170,8 @@ case id in
esac esac
} }
function update_menu () { function update_menu () {
cat<<EOF cat<<EOF
@ -160,9 +184,9 @@ read -p "> " menu
case "$menu" in case "$menu" in
1 | "r" | "R") 1 | "r" | "R")
recent_games_update;; recent_updates;;
2 | "s" | "S") 2 | "s" | "S")
search_games_update;; search_updates;;
3 | "m" | "M" | "q" | "Q" | "b" | "B") 3 | "m" | "M" | "q" | "Q" | "b" | "B")
main_menu;; main_menu;;
*) *)
@ -170,6 +194,8 @@ case "$menu" in
esac esac
} }
function edit_menu () { function edit_menu () {
cat<<EOF cat<<EOF
@ -192,6 +218,9 @@ case "$menu" in
esac esac
} }
function main () {
main_menu main_menu
case "$selection" in case "$selection" in
@ -206,3 +235,7 @@ case "$selection" in
*) *)
echo "Select a letter or number from the menu";; echo "Select a letter or number from the menu";;
esac esac
}
main

18
dist/index.html vendored
View File

@ -9,6 +9,24 @@
border-bottom: solid 1px black; border-bottom: solid 1px black;
margin-top: 3rem; margin-top: 3rem;
} }
h2, h3 {
position: relative;
}
h2 a, h3 a {
position: absolute;
left: -1.2rem;
text-decoration: none;
opacity: 0.2;
}
h2 a {
line-height: 1.4;
}
h3 a {
line-height: 1.2;
}
h2:hover a, h3:hover a {
opacity: 1;
}
</style> </style>
<h1>Gamelogs</h1> <h1>Gamelogs</h1>
<p>All the roleplaying games I've played.</p> <p>All the roleplaying games I've played.</p>

View File

@ -68,6 +68,24 @@ html:
border-bottom: solid 1px black; border-bottom: solid 1px black;
margin-top: 3rem; margin-top: 3rem;
} }
h2, h3 {
position: relative;
}
h2 a, h3 a {
position: absolute;
left: -1.2rem;
text-decoration: none;
opacity: 0.2;
}
h2 a {
line-height: 1.4;
}
h3 a {
line-height: 1.2;
}
h2:hover a, h3:hover a {
opacity: 1;
}
</style> </style>
EOF EOF
## END: STYLE ## ## END: STYLE ##