From 0b27af3dab56b667b50fd80590cdfd9df0feffbd Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 5 Nov 2018 15:40:18 +0100 Subject: File progress --- shardweb/lib/templates/directory/view.html.eex | 30 +++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'shardweb/lib/templates/directory') diff --git a/shardweb/lib/templates/directory/view.html.eex b/shardweb/lib/templates/directory/view.html.eex index ef8200b..7b9be38 100644 --- a/shardweb/lib/templates/directory/view.html.eex +++ b/shardweb/lib/templates/directory/view.html.eex @@ -76,6 +76,34 @@ <%= if @owner == @pk do %> + <%= if @public do %> +
Upload file + <%= form_for @conn, directory_path(@conn, :dir_upload), [multipart: true, class: "form-horizontal"], fn f -> %> + <%= hidden_input f, :dir_name, value: @name %> + <%= hidden_input f, :dir_public, value: @public %> +
+ <%= label :file, "File:", class: ["col-sm-2 control-label"] %> +
+ <%= file_input f, :file, [class: "form-control"] %> +
+
+
+ <%= label :upload_name, "Save as (optionnal):", class: ["col-sm-2 control-label"] %> +
+ <%= text_input f, :upload_name, [class: "form-control", value: ""] %> +
+
+
+
+ <%= submit "Upload file", [class: "btn btn-primary"] %> +
+
+ <% end %> +
+ <% else %> +

Warning: file upload in private directories does not keeps file private (yeah WTF right?), so we don't let you do that.

+ <% end %> +
Add existing item <%= form_for @conn, directory_path(@conn, :dir_add), [class: "form-horizontal"], fn f -> %> <%= hidden_input f, :dir_name, value: @name %> @@ -106,7 +134,7 @@
- <%= submit "Add", [class: "btn btn-default"] %> + <%= submit "Add", [class: "btn btn-primary"] %>
<% end %> -- cgit v1.2.3