Skip to content

Commit dc0eb6f

Browse files
committed
more updates
1 parent ab3f5a8 commit dc0eb6f

File tree

4 files changed

+1107
-31
lines changed

4 files changed

+1107
-31
lines changed

.github/workflows/deploy-tools.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,16 @@ jobs:
6666
file.copy("assets", "docs", recursive = TRUE)
6767
}
6868
69+
# Copy shared www directory to each app for Shinylive
70+
if(dir.exists("www")) {
71+
if(dir.exists("docs/donor-retention-calculator")) {
72+
file.copy("www", "docs/donor-retention-calculator", recursive = TRUE)
73+
}
74+
if(dir.exists("docs/board-packet-generator")) {
75+
file.copy("www", "docs/board-packet-generator", recursive = TRUE)
76+
}
77+
}
78+
6979
# Copy style guide if it exists
7080
if(file.exists("style-guide.html")) {
7181
file.copy("style-guide.html", "docs/style-guide.html")

board-packet-generator/app.R

Lines changed: 47 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,12 @@ corporate_colors <- list(
2121
muted = "#7f8c8d"
2222
)
2323

24-
# Use shared CSS file
25-
addResourcePath("www", "../www")
24+
# Use shared CSS file - handle both local and shinylive paths
25+
if (file.exists("../www")) {
26+
addResourcePath("www", "../www")
27+
} else if (file.exists("www")) {
28+
addResourcePath("www", "www")
29+
}
2630

2731
# Custom theme
2832
professional_theme <- bs_theme(
@@ -290,11 +294,11 @@ ui <- fluidPage(
290294
p(class = "metric-value", textOutput("page_estimate", inline = TRUE), " pages estimated")
291295
),
292296

293-
downloadButton(
297+
actionButton(
294298
"generate_packet",
295-
"Generate HTML Report",
299+
"Generate Board Packet",
296300
class = "btn btn-primary btn-lg w-100 mb-3",
297-
icon = icon("download")
301+
icon = icon("file-text")
298302
),
299303

300304
actionButton(
@@ -550,34 +554,46 @@ server <- function(input, output, session) {
550554
as.character(base_pages)
551555
})
552556

553-
# Generate board packet download
554-
output$generate_packet <- downloadHandler(
555-
filename = function() {
556-
paste0("Board_Packet_", format(input$meeting_date, "%Y%m%d"), ".html")
557-
},
558-
content = function(file) {
559-
# Generate HTML report
560-
html_content <- generate_board_packet_html(
561-
meeting_title = input$meeting_title,
562-
meeting_date = input$meeting_date,
563-
meeting_time = input$meeting_time,
564-
meeting_location = input$meeting_location,
565-
components = input$components,
566-
agenda_data = agenda_items(),
567-
financial_data = values$financial_data,
568-
include_watermark = input$include_watermark,
569-
include_toc = input$include_toc
557+
# Generate board packet (Shinylive-compatible)
558+
observeEvent(input$generate_packet, {
559+
# Generate HTML report
560+
html_content <- generate_board_packet_html(
561+
meeting_title = input$meeting_title,
562+
meeting_date = input$meeting_date,
563+
meeting_time = input$meeting_time,
564+
meeting_location = input$meeting_location,
565+
components = input$components,
566+
agenda_data = agenda_items(),
567+
financial_data = values$financial_data,
568+
include_watermark = input$include_watermark,
569+
include_toc = input$include_toc
570+
)
571+
572+
# Show generated HTML in a modal (Shinylive-compatible)
573+
showModal(modalDialog(
574+
title = "Board Packet Generated",
575+
size = "xl",
576+
div(
577+
style = "max-height: 500px; overflow-y: auto; border: 1px solid #ddd; padding: 1rem;",
578+
HTML(html_content)
579+
),
580+
footer = tagList(
581+
p(class = "text-muted",
582+
"Copy the content above or use your browser's print function to save as PDF."),
583+
modalButton("Close")
570584
)
571-
572-
writeLines(html_content, file)
573-
574-
# Show completion notification
575-
showNotification("Board packet generated successfully!", type = "message", duration = 5)
576-
577-
# Update step 3 to completed
585+
))
586+
587+
# Show completion notification
588+
showNotification("Board packet generated successfully!", type = "message", duration = 5)
589+
590+
# Update step 3 to completed
591+
tryCatch({
578592
shinyjs::runjs("$('#step3').addClass('completed').removeClass('active');")
579-
}
580-
)
593+
}, error = function(e) {
594+
# Silently handle if shinyjs fails
595+
})
596+
})
581597

582598
# Email preview modal
583599
observeEvent(input$email_preview, {
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Shared Styles for Nonprofit Analytics Tools
2+
3+
This directory contains shared CSS and assets used across all tools in the nonprofit analytics suite.
4+
5+
## Files
6+
7+
- `shared-styles.css` - Common styles used by all tools to ensure consistent branding and user experience
8+
9+
## Usage
10+
11+
Each tool app should include the shared styles using:
12+
13+
```r
14+
# Add at the top of your app.R file
15+
addResourcePath("www", "../www")
16+
17+
# In your UI tagList
18+
ui <- tagList(
19+
tags$head(tags$link(rel="stylesheet", type="text/css", href="www/shared-styles.css")),
20+
# ... rest of your UI
21+
)
22+
```
23+
24+
## Design System
25+
26+
The shared CSS implements a consistent design system with:
27+
28+
### Brand Colors
29+
- **Primary Gradient**: #F9B397, #D68A93, #AD92B1, #B07891
30+
- **Text**: #2c3e50 (dark gray)
31+
- **Accent**: #d68a93 (brand pink)
32+
33+
### Components
34+
- **Animated Navbar**: Gradient animation with consistent nav styling
35+
- **Value Boxes**: Outlined style with brand color borders (red, orange, yellow, green)
36+
- **Cards**: Clean design with subtle shadows and hover effects
37+
- **Buttons**: Professional styling with gradient primary buttons
38+
- **Tables**: Professional DataTables styling with consistent headers
39+
40+
### Features
41+
- Fully responsive design
42+
- Consistent typography
43+
- Loading animations
44+
- Drag and drop table styling
45+
- Footer styling matching the brand
46+
47+
## Adding New Styles
48+
49+
When adding styles for new components:
50+
51+
1. Add component-specific styles to the appropriate section
52+
2. Use the existing color variables and design patterns
53+
3. Ensure mobile responsiveness
54+
4. Test across all tools to ensure no conflicts
55+
56+
## Browser Support
57+
58+
The CSS is designed to work across modern browsers and includes fallbacks for older browsers where needed.

0 commit comments

Comments
 (0)