neon-jungle / wagtail-videos

Videos for Wagtail CMS, including transcoding
BSD 3-Clause "New" or "Revised" License
65 stars 57 forks source link

Fix action button #46

Closed jkevingutierrez closed 4 years ago

jkevingutierrez commented 4 years ago

Fix #45

seb-b commented 4 years ago

Ah good pickup, I've left one comment.

So it looks like wagtailadmin/shared/header.html was changed in 2.10 to take a different parameter. (add_link -> action_url)

So this is the correct approach for 2.10+. We can either make a convoluted approach that loads a different template based on the wagtail version, or I'll make then next release require wt>2.10

jkevingutierrez commented 4 years ago

@seb-b It could also include both parameters, like:

{% include "wagtailadmin/shared/header.html" with
     title=video_str 
     add_link="wagtailvideos:add_multiple"
     action_url="wagtailvideos:add_multiple"
     icon="media"
     add_text=add_video_str 
     action_text=add_video_str 
     search_url="wagtailvideos:index" %}

What do you think?

seb-b commented 4 years ago

@jkevingutierrez Yep, thats a good workaround, happy for both parameters to be used :)

add_link should just be the string "wagtailvideos:add_multiple" action_url should be the reversed url, like you originally had

jkevingutierrez commented 4 years ago

@seb-b done. Adding both parameters also fixed the tests https://travis-ci.org/github/neon-jungle/wagtailvideos/builds/723947902

seb-b commented 4 years ago

Released in 2.8.2 :tada: