-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.R
242 lines (215 loc) · 7.65 KB
/
ui.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# test for github upload
# Produce basic shell for the site
#---------------------------------------
# Load packages (only matters for publishing on shiny.io)
library(tidyverse)
library(shinyjs)
library(DT)
#-------------------------------
# Basic Layout
ui <- function(req){
fluidPage(
shinyjs::useShinyjs(),
# Style
tags$link(rel = "stylesheet", type = "text/css", href = "css/roboto.css"),
tags$style(paste0("
* {
font-family: 'Roboto', sans-serif; padding: 0px; margin: 0px;
}
.col-sm-12 {
padding: 0px;
}
.tracker-container {
max-width: 800px;
margin: auto;
padding-left: 24px;
padding-right:24px;
}
h1 {
font-size: 42px;
}
p {
font-size: 18px;
line-height:1.3em;
color:black;
}
.tab-header {margin-top:1em; margin-bottom: 1em;}
table.dataTable tr.selected td, table.dataTable td.selected, table.dataTable tr.selected {background-color: white !important;}
table thead.selected td {background-color: white !important;}
table.dataTable.hover tbody tr:hover, table.dataTable.display tbody tr:hover {background-color: white !important;}
.tabbable {
margin-top: 24px;
}
.tabbable h4 {
font-size: 18px;
font-weight: 600;
}
ul.nav-tabs {
border-bottom: 1px solid ","#fdb927",";
}
.nav-tabs li a {
padding: 0px 12px 0px 12px;
}
.nav-tabs li.active a, .nav-tabs li.active a:focus, .nav-tabs li.active a:hover {
border: 1px solid ","#fdb927",";
border-bottom: 1px solid white;
}
table.dataTable thead th {
padding: 8px 10px !important;
}
#DataTables_Table_0_filter {
float: right;
}
#DataTables_Table_0_filter input {
border: 1px solid #ccc;
border-radius: 4px;
}
.fab, .fa {
color: black;
}
.priorities-hierarchy-2 div {
margin-right: 6px;
}
.goog-te-gadget {
font-family: Roboto!important;
}
.goog-te-gadget-simple {
border: 0px solid white !important;
padding: 0px!important;
border-radius: 0px!important;
cursor: pointer;
}
.goog-te-menu-value span:nth-child(5) {
// display:none;
color: ","#fdb927","!important;
font-size: 12px!important;
}
.goog-te-menu {
border: 1px solid ","#fdb927",";
}
.goog-te-menu-value span:nth-child(3) {
display:none;
}
.goog-te-menu-value span {
// float: right;
text-align:right;
font-size: 15px!important;
font-weight: 500!important;
}
.goog-te-menu-value {
margin: 0px;
}
.goog-te-gadget-icon {
display:none;
}
.legend {
margin-left: 1px;
display:flex;
flex-direction:row;
flex-wrap:nowrap;
justify-content:flex-start;
align-items:baseline;
align-content:flex-start;
}
.legend p {
font-size: 14px!important;
font-weight: 400;
color: dimGrey!important;
margin-right: 0.75em;
}
.legend div {
margin-right: 0.35em;
width: 11px;
height: 11px;
}
"
)),
#-------------------------------
# Begin vertical R Shiny layout, add City Header
verticalLayout(
headerCity,
#-------------------------------
# Div for 'tracker' content
div(class="tracker-container",
#-------------------------------
# Header for page
div(style="margin-top:0px;padding-top:0px;display:flex;flex-direction:row;justify-content:space-between;align-items:flex-end;",
h1(strong(title),
style="font-size:42px;color:black;padding:0px;padding-right:16px;padding-bottom:14px;line-height:1.1;margin-bottom:-20px;"
),
# Google Translate
HTML('
<div id="google_translate_element"></div>
<script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: \'en\',
includedLanguages: \'en,es,fr,jv,ko,pa,pt,ru,zh-CN,ar\',
layout: google.translate.TranslateElement.InlineLayout.SIMPLE, autoDisplay: false},
\'google_translate_element\');
}
</script>
<script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
'
)
),
hr(style=paste0("margin:16px 0px 12px 0px;padding:0px;border-top: 3px solid", "#fdb927", ";")),
#-------------------------------
# Second level content
# Welcome comment from Mayor
div(style='margin-bottom:12px;margin-top:18px;',
img(src = "photos/mayor_brandon_scott.png",
style="margin-left: 2px; margin-top: 4px; margin-right:24px;margin-bottom:8px;float:left;" ,
height = 235),
text1),
# Overview progress and day trackers
div(style='padding:1px;max-width:900px;margin-top:24px;' ,
div(p(style="max-width:900px;font-weight:600;", textOutput("timelineText", container=span), " ")),
div(style='margin-left:-4px;margin-right:-4px;margin-bottom:0px;', class="small-tracker",
plotOutput("plotTimeline", width="100%", height="48px")),
htmlOutput("timelineLegend"),
div(p(style="max-width:900px;font-weight:600;", progressText, " ")),
div(style='margin-left:-4px;margin-right:-4px;margin-bottom:0px', class="small-tracker",
plotOutput("plotProgress", width="100%", height="48px")),
htmlOutput("progressLegend")
),
#--------------------------------------
# Third Level Content
# Tab setup for tracker "pages"
tabsetPanel(type="tabs",
tabPanel(h4(style="color:black;","Priorities & Progress"),
text2,
dataTableOutput("tbPriorities"),
downloadButton(style="border:none;padding-left:0px;margin-top:24px;","downloadActions", HTML("<p>Download this data (csv)</p>"))),
tabPanel(h4(style="color:black;","Updates"),
HTML(updateText)
),
tabPanel(h4(style="color:black;","Message from the Mayor"), aboutus ),
tabPanel(h4(style="color:black;","Resources & Feedback"),
text4,links,
HTML('<iframe src="https://docs.google.com/forms/d/e/1FAIpQLScjKePIaoUjUeI1-2Q9vvINtFdFl9ZGivr19BP6M9Hd6kdyhg/viewform?embedded=true" width="100%" height="360px" frameborder="0" marginheight="0" marginwidth="0">Loading…</iframe>')
)
),
#--------------------------------------
# Page Bottom
h4(),
hr(style=paste0("margin:16px 0px 12px 0px;padding:0px;border-top: 1px solid", "#fdb927", ";")),
div(style="display: flex; flex-direction:row;justify-content: space-between;",
tags$i(h4("Designed by the ",a(href = 'https://www.baltopi.com/',"Mayor's Office of Performance & Innovation"))),
h4(style="font-size:20px;",
#Be sure to replace these with your organization's links.
a(style="padding-left:1px;", href='https://twitter.com/MayorBMScott', icon("twitter")), " ",
a(style="padding-left:1px;", href='https://www.facebook.com/MayorBMScott',icon("facebook-square")), " ",
a(style="padding-left:1px;", href='https://www.instagram.com/MayorBMScott/',icon("instagram-square")), " ",
a(style="padding-left:1px;", href='https://www.youtube.com/channel/UCasQyO1K4yMq3Hi_0RQ0jfA',icon("youtube-square")), " ",
a(style="padding-left:1px;", href='https://mayor.baltimorecity.gov/connect',icon("envelope-square")), " ",
a(style="padding-left:1px;", href='https://mayor.baltimorecity.gov/subscribe/MDBALT_25',icon("rss-square")))),
h2()
#-------------------------------
# Close div for 'tracker' content
),
#-------------------------------
# Add Baltimore City footer
footerCity
#-------------------------------
) ) }