summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-05-22 17:35:41 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-05-22 17:35:41 +0000
commit05bff8b6800494dace7456c6acec6cb80c1bc1b2 (patch)
tree0d75d80640977e6ad43b42fd791261b08ec354f9 /app
parentde8c43f6f6e483495968f42b6165581c99ff9ba3 (diff)
parent1ad174fbcdb7c14eb8fbe9820e1152383f41a89e (diff)
downloadgitlab-ce-05bff8b6800494dace7456c6acec6cb80c1bc1b2.tar.gz
Merge branch 'improved-edit-file-ui' into 'master'
Improved edit file ui * remove ugly borders * replace small buttons with tabs * add spinner while diff is loading
Diffstat (limited to 'app')
-rw-r--r--app/assets/stylesheets/sections/diff.scss5
-rw-r--r--app/views/projects/edit_tree/preview.html.haml2
-rw-r--r--app/views/projects/edit_tree/show.html.haml23
3 files changed, 19 insertions, 11 deletions
diff --git a/app/assets/stylesheets/sections/diff.scss b/app/assets/stylesheets/sections/diff.scss
index af44654d5da..24d997c9fca 100644
--- a/app/assets/stylesheets/sections/diff.scss
+++ b/app/assets/stylesheets/sections/diff.scss
@@ -330,3 +330,8 @@
}
}
}
+
+.file-content .diff-file {
+ margin: 0;
+ border: none;
+}
diff --git a/app/views/projects/edit_tree/preview.html.haml b/app/views/projects/edit_tree/preview.html.haml
index fc6d3bfbc24..340f68cc05c 100644
--- a/app/views/projects/edit_tree/preview.html.haml
+++ b/app/views/projects/edit_tree/preview.html.haml
@@ -23,4 +23,4 @@
%td.new_line= link_to raw(type == "old" ? "&nbsp;" : line_new) , "##{line_code}", id: line_code
%td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw diff_line_content(line)
- else
- %p.nothing_here_message No changes.
+ .nothing-here-block No changes.
diff --git a/app/views/projects/edit_tree/show.html.haml b/app/views/projects/edit_tree/show.html.haml
index 93037ef9585..32a6d4ef36e 100644
--- a/app/views/projects/edit_tree/show.html.haml
+++ b/app/views/projects/edit_tree/show.html.haml
@@ -1,23 +1,26 @@
-%h3.page-title Edit mode
.file-editor
+ %ul.nav.nav-tabs.js-edit-mode
+ %li.active
+ = link_to 'Edit', '#editor'
+ %li
+ = link_to editing_preview_title(@blob.name), '#preview', 'data-preview-url' => preview_project_edit_tree_path(@project, @id)
+
= form_tag(project_edit_tree_path(@project, @id), method: :put, class: "form-horizontal") do
.file-holder.file
.file-title
- .btn-group.js-edit-mode.left-options
- = link_to 'Edit', '#editor', class: 'active hover btn btn-tiny'
- = link_to editing_preview_title(@blob.name), '#preview', class: 'btn btn-tiny', 'data-preview-url' => preview_project_edit_tree_path(@project, @id)
%i.icon-file
%span.file_name
+ %span.monospace.light #{@ref}:
= @path
- %small
- on
- %strong= @ref
%span.options
.btn-group.tree-btn-group
= link_to "Cancel", @after_edit_path, class: "btn btn-tiny btn-cancel", data: { confirm: leave_edit_message }
.file-content.code
%pre.js-edit-mode-pane#editor= @blob.data
.js-edit-mode-pane#preview.hide
+ %center
+ %h2
+ %i.icon-spinner.icon-spin
.form-group.commit_message-group
= label_tag 'commit_message', class: "control-label" do
@@ -61,14 +64,14 @@
paneId = currentLink.attr('href'),
currentPane = editModePanes.filter(paneId);
- editModeLinks.removeClass('active hover');
- currentLink.addClass('active hover');
+ editModeLinks.parent().removeClass('active hover');
+ currentLink.parent().addClass('active hover');
editModePanes.hide();
if (paneId == '#preview') {
+ currentPane.fadeIn(200);
$.post(currentLink.data('preview-url'), { content: editor.getValue() }, function(response) {
currentPane.empty().append(response);
- currentPane.fadeIn(200);
})
} else {
currentPane.fadeIn(200);