Skip to content

Commit

Permalink
Merge pull request #3669 from DavidKang/switch-dialog-buttons
Browse files Browse the repository at this point in the history
[webui] Change buttons position in dialogs
  • Loading branch information
Moisés Déniz Alemán committed Aug 25, 2017
2 parents aa0e57e + 3380439 commit 7144ce5
Show file tree
Hide file tree
Showing 23 changed files with 69 additions and 117 deletions.
4 changes: 1 addition & 3 deletions src/api/app/views/webui/main/_add_news_dialog.html.haml
Expand Up @@ -11,6 +11,4 @@
= label_tag(:severity, "Severity:")
%br/
= select_tag(:severity, options_for_select([['Information', 0], ['Green', 1], ['Yellow', 2], ['Red', 3]]))
.dialog-buttons
= submit_tag('Ok')
= remove_dialog_tag('Cancel')
= render partial: '/webui/shared/dialog_action_buttons'
Expand Up @@ -5,6 +5,4 @@
%p Really delete this message?
= form_tag({ controller: 'main', action: 'delete_message' }, method: 'post') do
= hidden_field_tag(:message_id, params[:message_id])
.dialog-buttons
= submit_tag('Ok')
= remove_dialog_tag('Cancel')
= render partial: '/webui/shared/dialog_action_buttons'
2 changes: 1 addition & 1 deletion src/api/app/views/webui/package/_branch_dialog.html.erb
Expand Up @@ -14,8 +14,8 @@
</div>

<div class="dialog-buttons">
<%= submit_tag('Ok') %>
<%= link_to('Close', '#', title: 'Close', class: 'close-dialog', data: { target: '#package_branch_dialog' }) %>
<%= submit_tag('Ok') %>
</div>
<% end %>
</div>
Expand Down
25 changes: 11 additions & 14 deletions src/api/app/views/webui/package/_delete_dialog.html.erb
Expand Up @@ -17,20 +17,17 @@
<% end %>
</div>
<%= form_tag({:controller => :package, :action => :remove}, :method => :post) do %>
<%= hidden_field_tag(:project, @project) %>
<%= hidden_field_tag(:package, @package) %>
<%- if @package.develpackages.any? %>
<p>
<label for="force">
Delete anyway?
</label>
<input id="force" name="force" type="checkbox" />
</p>
<% end %>
<div class="dialog-buttons">
<%= submit_tag('Ok') %>
<%= remove_dialog_tag('Cancel') %>
</div>
<%= hidden_field_tag(:project, @project) %>
<%= hidden_field_tag(:package, @package) %>
<%- if @package.develpackages.any? %>
<p>
<label for="force">
Delete anyway?
</label>
<input id="force" name="force" type="checkbox" />
</p>
<% end %>
<%= render partial: '/webui/shared/dialog_action_buttons' %>
<% end %>
</div>
</div>
Expand Up @@ -51,8 +51,6 @@
%b#devel-project-name
instead.

.dialog-buttons
= submit_tag('Ok')
= remove_dialog_tag('Cancel')
= render partial: '/webui/shared/dialog_action_buttons'

= javascript_tag 'setup_request_dialog();'
4 changes: 1 addition & 3 deletions src/api/app/views/webui/patchinfo/_delete_dialog.html.haml
Expand Up @@ -8,6 +8,4 @@
%div
= hidden_field_tag(:project, @project)
= hidden_field_tag(:package, @package)
.dialog-buttons
= submit_tag('Ok')
= remove_dialog_tag('Cancel')
= render partial: '/webui/shared/dialog_action_buttons'
Expand Up @@ -8,17 +8,14 @@
<h2 class="box-header">Add Project to Maintenance</h2>
<div class="dialog-content">
<p>Do you want to maintain <%= project_or_package_link project: @project.name %>?</p>

