aboutsummaryrefslogtreecommitdiff
path: root/shardweb/lib/templates/directory
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2018-11-05 15:40:18 +0100
committerAlex Auvolat <alex@adnab.me>2018-11-05 15:40:18 +0100
commit0b27af3dab56b667b50fd80590cdfd9df0feffbd (patch)
tree7c1185496166b04aa21ea66f285650d62e954f20 /shardweb/lib/templates/directory
parent72906c6bb473ea605235c84b6d01c318f7b6cef8 (diff)
downloadshard-0b27af3dab56b667b50fd80590cdfd9df0feffbd.tar.gz
shard-0b27af3dab56b667b50fd80590cdfd9df0feffbd.zip
File progress
Diffstat (limited to 'shardweb/lib/templates/directory')
-rw-r--r--shardweb/lib/templates/directory/view.html.eex30
1 files changed, 29 insertions, 1 deletions
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 @@
</table>
<%= if @owner == @pk do %>
+ <%= if @public do %>
+ <fieldset><legend>Upload file</legend>
+ <%= 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 %>
+ <div class="form-group">
+ <%= label :file, "File:", class: ["col-sm-2 control-label"] %>
+ <div class="col-sm-10">
+ <%= file_input f, :file, [class: "form-control"] %>
+ </div>
+ </div>
+ <div class="form-group">
+ <%= label :upload_name, "Save as (optionnal):", class: ["col-sm-2 control-label"] %>
+ <div class="col-sm-10">
+ <%= text_input f, :upload_name, [class: "form-control", value: ""] %>
+ </div>
+ </div>
+ <div class="form-group">
+ <div class="col-sm-offset-2 col-sm-10">
+ <%= submit "Upload file", [class: "btn btn-primary"] %>
+ </div>
+ </div>
+ <% end %>
+ </fieldset>
+ <% else %>
+ <p>Warning: file upload in private directories does not keeps file private (yeah WTF right?), so we don't let you do that.</p>
+ <% end %>
+
<fieldset><legend>Add existing item</legend>
<%= form_for @conn, directory_path(@conn, :dir_add), [class: "form-horizontal"], fn f -> %>
<%= hidden_input f, :dir_name, value: @name %>
@@ -106,7 +134,7 @@
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
- <%= submit "Add", [class: "btn btn-default"] %>
+ <%= submit "Add", [class: "btn btn-primary"] %>
</div>
</div>
<% end %>