Skip to content

Commit

Permalink
v2024.03.21
Browse files Browse the repository at this point in the history
- (ui) return to classic ui
- (tweak) sort by most recently updated
- (ui) home page
- (tweak) show diffs count and todo count in repos dropdown
- (misc) show author in logitem
- (misc) highlight active todos
  • Loading branch information
misterrager8 committed Mar 21, 2024
1 parent 0a1ddf9 commit 5d1e1fc
Show file tree
Hide file tree
Showing 11 changed files with 1,323 additions and 1,281 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ htmlcov/
*.db
garden-repos/
todos.json
App2.jsx
App2.css
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ CodeGarden can make it easier to perform common Git operations such as cloning,
2. (Optional) run command: `garden set-config port [PORT]`
3. Run `--help` command for all options

<pre>
```
add-repo Create a new repo.
add-todo Add a task.
commit Commit changes to git using task info as the commit...
Expand All @@ -44,7 +44,7 @@ CodeGarden can make it easier to perform common Git operations such as cloning,
view-todo Get a task and see detailed info.
view-todos See list of all undone todos.
web Launch web interface for CodeGarden.
</pre>
```

### Contributing

Expand Down
22 changes: 15 additions & 7 deletions code_garden/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def log(self):
_ = []
try:
for i in self.run_command(
["git", "log", "--oneline", "-20", "--pretty=format:%s\t%at\t%h"]
["git", "log", "--oneline", "-20", "--pretty=format:%s\t%at\t%h\t%an"]
).split("\n"):
if len(i.strip().split("\t")) == 2:
_.append(
Expand All @@ -72,6 +72,7 @@ def log(self):
"[No Commit Message]",
datetime.datetime.min,
i.strip().split("\t")[0],
i.strip().split("\t")[1],
)
)
else:
Expand All @@ -81,6 +82,7 @@ def log(self):
i.strip().split("\t")[0],
datetime.datetime.fromtimestamp(int(i.split("\t")[1])),
i.strip().split("\t")[2],
i.strip().split("\t")[3],
)
)

Expand Down Expand Up @@ -132,11 +134,15 @@ def remote_url(self):
@classmethod
def all(cls):
"""Get all Repositories in the home directory."""
return [
Repository(i.name)
for i in config.HOME_DIR.iterdir()
if i.is_dir() and (i / ".git").exists()
]
return sorted(
[
Repository(i.name)
for i in config.HOME_DIR.iterdir()
if i.is_dir() and (i / ".git").exists()
],
key=lambda x: x.log[0].timestamp,
reverse=True,
)

