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

Is it possible to edit a "photo" ? #580

Closed
ikus060 opened this issue Oct 18, 2022 · 3 comments
Closed

Is it possible to edit a "photo" ? #580

ikus060 opened this issue Oct 18, 2022 · 3 comments

Comments

@ikus060
Copy link

ikus060 commented Oct 18, 2022

Hello,

I'm testing various way to integrate the collect of multiple photo during the interview and then review the photo at the end.

So far, What I have it working very well, but the "Edit" feature is not working properly for picture. User get prompted to upload a new image, while user might want to only edit the description of the image.

I'm guessing it's related to the input form that doesn't really allow to submit an image as a default value ?

If it's a limitation of HTML and input form, would it be possible to provide a different "question" to allow user to only edit the image description ?

The table with edit button
image

When cliking on Edit. The image field is empty. That prevent user to "continue".
image

Here the relevant part of the interview:

---
objects:
  photos: DAList.using(minimum_number=1, object_type=Thing)
---
question: |
  Voulez-vous prendre une autre photo ?
yesno: photos.there_is_another
---
question: |
  Ajouter une photo
fields:
  - Photo: photos[i].image
    datatype: camera
  - Description: photos[i].name.text
---
mandatory: True
question: |
  Sommaire des photos
subquestion: |
  ${ photos.table }
  
  ${ photos.add_action() }
continue button field: done
---
table: photos.table
rows: photos
columns:
  - Photo: |
      row_item.image
edit:
  - name.text
---
@jhpyle
Copy link
Owner

jhpyle commented Oct 19, 2022

I would recommend using a separate screen for editing the description, and providing a button for uploading a new version of the photo.

objects:
  photos: DAList.using(minimum_number=1, object_type=Thing)
---
question: |
  Voulez-vous prendre une autre photo ?
yesno: photos.there_is_another
---
question: |
  Ajouter une photo
fields:
  - Photo: photos[i].image
    datatype: camera
  - Description: photos[i].name.text
---
question: |
  Describe photo
fields:
  - note: |
      ${ photos[i].image }
      ${ action_button_html(url_action(photos[i].attr_name('image')), label="Change photo", icon='pencil', color='secondary') }
  - Description: photos[i].name.text
continue button field: photos[i].photo_edit
---
mandatory: True
question: |
  Sommaire des photos
subquestion: |
  ${ photos.table }
  
  ${ photos.add_action() }
continue button field: done
---
table: photos.table
rows: photos
columns:
  - Photo: |
      str(row_item.image) + '[BR]' + row_item.name.text
edit:
  - photo_edit

@ikus060
Copy link
Author

ikus060 commented Oct 19, 2022

Brilliant ! I'm still not used to the dependencies resolution way of thinking.

Thanks will give it a trial and re-open if I need more detail.

@ikus060
Copy link
Author

ikus060 commented Nov 17, 2022

Closing as your solution is working great !

Thanks

@ikus060 ikus060 closed this as completed Nov 17, 2022
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

No branches or pull requests

2 participants