mirror of https://github.com/iv-org/invidious.git
Change "list" to "comp"
This commit is contained in:
parent
5fdaa1bf57
commit
379761ab7b
|
@ -452,7 +452,7 @@ end
|
||||||
def template_compilation(compilation)
|
def template_compilation(compilation)
|
||||||
html = <<-END_HTML
|
html = <<-END_HTML
|
||||||
<h3>
|
<h3>
|
||||||
<a href="/compilation?list=#{compilation["compilationId"]}">
|
<a href="/compilation?comp=#{compilation["compilationId"]}">
|
||||||
#{compilation["title"]}
|
#{compilation["title"]}
|
||||||
</a>
|
</a>
|
||||||
</h3>
|
</h3>
|
||||||
|
@ -463,7 +463,7 @@ def template_compilation(compilation)
|
||||||
compilation["videos"].as_a.each do |video|
|
compilation["videos"].as_a.each do |video|
|
||||||
html += <<-END_HTML
|
html += <<-END_HTML
|
||||||
<li class="pure-menu-item" id="#{video["videoId"]}">
|
<li class="pure-menu-item" id="#{video["videoId"]}">
|
||||||
<a href="/watch?v=#{video["videoId"]}&list=#{compilation["compilationId"]}&index=#{video["index"]}">
|
<a href="/watch?v=#{video["videoId"]}&comp=#{compilation["compilationId"]}&index=#{video["index"]}">
|
||||||
<div class="thumbnail">
|
<div class="thumbnail">
|
||||||
<img loading="lazy" class="thumbnail" src="/vi/#{video["videoId"]}/mqdefault.jpg" alt="" />
|
<img loading="lazy" class="thumbnail" src="/vi/#{video["videoId"]}/mqdefault.jpg" alt="" />
|
||||||
<p class="length">#{recode_length_seconds(video["lengthSeconds"].as_i)}</p>
|
<p class="length">#{recode_length_seconds(video["lengthSeconds"].as_i)}</p>
|
||||||
|
|
|
@ -52,7 +52,7 @@ module Invidious::Routes::Compilations
|
||||||
|
|
||||||
compilation = create_compilation(title, privacy, user)
|
compilation = create_compilation(title, privacy, user)
|
||||||
|
|
||||||
env.redirect "/compilation?list=#{compilation.id}"
|
env.redirect "/compilation?comp=#{compilation.id}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.delete_page(env)
|
def self.delete_page(env)
|
||||||
|
@ -264,7 +264,7 @@ module Invidious::Routes::Compilations
|
||||||
|
|
||||||
update_first_video_params(compid)
|
update_first_video_params(compid)
|
||||||
|
|
||||||
env.redirect "/compilation?list=#{compid}"
|
env.redirect "/compilation?comp=#{compid}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.add_compilation_items_page(env)
|
def self.add_compilation_items_page(env)
|
||||||
|
@ -496,7 +496,7 @@ module Invidious::Routes::Compilations
|
||||||
user = env.get?("user").try &.as(User)
|
user = env.get?("user").try &.as(User)
|
||||||
referer = get_referer(env)
|
referer = get_referer(env)
|
||||||
|
|
||||||
compid = env.params.query["list"]?.try &.gsub(/[^a-zA-Z0-9_-]/, "")
|
compid = env.params.query["comp"]?.try &.gsub(/[^a-zA-Z0-9_-]/, "")
|
||||||
if !compid
|
if !compid
|
||||||
return env.redirect "/"
|
return env.redirect "/"
|
||||||
end
|
end
|
||||||
|
@ -504,10 +504,6 @@ module Invidious::Routes::Compilations
|
||||||
page = env.params.query["page"]?.try &.to_i?
|
page = env.params.query["page"]?.try &.to_i?
|
||||||
page ||= 1
|
page ||= 1
|
||||||
|
|
||||||
if compid.starts_with? "RD"
|
|
||||||
return env.redirect "/mix?list=#{compid}"
|
|
||||||
end
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
compilation = get_compilation(compid)
|
compilation = get_compilation(compid)
|
||||||
rescue ex : NotFoundException
|
rescue ex : NotFoundException
|
||||||
|
|
|
@ -8,13 +8,13 @@
|
||||||
<div class="pure-u-1 pure-u-lg-3-5">
|
<div class="pure-u-1 pure-u-lg-3-5">
|
||||||
<div class="h-box">
|
<div class="h-box">
|
||||||
<form class="pure-form pure-form-aligned" action="/add_compilation_items" method="get">
|
<form class="pure-form pure-form-aligned" action="/add_compilation_items" method="get">
|
||||||
<legend><a href="/compilation?list=<%= compilation.id %>"><%= translate(locale, "Editing compilation `x`", %|"#{HTML.escape(compilation.title)}"|) %></a></legend>
|
<legend><a href="/compilation?comp=<%= compilation.id %>"><%= translate(locale, "Editing compilation `x`", %|"#{HTML.escape(compilation.title)}"|) %></a></legend>
|
||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<input class="pure-input-1" type="search" name="q"
|
<input class="pure-input-1" type="search" name="q"
|
||||||
<% if query %>value="<%= HTML.escape(query.text) %>"<% end %>
|
<% if query %>value="<%= HTML.escape(query.text) %>"<% end %>
|
||||||
placeholder="<%= translate(locale, "Search for videos") %>">
|
placeholder="<%= translate(locale, "Search for videos") %>">
|
||||||
<input type="hidden" name="list" value="<%= compid %>">
|
<input type="hidden" name="comp" value="<%= compid %>">
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -13,23 +13,23 @@
|
||||||
<%- if compilation.is_a?(InvidiousCompilation) && compilation.author == user.try &.email -%>
|
<%- if compilation.is_a?(InvidiousCompilation) && compilation.author == user.try &.email -%>
|
||||||
<%- if compilation.index.size > 0 -%>
|
<%- if compilation.index.size > 0 -%>
|
||||||
<div class="pure-u">
|
<div class="pure-u">
|
||||||
<a class="pure-button pure-button-secondary low-profile" dir="auto" href="/watch?v=<%= compilation.first_video_id %>&list=<%= compid %>&index=<%= compilation.index[0] %>&t=<%= compilation.first_video_starting_timestamp_seconds %>&end=<%= compilation.first_video_ending_timestamp_seconds %>">
|
<a class="pure-button pure-button-secondary low-profile" dir="auto" href="/watch?v=<%= compilation.first_video_id %>&comp=<%= compid %>&index=<%= compilation.index[0] %>&t=<%= compilation.first_video_starting_timestamp_seconds %>&end=<%= compilation.first_video_ending_timestamp_seconds %>">
|
||||||
<i class="icon ion-md-play"></i> <%= translate(locale, "compilation_button_play") %>
|
<i class="icon ion-md-play"></i> <%= translate(locale, "compilation_button_play") %>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<%- end -%>
|
<%- end -%>
|
||||||
<div class="pure-u">
|
<div class="pure-u">
|
||||||
<a class="pure-button pure-button-secondary low-profile" dir="auto" href="/add_compilation_items?list=<%= compid %>">
|
<a class="pure-button pure-button-secondary low-profile" dir="auto" href="/add_compilation_items?comp=<%= compid %>">
|
||||||
<i class="icon ion-md-add"></i> <%= translate(locale, "compilation_button_add_items") %>
|
<i class="icon ion-md-add"></i> <%= translate(locale, "compilation_button_add_items") %>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="pure-u">
|
<div class="pure-u">
|
||||||
<a class="pure-button pure-button-secondary low-profile" dir="auto" href="/edit_compilation?list=<%= compid %>">
|
<a class="pure-button pure-button-secondary low-profile" dir="auto" href="/edit_compilation?comp=<%= compid %>">
|
||||||
<i class="icon ion-md-create"></i> <%= translate(locale, "generic_button_edit") %>
|
<i class="icon ion-md-create"></i> <%= translate(locale, "generic_button_edit") %>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="pure-u">
|
<div class="pure-u">
|
||||||
<a class="pure-button pure-button-secondary low-profile" dir="auto" href="/delete_compilation?list=<%= compid %>">
|
<a class="pure-button pure-button-secondary low-profile" dir="auto" href="/delete_compilation?comp=<%= compid %>">
|
||||||
<i class="icon ion-md-trash"></i> <%= translate(locale, "generic_button_delete") %>
|
<i class="icon ion-md-trash"></i> <%= translate(locale, "generic_button_delete") %>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
if item.id.starts_with? "RD"
|
if item.id.starts_with? "RD"
|
||||||
link_url = "/mix?list=#{item.id}&continuation=#{URI.parse(item.thumbnail || "/vi/-----------").request_target.split("/")[2]}"
|
link_url = "/mix?list=#{item.id}&continuation=#{URI.parse(item.thumbnail || "/vi/-----------").request_target.split("/")[2]}"
|
||||||
elsif item.id.starts_with? "IVCMP"
|
elsif item.id.starts_with? "IVCMP"
|
||||||
link_url = "/compilation?list=#{item.id}"
|
link_url = "/compilation?comp=#{item.id}"
|
||||||
else
|
else
|
||||||
link_url = "/playlist?list=#{item.id}"
|
link_url = "/playlist?list=#{item.id}"
|
||||||
end
|
end
|
||||||
|
@ -100,7 +100,6 @@
|
||||||
elsif item.is_a?(MixVideo)
|
elsif item.is_a?(MixVideo)
|
||||||
link_url = "/watch?v=#{item.id}&list=#{item.rdid}"
|
link_url = "/watch?v=#{item.id}&list=#{item.rdid}"
|
||||||
endpoint_params = "?v=#{item.id}&list=#{item.rdid}"
|
endpoint_params = "?v=#{item.id}&list=#{item.rdid}"
|
||||||
# elsif item.is_a?(CompilationVideo)
|
|
||||||
else
|
else
|
||||||
link_url = "/watch?v=#{item.id}"
|
link_url = "/watch?v=#{item.id}"
|
||||||
endpoint_params = "?v=#{item.id}"
|
endpoint_params = "?v=#{item.id}"
|
||||||
|
|
|
@ -5,11 +5,11 @@
|
||||||
<link rel="alternate" type="application/rss+xml" title="RSS" href="/feed/compilation/<%= compid %>" />
|
<link rel="alternate" type="application/rss+xml" title="RSS" href="/feed/compilation/<%= compid %>" />
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<form action="/edit_compilation?list=<%= compid %>" method="post">
|
<form action="/edit_compilation?comp=<%= compid %>" method="post">
|
||||||
<div class="h-box flexible">
|
<div class="h-box flexible">
|
||||||
<div class="flex-right button-container">
|
<div class="flex-right button-container">
|
||||||
<div class="pure-u">
|
<div class="pure-u">
|
||||||
<a class="pure-button pure-button-secondary low-profile" dir="auto" href="/compilation?list=<%= compid %>">
|
<a class="pure-button pure-button-secondary low-profile" dir="auto" href="/compilation?comp=<%= compid %>">
|
||||||
<i class="icon ion-md-close"></i> <%= translate(locale, "generic_button_cancel") %>
|
<i class="icon ion-md-close"></i> <%= translate(locale, "generic_button_cancel") %>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="pure-u">
|
<div class="pure-u">
|
||||||
<a class="pure-button pure-button-secondary low-profile" dir="auto" href="/delete_compilation?list=<%= compid %>">
|
<a class="pure-button pure-button-secondary low-profile" dir="auto" href="/delete_compilation?comp=<%= compid %>">
|
||||||
<i class="icon ion-md-trash"></i> <%= translate(locale, "generic_button_delete") %>
|
<i class="icon ion-md-trash"></i> <%= translate(locale, "generic_button_delete") %>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue