Commit 752cb506 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Refactor blob views

parent 21297e78
.file-editor .file-editor
%ul.nav.nav-tabs.js-edit-mode %ul.nav.nav-tabs.js-edit-mode
%li.active %li.active
= link_to 'Edit', '#editor' = link_to '#editor' do
%i.fa.fa-edit
Edit file
%li %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 'projects/blob_editor', ref: @ref, path: @path, blob_data: @blob.data
= render 'shared/commit_message_container', params: params, = render 'shared/commit_message_container', params: params,
placeholder: "Update #{@blob.name}" placeholder: "Update #{@blob.name}"
......
%h3.page-title New file %h3.page-title New file
%hr %hr
.file-editor .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 .form-group.commit_message-group
= label_tag 'file_name', class: 'control-label' do = label_tag 'file_name', class: 'control-label' do
File name File name
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
The repository for this project is empty The repository for this project is empty
%p.lead %p.lead
You can 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 add a file
 or push it via command line.  or push it via command line.
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
= link_to title, '#' = link_to title, '#'
- if current_user && can_push_branch?(@project, @ref) - if current_user && can_push_branch?(@project, @ref)
%li %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 %small
%i.fa.fa-plus %i.fa.fa-plus
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment