diff --git a/app/components/input/select_component/select_component.html.haml b/app/components/input/select_component/select_component.html.haml new file mode 100644 index 0000000000..242f794058 --- /dev/null +++ b/app/components/input/select_component/select_component.html.haml @@ -0,0 +1,2 @@ += render Input::InputFieldComponent.new(name: @name, error_message: @error_message, helper_text: @helper_text, label: @label) do + = render SelectInputComponent.new(id: @id, name: @name, values: @values , selected: @selected , multiple: @multiple, open_to_add_values: @open_to_add_values ) \ No newline at end of file diff --git a/app/components/ontology_subscribe_button_component.rb b/app/components/ontology_subscribe_button_component.rb index 143e8e2dc7..86eaa89bb3 100644 --- a/app/components/ontology_subscribe_button_component.rb +++ b/app/components/ontology_subscribe_button_component.rb @@ -17,6 +17,18 @@ def initialize(ontology_id:, subscribed:, user_id:, count: 0, link: 'javascript: }, title: title } + @link = link + @count = count + end + + def title + if @subscribed + "#{@sub_text} this resource" + elsif @count.zero? + "Be the first to watch this resource and be notified of all its updates" + else + "Join the #{@count} users, watching this resource and be notified of all its updates" + end end def title diff --git a/app/components/select_input_component.rb b/app/components/select_input_component.rb index 25f905100d..59bc95d504 100644 --- a/app/components/select_input_component.rb +++ b/app/components/select_input_component.rb @@ -14,6 +14,10 @@ def initialize(id:, name:, values:, selected: nil, multiple: false, open_to_add_ @data = data @required = required end + + def call + select_input_tag(@id, @values, @selected, multiple: @multiple, open_to_add_values: @open_to_add_values) + end def call select_input_tag(@id, @name, @values, @selected, multiple: @multiple, open_to_add_values: @open_to_add_values,