diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-01-27 02:03:30 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-01-27 02:03:30 +0300 |
commit | 752cb506c033c281064abb56093c41a7dac2735a (patch) | |
tree | a3af84079a8109995a6ef33a4038c6860034a820 /app | |
parent | 21297e78afd5ddfbfdf62f471acf1ab2f0c2a892 (diff) |
Refactor blob views
Diffstat (limited to 'app')
-rw-r--r-- | app/views/projects/blob/edit.html.haml (renamed from app/views/projects/edit_tree/show.html.haml) | 11 | ||||
-rw-r--r-- | app/views/projects/blob/new.html.haml (renamed from app/views/projects/new_tree/show.html.haml) | 2 | ||||
-rw-r--r-- | app/views/projects/blob/preview.html.haml (renamed from app/views/projects/edit_tree/preview.html.haml) | 0 | ||||
-rw-r--r-- | app/views/projects/empty.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/tree/_tree.html.haml | 2 |
5 files changed, 11 insertions, 6 deletions
diff --git a/app/views/projects/edit_tree/show.html.haml b/app/views/projects/blob/edit.html.haml index 7e0789853af..883845c03f5 100644 --- a/app/views/projects/edit_tree/show.html.haml +++ b/app/views/projects/blob/edit.html.haml @@ -1,11 +1,16 @@ .file-editor %ul.nav.nav-tabs.js-edit-mode %li.active - = link_to 'Edit', '#editor' + = link_to '#editor' do + %i.fa.fa-edit + Edit file + %li - = link_to editing_preview_title(@blob.name), '#preview', 'data-preview-url' => preview_project_edit_tree_path(@project, @id) + = link_to '#preview', 'data-preview-url' => project_preview_blob_path(@project, @id) do + %i.fa.fa-eye + = editing_preview_title(@blob.name) - = form_tag(project_edit_tree_path(@project, @id), method: :put, class: "form-horizontal") do + = form_tag(project_update_blob_path(@project, @id), method: :put, class: "form-horizontal") do = render 'projects/blob_editor', ref: @ref, path: @path, blob_data: @blob.data = render 'shared/commit_message_container', params: params, placeholder: "Update #{@blob.name}" diff --git a/app/views/projects/new_tree/show.html.haml b/app/views/projects/blob/new.html.haml index cf7b768694f..57e830d5c56 100644 --- a/app/views/projects/new_tree/show.html.haml +++ b/app/views/projects/blob/new.html.haml @@ -1,7 +1,7 @@ %h3.page-title New file %hr .file-editor - = form_tag(project_new_tree_path(@project, @id), method: :put, class: 'form-horizontal form-new-file') do + = form_tag(project_create_blob_path(@project, @id), method: :post, class: 'form-horizontal form-new-file') do .form-group.commit_message-group = label_tag 'file_name', class: 'control-label' do File name diff --git a/app/views/projects/edit_tree/preview.html.haml b/app/views/projects/blob/preview.html.haml index e7c3460ad78..e7c3460ad78 100644 --- a/app/views/projects/edit_tree/preview.html.haml +++ b/app/views/projects/blob/preview.html.haml diff --git a/app/views/projects/empty.html.haml b/app/views/projects/empty.html.haml index 3a42fce43e9..776a7327bc2 100644 --- a/app/views/projects/empty.html.haml +++ b/app/views/projects/empty.html.haml @@ -8,7 +8,7 @@ The repository for this project is empty %p.lead You can - = link_to '#', class: 'btn btn-new btn-lg' do + = link_to project_new_blob_path(@project, 'master'), class: 'btn btn-new btn-lg' do add a file or push it via command line. diff --git a/app/views/projects/tree/_tree.html.haml b/app/views/projects/tree/_tree.html.haml index 68ccd4d61bb..f902440b3f1 100644 --- a/app/views/projects/tree/_tree.html.haml +++ b/app/views/projects/tree/_tree.html.haml @@ -10,7 +10,7 @@ = link_to title, '#' - if current_user && can_push_branch?(@project, @ref) %li - = link_to project_new_tree_path(@project, @id), title: 'New file', id: 'new-file-link' do + = link_to project_new_blob_path(@project, @id), title: 'New file', id: 'new-file-link' do %small %i.fa.fa-plus |