diff options
| author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-07-10 23:12:38 +0300 |
|---|---|---|
| committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-07-10 23:12:38 +0300 |
| commit | f88a2617e65ecc037d3f885965efcee39745163d (patch) | |
| tree | 135d118cb7a5d9020ad411b0ce7d645aa88220c1 /app/helpers/tree_helper.rb | |
| parent | 1a2bacfb4b4b8f4d79df0335b4daf1d2cfa16d88 (diff) | |
| download | gitlab-ce-f88a2617e65ecc037d3f885965efcee39745163d.tar.gz | |
Tree ajax log. progress bar & refactoring
Diffstat (limited to 'app/helpers/tree_helper.rb')
| -rw-r--r-- | app/helpers/tree_helper.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/app/helpers/tree_helper.rb b/app/helpers/tree_helper.rb new file mode 100644 index 00000000000..ed3053d8af5 --- /dev/null +++ b/app/helpers/tree_helper.rb @@ -0,0 +1,27 @@ +module TreeHelper + def tree_icon(content) + if content.is_a?(Grit::Blob) + if content.text? + image_tag "file_txt.png" + elsif content.image? + image_tag "file_img.png" + else + image_tag "file_bin.png" + end + else + image_tag "file_dir.png" + end + end + + def tree_hex_class(content) + "file_#{hexdigest(content.name)}" + end + + def tree_full_path(content) + if params[:path] + File.join(params[:path], content.name) + else + content.name + end + end +end |