<%= form_tag({:controller => 'project', :action => 'add_maintained_project'}) do %>
<%= hidden_field_tag(:project, @project) %>
<p>
<%= label_tag(:maintained_project, 'Project to maintain:') %><br/>
<%= text_field_tag(:maintained_project, '', :size => 40) %>
</p>
<div class="dialog-buttons">
<%= submit_tag('Ok') %>
<%= remove_dialog_tag('Cancel') %>
</div>
<%= render partial: '/webui/shared/dialog_action_buttons' %>
<% end %>
</div>
</div>
Expand Down
9 changes: 3 additions & 6 deletions src/api/app/views/webui/project/_delete_dialog.html.erb
Expand Up @@ -3,7 +3,7 @@
<h2 class="box-header">Delete Confirmation</h2>
<div class="dialog-content">
<p>Do you really want to delete <%= project_or_package_link project: @project.name %>?</p>

<%= form_tag({:controller => 'project', :action => 'destroy'}, :method => 'delete') do %>
<%= hidden_field_tag(:project, @project) %>
<% if @linking_projects && @linking_projects.length > 0 %>
Expand All @@ -14,11 +14,8 @@
<% end %>
</ul>
<% end %>

<div class="dialog-buttons">
<%= submit_tag('Ok') %>
<%= remove_dialog_tag('Cancel') %>
</div>
<%= render partial: '/webui/shared/dialog_action_buttons' %>
<% end %>
</div>
</div>
Expand Down
Expand Up @@ -8,7 +8,7 @@
<p>
<%= label_tag(:sourceproject, 'Project submitted as Update:') %><br/>
<%= text_field_tag(:sourceproject, format_projectname(@project.name, User.current.login), :size => 40, :disabled => true) %><br/>

<%= label_tag(:sourceproject, 'Release Targets:') %><br/>
<% @releasetargets.each do |rt| %>
<%= text_field_tag(:releasetarget, rt, :size=> 40, :disabled => true) %>
Expand All @@ -17,10 +17,7 @@
<%= label_tag(:description, 'Description:') %><br/>
<%= text_area_tag(:description, '', :size => '40x3') %>
</p>
<div class="dialog-buttons">
<%= submit_tag('Ok') %>
<%= remove_dialog_tag('Cancel') %>
</div>
<%= render partial: '/webui/shared/dialog_action_buttons' %>
<% end %>
</div>
</div>
Expand Down
Expand Up @@ -17,10 +17,7 @@
<%= check_box_tag(:supersede) %> Supersede pending requests<br/>
</span>
</p>
<div class="dialog-buttons">
<%= submit_tag('Ok') %>
<%= remove_dialog_tag('Cancel') %>
</div>
<%= render partial: '/webui/shared/dialog_action_buttons' %>
<% end %>
</div>
</div>
Expand Down
Expand Up @@ -3,18 +3,15 @@
<h2 class="box-header">Create Repository Delete Request</h2>
<div class="dialog-content">
<p>Do you really want to request the deletion of repository <i><%= params[:repository] %></i>?</p>

<%= form_tag({:controller => 'project', :action => 'remove_target_request'}, :method => 'post') do %>
<%= hidden_field_tag(:project, params[:project]) %>
<%= hidden_field_tag(:repository, params[:repository]) %>
<p>
<%= label_tag(:description, 'Description:') %><br/>
<%= text_area_tag(:description, '', :size => '40x3') %>
</p>
<div class="dialog-buttons">
<%= submit_tag('Ok') %>
<%= remove_dialog_tag('Cancel') %>
</div>
<%= render partial: '/webui/shared/dialog_action_buttons' %>
<% end %>
</div>
</div>
Expand Down
7 changes: 2 additions & 5 deletions src/api/app/views/webui/project/_unlock_dialog.html.erb
Expand Up @@ -3,17 +3,14 @@
<h2 class="box-header">Unlock Confirmation</h2>
<div class="dialog-content">
<p>Do you really want to unlock <%= project_or_package_link project: @project.name %>?</p>

