Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Add lookbook param for octicons

Oliver Günther9f7efef444c5
diff --git a/app/views/lookbook/previews/inputs/_octicon.html.erb b/app/views/lookbook/previews/inputs/_octicon.html.erb
new file mode 100644
index 00000000000..35a1a08608f
--- /dev/null
+++ b/app/views/lookbook/previews/inputs/_octicon.html.erb
@@ -0,0 +1 @@
+<%= select_tag(name, options_for_select([:none, *Octicons::OCTICON_SYMBOLS.keys], value), **input_options, "x-model": "value") %>
diff --git a/config/initializers/lookbook.rb b/config/initializers/lookbook.rb
index c7a6d9593ca..bdf5b9a46be 100644
--- a/config/initializers/lookbook.rb
+++ b/config/initializers/lookbook.rb
@@ -37,6 +37,8 @@ OpenProject::Application.configure do
# rubocop:enable Lint/ConstantDefinitionInBlock
Rails.application.reloader.to_prepare do
+ Lookbook.define_param_input(:octicon, "lookbook/previews/inputs/octicon")
+
[
Lookbook::ApplicationController,
Lookbook::PreviewController,