Skip to content

Commit

Permalink
Remove outdated patch
Browse files Browse the repository at this point in the history
  • Loading branch information
akadusei committed Jul 11, 2024
1 parent fa82153 commit 905281b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 23 deletions.
17 changes: 0 additions & 17 deletions config/charms.cr
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,3 @@ end
abstract class Avram::Model
include JSON::Serializable
end

module Lucky::SelectHelpers
def options_for_multi_select(
field : Avram::Attribute(Array(T)),
select_options : Array(Tuple(String, T)),
**html_options
) : Nil forall T
select_options.each do |option_name, option_value|
attributes = {"value" => option_value.to_s}

is_selected = field.value && attributes["value"].in?(field.value.not_nil!)
attributes["selected"] = "selected" if is_selected

option option_name, merge_options(html_options, attributes)
end
end
end
10 changes: 4 additions & 6 deletions src/pages/current_user/bearer_logins/new_page.cr
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ struct CurrentUser::BearerLogins::NewPage < MainLayout
end

para do
label Rex.t(:"page.current_user.bearer_login.new.form.scopes.label"),
for: "#{param_key}_scopes"
label_for operation.scopes,
Rex.t(:"page.current_user.bearer_login.new.form.scopes.label")

select_tag id: "#{param_key}_scopes",
name: "#{param_key}:scopes[]",
attrs: [:multiple] do
options_for_multi_select operation.scopes, options_for_scopes
multi_select_input(operation.scopes) do
options_for_select(operation.scopes, options_for_scopes)
end

mount Shared::FieldErrors, operation.scopes
Expand Down

0 comments on commit 905281b

Please sign in to comment.