diff --git a/public/style.css b/public/style.css index 951bc11..524461c 100644 --- a/public/style.css +++ b/public/style.css @@ -150,4 +150,20 @@ pre { .circle-button.notifications-unread > svg { fill: currentColor; +} + +.header { + height: 96px; + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; +} + +.title { + font-size: x-large; + display: flex; + flex-direction: row; + gap: 0.5em; + align-items: center; } \ No newline at end of file diff --git a/public/template/account_management.ecr b/public/template/account_management.ecr index 0e00f7f..d5aab45 100644 --- a/public/template/account_management.ecr +++ b/public/template/account_management.ecr @@ -5,7 +5,7 @@ - Account Management + Home - <%= Templates.dir_header %>
+
+ + " class="icon"> + + + + Account Settings + + "> + <%= # todo: unhardcode public dir location + File.read("public/assets/icons/bell.svg") %> + +

<%- if error -%>
<%= error %>
diff --git a/public/template/notifications.ecr b/public/template/notifications.ecr index 7e2f049..4030f42 100644 --- a/public/template/notifications.ecr +++ b/public/template/notifications.ecr @@ -13,22 +13,6 @@ padding: 1em; } - .header { - height: 96px; - display: flex; - flex-direction: row; - justify-content: space-between; - align-items: center; - } - - .title { - font-size: x-large; - display: flex; - flex-direction: row; - gap: 0.5em; - align-items: center; - } - .notification { margin: 0.5em; border-radius: 20px; diff --git a/src/template_endpoints/account_settings.cr b/src/template_endpoints/account_settings.cr index d7a4643..41d5d50 100644 --- a/src/template_endpoints/account_settings.cr +++ b/src/template_endpoints/account_settings.cr @@ -11,6 +11,13 @@ CrystalGauntlet.template_endpoints["/accounts/settings"] = ->(context : HTTP::Se Templates.auth() + stars, demons, coins, user_coins, diamonds, creator_points, icon_type, color1, color2, cube, ship, ball, ufo, wave, robot, spider, glow = DATABASE.query_one("select stars, demons, coins, user_coins, diamonds, creator_points, icon_type, color1, color2, cube, ship, ball, ufo, wave, robot, spider, glow from users where id = ?", user_id, as: {Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32}) + + icon_value = [cube, ship, ball, ufo, wave, robot, spider][icon_type] + type_str = ["cube", "ship", "ball", "ufo", "wave", "robot", "spider"][icon_type] + + unread_notifications = DATABASE.scalar("select count(*) from notifications where account_id = ? and read_at is null", account_id).as(Int64) > 0 + email = DATABASE.query_one("select email from accounts where id = ?", account_id, as: {String}) result = nil