On 10/18/2010 01:52 PM, Jan Provazník wrote: > Dne 18.10.2010 16:46, Mohammed Morsi napsal(a): >> Currently when a user adds a package to a new template, a temporary >> template gets created for use until the form is submitted. If the >> user >> cancels the form, the template still exists when it should not. This >> patch simply changes the create template logic to only create the >> template when the form is submitted >> --- >> src/app/controllers/templates_controller.rb | 64 >> +++++++++++------------ >> src/app/models/template.rb | 18 ++---- >> src/app/util/image_descriptor_xml.rb | 4 ++ >> src/app/views/templates/_content_selection.haml | 52 >> ------------------ >> src/app/views/templates/_managed_content.haml | 21 ++++---- >> src/app/views/templates/add_software_form.haml | 1 - >> src/app/views/templates/content_selection.haml | 41 ++++++++++++++ >> src/app/views/templates/managed_content.haml | 1 + >> src/app/views/templates/new.haml | 51 >> +++++++++--------- >> 9 files changed, 118 insertions(+), 135 deletions(-) >> delete mode 100644 src/app/views/templates/_content_selection.haml >> delete mode 100644 src/app/views/templates/add_software_form.haml >> create mode 100644 src/app/views/templates/content_selection.haml >> create mode 100644 src/app/views/templates/managed_content.haml >> > > Hi, the problem is that template creation won't work with this patch > w/o JS and JS independence is prerequisity for Cloud Engine stuff. I > think there is really simple solution for this bug: save selected > packages in session and add them to xml before template is saved. > > Jan
Ah ok, had forgotten about the no-js bit. That being said, I think we can do this without using the session as a temporary storage place for template packages (seems a bit hacky). We can just parametrize the add-packages-to-template form to include all the fields for the template, and then just pass them back in addition to the selected packages to the new template form. Will throw this together and send out an updated patch in a bit. -Mo _______________________________________________ deltacloud-devel mailing list [email protected] https://fedorahosted.org/mailman/listinfo/deltacloud-devel
