summaryrefslogtreecommitdiff
path: root/app/views/projects/edit.html.haml
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-03-11 15:15:08 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-03-11 15:15:08 +0200
commit7157f79caa88689f1b8989d183ef20fbc942bd0f (patch)
tree91af9f2e55ae1590eed375ee740e6d3756dc5a42 /app/views/projects/edit.html.haml
parent9f405068cdfeb185cd3762f0ae5df6d87f6e31ba (diff)
downloadgitlab-ce-7157f79caa88689f1b8989d183ef20fbc942bd0f.tar.gz
Refactor js behaviours helpers
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/views/projects/edit.html.haml')
-rw-r--r--app/views/projects/edit.html.haml173
1 files changed, 87 insertions, 86 deletions
diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml
index 005d994806e..10674ccae46 100644
--- a/app/views/projects/edit.html.haml
+++ b/app/views/projects/edit.html.haml
@@ -93,100 +93,101 @@
- .centered-light-block
- %h3
- %i.icon-warning-sign
- Dangerous settings
-
- %p Project settings below may result in data loss!
- = link_to '#', class: 'btn js-toggle-visibility-link' do
- Show it to me
- %i.icon-chevron-down
-
- .js-toggle-visibility-container.hide
- - if can? current_user, :archive_project, @project
- .ui-box.ui-box-danger
- .title
- - if @project.archived?
- Unarchive project
- - else
- Archive project
- .body
- - if @project.archived?
- %p
- Unarchiving the project will mark its repository as active.
- %br
- The project can be committed to.
- %br
- %strong Once active this project shows up in the search and on the dashboard.
- = link_to 'Unarchive', unarchive_project_path(@project),
- data: { confirm: "Are you sure that you want to unarchive this project?\nWhen this project is unarchived it is active and can be comitted to again." },
- method: :post, class: "btn btn-remove"
- - else
- %p
- Archiving the project will mark its repository as read-only.
- %br
- It is hidden from the dashboard and doesn't show up in searches.
- %br
- %strong Archived projects cannot be committed to!
- = link_to 'Archive', archive_project_path(@project),
- data: { confirm: "Are you sure that you want to archive this project?\nAn archived project cannot be committed to." },
- method: :post, class: "btn btn-remove"
- - else
- .nothing-here-block Only the project owner can archive a project
-
- - if can?(current_user, :change_namespace, @project)
+ .danger-settings.js-toggle-container
+ .centered-light-block
+ %h3
+ %i.icon-warning-sign
+ Dangerous settings
+
+ %p Project settings below may result in data loss!
+ = link_to '#', class: 'btn js-toggle-button' do
+ Show it to me
+ %i.icon-chevron-down
+
+ .js-toggle-content.hide
+ - if can? current_user, :archive_project, @project
+ .ui-box.ui-box-danger
+ .title
+ - if @project.archived?
+ Unarchive project
+ - else
+ Archive project
+ .body
+ - if @project.archived?
+ %p
+ Unarchiving the project will mark its repository as active.
+ %br
+ The project can be committed to.
+ %br
+ %strong Once active this project shows up in the search and on the dashboard.
+ = link_to 'Unarchive', unarchive_project_path(@project),
+ data: { confirm: "Are you sure that you want to unarchive this project?\nWhen this project is unarchived it is active and can be comitted to again." },
+ method: :post, class: "btn btn-remove"
+ - else
+ %p
+ Archiving the project will mark its repository as read-only.
+ %br
+ It is hidden from the dashboard and doesn't show up in searches.
+ %br
+ %strong Archived projects cannot be committed to!
+ = link_to 'Archive', archive_project_path(@project),
+ data: { confirm: "Are you sure that you want to archive this project?\nAn archived project cannot be committed to." },
+ method: :post, class: "btn btn-remove"
+ - else
+ .nothing-here-block Only the project owner can archive a project
+
+ - if can?(current_user, :change_namespace, @project)
+ .ui-box.ui-box-danger
+ .title Transfer project
+ .errors-holder
+ .form-holder
+ = form_for(@project, url: transfer_project_path(@project), method: :put, remote: true, html: { class: 'transfer-project form-horizontal' }) do |f|
+ .form-group
+ = f.label :namespace_id, class: 'control-label' do
+ %span Namespace
+ .col-sm-10
+ .form-group
+ = f.select :namespace_id, namespaces_options(@project.namespace_id), { prompt: 'Choose a project namespace' }, { class: 'select2' }
+ %ul
+ %li Be careful. Changing the project's namespace can have unintended side effects.
+ %li You can only transfer the project to namespaces you manage.
+ %li You will need to update your local repositories to point to the new location.
+ .form-actions
+ = f.submit 'Transfer', class: "btn btn-remove"
+ - else
+ .nothing-here-block Only the project owner can transfer a project
+
.ui-box.ui-box-danger
- .title Transfer project
+ .title Rename repository
.errors-holder
.form-holder
- = form_for(@project, url: transfer_project_path(@project), method: :put, remote: true, html: { class: 'transfer-project form-horizontal' }) do |f|
+ = form_for(@project, html: { class: 'form-horizontal' }) do |f|
.form-group
- = f.label :namespace_id, class: 'control-label' do
- %span Namespace
- .col-sm-10
+ = f.label :path, class: 'control-label' do
+ %span Path
+ .col-sm-9
.form-group
- = f.select :namespace_id, namespaces_options(@project.namespace_id), { prompt: 'Choose a project namespace' }, { class: 'select2' }
+ .input-group
+ = f.text_field :path, class: 'form-control'
+ %span.input-group-addon .git
%ul
- %li Be careful. Changing the project's namespace can have unintended side effects.
- %li You can only transfer the project to namespaces you manage.
+ %li Be careful. Renaming a project's repository can have unintended side effects.
%li You will need to update your local repositories to point to the new location.
.form-actions
- = f.submit 'Transfer', class: "btn btn-remove"
- - else
- .nothing-here-block Only the project owner can transfer a project
-
- .ui-box.ui-box-danger
- .title Rename repository
- .errors-holder
- .form-holder
- = form_for(@project, html: { class: 'form-horizontal' }) do |f|
- .form-group
- = f.label :path, class: 'control-label' do
- %span Path
- .col-sm-9
- .form-group
- .input-group
- = f.text_field :path, class: 'form-control'
- %span.input-group-addon .git
- %ul
- %li Be careful. Renaming a project's repository can have unintended side effects.
- %li You will need to update your local repositories to point to the new location.
- .form-actions
- = f.submit 'Rename', class: "btn btn-remove"
-
- - if can?(current_user, :remove_project, @project)
- .ui-box.ui-box-danger
- .title Remove project
- .body
- %p
- Removing the project will delete its repository and all related resources including issues, merge requests etc.
- %br
- %strong Removed projects cannot be restored!
-
- = link_to 'Remove project', @project, data: { confirm: remove_project_message(@project) }, method: :delete, class: "btn btn-remove"
- - else
- .nothing-here-block Only project owner can remove a project
+ = f.submit 'Rename', class: "btn btn-remove"
+
+ - if can?(current_user, :remove_project, @project)
+ .ui-box.ui-box-danger
+ .title Remove project
+ .body
+ %p
+ Removing the project will delete its repository and all related resources including issues, merge requests etc.
+ %br
+ %strong Removed projects cannot be restored!
+
+ = link_to 'Remove project', @project, data: { confirm: remove_project_message(@project) }, method: :delete, class: "btn btn-remove"
+ - else
+ .nothing-here-block Only project owner can remove a project
.save-project-loader.hide
%center