Skip to content

Self-hosted project management for devs and their clients: tickets, time tracking, docs and meetings, with an AI assistant that cites its sources. AGPL-3.0.

1.0 KB
Raw Blame
<%# "Number of entries" dropdown for list widgets (recent_tickets / recent_notes /
    smart_folder_tickets). data-name-suffix="[limit]" so the reindex contract rewrites the full
    rows[i][widgets][j][limit] name before submit (see _widget_settings header). Pre-selects the
    widget's effective limit (Dashboards::LayoutEngine.effective_item_limit) so a no-op save preserves
    today's behaviour — incl. the higher grouped-recent_tickets default.

    Locals: prefix, widget_data, field_classes, label_classes. %>
<div>
  <label class="<%= label_classes %>"><%= t('dashboard.configuration.item_count') %></label>
  <% suffix = '[limit]' %>
  <% selected = Dashboards::LayoutEngine.effective_item_limit(widget_data) %>
  <select name="<%= prefix + suffix %>" data-name-suffix="<%= suffix %>" form="dashboard_edit_form" class="<%= field_classes %>">
    <% Dashboards::LayoutEngine::LIST_LIMIT_OPTIONS.each do |n| %>
      <option value="<%= n %>" <%= 'selected' if n == selected %>><%= n %></option>
    <% end %>
  </select>
</div>