Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#34206 closed task (blessed) (fixed)

Add a Favorites Tab to the Add New Themes Page

Reported by: jeffr0's profile jeffr0 Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.4 Priority: normal
Severity: normal Version:
Component: Themes Keywords: has-screenshots has-patch
Focuses: ui Cc:

Description

The ability to mark themes as favorites in the WordPress theme directory was added three months ago https://meta.trac.wordpress.org/changeset/1770 Unlike the Add New Plugins page in the backend of WordPress, the Add Themes page does not have a Favorites tab to browse and install themes marked as Favorites. For consistency, I think Favorites should be added to the Add Themes page.

This screenshot is the Add Themes page in WordPress 4.4 Alpha
https://cloudup.com/cN6rYpDiPUw

Attachments (6)

MissingFavoritesTab.png (192.1 KB) - added by jeffr0 9 years ago.
34206.diff (1.3 KB) - added by swissspidy 9 years ago.
34206.2.diff (3.5 KB) - added by swissspidy 9 years ago.
favorites-tab.png (684.4 KB) - added by swissspidy 9 years ago.
New favorites tab
favorites-tab-with-filters.png (156.1 KB) - added by swissspidy 9 years ago.
New favorites tab with open filter view
34206.3.diff (5.9 KB) - added by swissspidy 9 years ago.

Download all attachments as: .zip

Change History (25)

#1 @swissspidy
9 years ago

  • Focuses ui added
  • Keywords needs-patch added

+1 for this. According to the themes_api docs querying favorites should already be possible.

@swissspidy
9 years ago

#2 @swissspidy
9 years ago

  • Keywords has-patch needs-refresh added; needs-patch removed

34206.diff adds the "Favorites" tab to the theme installer.

The only thing missing is the form to enter your username if absent, like on the plugin install screen. Perhaps it doesn't make sense to have this form at two places though.

#3 @SergeyBiryukov
9 years ago

  • Milestone changed from Awaiting Review to 4.4

#4 @wonderboymusic
9 years ago

  • Owner set to SergeyBiryukov
  • Status changed from new to assigned

#5 @DrewAPicture
9 years ago

  • Keywords needs-refresh removed

@swissspidy We're going to need the username field for this to be ready. Did you want to take a stab at it? 34206.diff still applies.

#6 @swissspidy
9 years ago

Yep, will look into it!

@swissspidy
9 years ago

@swissspidy
9 years ago

New favorites tab

@swissspidy
9 years ago

New favorites tab with open filter view

#7 @swissspidy
9 years ago

  • Keywords dev-feedback added

34206.2.diff is a new patch that adds the username form as well.

Data is submitted via GET, just like on the plugin install screen. Because of that I needed to add a sort.split('&')[0] line to the sort method. Otherwise it would try to sort themes after favorites&user=<user>. Haven't found the proper way in the router to change that. It's not a big deal, but maybe someone wants to make this more beautiful.

#8 @swissspidy
9 years ago

  • Keywords has-screenshots added

#9 @wonderboymusic
9 years ago

  • Milestone changed from 4.4 to Future Release

This ticket was mentioned in Slack in #core by helen. View the logs.


9 years ago

#11 @wonderboymusic
9 years ago

  • Milestone changed from Future Release to 4.4
  • Type changed from enhancement to task (blessed)

#12 follow-up: @SergeyBiryukov
9 years ago

  • Keywords needs-patch added; has-patch dev-feedback removed

Tested 34206.2.diff:

  • If I open the Favorites tab and then click on any other tab, the username input form does not disappear, because the .show-favorites-form class is never removed.
  • Any chance to get rid of the page refresh when clicking Get Favorites? It could probably work the same way as the Apply Filters button on Feature Filter tab.

#13 in reply to: ↑ 12 @swissspidy
9 years ago

Replying to SergeyBiryukov:

  • If I open the Favorites tab and then click on any other tab, the username input form does not disappear, because the .show-favorites-form class is never removed.

Argh, I could swear I've tested this.

  • Any chance to get rid of the page refresh when clicking Get Favorites? It could probably work the same way as the Apply Filters button on Feature Filter tab.

That's what I first tried to implement, but I encountered problems with the request cache. Will look into it again though.

@swissspidy
9 years ago

#14 @swissspidy
9 years ago

  • Keywords has-patch added; needs-patch removed

34206.3.diff is an updated patch that fixes the bug mentioned by @SergeyBiryukov and also uses Ajax to save the username.

Saving happens when clicking on the button or pressing enter. When saving was successful, a second query to browse the themes happens.

This ticket was mentioned in Slack in #core by wonderboymusic. View the logs.


9 years ago

#16 @SergeyBiryukov
9 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 35527:

Themes: Add a Favorites tab to the Add Themes screen.

You can now browse and install your wordpress.org theme favorites from the theme installer, just like with plugins.

Props swissspidy.
Fixes #34206.

#17 @pento
9 years ago

In 35533:

Themes: Remove an errant comma from theme.js.

Added in [35527].

See #34206.

#18 @ocean90
9 years ago

In 35646:

Themes: Check if the browse view is set in wp_ajax_query_themes() to avoid a PHP notice when searching for new themes.

Introduced in [35527].

See #34206.

#19 @ocean90
9 years ago

In 35647:

Themes: Hide the favorites form when performing a search.

The search is global and ignores the user setting. Same for filters.

See #34206.

Note: See TracTickets for help on using tickets.