Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
96 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<nav class="act-menu"> | ||
<% if params[:action] =~ /index/ %> | ||
<%= link_to t('views.button.upload'), action: :new %> | ||
<% elsif params[:action] =~ /new|create/ %> | ||
<%= link_to :back_to_index, action: :index %> | ||
<% elsif params[:action] =~ /edit|update|delete/ %> | ||
<%= link_to :back_to_show, action: :show, id: @item %> | ||
<%= link_to :back_to_index, action: :index %> | ||
<% else %> | ||
<%= link_to :delete, action: :delete, id: @item %> | ||
<%= link_to :back_to_index, action: :index %> | ||
<% end %> | ||
</nav> | ||
|
||
<% if params[:action] =~ /show|new|edit|create|update/ %> | ||
<%= render file: "_addons_menu" %> | ||
<% end %> |
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,47 @@ | ||
<% unless @items.empty? %> | ||
|
||
<div class="index share-files"> | ||
<table class="share-files-view"> | ||
<thead> | ||
<tr> | ||
<th> </th> | ||
<th><%= @model.t("basename") %></th> | ||
<th><%= @model.t("size") %></th> | ||
<th><%= @model.t("user_id") %></th> | ||
<th><%= @model.t("created") %></th> | ||
<th><%= @model.t("updated") %></th> | ||
<th> </th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% @items.each do |item| %> | ||
<tr id="share-file<%= item.id %>"> | ||
<td> | ||
<a class="thumb view" href="<%= url_for action: :view, id: item %>"> | ||
<% if item.image? %> | ||
<img src="<%= url_for(action: :thumb, id: item) %>" alt="<%= item.basename %>" /> | ||
<% else %> | ||
<span class="ext icon-<%= item.extname %>"><%= item.extname %></span> | ||
<% end %> | ||
</a> | ||
</td> | ||
<td><a class="detail" href="<%= url_for action: :show, id: item %>"><%= item.basename %></a></td> | ||
<td class="filesize"><%= number_to_human_size(item.size) %></td> | ||
<td class="owner"><%= item.user.name %></td> | ||
<td><%= item.created.strftime("%Y/%m/%d %H:%M") %></td> | ||
<td><%= item.updated.strftime("%Y/%m/%d %H:%M") %></td> | ||
<td> | ||
<%= link_to t("views.button.download"), download_share_file_path(id: item), class: "download" %> | ||
<%= link_to t("views.button.delete"), delete_share_file_path(id: item), class: "delete", id: "#share-file#{item.id}" %> | ||
</td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
<div style="clear: both;"></div> | ||
|
||
<%= paginate @items if @items.try(:current_page) %> | ||
<% end %> |
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,9 @@ | ||
<%= form_for :item, url: { action: :create }, html: { class: "share-file", multipart: true } do |f| %> | ||
<%= error_messages_for :item %> | ||
|
||
<div class="uploader"> | ||
<%= f.file_field :in_files, multiple: :multiple, required: :required %> | ||
<%= f.submit t("views.button.upload"), class: :save %> | ||
</div> | ||
|
||
<% end %> |
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,23 @@ | ||
<div class="file-detail"> | ||
<a class="thumb" href="<%= view_share_file_path(id: @item) %>" target="_blank"> | ||
<% if @item.image? %> | ||
<img src="<%= thumb_share_file_path(id: @item) %>" alt="<%= @item.basename %>" /> | ||
<% else %> | ||
<span class="ext icon-<%= @item.extname %>"><%= @item.extname %></span> | ||
<% end %> | ||
</a> | ||
<div class="name"> | ||
<input type="hidden" name="item[image_id]" value="<%= @item.id %>" /> | ||
<%= @item.basename %> | ||
<br /> | ||
</div> | ||
<div class="filesize"> | ||
<%= number_to_human_size(@item.size) %> | ||
</div> | ||
<div class="owner"> | ||
<%= @item.user.name %> | ||
</div> | ||
<div class="action download"> | ||
<%= link_to t("views.button.download"), download_share_file_path(id: @item), class: "download" %> | ||
</div> | ||
</div> |