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

Simple filters

Oliver Günthera3f5a685b313
diff --git a/frontend/src/global_styles/content/_simple_filters.lsg b/frontend/src/global_styles/content/_simple_filters.lsg
index 13b0182fa3a..ef95f1c0747 100644
--- a/frontend/src/global_styles/content/_simple_filters.lsg
+++ b/frontend/src/global_styles/content/_simple_filters.lsg
@@ -1,10 +1,6 @@
# Simple filters
-Simple filters are forms that serve the purpose of limiting the number of entries in a list. As opposed to advanced filters however, there is no operator selection to search with.
-By default, simple filters can have multiple fields per row (as many as the given space allows).
-
-## Simple filters: Standard style
```
@full-width
diff --git a/spec/components/previews/simple_filters_preview.rb b/spec/components/previews/simple_filters_preview.rb
new file mode 100644
index 00000000000..426940a6f06
--- /dev/null
+++ b/spec/components/previews/simple_filters_preview.rb
@@ -0,0 +1,12 @@
+# @logical_path OpenProject
+class SimpleFiltersPreview < Lookbook::Preview
+ # Simple filters
+ # --------------
+ # Simple filters are forms that serve the purpose of limiting the number of entries in a list.
+ # As opposed to advanced filters however, there is no operator selection to search with.
+ #
+ # By default, simple filters can have multiple fields per row (as many as the given space allows).
+ def default; end
+
+ def with_radio_buttons; end
+end
diff --git a/spec/components/previews/simple_filters_preview/default.html.erb b/spec/components/previews/simple_filters_preview/default.html.erb
new file mode 100644
index 00000000000..3adbd5f391c
--- /dev/null
+++ b/spec/components/previews/simple_filters_preview/default.html.erb
@@ -0,0 +1,36 @@
+<fieldset class="simple-filters--container">
+ <a title="Close filter" class="simple-filters--close icon-context icon-close"></a>
+ <legend>Simple Filters</legend>
+ <ul class="simple-filters--filters">
+ <li class="simple-filters--filter">
+ <label for="filter-1" class="simple-filters--filter-name">Project</label>
+ <div class="simple-filters--filter-value">
+ <input id="filter-1" type="text" placeholder="select">
+ </div>
+ </li>
+ <li class="simple-filters--filter">
+ <label for="filter-2" class="simple-filters--filter-name">Status</label>
+ <div class="simple-filters--filter-value">
+ <select id="filter-2" class="simple-filters--select">
+ <option value="=" label="Active" selected="selected">Active</option>
+ <option value="!" label="Archived">Archived</option>
+ <option value="!*" label="All">all</option>
+ </select>
+ </div>
+ </li>
+ <li class="simple-filters--filter">
+ <label for="filter-3" class="simple-filters--filter-name">Name</label>
+ <div class="simple-filters--filter-value">
+ <select id="filter-3" class="simple-filters--select">
+ <option value="=" label="Active" selected="selected">Active</option>
+ <option value="!" label="Archived">Archived</option>
+ <option value="!*" label="All">all</option>
+ </select>
+ </div>
+ </li>
+ <li class="simple-filters--controls">
+ <a class="button -highlight -small" href="#">Apply</a>
+ <a class="button -small -with-icon icon-undo" href="#">Clear</a>
+ </li>
+ </ul>
+</fieldset>
diff --git a/spec/components/previews/simple_filters_preview/with_radio_buttons.html.erb b/spec/components/previews/simple_filters_preview/with_radio_buttons.html.erb
new file mode 100644
index 00000000000..7f3b5e34966
--- /dev/null
+++ b/spec/components/previews/simple_filters_preview/with_radio_buttons.html.erb
@@ -0,0 +1,49 @@
+<fieldset class="simple-filters--container">
+ <a title="Close filter" class="simple-filters--close icon-context icon-close"></a>
+ <legend>Simple Filters</legend>
+ <ul class="simple-filters--filters">
+ <li class="simple-filters--filter -with-radio-buttons">
+ <span class="form--radio-button-container">
+ <input type="radio" name="period_type" class="form--radio-button">
+ </span>
+ <label class="simple-filters--filter-name form--label" title="From" for="from">
+ This is a simple filter with radio button and label
+ </label>
+ </li>
+ <li class="simple-filters--filter -with-radio-buttons">
+ <span class="form--radio-button-container">
+ <input type="radio" name="period_type" class="form--radio-button">
+ </span>
+ <label class="simple-filters--filter-name form--label" title="From" for="from">From</label>
+ <div class="simple-filters--filter-value">
+ <span class="form--text-field-container">
+ <input type="text" name="from" id="from" class="-augmented-datepicker form--text-field">
+ </span>
+ </div>
+ <label class="simple-filters--filter-name form--label" title="To" for="to">To</label>
+ <div class="simple-filters--filter-value">
+ <span class="form--text-field-container">
+ <input type="text" name="to" class="-augmented-datepicker form--text-field">
+ </span>
+ </div>
+ </li>
+ <li class="simple-filters--filter -with-radio-buttons">
+ <span class="form--radio-button-container">
+ <input type="radio" name="period_type" value="1" class="form--radio-button" checked="checked">
+ </span>
+ <div class="simple-filters--filter-value">
+ <span class="form--select-container">
+ <select name="period" id="period" class="-narrow form--select">
+ <option value="all">all time</option>
+ <option value="today">today</option>
+ <option value="yesterday">yesterday</option>
+ </select>
+ </span>
+ </div>
+ </li>
+ <li class="simple-filters--controls">
+ <a class="button -highlight -small" href="#">Apply</a>
+ <a class="button -small -with-icon icon-undo" href="#">Clear</a>
+ </li>
+ </ul>
+</fieldset>