ResetNetwork / apply-app

The app behind the ResetNetwork
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Publish in future time doesn't work #129

Open danblah opened 3 years ago

danblah commented 3 years ago

Entering in date works and as soon as you move away it clears

frjo commented 3 years ago

This seems to be a wagtail bug. The jQuery date picker that wagtail uses clash with the browsers built in one.

frjo commented 3 years ago

@Parbhat Any ideas here?

Parbhat commented 3 years ago

@frjo Yeah looks like a Wagtail bug. Also can not find the fix in the latest releases. We should report it to the Wagtail repo.

frjo commented 3 years ago

@Parbhat Thanks, I will report it.

frjo commented 3 years ago

https://github.com/wagtail/wagtail/issues/7632

frjo commented 3 years ago

Turns out to be a Hypha issue. The scheduled publishing date fields use this template hypha/templates/django/forms/widgets/datetime.html. Removing that solves the issue.

@Parbhat Ideas how to fix this in a nice way? Can we make this field use the default template instead?

{'name': 'go_live_at', 'is_hidden': False, 'required': False, 'value': None, 'attrs': {'autocomplete': 'off', 'id': 'id_go_live_at'}, 'template_name': 'wagtailadmin/widgets/datetime_input.html', 'type': 'text', 'config_json': '{"dayOfWeekStart": 0, "format": "Y-m-d H:i", "formatTime": "H:i"}'}

Parbhat commented 3 years ago

@frjo Thanks for looking into it closely. I don't know the context why we are overriding these django widget templates. Can we try to use the overriden templates only where required instead of changing the default template?

sandeepsajan0 commented 3 years ago

@frjo @Parbhat We are using customised django forms widget templates date.html and datetime.html in apply funds, projects(start/end proposing dates) and many other places. And internally, wagtail is also using the django forms widget templates. That's why it is showing both of the designs.

So now we have two cases:

  1. We can use only and same customized template at both the places(in wagtail form, and in django form). It will give us similar design at both of the places.
  2. Or we can use only wagtail widget in wagtail and django widget in django forms(it can be done by overwritting the wagtail widget templates)

Which one looks better to you?

frjo commented 3 years ago

I think the best is to use standard Wagtail date/datetime widget in Wagtail admin. The custom one we only use in Hypha itself.

That should resolve this bug.

I believe it is a good point to have Wagtail use its defaults as much as possible.