<%= form_tag({:controller => 'project', project: @project, :action => 'unlock'}, :method => 'post') do %>
<%= hidden_field_tag(:project, @project) %>
<p>
<%= label_tag(:comment, 'Comment:') %><br/>
<%= text_area_tag(:comment, '', :size => '40x3') %><br/>
</p>
<div class="dialog-buttons">
<%= submit_tag('Ok') %>
<%= remove_dialog_tag('Cancel') %>
</div>
<%= render partial: '/webui/shared/dialog_action_buttons' %>
<% end %>
</div>
</div>
Expand Down
Expand Up @@ -32,7 +32,7 @@
%pre
= @project.key_info.fingerprint
.dialog-buttons
= remove_dialog_tag('Close')
= link_to('GPG Key', project_public_key_path(project_name: @project.name), class: 'close-dialog')
- if @project.key_info.ssl_certificate.present?
= link_to('SSL Cert.', project_ssl_certificate_path(project_name: @project.name), class: 'close-dialog')
= remove_dialog_tag('Close')
57 changes: 27 additions & 30 deletions src/api/app/views/webui/request/_add_reviewer_dialog.html.erb
Expand Up @@ -3,37 +3,34 @@
<h2 class="box-header">Add Reviewer</h2>
<div class="dialog-content">
<p>Add a reviewer to request <%= @request_number %></p>

<%= form_tag(:action => "add_reviewer") do %>
<%= hidden_field_tag(:number, @request_number) %>
<p>
<%= label_tag(:review_type, "Type:") %><br/>
<%= select_tag(:review_type, options_for_select([%w(User user), %w(Group group), %w(Project project), %w(Package package)])) %>
<br/>
<span id="review_user_span">
<%= label_tag(:review_user, "User:") %><br/>
<%= text_field_tag(:review_user) %><br/>
</span>
<span id="review_group_span" class="hidden">
<%= label_tag(:review_group, "Group:") %><br/>
<%= text_field_tag(:review_group) %><br/>
</span>
<span id="review_project_span" class="hidden">
<%= label_tag(:review_project, "Project:") %><br/>
<%= text_field_tag(:review_project) %><br/>
</span>
<span id="review_package_span" class="hidden">
<%= label_tag(:review_package, "Package:") %><br/>
<%= text_field_tag(:review_package) %><br/>
</span>
<%= label_tag(:review_comment, "Comment for reviewer:") %><br/>
<%= text_area_tag('review_comment', nil, :size => '80x3') %>
</p>

<div class="dialog-buttons">
<%= submit_tag("Ok") %>
<%= remove_dialog_tag('Cancel') %>
</div>
<%= hidden_field_tag(:number, @request_number) %>
<p>
<%= label_tag(:review_type, "Type:") %><br/>
<%= select_tag(:review_type, options_for_select([%w(User user), %w(Group group), %w(Project project), %w(Package package)])) %>
<br/>
<span id="review_user_span">
<%= label_tag(:review_user, "User:") %><br/>
<%= text_field_tag(:review_user) %><br/>
</span>
<span id="review_group_span" class="hidden">
<%= label_tag(:review_group, "Group:") %><br/>
<%= text_field_tag(:review_group) %><br/>
</span>
<span id="review_project_span" class="hidden">
<%= label_tag(:review_project, "Project:") %><br/>
<%= text_field_tag(:review_project) %><br/>
</span>
<span id="review_package_span" class="hidden">
<%= label_tag(:review_package, "Package:") %><br/>
<%= text_field_tag(:review_package) %><br/>
</span>
<%= label_tag(:review_comment, "Comment for reviewer:") %><br/>
<%= text_area_tag('review_comment', nil, :size => '80x3') %>
</p>

<%= render partial: '/webui/shared/dialog_action_buttons' %>
<% end %>
</div>
</div>
Expand Down
Expand Up @@ -3,7 +3,7 @@
<h2 class="box-header">Add Role Request</h2>
<div class="dialog-content">
<p>Do you want to request a role addition to <%= project_or_package_link project: @project, package: @package %>?</p>

