mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-30 14:57:59 +01:00
fix autocomplete and fetch controller paths
This commit is contained in:
parent
f56ce27780
commit
f6c8d57bdf
6 changed files with 10 additions and 8 deletions
|
@ -44,7 +44,7 @@ function fetchAndPersistTags(tagIds) {
|
|||
const ids = tagIds.slice(0, 40);
|
||||
const remaining = tagIds.slice(41);
|
||||
|
||||
fetch(`/tags/fetch?ids[]=${ids.join('&ids[]=')}`)
|
||||
fetch(`/fetch/tags?ids[]=${ids.join('&ids[]=')}`)
|
||||
.then(response => response.json())
|
||||
.then(data => data.tags.forEach(tag => persistTag(tag)))
|
||||
.then(() => fetchAndPersistTags(remaining));
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
defmodule PhilomenaWeb.Tag.AutocompleteController do
|
||||
defmodule PhilomenaWeb.Autocomplete.TagController do
|
||||
use PhilomenaWeb, :controller
|
||||
|
||||
alias Philomena.Elasticsearch
|
|
@ -1,4 +1,4 @@
|
|||
defmodule PhilomenaWeb.Tag.FetchController do
|
||||
defmodule PhilomenaWeb.Fetch.TagController do
|
||||
use PhilomenaWeb, :controller
|
||||
|
||||
alias Philomena.Tags.Tag
|
|
@ -446,9 +446,11 @@ defmodule PhilomenaWeb.Router do
|
|||
resources "/favorites", Image.FavoriteController, only: [:index]
|
||||
end
|
||||
|
||||
scope "/tags", Tag, as: :tag do
|
||||
resources "/autocomplete", AutocompleteController, only: [:show], singleton: true
|
||||
resources "/fetch", FetchController, only: [:index]
|
||||
scope "/autocomplete", Autocomplete, as: :autocomplete do
|
||||
resources "/tags", TagController, only: [:show], singleton: true
|
||||
end
|
||||
scope "/fetch", Fetch, as: :fetch do
|
||||
resources "/tags", TagController, only: [:index]
|
||||
end
|
||||
|
||||
resources "/tags", TagController, only: [:index, :show] do
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
' Artist Link validation is intended for artists. Validating your link will give you control over your content on the site, allowing you to create a
|
||||
a> href="/commissions" commissions
|
||||
' listing and request takedowns or DNPs. Do not request a link if the source contains no artwork which you have created.
|
||||
= text_input f, :tag_name, value: assigns[:tag_name], class: "input", autocomplete: "off", placeholder: "artist:your-name", data: [ac: "true", ac_min_length: "3", ac_source: "/tags/autocomplete?term="]
|
||||
= text_input f, :tag_name, value: assigns[:tag_name], class: "input", autocomplete: "off", placeholder: "artist:your-name", data: [ac: "true", ac_min_length: "3", ac_source: "/autocomplete/tags?term="]
|
||||
= error_tag f, :tag
|
||||
|
||||
.field
|
||||
|
|
|
@ -9,7 +9,7 @@ elixir:
|
|||
.js-tag-block class="fancy-tag-#{@type}"
|
||||
= textarea @f, @name, html_options
|
||||
.js-taginput.input.input--wide.tagsinput.hidden class="js-taginput-fancy" data-click-focus=".js-taginput-input.js-taginput-#{@name}"
|
||||
input.input class="js-taginput-input js-taginput-#{@name}" id="taginput-fancy-#{@name}" type="text" placeholder="add a tag" autocomplete="off" autocapitalize="none" data-ac="true" data-ac-min-length="3" data-ac-source="/tags/autocomplete?term="
|
||||
input.input class="js-taginput-input js-taginput-#{@name}" id="taginput-fancy-#{@name}" type="text" placeholder="add a tag" autocomplete="off" autocapitalize="none" data-ac="true" data-ac-min-length="3" data-ac-source="/autocomplete/tags?term="
|
||||
button.button.button--state-primary.button--bold class="js-taginput-show" data-click-show=".js-taginput-fancy,.js-taginput-hide" data-click-hide=".js-taginput-plain,.js-taginput-show" data-click-focus=".js-taginput-input.js-taginput-#{@name}"
|
||||
= hidden_input :fuck_ie, :fuck_ie, value: "fuck_ie"
|
||||
' Fancy Editor
|
||||
|
|
Loading…
Reference in a new issue