Skip to content

Commit

Permalink
Merge pull request #3010 from DavidKang/id_names-lint
Browse files Browse the repository at this point in the history
Enable Haml-Lint idNames
  • Loading branch information
bgeuken committed Apr 20, 2017
2 parents a910a39 + 681c7a3 commit c14a409
Show file tree
Hide file tree
Showing 43 changed files with 147 additions and 179 deletions.
33 changes: 1 addition & 32 deletions src/api/.haml-lint_todo.yml
Expand Up @@ -7,37 +7,6 @@
# versions of Haml-Lint, may require this file to be generated again.

linters:
# Offense count: 63
IdNames:
exclude:
- "app/views/shared/_requests.html.haml"
- "app/views/webui/attribute/_form.html.haml"
- "app/views/webui/configuration/_tabs.html.haml"
- "app/views/webui/groups/index.html.haml"
- "app/views/webui/groups/show.html.haml"
- "app/views/webui/main/_add_news_dialog.html.haml"
- "app/views/webui/main/_delete_message_dialog.html.haml"
- "app/views/webui/main/index.html.haml"
- "app/views/webui/monitor/_building.html.haml"
- "app/views/webui/monitor/_building_table.html.haml"
- "app/views/webui/monitor/_events.html.haml"
- "app/views/webui/monitor/_workers_table.html.haml"
- "app/views/webui/package/_submit_request_dialog.html.haml"
- "app/views/webui/patchinfo/_delete_dialog.html.haml"
- "app/views/webui/patchinfo/_form.html.haml"
- "app/views/webui/project/subprojects.html.haml"
- "app/views/webui/search/_owners.html.haml"
- "app/views/webui/search/_results.html.haml"
- "app/views/webui/search/_tabs.html.haml"
- "app/views/webui/search/index.html.haml"
- "app/views/webui/search/owner.html.haml"
- "app/views/webui/theme/bratwurst/webui/package/_files.html.haml"
- "app/views/webui/user/_login_form.html.haml"
- "app/views/webui/user/_password_dialog.html.haml"
- "app/views/webui/user/_save_dialog.html.haml"
- "app/views/webui/user/index.html.haml"
- "app/views/webui/user/show.html.haml"

