diff --git a/app/javascript/controllers/filter_controller.js b/app/javascript/controllers/filter_controller.js index 7c224698..a4c61b74 100644 --- a/app/javascript/controllers/filter_controller.js +++ b/app/javascript/controllers/filter_controller.js @@ -1,4 +1,4 @@ -import { Controller } from "stimulus"; +import { Controller } from "stimulus" export default class extends Controller { static targets = ["input", "item"] @@ -13,20 +13,20 @@ export default class extends Controller { update(event) { - const query = this.inputTarget.value.toLowerCase() - - localStorage.setItem("searchQuery", query) + const query = !this.hasInputTarget ? event.target.value.toLocaleLowerCase() : this.inputTarget.value.toLowerCase() + if(this.hasInputTarget) { + localStorage.setItem("searchQuery", query) + } + this.itemTargets.forEach(target => { const searchText = target.innerText.toLowerCase() const searchTerms = query.split(" ") if (searchTerms.every(term => searchText.includes(term))) { target.classList.remove("d-none") - target.style.display = "flex" } else { target.classList.add("d-none") - target.style.display = "none" } }); } diff --git a/app/views/datasets/edit.html.erb b/app/views/datasets/edit.html.erb index e42c8682..0b0835e5 100644 --- a/app/views/datasets/edit.html.erb +++ b/app/views/datasets/edit.html.erb @@ -1,10 +1,15 @@ -
-

Edit Dataset

- <%= form_for @dataset do |f| %> -
- <%= f.label :name %> - <%= f.text_field :name, class: 'form-control' %> -
- <%= f.submit 'Update', class: 'btn btn-primary' %> - <% end %> +
+
+ Edit Dataset +
+ +
+ <%= form_for @dataset do |f| %> +
+ <%= f.label :name %> + <%= f.text_field :name, class: 'form-control' %> +
+ <%= f.submit 'Update', class: 'btn btn-primary' %> + <% end %> +
\ No newline at end of file diff --git a/app/views/datasets/index.html.erb b/app/views/datasets/index.html.erb index f73547ef..519d6680 100644 --- a/app/views/datasets/index.html.erb +++ b/app/views/datasets/index.html.erb @@ -9,7 +9,7 @@
<% @team.datasets.order(:name).each do |dataset| %> -
+
<% if dataset.gridtype == 'BooleanTileGrid' %> @@ -19,8 +19,6 @@ <% else %> Categorical <% end %> - - <%= dataset.name %> (<%= dataset.created_at.strftime("%d/%m/%Y") %>) diff --git a/app/views/extents/index.html.erb b/app/views/extents/index.html.erb index 9270bf91..dff19221 100644 --- a/app/views/extents/index.html.erb +++ b/app/views/extents/index.html.erb @@ -13,8 +13,8 @@
<% @team_extents.sort_by { |extent| extent.name.downcase }.each do |extent| %> - <%= link_to edit_extent_path(extent.id), class: "list-group-item list-group-item-action border-0" do %> -
+ <%= link_to edit_extent_path(extent.id), class: "list-group-item list-group-item-action p-0" do %> +
<%= extent.name %>