inpho / inphosite

The InPhO API
https://inphoproject.org
15 stars 5 forks source link

Pluralization in admin interface #64

Closed JaimieMurdock closed 12 years ago

JaimieMurdock commented 12 years ago

First, when working on this part, let's create a new branch.

git checkout master
git checkout -b searchpatterns

Make sure you're working on the right branch, and the first time you push you may have to do:

git push -u origin searchpatterns

Code to generate list of pluralizations: inpho/model/entity.py Populate list of pluralizations on site in templates/entity/entity.html For now, you can stick this in the printAdminPanel after it does printAttr:

%for pattern in c.entity.pluralize():
## code to render checkbox for each
%endfor

The checkboxes need to submit the patterns to the list of search patterns. The URL to send to is c.entity.url(action='searchpatterns'). The JavaScript for submitting a pattern is in public/js/admin.js and can be found in the inpho.admin.submit_field function. You may want to write your own function though, which takes all the selected checkboxes and fires off the right AJAX request for each. There's quite a bit of code for updating the status icon in the inpho.admin.submit_field function. Code for deleting a pattern can be found in inpho.admin.remove.

Once you get the checkboxes rendering and submitting properly, the next step is wrapping the code in a Bootstrap "modal" and getting the modal to launch with a button.

alefrost commented 12 years ago

I was able to get the pattern submit working. Heading up on wrapping it in a Bootstrap "modal" now.

alefrost commented 12 years ago

All wrapped up in a modal now and updates the list of searchpatterns once items are added.

JaimieMurdock commented 12 years ago

Closed with merge commit 4b5938ef16f7899db78554836c4b67b36adb95ee