Skip to content

Dan notification banner #1197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add notification
  • Loading branch information
chillenberger committed Nov 22, 2023
commit 1228745b7f37017a3bec632d9e109d0efa4361e0
40 changes: 39 additions & 1 deletion pgml-dashboard/src/guards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,47 @@ pub fn default_database_url() -> String {
}
}

#[derive(Debug)]
#[derive(Debug, Clone, Default)]
pub struct Cluster {
pub pool: Option<PgPool>,
pub context: Context,
pub notifications: Option<Vec<Notification>>
}

#[derive(Debug, Clone, Default)]
pub struct Notification {
pub message: String,
pub level: NotificationLevel,
pub id: String,
pub dismissible: bool,
pub viewed: bool,
pub link: String,
}

#[derive(Debug, Clone, Default, PartialEq)]
pub enum NotificationLevel {
#[default]
News,
Blog,
Launch,
Tip,
Level1,
Level2,
Level3,
}

impl std::fmt::Display for NotificationLevel {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
NotificationLevel::News => write!(f, "news"),
NotificationLevel::Blog => write!(f, "blog"),
NotificationLevel::Launch => write!(f, "launch"),
NotificationLevel::Tip => write!(f, "tip"),
NotificationLevel::Level1 => write!(f, "level1"),
NotificationLevel::Level2 => write!(f, "level2"),
NotificationLevel::Level3 => write!(f, "level3"),
}
}
}

impl Cluster {
Expand Down Expand Up @@ -142,6 +179,7 @@ impl Cluster {
lower_left_nav: StaticNav::default(),
marketing_footer: MarketingFooter::new().render_once().unwrap(),
},
notifications: None,
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions pgml-dashboard/static/css/scss/components/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@
--bs-btn-border-color: transparent;

--bs-btn-hover-bg: transparent;
--bs-btn-hover-color: #{$gray-100};
--bs-btn-hover-color: #{$slate-tint-400};
--bs-btn-hover-border-color: transparent;

--bs-btn-active-bg: transparent;
--bs-btn-active-color: #{$gray-100};
--bs-btn-active-color: #{$slate-tint-700};
--bs-btn-active-border-color: transparent;

span {
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy