codidact / qpixel

Q&A-based community knowledge-sharing software
https://codidact.com
GNU Affero General Public License v3.0
385 stars 69 forks source link

Support native/imported/all in filters, for sites with imported content #1253

Open cellio opened 9 months ago

cellio commented 9 months ago

Prompted by, but not exactly, meta:289139 and meta:289141 .

A few communities support imported content, and those communities have an extra sorting button on the category page for "native". It's actually a sort, not a filter, but the user expects a filter. Now that we have filters, can we fold it in there?

The presence of the button is controlled by this logic:

    <% if SiteSetting['AllowContentTransfer'] %>
      <%= link_to 'Native', request.params.merge(sort: 'native'),
                  class: "button is-muted is-outlined #{params[:sort] == 'native' ? 'is-active' : ''}",
                  title: 'exclude imported posts' %>
    <% end %>

On sites with imported content only, could the filters widget add a control with a drop-down menu for native, imported, any, like this? This is similar to the Status field for open, closed, any.

native-mockup