This repository has been archived by the owner on Jan 30, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial public download view for Folders
- Loading branch information
Pablo Villalba
authored and
Artur Szwed
committed
Sep 2, 2011
1 parent
48baf7d
commit 9c466b4
Showing
8 changed files
with
122 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
- upload = @upload | ||
- icon_path = "file_icons/48px/#{h upload.file_type}.png" | ||
|
||
.file | ||
.fade | ||
- if Rails.root.join("public/images/#{icon_path}").exist? | ||
.info | ||
= link_to image_tag(icon_path), public_send_file_path(upload.token), :class => 'file_icon', :rel => (upload.image? ? 'facebox' : '') | ||
%h1= t('.download_file') | ||
|
||
.filename | ||
%p.title= t('.download_file') | ||
= link_to upload.asset_file_name, public_send_file_path(upload.token) | ||
%p== #{number_to_human_size(upload.size)}, by #{upload.user.name} | ||
#download_file | ||
.file_pane | ||
.fade | ||
- if Rails.root.join("public/images/#{icon_path}").exist? | ||
.info | ||
= link_to image_tag(icon_path), public_send_file_path(upload.token), :class => 'file_icon', :rel => (upload.image? ? 'facebox' : '') | ||
|
||
.filename | ||
= link_to upload.asset_file_name, public_send_file_path(upload.token) | ||
%p== #{number_to_human_size(upload.size)}, by #{upload.user.name} |
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,13 @@ | ||
%h1= @folder | ||
#file_list | ||
- for folder in @folders | ||
.upload{ :class => cycle('alternate', '') } | ||
.icon= image_tag '/famfamfam/folder.png' | ||
.file= link_to folder.name, public_download_folder_path(folder.token) | ||
.size= pluralize (folder.uploads_count + folder.folders_count), 'file' | ||
- for upload in @uploads | ||
.upload.file_upload{ :class => cycle('alternate', '') } | ||
.icon= image_tag file_icon_path(upload, '16px') | ||
.file= link_to upload.asset_file_name, public_send_file_path(upload.token) | ||
.size= number_to_human_size upload.size | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class AddTokenToFolders < ActiveRecord::Migration | ||
def self.up | ||
add_column :folders, :token, :string | ||
add_index :folders, :token | ||
end | ||
|
||
def self.down | ||
remove_index :folders, :token | ||
remove_column :folders, :token | ||
end | ||
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
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