-
Notifications
You must be signed in to change notification settings - Fork 21
/
ui.R
116 lines (109 loc) · 3.86 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
dashboardPage(
skin = "black",
dashboardHeader(
title = "NYT Bar Optimizer"
),
dashboardSidebar(
includeCSS("www/styles.css"),
includeScript("www/d3.v3.min.js"),
includeScript("www/d3-tip.js"),
useShinyjs(),
extendShinyjs(text = showModal),
sidebarMenu(
menuItem("Recipe View", tabName = "recipeView",
icon = icon("glass", lib="font-awesome")
),
menuItem("Network View", tabName = "networkView",
icon = icon("share-alt", lib="font-awesome")
),
menuItem("Configure", tabName = "configure",
icon = icon("gear", lib="font-awesome")
),
menuItem("About", tabName = "about",
icon = icon("info-circle", lib="font-awesome")
)
)
),
dashboardBody(
tabItems(
tabItem(tabName = "recipeView",
uiOutput("tiles"),
bsModal("aboutModal", h3(" "), "", size = "large",
includeMarkdown("www/about.md")
)
),
tabItem(tabName = "networkView",
fluidRow(
column(12,
htmlOutput('networkPlot')
)
)
),
tabItem(tabName = "configure",
fluidRow(
column(width = 9,
box(width = NULL,
fluidRow(
column(width = 5,
selectInput("cfgPreset", "Bar Presets ",
choices = c("My Bar", "Optimal Bar",
"All Ingredients"),
selected = "All Ingredients"),
conditionalPanel("input.cfgPreset == 'Optimal Bar'",
numericInput("cfgBarSize",
"Bar Size (Up to 40 Bottles)",
value = 5, min = 1, max = 40)
)
),
column(width = 4,
checkboxInput("cfgSubs", "Allow Substitutions", value=FALSE),
checkboxInput( "cfgPantry", "Include Pantry", value=TRUE)
),
column(width = 3,
actionLink("editInv", label="Edit Bar"),
HTML(" "),
downloadLink("saveInv", label="Save Bar"),
HTML(" "),
actionLink("uploadToggle", label="Upload Bar"),
fileInput("uploadInv", NULL,
accept=c('text/csv',
'text/comma-separated-values,text/plain',
'.csv'), width = "100%")
)
),
tabsetPanel(
tabPanel("Bar", h2(''), dataTableOutput("bottlesTable")),
tabPanel("Pantry", h2(''), dataTableOutput("pantryTable"))
),
bsModal("invModal", "Edit Inventory - Click headers to sort",
"editInv", size = "large",
rHandsontableOutput("inventoryTable")
)
)
),
column(width = 3,
uiOutput("drinkStats"),
uiOutput("ingredientStats"),
box(width = NULL, title = "Bar Stats",
tabsetPanel(id="bottleTabset",
tabPanel("Next Best", h4(''), htmlOutput("nextBestBottles")),
tabPanel("Most Used", h4(''), htmlOutput("mostUsedBottles"))
)
),
box(width = NULL, title = "Pantry Stats",
tabsetPanel(id="pantryTabset",
tabPanel("Next Best", h4(''), htmlOutput("nextBestPantry")),
tabPanel("Most Used", h4(''), htmlOutput("mostUsedPantry"))
)
)
)
)
),
tabItem(tabName = "about",
box(width = 12,
includeMarkdown("www/about.md")
)
)
) ## end tabItems
) ## end dashboardBody
) ## end dashboardPage