-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Nettoyage du contrôleur de resources : actions producteurs bougées (#…
…4169) * Router: put resource edition in espace_producteur namespace * Move resource actions to espace producteur controller * rename form file template to resource_form * Move locales from resource to espace producteur * Rename when needed dataset_id to dataset_datagouv_id etc * Move auth to plug system: delete confirmation * use espace producteur plugs for resource forms * Rename some functions * Comment on the post_file function * Link directly to correct page in espace producteur * Remove space in english locale Co-authored-by: Antoine Augusti <antoine.augusti@transport.data.gouv.fr> * Remove leading underscore in new_resource route * Actually use new locale * Helpers with better names for urls * fix bug for editing resources with uploaded file --------- Co-authored-by: Antoine Augusti <antoine.augusti@transport.data.gouv.fr>
- Loading branch information
1 parent
4446da2
commit 922ec4b
Showing
23 changed files
with
660 additions
and
592 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...templates/resource/_specify_url.html.heex → .../espace_producteur/_specify_url.html.heex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<div class="choose-option"> | ||
<%= dgettext("resource", "Give a link for the resource") %> | ||
<%= dgettext("espace-producteurs", "Give a link for the resource") %> | ||
<%= text_input( | ||
@f, | ||
:url, | ||
placeholder: "https://data.ville.fr/gtfs.zip", | ||
value: @resource["url"] | ||
value: @datagouv_resource["url"] | ||
) %> | ||
</div> |
11 changes: 11 additions & 0 deletions
11
apps/transport/lib/transport_web/templates/espace_producteur/_upload_file.html.heex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<div class="choose-option"> | ||
<%= dgettext("espace-producteurs", "Upload a file") %> | ||
<%= unless is_nil(@datagouv_resource["url"]) do %> | ||
<p> | ||
<%= dgettext("espace-producteurs", "Current file: %{current_file}", | ||
current_file: Path.basename(@datagouv_resource["url"]) | ||
) %> | ||
</p> | ||
<% end %> | ||
<%= file_input(@f, :resource_file) %> | ||
</div> |
Oops, something went wrong.