<%= form_tag(:action => 'add_role_request') do %>
<%= hidden_field_tag(:project, @project) %>
<%= hidden_field_tag(:package, @package) if defined? @package %>
Expand All @@ -19,10 +19,7 @@
<%= label_tag(:description, 'Description:') %><br/>
<%= text_area_tag(:description, '', :size => '40x3') %>
</p>
<div class="dialog-buttons">
<%= submit_tag('Ok') %>
<%= remove_dialog_tag('Cancel') %>
</div>
<%= render partial: '/webui/shared/dialog_action_buttons' %>
<% end %>
</div>
</div>
Expand Down
Expand Up @@ -22,10 +22,7 @@
<%= label_tag(:description, 'Description:') %><br/>
<%= text_area_tag(:description, '', :size => '40x3') %>
</p>
<div class="dialog-buttons">
<%= submit_tag('Ok') %>
<%= remove_dialog_tag('Cancel') %>
</div>
<%= render partial: '/webui/shared/dialog_action_buttons' %>
<% end %>
</div>
</div>
Expand Down
Expand Up @@ -3,7 +3,7 @@
<h2 class="box-header">Create Delete Request</h2>
<div class="dialog-content">
<p>Do you really want to request the deletion of <%= project_or_package_link project: @project, package: @package %>?</p>

<%= form_tag(:action => 'delete_request', :method => 'post') do %>
<%= hidden_field_tag(:project, @project) %>
<%= hidden_field_tag(:package, @package) if defined? @package %>
Expand All @@ -15,10 +15,7 @@
<%= label_tag(:description, 'Please explain why:') %><br/>
<%= text_area_tag(:description, '', :size => '40x3') %>
</p>
<div class="dialog-buttons">
<%= submit_tag('Ok') %>
<%= remove_dialog_tag('Cancel') %>
</div>
<%= render partial: '/webui/shared/dialog_action_buttons' %>
<% end %>
</div>
</div>
Expand Down
Expand Up @@ -13,7 +13,7 @@
<% end %>
</tbody>
</table>

<div class="dialog-buttons">
<%= link_to('close', '#', title: 'Close', class: 'close-dialog', data: { target: '#maintainers_dialog' }) %>
</div>
Expand Down
Expand Up @@ -31,10 +31,7 @@
<%= label_tag(:description, "Description:") %><br/>
<%= text_area_tag(:description, "", :size => "40x3") %>
</p>
<div class="dialog-buttons">
<%= submit_tag("Ok") %>
<%= remove_dialog_tag('Cancel') %>
</div>
<%= render partial: '/webui/shared/dialog_action_buttons' %>
<% end %>
</div>
</div>
Expand Down
Expand Up @@ -11,10 +11,7 @@
<%= label_tag(:incident_project, 'Incident:') %><br/>
<%= text_field_tag(:incident_project, '', :size => 40) %><br/>
</p>
<div class="dialog-buttons">
<%= submit_tag('Ok') %>
<%= remove_dialog_tag('Cancel') %>
</div>
<%= render partial: '/webui/shared/dialog_action_buttons' %>
<% end %>
</div>
</div>
Expand Down
@@ -0,0 +1,3 @@
.dialog-buttons
= remove_dialog_tag('Cancel')
= submit_tag('Ok')
4 changes: 1 addition & 3 deletions src/api/app/views/webui/user/_password_dialog.html.haml
Expand Up @@ -16,6 +16,4 @@
%br/
= text_field_tag :repeat_password, nil, type: 'password', autocomplete: 'off', required: 'true'
%input#user{ name: "user", type: "hidden", value: "#{User.current.login}" }/
.dialog-buttons
= submit_tag("Ok")
= remove_dialog_tag('Cancel')
= render partial: '/webui/shared/dialog_action_buttons'
4 changes: 1 addition & 3 deletions src/api/app/views/webui/user/_save_dialog.html.haml
Expand Up @@ -11,6 +11,4 @@
%p
= f.label(:email, "e-Mail:")
= f.text_field(:email, required: true, email: true)
.dialog-buttons
= submit_tag("Ok")
= remove_dialog_tag('Cancel')
= render partial: '/webui/shared/dialog_action_buttons'

0 comments on commit 7144ce5

Please sign in to comment.