Commit 8beb7c886e3bb9706bfa6760325453e749b84231
1 parent
c2c43e6a
Exists in
spb-stable
and in
2 other branches
Different UI colors for archive project and remove project
Since remove is more danger in compare to archive it good to have them in different colors Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
2 changed files
with
37 additions
and
21 deletions
Show diff stats
app/assets/stylesheets/generic/buttons.scss
@@ -104,6 +104,22 @@ | @@ -104,6 +104,22 @@ | ||
104 | } | 104 | } |
105 | } | 105 | } |
106 | 106 | ||
107 | + &.btn-warning { | ||
108 | + color: #ffffff; | ||
109 | + background-color: $bg_warning; | ||
110 | + border-color: $border_warning; | ||
111 | + | ||
112 | + | ||
113 | + &.hover, | ||
114 | + &:hover, | ||
115 | + &.disabled, | ||
116 | + &[disabled] { | ||
117 | + color: #ffffff; | ||
118 | + background-color: #e38c02; | ||
119 | + border-color: #e38c02; | ||
120 | + } | ||
121 | + } | ||
122 | + | ||
107 | &.btn-new { | 123 | &.btn-new { |
108 | @extend .btn-success; | 124 | @extend .btn-success; |
109 | } | 125 | } |
app/views/projects/edit.html.haml
@@ -106,7 +106,7 @@ | @@ -106,7 +106,7 @@ | ||
106 | 106 | ||
107 | .js-toggle-content.hide | 107 | .js-toggle-content.hide |
108 | - if can? current_user, :archive_project, @project | 108 | - if can? current_user, :archive_project, @project |
109 | - .panel.panel-default.panel.panel-danger | 109 | + .panel.panel-default.panel.panel-warning |
110 | .panel-heading | 110 | .panel-heading |
111 | - if @project.archived? | 111 | - if @project.archived? |
112 | Unarchive project | 112 | Unarchive project |
@@ -132,10 +132,29 @@ | @@ -132,10 +132,29 @@ | ||
132 | %strong Archived projects cannot be committed to! | 132 | %strong Archived projects cannot be committed to! |
133 | = link_to 'Archive', archive_project_path(@project), | 133 | = link_to 'Archive', archive_project_path(@project), |
134 | data: { confirm: "Are you sure that you want to archive this project?\nAn archived project cannot be committed to." }, | 134 | data: { confirm: "Are you sure that you want to archive this project?\nAn archived project cannot be committed to." }, |
135 | - method: :post, class: "btn btn-remove" | 135 | + method: :post, class: "btn btn-warning" |
136 | - else | 136 | - else |
137 | .nothing-here-block Only the project owner can archive a project | 137 | .nothing-here-block Only the project owner can archive a project |
138 | 138 | ||
139 | + .panel.panel-default.panel.panel-warning | ||
140 | + .panel-heading Rename repository | ||
141 | + .errors-holder | ||
142 | + .panel-body | ||
143 | + = form_for(@project, html: { class: 'form-horizontal' }) do |f| | ||
144 | + .form-group | ||
145 | + = f.label :path, class: 'control-label' do | ||
146 | + %span Path | ||
147 | + .col-sm-9 | ||
148 | + .form-group | ||
149 | + .input-group | ||
150 | + = f.text_field :path, class: 'form-control' | ||
151 | + %span.input-group-addon .git | ||
152 | + %ul | ||
153 | + %li Be careful. Renaming a project's repository can have unintended side effects. | ||
154 | + %li You will need to update your local repositories to point to the new location. | ||
155 | + .form-actions | ||
156 | + = f.submit 'Rename', class: "btn btn-warning" | ||
157 | + | ||
139 | - if can?(current_user, :change_namespace, @project) | 158 | - if can?(current_user, :change_namespace, @project) |
140 | .panel.panel-default.panel.panel-danger | 159 | .panel.panel-default.panel.panel-danger |
141 | .panel-heading Transfer project | 160 | .panel-heading Transfer project |
@@ -157,25 +176,6 @@ | @@ -157,25 +176,6 @@ | ||
157 | - else | 176 | - else |
158 | .nothing-here-block Only the project owner can transfer a project | 177 | .nothing-here-block Only the project owner can transfer a project |
159 | 178 | ||
160 | - .panel.panel-default.panel.panel-danger | ||
161 | - .panel-heading Rename repository | ||
162 | - .errors-holder | ||
163 | - .panel-body | ||
164 | - = form_for(@project, html: { class: 'form-horizontal' }) do |f| | ||
165 | - .form-group | ||
166 | - = f.label :path, class: 'control-label' do | ||
167 | - %span Path | ||
168 | - .col-sm-9 | ||
169 | - .form-group | ||
170 | - .input-group | ||
171 | - = f.text_field :path, class: 'form-control' | ||
172 | - %span.input-group-addon .git | ||
173 | - %ul | ||
174 | - %li Be careful. Renaming a project's repository can have unintended side effects. | ||
175 | - %li You will need to update your local repositories to point to the new location. | ||
176 | - .form-actions | ||
177 | - = f.submit 'Rename', class: "btn btn-remove" | ||
178 | - | ||
179 | - if can?(current_user, :remove_project, @project) | 179 | - if can?(current_user, :remove_project, @project) |
180 | .panel.panel-default.panel.panel-danger | 180 | .panel.panel-default.panel.panel-danger |
181 | .panel-heading Remove project | 181 | .panel-heading Remove project |