Skip to content

Add Edit In Place functionnality #23

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

Merged
merged 12 commits into from
Dec 26, 2016
Merged

Add Edit In Place functionnality #23

merged 12 commits into from
Dec 26, 2016

Conversation

damienalexandre
Copy link
Contributor

@damienalexandre damienalexandre commented Dec 13, 2016

This PR adds Edit In Place to any page on a Symfony project. This is highly experimental ⚠️ but.. it's awesome 😋

The JavaScript part is based on the excellent ContentTools lib, v1.3.1 by Anthony Blackshaw, very well written and using a real ContentEditable attribute, which is very elegant.

Demo

ezgif com-optimize 2

TODO

There is still a lot of stuffs to do:

  • Add better handling of the multiple configs available in the Bundle, for now, I force the first one only
  • the Twig Extension part is messy, should find a better way than full override of the bridge
  • in ResponseListener, remove the hardcoded configName / domain / locale parameters
  • remove all cache headers from response if when the editor kick in
  • [ ] all the links when editing should have the token added for easy navigation. Also maybe an URL token is NOT the best way to handle enabling / disabling the editor
  • validate the incoming messages (create a custom EditInPlaceMessage model?)
  • for html keys, set back the default WYSIWYG tools (like if we detect .html in the key name, pop the HTML editor?)
  • if the ajax requests fail display the error (validation?)
  • add tests!!
  • make sure it works with transChoice too
  • [ ] maybe support PHP templating too?

Cheers

Copy link
Member

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. I think it looks good. Let's just do some more of those things listed as TODO on this PR and I'll be happy to merge.


public function checkRequest(Request $request = null)
{
return true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a TODO here so we do not forget.

@damienalexandre damienalexandre changed the title [WIP] Add Edit In Place functionnality Add Edit In Place functionnality Dec 26, 2016
@damienalexandre
Copy link
Contributor Author

@Nyholm Ready for review!

I will also create issues for some issues and todo I left there,
like the ability to display contextual information when the editor kicks in (available parameters, etc).

And I'm sending the documentation PR today 😉

Copy link
Member

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. It looks great.

While reading the changes Im starting to consider moving some classes to a library... But Im not sure. We can talk about that later. I'll merge this for now. Really good job!

@Nyholm Nyholm merged commit bdaaf97 into master Dec 26, 2016
@Nyholm Nyholm deleted the edit-in-place branch December 26, 2016 17:13
Nyholm pushed a commit to php-translation/documentation that referenced this pull request Dec 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants