Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdminUI: Use Select2.js for SiteSetting Lists – adds Autocomplete and DnD-Sorting #2405

Merged
merged 2 commits into from Jun 4, 2014

Conversation

gnunicorn
Copy link
Contributor

This PR rebases the list-sitesetting component on top of Select2.js for better autocompletion and sorting support. For the later it uses the already included html5sorting library. Additionally sitesettings can now also contain a choices-list that is shown as autocomplete (preventing typos) and are automatically merged if extended by plugins. This has been added for post_menu, top_menu and share_links.

To extend this, a plugin just provides a site_settings.yml file with the following:

basic:
  post_menu:
    choices:
      - sharedEdit

Some screenshots:

Autocomplete:
screen shot 2014-06-01 at 16 47 50

Drag and Drop with placeholder element for positioning:

screen shot 2014-06-01 at 16 48 06

 - and use jquery.sortable to allow sorting
 - support for autocompletion
 - add site_setting choices lists to list entries
 - allows for handy autocompletion using the new select2.js UI
 - automatically merges plugin choices into existing list, allowing for easy extension
@discoursebot
Copy link

You've signed the CLA, ligthyear. Thank you! This pull request is ready for review.

@riking
Copy link
Contributor

riking commented Jun 2, 2014

Looks awesome!

@eviltrout
Copy link
Contributor

This is a great PR! Thanks so much.

My only complaint is the modules should be ES6 but we'll get to that later :)

eviltrout added a commit that referenced this pull request Jun 4, 2014
AdminUI: Use Select2.js for SiteSetting Lists – adds Autocomplete and DnD-Sorting
@eviltrout eviltrout merged commit a1887c9 into discourse:master Jun 4, 2014
@ZogStriP
Copy link
Member

ZogStriP commented Jun 4, 2014

Does it work with values like latest,-Computer Help or category/Computer Help for the top_menu setting?

@eviltrout
Copy link
Contributor

I've removed the choices from the top_menu because of this.

@gnunicorn
Copy link
Contributor Author

@eviltrout , please don't - cc3119f#commitcomment-6555186 .
@ZogStriP, it allows any input. but right now space, komma and "|" are considered token separators –

. We can change that to also include " " if that is officially supported by discourse (which I didn't know).

@ZogStriP
Copy link
Member

ZogStriP commented Jun 4, 2014

I think we should remove both space and comma as token separators and we'll be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants