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

Refactor blob views

parent 21297e78
.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}"
......
%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
......
......@@ -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.
......
......@@ -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
......
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