# Offense count: 309
RuboCop:
exclude:
Expand Down Expand Up @@ -305,4 +274,4 @@ linters:
HtmlAttributes:
exclude:
- "app/views/webui/user/_dropdown_menu.html.haml"
- "app/views/webui/user/index.html.haml"
- "app/views/webui/user/index.html.haml"
Expand Up @@ -124,15 +124,15 @@ function patchinfoReady() {
$("#selected_binaries option[value='']").remove();
moveSelectedItems('#available_binaries', '#selected_binaries');
});
$('#addAll').click(function () {
$('#add-all').click(function () {
$("#selected_binaries option[value='']").remove();
$('#available_binaries option').attr('selected', 'true');
moveSelectedItems('#available_binaries', '#selected_binaries');
});
$('#remove').click(function () {
moveSelectedItems('#selected_binaries', '#available_binaries');
});
$('#removeAll').click(function () {
$('#remove-all').click(function () {
$('#selected_binaries option').attr('selected', 'true');
moveSelectedItems('#selected_binaries', '#available_binaries');
});
Expand Down
12 changes: 6 additions & 6 deletions src/api/app/assets/javascripts/webui/application/project.js
Expand Up @@ -39,8 +39,8 @@ function renderProjectsTable(length) {
var projects = main_projects;
if (!$('#excludefilter').is(":checked"))
projects = projects.concat(excl_projects);
var projecturl = $("#projects_table_wrapper").data("url");
$("#projects_table_wrapper").html('<table cellpadding="0" cellspacing="0" border="0" class="compact stripe" id="projects_table"></table>');
var projecturl = $("#projects-table-wrapper").data("url");
$("#projects-table-wrapper").html('<table cellpadding="0" cellspacing="0" border="0" class="compact stripe" id="projects_table"></table>');
$("#projects_table").dataTable({
"data": projects,
"paging": true,
Expand Down Expand Up @@ -143,14 +143,14 @@ function repositories_setup_autocomplete() {
}

function setup_subprojects_tables() {
$('#parentprojects_table').dataTable({
$('#parentprojects-table').dataTable({
'paging': false,
'searching': false,
'info': false,
"autoWidth": false
});
if ($('#siblingprojects_table').length) {
$('#siblingprojects_table').dataTable({
if ($('#siblingprojects-table').length) {
$('#siblingprojects-table').dataTable({
'paging': false,
'searching': false,
'info': false,
Expand All @@ -160,7 +160,7 @@ function setup_subprojects_tables() {
]
});
}
$('#subprojects_table').dataTable({
$('#subprojects-table').dataTable({
'paging': false,
'searching': false,
'info': false,
Expand Down
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
8 changes: 4 additions & 4 deletions src/api/app/assets/stylesheets/webui/application/search.scss
@@ -1,4 +1,4 @@
#search_form {
#search-form {
width: 600px;
margin-left: auto ;
margin-right: auto ;
Expand All @@ -13,15 +13,15 @@
text-indent:10px;
font-family:arial, sans-serif;
font-size:1em;
color:#333;
color:#333;
background: #fff;
border:solid 1px #d9d9d9;
border-top:solid 1px #c0c0c0;
border-right:none;
}

#search_button {
cursor:pointer;
cursor:pointer;
width:70px;
height: 33px;
line-height: 33px;
Expand All @@ -34,7 +34,7 @@
-webkit-border-radius: 0px;
}

#advanced_link {
#advanced-link {
float: right;
background-color: transparent;
}
Expand Down
4 changes: 2 additions & 2 deletions src/api/app/assets/stylesheets/webui/application/style.scss
Expand Up @@ -166,7 +166,7 @@ div#log_space_wrapper {

/* main page (/) */

#proceed_list {
#proceed-list {
height: 2em;
margin-bottom: 40px;
li {
Expand Down Expand Up @@ -400,7 +400,7 @@ div.dataTables_wrapper:after {
}

// Indentation for the old monitoring page
#schedulerstatus, #building_all, #idlehosts {
#schedulerstatus, #building-all, #idlehosts {
padding-top: 1em;
}

Expand Down
4 changes: 2 additions & 2 deletions src/api/app/views/shared/_involved_users.html.erb
Expand Up @@ -10,7 +10,7 @@
<%= content_tag(:div, id: 'involved_users', data: data) do %>
<% if @users.present? %>
<h3>User Roles <%= image_tag 'ajax-loader.gif', :id => 'user_spinner', :class => 'hidden' %></h3>
<table id="user_table" class="compact stripe">
<table id="user-table" class="compact stripe">
<thead>
<tr>
<td>Username</td>
Expand Down Expand Up @@ -109,7 +109,7 @@
<%= content_for :ready_function do %>
<% if @users && @users.length > 0 %>
$('#user_table').dataTable({
$('#user-table').dataTable({
'columns': [
null,
<% @roles.length.times do %>null,
Expand Down
4 changes: 2 additions & 2 deletions src/api/app/views/shared/_requests.html.haml
@@ -1,7 +1,7 @@
- if requests.blank?
%p No requests.
- else
%table.compact#request_table{:width => '100%'}
%table.compact#request-table{:width => '100%'}
%thead
%tr
%th Created
Expand All @@ -15,7 +15,7 @@
- requests.each do |req|
= render partial: 'shared/single_request', locals: { req: req }
:javascript
$('#request_table').dataTable({
$('#request-table').dataTable({
'order': [[0,'desc']],
'columns': [ null, null, null, null, null, null, null ],
'info': false,
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/views/webui/attribute/_form.html.haml
@@ -1,6 +1,6 @@
= form_for(@attribute) do |attribute_form|
- if @attribute.errors.any?
#error_explanation
#error-explanation
%h2
= pluralize(@attribute.errors.count, "error")
prohibited this attribute from being saved:
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/views/webui/configuration/_tabs.html.haml
@@ -1,4 +1,4 @@
.box-header.header-tabs#configuration_tabs
.box-header.header-tabs#configuration-tabs
%ul
= tab 'configuration', 'Configuration', controller: :configuration, action: :index
= tab 'architectures', 'Architectures', controller: :architectures, action: :index
Expand Down
4 changes: 2 additions & 2 deletions src/api/app/views/webui/groups/index.html.haml
Expand Up @@ -6,7 +6,7 @@
%p
Manage groups.
- unless @groups.empty?
%table.compact#group_table
%table.compact#group-table
%thead
%tr
%th Group name
Expand All @@ -28,5 +28,5 @@
- if @groups.length > 0
:javascript
$(function() {
$('#group_table').dataTable();
$('#group-table').dataTable();
});
4 changes: 2 additions & 2 deletions src/api/app/views/webui/groups/show.html.haml
@@ -1,7 +1,7 @@
- @pagetitle = "Group #{@group.title}"
%h2= @pagetitle
- unless @group.users.empty?
%table#group_members_table
%table#group-members-table
%thead
%tr
%th Group members
Expand All @@ -13,4 +13,4 @@
%p
%i This group does not contain users
- content_for :ready_function do
$('#group_members_table').dataTable();
$('#group-members-table').dataTable();
2 changes: 1 addition & 1 deletion src/api/app/views/webui/main/index.html.haml
Expand Up @@ -6,7 +6,7 @@
Welcome to #{@configuration['title']}
= raw @configuration['description']
%br/
%ul#proceed_list
%ul#proceed-list
- if User.current.is_admin?
= proceed_link 'configure', 'Configuration', controller: 'configuration', action: 'index'
= proceed_link 'list', 'All Projects', controller: 'project'
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/views/webui/monitor/_building.html.haml
@@ -1,6 +1,6 @@
- max_clients = @workerstatus['clients']
- build_count = @workerstatus.elements('building').length
#building_all
#building-all
%h2 Building
- if build_count > 0
%p.info Hover the job time field to see the start time.
Expand Down
6 changes: 3 additions & 3 deletions src/api/app/views/webui/monitor/_building_table.html.haml
@@ -1,6 +1,6 @@
#building_list
#building-list
- if @workerstatus.has_key? 'building'
%table.building#building_table
%table.building#building-table
%thead
%tr
%th Project
Expand Down Expand Up @@ -47,7 +47,7 @@

= content_for :ready_function do
:plain
$('#building_table').dataTable({
$('#building-table').dataTable({
'aaSorting': [[3, 'desc']],
'bInfo': false,
'bPaginate': false,
Expand Down
12 changes: 6 additions & 6 deletions src/api/app/views/webui/monitor/_events.html.haml
Expand Up @@ -14,20 +14,20 @@
#building{ style: "height:250px; margin-right: 20px" }
.centered
Workers
%span.flot_legend#legend_building
%span.flot_legend#legend-building
.plotspinner= image_tag('ajax-loader.gif')
.clear
.grid_8.alpha
#events{ style: "height:250px; margin-left: 20px; margin-right: 20px" }
.centered
Repositories to recalculate
%span.flot_legend#legend_events
%span.flot_legend#legend-events
.plotspinner= image_tag('ajax-loader.gif')
.grid_8.omega
#jobs{ style: "height:250px; margin-right: 20px" }
.centered
Packages scheduled for building
%span.flot_legend#legend_jobs
%span.flot_legend#legend-jobs
.plotspinner= image_tag('ajax-loader.gif')
.clear
Expand All @@ -46,7 +46,7 @@
lines: { show: true, fill: true },
stack: true
},
legend: { noColumns: 3, position: "ne", container: "#legend_events" },
legend: { noColumns: 3, position: "ne", container: "#legend-events" },
xaxis: { mode: 'time' },
yaxis: { min: 0, max: data['events_max'], position: "left", labelWidth: 25 }
});
Expand All @@ -63,7 +63,7 @@
},
xaxis: { mode: 'time' },
yaxis: { min: 0, position: "left", labelWidth: 25 },
legend: { noColumns: 3, position: "ne", container: "#legend_building" }
legend: { noColumns: 3, position: "ne", container: "#legend-building" }
});
$.plot($("#jobs"), [
{ data: data['waiting'], label: "Ready to build", color: 5},
Expand All @@ -75,7 +75,7 @@
},
xaxis: { mode: 'time' },
yaxis: { max: data['jobs_max'], position: "left", labelWidth: 25 },
legend: { noColumns: 3, position: "ne", container: "#legend_jobs" }
legend: { noColumns: 3, position: "ne", container: "#legend-jobs" }
});
}

Expand Down

0 comments on commit c14a409

Please sign in to comment.