aboutsummaryrefslogtreecommitdiff
path: root/shardweb/lib/templates/directory/view.html.eex
diff options
context:
space:
mode:
Diffstat (limited to 'shardweb/lib/templates/directory/view.html.eex')
-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 %>