Skip to content

Commit

Permalink
[webui] Apply Haml-Lint idNames in package
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidKang committed Apr 19, 2017
1 parent 44cab43 commit 97e1178
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
22 changes: 11 additions & 11 deletions src/api/app/assets/javascripts/webui/application/request.js
@@ -1,10 +1,10 @@
function updateSupersedeAndDevelPackageDisplay() {
if ($('#targetproject').length > 0 && $('#targetproject')[0].value.length > 2) {
if ($('#targetproject')[0].value == $('#sourceproject')[0].value) {
$('#sourceupdate_display').hide();
$('#sourceupdate-display').hide();
$('#sourceupdate').prop('disabled', true); // hide 'sourceupdate' from Ruby
} else {
$('#sourceupdate_display').show();
$('#sourceupdate-display').show();
$('#sourceupdate').prop('disabled', false);
}
$.ajax({
Expand All @@ -18,11 +18,11 @@ function updateSupersedeAndDevelPackageDisplay() {
},
success: function (data) {
if (data.indexOf('No requests') == -1) {
$('#supersede_display').show();
$('#supersede_requests').html(data);
$('#supersede-display').show();
$('#supersede-requests').html(data);
} else {
$('#supersede_display').hide();
$('#supersede_requests').html('');
$('#supersede-display').hide();
$('#supersede-requests').html('');
}
}
});
Expand All @@ -34,19 +34,19 @@ function updateSupersedeAndDevelPackageDisplay() {
},
success: function (data) {
if (data.length > 0) {
$('#devel_project_warning').show();
$('#devel_project_name').html(data);
$('#devel-project-warning').show();
$('#devel-project-name').html(data);
} else {
$('#devel_project_warning').hide();
$('#devel-project-warning').hide();
}
}
});
}
}

function setup_request_dialog() {
$('#devel_project_name').click(function () {
$('#targetproject').attr('value', $('#devel_project_name').html());
$('#devel-project-name').click(function () {
$('#targetproject').attr('value', $('#devel-project-name').html());
});

$('#targetproject').autocomplete({
Expand Down
10 changes: 5 additions & 5 deletions src/api/app/views/webui/package/_submit_request_dialog.html.haml
Expand Up @@ -37,18 +37,18 @@
~ text_area_tag(:description, '', size: '40x3')
%br/

%span.hidden#supersede_display
%span.hidden#supersede-display
= label_tag(:supersede_requests, 'Supersede requests:')
%br/
%span#supersede_requests
%span#supersede-requests

%span#sourceupdate_display
%span#sourceupdate-display
= check_box_tag(:sourceupdate, 'cleanup', @cleanup_source)
= label_tag(:sourceupdate, 'Remove local package if request is accepted')

%p.hidden#devel_project_warning
%p.hidden#devel-project-warning
You are about to bypass the devel project, please submit to
%b#devel_project_name
%b#devel-project-name
instead.

.buttons
Expand Down
Expand Up @@ -3,17 +3,17 @@
<h2 class="box-header">Create Maintenance Release Request</h2>
<div class="dialog-content">
<p>Do you want to release <%= project_or_package_link project: @project.name %> as a maintenance update?</p>

<%= form_tag({:controller => 'project', :action => 'new_release_request'}) do -%>
<%= hidden_field_tag(:project, @project.name) %>
<p>
<%= label_tag(:sourceproject, 'From project:') %><br/>
<%= text_field_tag(:sourceproject, elide(@project.name, 40), :size => 40, :disabled => true) %><br/>
<%= label_tag(:description, 'Description:') %><br/>
<%= text_area_tag(:description, '', :size => '40x3') %><br/>
<span id="supersede_display" class="hidden">
<span id="supersede-display" class="hidden">
<%= label_tag(:pending_requests, 'Pending requests:') %><br/>
<span id="pending_requests"></span>
<span id="pending-requests"></span>
<%= check_box_tag(:supersede) %> Supersede pending requests<br/>
</span>
</p>
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/functional/webui/package_controller_test.rb
Expand Up @@ -388,7 +388,7 @@ def test_submit_package
page.must_have_field('targetproject', with: 'home:dmayr')
page.must_have_field('targetpackage', with: 'x11vnc')

within '#supersede_display' do
within '#supersede-display' do
page.must_have_text "#{requestid} by adrian"
end

Expand Down

0 comments on commit 97e1178

Please sign in to comment.