@classmethod
def generate_name(cls):
Expand Down Expand Up @@ -311,11 +317,12 @@ class LogItem(object):
name (str): subject line of this commit.
"""

def __init__(self, repository, name, timestamp, abbrev_hash):
def __init__(self, repository, name, timestamp, abbrev_hash, author):
self.repository = repository
self.name = name
self.timestamp = timestamp
self.abbrev_hash = abbrev_hash
self.author = author

@classmethod
def get(cls, repository, abbrev_hash):
Expand All @@ -334,6 +341,7 @@ def to_dict(self):
name=self.name,
timestamp=self.timestamp.strftime("%B %-d, %Y @ %-I:%M %p"),
abbrev_hash=self.abbrev_hash,
author=self.author,
)


Expand Down
24 changes: 23 additions & 1 deletion code_garden/web/routes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import datetime
from pathlib import Path

from flask import current_app, render_template, request

Expand All @@ -10,7 +11,28 @@

@current_app.get("/")
def index():
return render_template("index.html", env=current_app.config["ENV"])
return render_template(
"index.html", debug=current_app.config.get("ENV") == "development"
)


@current_app.post("/about")
def about():
success = True
msg = ""
readme_ = ""

try:
readme_ = open(Path(__file__).parent.parent.parent / "README.md").read()
except Exception as e:
success = False
msg = str(e)

return {
"success": success,
"msg": msg,
"readme": readme_,
}


@current_app.post("/settings")
Expand Down
197 changes: 92 additions & 105 deletions code_garden/web/static/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,93 +6,90 @@
html[data-theme="light"] {
--primary-bg: #cccccc;
--primary-txt: #1a1a1a;
--btn-color: #343030;
--btn-hover: #cccccc;
--btn-color: #1a1a1a;
--btn-hover-text: #cccccc;
}

html[data-theme="scarlet"] {
--primary-bg: #cccccc;
--primary-txt: #380808;
--btn-color: #910000;
--btn-hover: #cccccc;
html[data-theme="dark"] {
--primary-bg: #1a1a1a;
--primary-txt: #cccccc;
--btn-color: #cccccc;
--btn-hover-text: #1a1a1a;
}

html[data-theme="gold"] {
--primary-bg: #cccccc;
--primary-txt: #584c18;
--btn-color: #a96e00;
--btn-hover: #cccccc;
html[data-theme="scarlet-light"] {
--primary-bg: #ea9599;
--primary-txt: #1a1a1a;
--btn-color: #1a1a1a;
--btn-hover-text: #ea9599;
}

html[data-theme="forest"] {
--primary-bg: #cccccc;
--primary-txt: #183508;
--btn-color: #135313;
--btn-hover: #cccccc;
html[data-theme="scarlet-dark"] {
--primary-bg: #582930;
--primary-txt: #cccccc;
--btn-color: #cccccc;
--btn-hover-text: #582930;
}

html[data-theme="navy"] {
--primary-bg: #cccccc;
--primary-txt: #080a21;
--btn-color: #29297c;
--btn-hover: #cccccc;
html[data-theme="manila-light"] {
--primary-bg: #c1b58a;
--primary-txt: #1a1a1a;
--btn-color: #1a1a1a;
--btn-hover-text: #c1b58a;
}

html[data-theme="dark"] {
--primary-bg: #1a1a1a;
html[data-theme="manila-dark"] {
--primary-bg: #6a4c3f;
--primary-txt: #cccccc;
--btn-color: #bfbfbf;
--btn-hover: #292929;
--btn-color: #cccccc;
--btn-hover-text: #6a4c3f;
}

html[data-theme="neon"] {
--primary-bg: #1a1a1a;
--primary-txt: #cccccc;
--btn-color: #ff5e5e;
--btn-hover: #cccccc;
html[data-theme="mint-light"] {
--primary-bg: #9eba75;
--primary-txt: #1a1a1a;
--btn-color: #1a1a1a;
--btn-hover-text: #9eba75;
}

html[data-theme="hornet"] {
--primary-bg: #1a1a1a;
html[data-theme="mint-dark"] {
--primary-bg: #415641;
--primary-txt: #cccccc;
--btn-color: #cf911f;
--btn-hover: #1a1a1a;
--btn-color: #cccccc;
--btn-hover-text: #415641;
}

html[data-theme="xbox"] {
--primary-bg: #1a1a1a;
--primary-txt: #cccccc;
--btn-color: #68bf68;
--btn-hover: #1a1a1a;
html[data-theme="ocean-light"] {
--primary-bg: #5e8a9f;
--primary-txt: #1a1a1a;
--btn-color: #1a1a1a;
--btn-hover-text: #5e8a9f;
}

html[data-theme="ocean"] {
--primary-bg: #1a1a1a;
html[data-theme="ocean-dark"] {
--primary-bg: #263380;
--primary-txt: #cccccc;
--btn-color: #6682d7;
--btn-hover: #cccccc;
--btn-color: #cccccc;
--btn-hover-text: #263380;
}

body {
background-color: var(--primary-bg);
color: var(--primary-txt);
html[data-theme="lavender-light"] {
--primary-bg: #bf85c8;
--primary-txt: #1a1a1a;
--btn-color: #1a1a1a;
--btn-hover-text: #bf85c8;
}

.dropdown-menu {
background-color: var(--primary-bg);
color: var(--primary-txt);
border: 1px solid var(--btn-color);
html[data-theme="lavender-dark"] {
--primary-bg: #5d2a5e;
--primary-txt: #cccccc;
--btn-color: #cccccc;
--btn-hover-text: #5d2a5e;
}

.dropdown-item {
body {
background-color: var(--primary-bg);
color: var(--primary-txt);
font-size: small;
letter-spacing: 1px;
}

.dropdown-item:hover {
background-color: var(--btn-color);
color: var(--btn-hover);
}

a,
Expand All @@ -103,83 +100,73 @@ a:hover {
}

.btn {
border-color: var(--btn-color);
background-color: transparent;
color: var(--btn-color);
/* font-size: small; */
border-color: var(--btn-color);
letter-spacing: 1px;
}

.btn:hover,
.btn.active {
background-color: var(--btn-color);
color: var(--btn-hover);
}

.form-control,
.form-control:focus {
background-color: transparent;
color: var(--primary-txt);
border-color: var(--primary-txt);
/* font-size: small; */
color: var(--btn-hover-text);
border-color: transparent;
}

::placeholder {
color: var(--primary-txt) !important;
opacity: 50% !important;
letter-spacing: 1px;
letter-spacing: 1px !important;
}

.scroll {
overflow-y: scroll;
height: 700px;
.dropdown-menu {
background-color: var(--primary-bg);
border-color: var(--primary-txt);
}

.badge {
border: 0;
border-left: 1px dotted var(--btn-color);
background-color: var(--primary-bg);
color: var(--btn-color);
.dropdown-item {
color: var(--primary-txt);
letter-spacing: 1px;
font-size: small;
}

.row {
height: 700px;
.dropdown-item:hover {
background-color: var(--primary-txt);
color: var(--primary-bg);
}

.col-2 {
border-right: 1px dotted;
overflow: hidden;
.between {
display: flex;
justify-content: space-between;
}

.col-10 {
overflow: auto;
.form-control,
.form-control:focus {
background-color: transparent;
border-color: var(--primary-txt);
color: var(--primary-txt);
}

.text-warning {
color: darkorange !important;
hr {
border-style: dotted !important;
}

.border {
border-color: var(--primary-txt) !important;
.badge {
color: var(--primary-txt);
border: 1px solid var(--primary-txt);
font-weight: unset;
letter-spacing: 1px;
padding: 3px 10px;
}

.desc {
resize: none;
font-weight: lighter !important;
font-style: italic;
border: 0;
/* font-size: small; */
border-left: 1px dotted;
margin-left: 20px;
width: 90%;
border-radius: 0;
.border-bottom {
border-bottom-color: var(--primary-txt) !important;
}

.desc:focus {
outline: none !important;
.hover:hover {
border-bottom: 1px dotted var(--primary-txt);
}

.diff-item:hover,
.log-item:hover {
border-bottom: 1px dotted;
.hover {
border-bottom: 1px dotted var(--primary-bg);
}
Loading

0 comments on commit 5d1e1fc

Please sign in to comment.