<%= search_form_for(dtext_links_path) do |f| %> <%= f.simple_fields_for :model do |fa| %> <%= fa.input :title, label: "Wiki", hint: "Use * for wildcard", input_html: { value: params.dig(:search, :model, :title), "data-autocomplete": "wiki-page" } %> <% end %> <%= f.input :link_target_ilike, label: "Link", hint: "Use * for wildcard", input_html: { value: params[:search][:link_target_ilike], data: { autocomplete: "wiki-page" } } %> <%= f.simple_fields_for :model do |fm| %> <%= fm.simple_fields_for :tag do |ft| %> <%= ft.input :category, label: "Wiki Type", collection: TagCategory.canonical_mapping.to_a, include_blank: true, selected: params.dig(:search, :model, :tag, :category) %> <% end %> <% end %> <%= f.input :link_type, label: "Link Type", collection: [["Wiki", "0"], ["External", "1"]], include_blank: true, selected: params[:search][:link_type] %> <%= f.input :linked_wiki_exists, label: "Wiki Exists?", collection: ["Yes", "No"], include_blank: true, selected: params[:search][:linked_wiki_exists] %> <%= f.input :linked_tag_exists, label: "Tag Exists?", collection: ["Yes", "No"], include_blank: true, selected: params[:search][:linked_tag_exists] %> <%= f.submit "Search" %> <% end %> <% @dtext_links.each do |dtext_link| %> <% end %>
Wiki Link Type
<%= link_to(dtext_link.model.title, dtext_link.model) %> <%= link_to("»", dtext_links_path(search: { model: { title: dtext_link.model.title }})) %> <% if dtext_link.external_link? %> <%= external_link_to(dtext_link.link_target) %> <% elsif dtext_link.wiki_link? %> <%= link_to(dtext_link.link_target, show_or_new_wiki_pages_path(title: dtext_link.link_target), class: "tag-type-#{Tag.category_for(dtext_link.link_target)}") %> <% end %> <%= link_to("»", dtext_links_path(search: { link_target: dtext_link.link_target })) %> <%= dtext_link.link_type.delete_suffix("_link").capitalize %>
<%= numbered_paginator(@dtext_links) %>