diff options
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/activities/_costs_and_requirements.html.erb | 5 | ||||
-rw-r--r-- | app/views/characters/hearth/index.html.erb | 14 |
2 files changed, 14 insertions, 5 deletions
diff --git a/app/views/activities/_costs_and_requirements.html.erb b/app/views/activities/_costs_and_requirements.html.erb new file mode 100644 index 0000000..6ae66bb --- /dev/null +++ b/app/views/activities/_costs_and_requirements.html.erb @@ -0,0 +1,5 @@ +<div class="text-sm border border-2 border-gray-700 rounded p-2 w-full"> + <%= @text %> + <p>Costs:<strong> <%= @activity.costs&.join(", ") || "None" %></strong> </p> + <p>Requires:<strong> <%= @activity.requirements&.join(", ") || "None" %></strong> </p> +</div> diff --git a/app/views/characters/hearth/index.html.erb b/app/views/characters/hearth/index.html.erb index ee5b07d..1ad2726 100644 --- a/app/views/characters/hearth/index.html.erb +++ b/app/views/characters/hearth/index.html.erb @@ -15,11 +15,15 @@ <p class="mb-2">Level <%= built_amenity.level %></p> <p class="mb-2"><%= ha.description %></p> <% if @amenity_activities[ha.gid.to_sym] %> - <%= form_with url: start_activity_path, method: :post do |f| %> - <%= f.select :id, @amenity_activities[ha.gid.to_sym].sort_by { |a| a.name }.map { |a| [a.name, a.id] } %> - <%= f.number_field :actions, value: 1, size: 5, min: 1, max: 2_000_000_000 %> - <%= f.submit "Go" %> - <% end %> + <div data-controller="activity-select"> + <%= form_with url: start_activity_path, method: :post do |f| %> + <%= f.select :id, @amenity_activities[ha.gid.to_sym].sort_by { |a| a.name }.map { |a| [a.name, a.id] }, + {}, { data: { activity_select_target: "select", action: "activity-select#load" } } %> + <%= f.number_field :actions, value: 1, size: 5, min: 1, max: 2_000_000_000 %> + <%= f.submit "Go" %> + <% end %> + <div data-activity-select-target="output" class="my-1"></div> + </div> <% end %> <% if built_amenity.usable? %> <% if built_amenity.on_cooldown? %> |