diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2016-12-08 09:59:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-08 09:59:07 +0100 |
commit | 6d5fd08094fc87c6678f7f3f6420846f0db4abf6 (patch) | |
tree | 379e996ddb909634193f6c7a1d25f32c212dfa71 /server | |
parent | fbb33db724f16444ac882a4ffe88d15e8ff39837 (diff) | |
download | sonarqube-6d5fd08094fc87c6678f7f3f6420846f0db4abf6.tar.gz sonarqube-6d5fd08094fc87c6678f7f3f6420846f0db4abf6.zip |
drop unused ruby views and controllers (#1438)
Diffstat (limited to 'server')
114 files changed, 0 insertions, 3314 deletions
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/about_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/about_controller.rb deleted file mode 100644 index 5fcb51d0469..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/about_controller.rb +++ /dev/null @@ -1,27 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2014 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -class AboutController < ApplicationController - - def index - - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/account_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/account_controller.rb deleted file mode 100644 index 7851dd89c8f..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/account_controller.rb +++ /dev/null @@ -1,118 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class AccountController < ApplicationController - - before_filter :login_required - - def index - @channels = notification_service.getChannels() - @global_dispatchers = dispatchers_for_scope("globalNotification") - @per_project_dispatchers = dispatchers_for_scope("perProjectNotification") - - @global_notifications = {} - @per_project_notifications = {} - load_notification_properties - - if params[:new_project] - new_project = Project.by_key params[:new_project] - unless @per_project_notifications[new_project.id] - @per_project_notifications[new_project.id] = init_project_notifications - @new_project_id = new_project.id - end - @selected_project_id = new_project.id - end - end - - def update_notifications - verify_post_request - # Global notifs - global_notifs = params[:global_notifs] - Property.delete_all(['prop_key like ? AND user_id = ? AND resource_id IS NULL', 'notification.%', current_user.id]) - global_notifs.each_key { |key| Api::Utils.java_facade.saveProperty('notification.' + key, nil, current_user.id, 'true') } if global_notifs - - # Per project notifs - project_notifs = params[:project_notifs] - Property.delete_all(['prop_key like ? AND user_id = ? AND resource_id IS NOT NULL', 'notification.%', current_user.id]) - if project_notifs - project_notifs.each do |r_id, per_project_notif| - per_project_notif.each do |dispatch, channels| - channels.each do |channel, value| - Api::Utils.java_facade.saveProperty('notification.' + dispatch + '.' + channel, r_id.to_i, current_user.id, 'true') - end - end - end - end - - redirect_to "#{ApplicationController.root_context}/account/notifications/" - end - - private - - def notification_service - java_facade.getCoreComponentByClassname('org.sonar.server.notification.NotificationCenter') - end - - def dispatchers_for_scope(scope) - notification_service.getDispatcherKeysForProperty(scope, "true").to_a.sort {|x,y| dispatcher_name(x) <=> dispatcher_name(y)} - end - - def dispatcher_name(dispatcher_key) - Api::Utils.message('notification.dispatcher.' + dispatcher_key) - end - - def load_notification_properties - channel_keys = @channels.map {|c| c.getKey()} - - Property.find(:all, :conditions => ['prop_key like ? AND user_id = ?', 'notification.%', current_user.id]).each do |property| - r_id = property.resource_id - if r_id - # This is a per-project notif - parts = property.key.split('.') - dispatcher_key = parts[1] - channel_key = parts[2] - if @per_project_dispatchers.include?(dispatcher_key) && channel_keys.include?(channel_key) - project_notifs = get_project_notifications(r_id) - project_notifs[dispatcher_key] << channel_key - end - else - # This is a global notif - @global_notifications[property.key.sub('notification.', '')] = true - end - end - end - - def get_project_notifications(resource_id) - project_notifs = @per_project_notifications[resource_id] - unless project_notifs - project_notifs = init_project_notifications - @per_project_notifications[resource_id] = project_notifs - end - project_notifs - end - - def init_project_notifications - project_notifs = {} - @per_project_dispatchers.each do |dispatcher| - project_notifs[dispatcher] = [] - end - project_notifs - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/background_tasks_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/background_tasks_controller.rb deleted file mode 100644 index 084240d61b0..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/background_tasks_controller.rb +++ /dev/null @@ -1,32 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -class BackgroundTasksController < ApplicationController - - before_filter :admin_required - - SECTION=Navigation::SECTION_CONFIGURATION - - def index - - end - - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/code_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/code_controller.rb deleted file mode 100644 index 033b0e983bd..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/code_controller.rb +++ /dev/null @@ -1,29 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class CodeController < ApplicationController - before_filter :init_resource_for_user_role - - SECTION=Navigation::SECTION_RESOURCE - - def index - - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/coding_rules_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/coding_rules_controller.rb deleted file mode 100644 index 9cf4c2607e4..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/coding_rules_controller.rb +++ /dev/null @@ -1,30 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -class CodingRulesController < ApplicationController - - SECTION=Navigation::SECTION_CODING_RULES - - # GET /coding_rules/index - def index - - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/component_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/component_controller.rb deleted file mode 100644 index 54490d04949..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/component_controller.rb +++ /dev/null @@ -1,49 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class ComponentController < ApplicationController - - SECTION=Navigation::SECTION_RESOURCE - - def index - if params[:id] - @resource=Project.by_key(params[:id]) - return project_not_found unless @resource - @resource=@resource.permanent_resource - end - - @line = params[:line] - - if request.xhr? - render :action => 'index' - else - # popup mode, title will always be displayed - params[:layout] = 'false' - render :action => 'index' - end - end - - private - - def project_not_found - flash[:error] = message('dashboard.project_not_found') - redirect_to :controller => 'dashboard', :action => 'index' - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/component_issues_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/component_issues_controller.rb deleted file mode 100644 index 9b5a582d03a..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/component_issues_controller.rb +++ /dev/null @@ -1,33 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class ComponentIssuesController < ApplicationController - before_filter :init_resource_for_user_role - - SECTION=Navigation::SECTION_RESOURCE - - def index - if params[:period].present? && params[:period].to_i>0 - @period=params[:period].to_i - else - @period=nil - end - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/component_measures_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/component_measures_controller.rb deleted file mode 100644 index ff17773d070..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/component_measures_controller.rb +++ /dev/null @@ -1,28 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class ComponentMeasuresController < ApplicationController - before_filter :init_resource_for_user_role - - SECTION=Navigation::SECTION_RESOURCE - - def index - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/confirm_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/confirm_controller.rb deleted file mode 100644 index ab3f18acaa5..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/confirm_controller.rb +++ /dev/null @@ -1,27 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class ConfirmController < ApplicationController - - # GET /confirm?url=<return_to_url>[&tk=<title_key][&mk=<message_key][&mp=<message_parameters] - def index - render :partial => 'confirm/confirm' - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/custom_measures_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/custom_measures_controller.rb deleted file mode 100644 index 76b456e361d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/custom_measures_controller.rb +++ /dev/null @@ -1,29 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class CustomMeasuresController < ApplicationController - - SECTION=Navigation::SECTION_RESOURCE - before_filter :init_resource_for_admin_role - - def index - - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb deleted file mode 100644 index 5d9e1d37613..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb +++ /dev/null @@ -1,65 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -include ERB::Util -class DashboardController < ApplicationController - - SECTION=Navigation::SECTION_RESOURCE - - def index - @resource = Project.by_key(params[:id]) - return project_not_found unless @resource - @resource = @resource.permanent_resource - - access_denied unless has_role?(:user, @resource) - - # for backward compatibility with old widgets - @project = @resource - - # if file - if !@resource.display_dashboard? - @snapshot = @resource.last_snapshot - return project_not_analyzed unless @snapshot - @hide_sidebar = true - @file = @resource - @project = @resource.root_project - @metric=params[:metric] - render :action => 'no_dashboard' - else - # it is a project dashboard - # if governance plugin is installed and we are opening a view - if Project.root_qualifiers.include?('VW') && (@resource.qualifier == 'VW' || @resource.qualifier == 'SVW') - return redirect_to(url_for({:controller => 'governance'}) + '?id=' + url_encode(params[:id])) - else - @snapshot = @resource.last_snapshot - render :action => 'overview' - end - end - end - - private - - def project_not_found - raise ActionController::RoutingError.new('Not Found') - end - - def project_not_analyzed - render :action => 'empty' - end -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/drilldown_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/drilldown_controller.rb deleted file mode 100644 index 1122d163b1b..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/drilldown_controller.rb +++ /dev/null @@ -1,41 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class DrilldownController < ApplicationController - before_filter :init_resource_for_user_role - - SECTION=Navigation::SECTION_RESOURCE - - def measures - metric = params[:metric] || 'ncloc' - period = params[:period].to_i if params[:period].present? && params[:period].to_i > 0 - if period - return redirect_to(ApplicationController.root_context + "/component_measures/metric/#{metric}?id=#{url_encode(@resource.key)}&period=#{period}") - else - return redirect_to(ApplicationController.root_context + "/component_measures/metric/#{metric}?id=#{url_encode(@resource.key)}") - end - end - - def issues - @rule=Rule.by_key_or_id(params[:rule]) - @period=params[:period].to_i if params[:period].present? && params[:period].to_i>0 - @severity = params[:severity] - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/email_configuration_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/email_configuration_controller.rb deleted file mode 100644 index 7711fa43503..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/email_configuration_controller.rb +++ /dev/null @@ -1,77 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class EmailConfigurationController < ApplicationController - - SECTION=Navigation::SECTION_CONFIGURATION - before_filter :admin_required - - def index - @smtp_host = Property.value(configuration::SMTP_HOST, nil, configuration::SMTP_HOST_DEFAULT) - @smtp_port = Property.value(configuration::SMTP_PORT, nil, configuration::SMTP_PORT_DEFAULT) - @smtp_secure_connection = Property.value(configuration::SMTP_SECURE_CONNECTION, nil, configuration::SMTP_SECURE_CONNECTION) - @smtp_username = Property.value(configuration::SMTP_USERNAME, nil, configuration::SMTP_USERNAME_DEFAULT) - @smtp_password = Property.value(configuration::SMTP_PASSWORD, nil, configuration::SMTP_PASSWORD_DEFAULT) - @email_from = Property.value(configuration::FROM, nil, configuration::FROM_DEFAULT) - @email_prefix = Property.value(configuration::PREFIX, nil, configuration::PREFIX_DEFAULT) - @server_base_url = Property.value(properties::SERVER_BASE_URL, nil, properties::SERVER_BASE_URL_DEFAULT_VALUE) - params[:layout]='false' - end - - def save - Property.set(configuration::SMTP_HOST, params[:smtp_host]) - Property.set(configuration::SMTP_PORT, params[:smtp_port]) - Property.set(configuration::SMTP_SECURE_CONNECTION, params[:smtp_secure_connection]) - Property.set(configuration::SMTP_USERNAME, params[:smtp_username]) - # Do not update password that wasn't updated - Property.set(configuration::SMTP_PASSWORD, params[:smtp_password]) unless params[:smtp_password] == Property::EXISTING_PASSWORD - Property.set(configuration::FROM, params[:email_from]) - Property.set(configuration::PREFIX, params[:email_prefix]) - flash[:notice] = message('email_configuration.settings_saved') - redirect_to :action => 'index' - end - - def send_test_email - to_address = params[:to_address] - subject = params[:subject] - message = params[:message] - if to_address.blank? - flash[:error] = message('email_configuration.test.to_address_required') - else - begin - java_facade.getCoreComponentByClassname('org.sonar.server.notification.email.EmailNotificationChannel').sendTestEmail(to_address, subject, message) - flash[:notice] = message('email_configuration.test.email_was_sent_to_x', :params => [to_address]) - rescue Exception => e - flash[:error] = e.message - end - end - redirect_to :action => 'index' - end - - private - - def configuration - java_facade.getCoreComponentByClassname('org.sonar.api.config.EmailSettings').class - end - - def properties - Java::OrgSonarApi::CoreProperties - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/favourites_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/favourites_controller.rb deleted file mode 100644 index 8cbb258d0f1..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/favourites_controller.rb +++ /dev/null @@ -1,40 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class FavouritesController < ApplicationController - - before_filter :login_required - - def toggle - favourite_id=params[:id] - - if current_user.favourite?(favourite_id) - current_user.delete_favourite(favourite_id) - css='icon-not-favorite' - title=message('click_to_add_to_favorites') - else - current_user.add_favourite(favourite_id) - css='icon-favorite' - title=message('click_to_remove_from_favorites') - end - - render :json => {:css => css, :title => title}, :status => 200 - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/groups_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/groups_controller.rb deleted file mode 100644 index 0b7ba6dccc7..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/groups_controller.rb +++ /dev/null @@ -1,29 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class GroupsController < ApplicationController - - SECTION=Navigation::SECTION_CONFIGURATION - before_filter :admin_required - - def index - - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb deleted file mode 100644 index c128815bf59..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb +++ /dev/null @@ -1,73 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -require 'set' - -class IssuesController < ApplicationController - - SECTION=Navigation::SECTION_ISSUES - - # GET /issues/index - def index - - end - - # GET /issues/search - def search - redirect_to :action => 'index' - end - - def show - # the redirect is needed for the backward compatibility with eclipse plugin - redirect_to :action => 'search', :anchor => 'issues=' + params[:id] - end - - # GET /issues/bulk_change_form?[&criteria] - def bulk_change_form - access_denied unless logged_in? - - issues_query_params = criteria_params.clone.merge({'pageSize' => -1}) - # SONAR-4654 pagination parameters should be remove when loading issues for bulk change - issues_query_params.delete('pageIndex') - @issues = Internal.issues.execute(issues_query_params) - - @projectUuids = Set.new(@issues.map {|issue| issue.projectUuid()}) - @tags = Internal.issues.listTags() - - render :partial => 'issues/bulk_change_form' - end - - # POST /issues/bulk_change?criteria - def bulk_change - verify_post_request - Internal.issues.bulkChange(params, params[:comment], params[:sendNotifications] == 'true') - render :text => '', :status => 200 - end - - - private - - def criteria_params - new_params = params.clone - new_params.delete('controller') - new_params.delete('action') - new_params - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/landing_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/landing_controller.rb deleted file mode 100644 index 878e8669742..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/landing_controller.rb +++ /dev/null @@ -1,31 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2014 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -class LandingController < ApplicationController - - def index - if logged_in? - return redirect_to :controller => 'projects', :action => 'favorite' - else - return redirect_to :controller => 'about' - end - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/maintenance_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/maintenance_controller.rb deleted file mode 100644 index 3af7f4669c0..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/maintenance_controller.rb +++ /dev/null @@ -1,28 +0,0 @@ - # - # SonarQube, open source software quality management tool. - # Copyright (C) 2008-2016 SonarSource - # mailto:contact AT sonarsource DOT com - # - # SonarQube is free software; you can redistribute it and/or - # modify it under the terms of the GNU Lesser General Public - # License as published by the Free Software Foundation; either - # version 3 of the License, or (at your option) any later version. - # - # SonarQube is distributed in the hope that it will be useful, - # but WITHOUT ANY WARRANTY; without even the implied warranty of - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - # Lesser General Public License for more details. - # - # You should have received a copy of the GNU Lesser General Public License - # along with this program; if not, write to the Free Software Foundation, - # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - # -class MaintenanceController < ApplicationController - skip_before_filter :check_database_version, :check_authentication - - SECTION=Navigation::SECTION_CONFIGURATION - - def index - render :template => "maintenance/index", :layout => 'nonav' - end -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/markdown_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/markdown_controller.rb deleted file mode 100644 index 3aa931a541f..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/markdown_controller.rb +++ /dev/null @@ -1,32 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class MarkdownController < ApplicationController - - SECTION=Navigation::SECTION_CONFIGURATION - - # just for speed optimization... - skip_before_filter :check_database_version, :check_authentication - - def help - params[:layout] = 'false' - render :action => 'help' - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/metrics_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/metrics_controller.rb deleted file mode 100644 index 3c8fcc8dc01..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/metrics_controller.rb +++ /dev/null @@ -1,30 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class MetricsController < ApplicationController - - before_filter :admin_required - - SECTION=Navigation::SECTION_CONFIGURATION - - def index - - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/overview_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/overview_controller.rb deleted file mode 100644 index b0b19617e9b..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/overview_controller.rb +++ /dev/null @@ -1,29 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class OverviewController < ApplicationController - before_filter :init_resource_for_user_role - - SECTION=Navigation::SECTION_RESOURCE - - def index - redirect_to "#{ApplicationController.root_context}/dashboard/?id=#{url_encode(params[:id])}" - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/permission_templates_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/permission_templates_controller.rb deleted file mode 100644 index 792bafff85b..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/permission_templates_controller.rb +++ /dev/null @@ -1,29 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -class PermissionTemplatesController < ApplicationController - SECTION = Navigation::SECTION_CONFIGURATION - - before_filter :admin_required - - # GET - def index - end -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb deleted file mode 100644 index c450e4c68c0..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb +++ /dev/null @@ -1,64 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -class ProfilesController < ApplicationController - - def index - - end - - def show - render :action => 'index' - end - - def changelog - render :action => 'index' - end - - def compare - render :action => 'index' - end - - def create - render :action => 'index' - end - - # GET /profiles/export?name=<profile name>&language=<language>&format=<exporter key> - def export - language = params[:language] - if params[:name].blank? - profile = Internal.qprofile_service.getDefault(language) - else - profile = Internal.qprofile_loader.getByLangAndName(language, CGI::unescape(params[:name])) - end - not_found('Profile not found') unless profile - - if params[:format].blank? - # standard sonar format - result = Internal.qprofile_service.backup(profile.getKee()) - send_data(result, :type => 'text/xml', :disposition => 'inline') - else - exporter_key = params[:format] - result = Internal.qprofile_exporters.export(profile.getKee(), exporter_key) - send_data(result, :type => Internal.qprofile_exporters.mimeType(exporter_key), :disposition => 'inline') - end - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/project_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/project_controller.rb deleted file mode 100644 index 880e2ab2b09..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/project_controller.rb +++ /dev/null @@ -1,232 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class ProjectController < ApplicationController - - SECTION=Navigation::SECTION_RESOURCE - - def index - # this URL should not be called. Replaced by dashboard/index - redirect_to :overwrite_params => {:controller => :dashboard, :action => 'index'} - end - - def settings - @project = get_current_project(params[:id]) - end - - def deletion - @project = get_current_project(params[:id]) - end - - def quality_profiles - # since 6.1 - @project = Project.by_key(params[:id]) - not_found("Project not found") unless @project - access_denied unless (is_admin?(@project.uuid) || has_role?(:profileadmin)) - end - - def profile - # redirect to another url since 6.1 - redirect_to(url_for({:action => 'quality_profiles'}) + '?id=' + url_encode(params[:id])) - end - - def background_tasks - @project = get_current_project(params[:id]) - end - - def quality_gate - # since 6.1 - @project = get_current_project(params[:id]) - end - - def qualitygate - # redirect to another url since 6.1 - redirect_to(url_for({:action => 'quality_gate'}) + '?id=' + url_encode(params[:id])) - end - - def links - @project = get_current_project(params[:id]) - end - - def key - @project = get_current_project(params[:id]) - end - - def history - @project = get_current_project(params[:id]) - - unless java_facade.getResourceTypeBooleanProperty(@project.qualifier, 'modifiable_history') - redirect_to :action => 'index', :id => params[:id] - end - - @snapshot = @project.last_analysis - @analyses = Snapshot.all(:conditions => ["status='P' AND component_uuid=?", @project.uuid], - :include => 'events', :order => 'snapshots.created_at DESC') - end - - def update_version - snapshot=Snapshot.find(params[:sid], :include => 'project') - not_found("Snapshot not found") unless snapshot - access_denied unless is_admin?(snapshot) - - unless params[:version_name].blank? - if Event.already_exists(snapshot.component_uuid, params[:version_name], EventCategory::KEY_VERSION) - flash[:error] = message('project_history.version_already_exists', :params => h(params[:version_name])) - else - # We update the snapshot to have a version attribute in sync with the new name - snapshot.version = params[:version_name] - snapshot.save! - # And then we update/create the event on the snapshot - if snapshot.event(EventCategory::KEY_VERSION) - # This is an update: we update the event - Event.update_all({:name => params[:version_name]}, - ["category = ? AND analysis_uuid = ?", EventCategory::KEY_VERSION, snapshot.uuid]) - flash[:notice] = message('project_history.version_updated', :params => h(params[:version_name])) - else - # We create an event on the snapshot - event = Event.create!(:name => params[:version_name], :snapshot => snapshot, - :component_uuid => snapshot.project.uuid, :category => EventCategory::KEY_VERSION, - :event_date => snapshot.created_at) - flash[:notice] = message('project_history.version_created', :params => h(params[:version_name])) - end - end - end - - redirect_to :action => 'history', :id => snapshot.project.id - end - - def delete_version - parent_snapshot=Snapshot.find(params[:sid]) - not_found("Snapshot not found") unless parent_snapshot - access_denied unless is_admin?(parent_snapshot) - - # We update all the related snapshots to have the same version as the next snapshot - next_snapshot = Snapshot.find(:first, :conditions => ['created_at>? and component_uuid=?', parent_snapshot.created_at_long, parent_snapshot.component_uuid], :order => 'created_at asc') - parent_snapshot.version = next_snapshot.version - parent_snapshot.save! - - # and we delete the events - event = parent_snapshot.event(EventCategory::KEY_VERSION) - old_version_name = event.name - events = find_events(event) - - Event.transaction do - events.map { |e| e.id }.each_slice(999) do |safe_for_oracle_ids| - Event.delete(safe_for_oracle_ids) - end - end - - flash[:notice] = message('project_history.version_removed', :params => h(old_version_name)) - redirect_to :action => 'history', :id => parent_snapshot.project.id - end - - def create_event - snapshot=Snapshot.find(params[:sid]) - not_found("Snapshot not found") unless snapshot - access_denied unless is_admin?(snapshot) - - if Event.already_exists(snapshot.component_uuid, params[:event_name], EventCategory::KEY_OTHER) - flash[:error] = message('project_history.event_already_exists', :params => h(params[:event_name])) - else - e = Event.new({:name => params[:event_name], - :category => EventCategory::KEY_OTHER, - :snapshot => snapshot, - :component_uuid => snapshot.project.uuid, - :event_date => snapshot.created_at}) - e.save! - flash[:notice] = message('project_history.event_created', :params => h(params[:event_name])) - end - - redirect_to :action => 'history', :id => snapshot.project.id - end - - def update_event - event = Event.find(params[:id]) - not_found("Event not found") unless event - access_denied unless is_admin?(event.resource) - - if Event.already_exists(event.component_uuid, params[:event_name], EventCategory::KEY_OTHER) - flash[:error] = message('project_history.event_already_exists', :params => h(event.name)) - else - events = find_events(event) - events.each do |e| - e.name = params[:event_name] - e.save! - end - flash[:notice] = message('project_history.event_updated') - end - - redirect_to :action => 'history', :id => event.resource.id - end - - def delete_event - event = Event.find(params[:id]) - not_found("Event not found") unless event - access_denied unless is_admin?(event.resource) - - name = event.name - resource_id = event.resource.id - events = find_events(event) - Event.transaction do - events.map { |e| e.id }.each_slice(999) do |safe_for_oracle_ids| - Event.delete(safe_for_oracle_ids) - end - end - - flash[:notice] = message('project_history.event_deleted', :params => h(name)) - redirect_to :action => 'history', :id => resource_id - end - - def delete_snapshot_history - @project = get_current_project(params[:id]) - - sid = params[:snapshot_id] - if sid - Snapshot.update_all("status='U'", ["id=?", sid.to_i]) - flash[:notice] = message('project_history.snapshot_deleted') - end - - redirect_to :action => 'history', :id => @project.id - end - - protected - - def get_current_project(project_id) - project=Project.by_key(project_id) - not_found("Project not found") unless project - access_denied unless is_admin?(project) - project - end - - # Returns all an array that contains the given event + all the events that are the same - def find_events(event) - events = [] - name = event.name - category = event.category - event.snapshot.events.reject { |e| e.name!=name || e.category!=category }.each do |event| - events << event - end - events - end - - def redirect_to_default - redirect_to home_path - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/project_roles_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/project_roles_controller.rb deleted file mode 100644 index 1e543b5ce19..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/project_roles_controller.rb +++ /dev/null @@ -1,29 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class ProjectRolesController < ApplicationController - - SECTION=Navigation::SECTION_RESOURCE - - def index - @project = Project.by_key(params[:id]) - access_denied unless is_admin? || is_admin?(@project) - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/projects_admin_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/projects_admin_controller.rb deleted file mode 100644 index 27d848d7f2e..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/projects_admin_controller.rb +++ /dev/null @@ -1,30 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class ProjectsAdminController < ApplicationController - - before_filter :admin_required - - SECTION=Navigation::SECTION_CONFIGURATION - - def index - - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/projects_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/projects_controller.rb deleted file mode 100644 index b73c013b73a..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/projects_controller.rb +++ /dev/null @@ -1,30 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class ProjectsController < ApplicationController - - def index - - end - - def favorite - render :action => 'index' - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/property_sets_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/property_sets_controller.rb deleted file mode 100644 index e336e5d91a8..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/property_sets_controller.rb +++ /dev/null @@ -1,30 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class PropertySetsController < ApplicationController - - SECTION=Navigation::SECTION_CONFIGURATION - before_filter :admin_required - - def index - @property_sets = java_facade.listPropertySets() - render :partial => 'property_sets/list' - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/quality_gates_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/quality_gates_controller.rb deleted file mode 100644 index e07fcaae434..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/quality_gates_controller.rb +++ /dev/null @@ -1,30 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -class QualityGatesController < ApplicationController - - SECTION=Navigation::SECTION_QUALITY_GATES - - # GET /quality_gates/index - def index - - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb deleted file mode 100644 index 0f6403aab55..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb +++ /dev/null @@ -1,40 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -class ResourceController < ApplicationController - - SECTION=Navigation::SECTION_RESOURCE - - # DO NOT REMOVE - used by eclipse plugin - def index - require_parameters 'id' - - component_key = params[:id] - if Api::Utils.is_number?(component_key) - component=Project.by_key(component_key) - not_found unless component - access_denied unless has_role?(:user, component) - component_key = component.key - end - - redirect_to url_for(:controller => 'component', :action => 'index', :id => component_key) - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb deleted file mode 100644 index 3775accd86f..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb +++ /dev/null @@ -1,29 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class RolesController < ApplicationController - - SECTION=Navigation::SECTION_CONFIGURATION - - before_filter :admin_required - - # GET /roles/global - def global - end -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb deleted file mode 100644 index 4333b514349..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb +++ /dev/null @@ -1,32 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -require 'java' - -class RulesConfigurationController < ApplicationController - - SECTION=Navigation::SECTION_QUALITY_PROFILES - - # deprecated since 2.3 - def export - redirect_to request.query_parameters.merge({:controller => 'profiles', :action => 'export'}) - end - - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/rules_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/rules_controller.rb deleted file mode 100644 index 1415bfb39ec..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/rules_controller.rb +++ /dev/null @@ -1,40 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -require "erb" -include ERB::Util - -class RulesController < ApplicationController - - SECTION=Navigation::SECTION_CONFIGURATION - - # GET /rules/show/<key> - # This URL is used by the Eclipse plugin - # - # Example: GET /rules/show/squid:AvoidCycles - # - def show - require_parameters :id - - # the redirect is needed for the backward compatibility with eclipse plugin - url = url_for :controller => 'coding_rules', :action => 'index' - url = url + '#rule_key=' + url_encode(params[:id]) - redirect_to url - end -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/sessions_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/sessions_controller.rb deleted file mode 100644 index 4a302c34573..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/sessions_controller.rb +++ /dev/null @@ -1,66 +0,0 @@ - # - # SonarQube, open source software quality management tool. - # Copyright (C) 2008-2016 SonarSource - # mailto:contact AT sonarsource DOT com - # - # SonarQube is free software; you can redistribute it and/or - # modify it under the terms of the GNU Lesser General Public - # License as published by the Free Software Foundation; either - # version 3 of the License, or (at your option) any later version. - # - # SonarQube is distributed in the hope that it will be useful, - # but WITHOUT ANY WARRANTY; without even the implied warranty of - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - # Lesser General Public License for more details. - # - # You should have received a copy of the GNU Lesser General Public License - # along with this program; if not, write to the Free Software Foundation, - # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - # - -### Sessions Controller from restful_authentication (http://agilewebdevelopment.com/plugins/restful_authentication) -class SessionsController < ApplicationController - - layout 'nonav' - skip_before_filter :check_authentication - - def login - redirect_to :action => 'new' - end - - def logout - if logged_in? - self.current_user.on_logout - end - cookies.delete 'JWT-SESSION' - cookies.delete 'XSRF-TOKEN' - redirect_to(home_path) - end - - def new - default = home_url - if params[:return_to] - # user clicked on the link "login" : redirect to the original uri after authentication - default = Api::Utils.absolute_to_relative_url(params[:return_to]) - # else the original uri can be set by ApplicationController#access_denied - end - @return_to = get_redirect_back_or_default(default) - end - - private - - # Get redirection to the URI stored by the most recent store_location call or to the passed default. - def get_redirect_back_or_default(default) - # Prevent CSRF attack -> do not accept absolute urls - url = get_cookie_flash('return_to') || default - begin - url = URI(url).request_uri - rescue - url - end - anchor=params[:return_to_anchor] - url += anchor if anchor && anchor.start_with?('#') - url - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/settings_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/settings_controller.rb deleted file mode 100644 index dcc132c323f..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/settings_controller.rb +++ /dev/null @@ -1,39 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class SettingsController < ApplicationController - SECTION=Navigation::SECTION_CONFIGURATION - before_filter :admin_required - - def index - - end - - def licenses - render :action => 'index' - end - - def encryption - render :action => 'index' - end - - def server_id - render :action => 'index' - end -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/setup_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/setup_controller.rb deleted file mode 100644 index 20643ada37e..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/setup_controller.rb +++ /dev/null @@ -1,29 +0,0 @@ - # - # SonarQube, open source software quality management tool. - # Copyright (C) 2008-2016 SonarSource - # mailto:contact AT sonarsource DOT com - # - # SonarQube is free software; you can redistribute it and/or - # modify it under the terms of the GNU Lesser General Public - # License as published by the Free Software Foundation; either - # version 3 of the License, or (at your option) any later version. - # - # SonarQube is distributed in the hope that it will be useful, - # but WITHOUT ANY WARRANTY; without even the implied warranty of - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - # Lesser General Public License for more details. - # - # You should have received a copy of the GNU Lesser General Public License - # along with this program; if not, write to the Free Software Foundation, - # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - # -class SetupController < ApplicationController - skip_before_filter :check_database_version, :check_authentication - - SECTION=Navigation::SECTION_CONFIGURATION - - def index - render :template => 'setup/index', :layout => 'nonav' - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/system_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/system_controller.rb deleted file mode 100644 index a64db082d44..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/system_controller.rb +++ /dev/null @@ -1,29 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class SystemController < ApplicationController - - SECTION=Navigation::SECTION_CONFIGURATION - before_filter :admin_required - - def index - - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/updatecenter_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/updatecenter_controller.rb deleted file mode 100644 index 53bd57da3c7..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/updatecenter_controller.rb +++ /dev/null @@ -1,44 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class UpdatecenterController < ApplicationController - - SECTION=Navigation::SECTION_CONFIGURATION - before_filter :admin_required - - def index - - end - - def installed - render :action => 'index' - end - - def updates - render :action => 'index' - end - - def available - render :action => 'index' - end - - def system - render :action => 'index' - end -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/users_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/users_controller.rb deleted file mode 100644 index 455588d67fd..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/users_controller.rb +++ /dev/null @@ -1,64 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -### Users Controller from restful_authentication (http://agilewebdevelopment.com/plugins/restful_authentication) -class UsersController < ApplicationController - - SECTION=Navigation::SECTION_CONFIGURATION - before_filter :admin_required, :except => ['new', 'signup', 'autocomplete'] - skip_before_filter :check_authentication, :only => ['new', 'signup', 'autocomplete'] - - def signup - access_denied unless request.post? && Property.value('sonar.allowUsersToSignUp')=='true' - - @user=prepare_user - if @user.save - Internal.users_api.index() - @user.notify_creation_handlers - flash[:notice] = 'Please log in now.' - redirect_to home_url - else - render :action => 'new', :layout => 'nonav' - end - end - - def index - - end - - def new - render :action => 'new', :layout => 'nonav' - end - - - private - - def prepare_user - user = User.new(params[:user]) - user.external_identity = user.login - user.external_identity_provider = 'sonarqube' - user.user_local = true - user.is_root = false - default_group_name=java_facade.getSettings().getString('sonar.defaultGroup') - default_group=Group.find_by_name(default_group_name) - user.groups<<default_group if default_group - user - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/view_projects_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/view_projects_controller.rb deleted file mode 100644 index a77589144d4..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/view_projects_controller.rb +++ /dev/null @@ -1,29 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class ViewProjectsController < ApplicationController - before_filter :init_resource_for_user_role - - SECTION=Navigation::SECTION_RESOURCE - - def index - - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/web_api_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/web_api_controller.rb deleted file mode 100644 index 2394874ca93..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/web_api_controller.rb +++ /dev/null @@ -1,28 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2016 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -class WebApiController < ApplicationController - - def index - # Fix a very strange bug that generates a server error when the format parameter is set - params[:format] = nil if params[:format] - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/about/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/about/index.html.erb deleted file mode 100644 index 7b618242ab9..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/about/index.html.erb +++ /dev/null @@ -1,18 +0,0 @@ -<% content_for :extra_script do %> - <script> - window.sonarqube.signUpAllowed = <%= Property.value("sonar.allowUsersToSignUp") == "true" ? "true" : "false" -%>; - window.sonarqube.landingText = '<%= escape_javascript configuration("sonar.lf.aboutText", "") -%>'; - - <% auth_providers = Api::Utils.java_facade.getIdentityProviders().to_a %> - window.sonarqube.authProviders = [ - <% auth_providers.each do |provider| %> - { - key: '<%= provider.getKey().to_s %>', - name: '<%= provider.getName().to_s -%>', - iconPath: '<%= provider.getDisplay().getIconPath().to_s -%>', - backgroundColor: '<%= provider.getDisplay().getBackgroundColor().to_s -%>' - }, - <% end %> - ]; - </script> -<% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/_favorites.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/_favorites.html.erb deleted file mode 100644 index e0f6c2f658f..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/_favorites.html.erb +++ /dev/null @@ -1,24 +0,0 @@ -<% max_favorites = 5 %> - -<h2 class="spacer-bottom"><%= message('my_profile.favorites.title') -%></h2> -<table class="data js-account-favorites"> - <% current_user.favourites.each_with_index do |f, index | %> - <tr <% if index >= max_favorites %>class="hidden"<% end %>> - <td class="thin"><%= link_to_favourite f -%></td> - <td> - <% - url = ApplicationController.root_context + '/dashboard?id=' + url_encode(f.key) - %> - <a href="<%= url -%>" class="link-with-icon"> - <%= qualifier_icon f %> - <span><%= h f.name -%></span> - </a> - </td> - </tr> - <% end %> -</table> -<% if current_user.favourites.size > max_favorites %> -<div class="spacer-top little-spacer-left"> - <a class="js-show-all-favorites" href="#">Show All</a> -</div> -<% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/_global_notifications.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/_global_notifications.html.erb deleted file mode 100644 index 2d2b66ce8a9..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/_global_notifications.html.erb +++ /dev/null @@ -1,31 +0,0 @@ -<h2 class="spacer-bottom"><%= message('my_profile.overall_notifications.title') -%></h2> - -<p class="spacer-bottom"><%= message('notification.dispatcher.information') -%></p> - -<table class="form"> - <thead> - <tr> - <th></th> - <% for channel in @channels %> - <th class="text-center"><%= message('notification.channel.' + channel.getKey()) -%></th> - <% end %> - </tr> - </thead> - <tbody> - <% for dispatcher in @global_dispatchers %> - <tr> - <td><%= message('notification.dispatcher.' + dispatcher) -%></td> - <% - for channel in @channels - notification_id = dispatcher + '.' + channel.getKey() - check_box_id = 'global_notifs[' + notification_id + ']' - check_box_checked = @global_notifications[notification_id] - %> - <td class="text-center"> - <%= check_box_tag check_box_id, 'true', check_box_checked %> - </td> - <% end %> - </tr> - <% end %> - </tbody> -</table> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/_per_project_notifications.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/_per_project_notifications.html.erb deleted file mode 100644 index a05956318dd..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/_per_project_notifications.html.erb +++ /dev/null @@ -1,57 +0,0 @@ -<h2 class="spacer-bottom"><%= message('my_profile.per_project_notifications.title') -%></h2> - -<% @per_project_notifications.each do |r_id, per_project_notif| %> - <div class="spacer-bottom js-project" data-project-id="<%= r_id -%>"> - <table class="form"> - <thead> - <tr> - <th> - <a class="spacer-right icon-delete js-delete-project" href="#"></a> - <h3 class="display-inline-block"><%= Project.by_key(r_id).name -%></h3> - </th> - <% for channel in @channels %> - <th class="text-center"><%= message('notification.channel.' + channel.getKey()) -%></th> - <% end %> - </tr> - </thead> - <tbody> - <% @per_project_dispatchers.each do |dispatcher| %> - <tr> - <td><%= message('notification.dispatcher.' + dispatcher) -%></td> - <% - for channel in @channels - check_box_id = 'project_notifs[' + r_id.to_s + '][' + dispatcher + '][' + channel.getKey() + ']' - check_box_checked = per_project_notif[dispatcher].include?(channel.getKey()) - %> - <td class="text-center"> - <%= check_box_tag check_box_id, 'true', check_box_checked %> - </td> - <% end %> - </tr> - <% end %> - </tbody> - </table> - </div> -<% end %> - -<div class="spacer-bottom"> - <%= resource_select_tag 'new_project', {:qualifiers => ['TRK'], :width => '250px', - :select2_options => {'placeholder' => "'" + message('my_profile.add_project') + "'"} - } -%> -</div> - -<script> - (function ($) { - $('#new_project').on('change', function (e) { - var id = $(e.currentTarget).val(); - if (id != null) { - $('#notif_form').submit(); - } - }); - - $('.js-delete-project').on('click', function (e) { - e.preventDefault(); - $(e.currentTarget).closest('[data-project-id]').remove(); - }); - })(window.jQuery); -</script> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/index.html.erb deleted file mode 100644 index c15f578952f..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/index.html.erb +++ /dev/null @@ -1,75 +0,0 @@ -<% content_for :extra_script do %> - <script> - window.sonarqube.notifications = { - channels: [ - <% for channel in @channels -%> - '<%= escape_javascript channel.getKey() -%>', - <% end %> - ], - - globalDispatchers: [ - <% for dispatcher in @global_dispatchers -%> - '<%= escape_javascript dispatcher -%>', - <% end %> - ], - - projectDispatchers: [ - <% for dispatcher in @per_project_dispatchers -%> - '<%= escape_javascript dispatcher -%>', - <% end %> - ], - - global: [ - <% for dispatcher in @global_dispatchers %> - { - dispatcher: '<%= escape_javascript dispatcher -%>', - channels: [ - <% - for channel in @channels - notification_id = dispatcher + '.' + channel.getKey() - check_box_checked = @global_notifications[notification_id] - -%> - { - id: '<%= escape_javascript channel.getKey() -%>', - checked: <%= check_box_checked ? 'true' : 'false' %> - }, - <% end %> - ] - }, - <% end %> - ], - - project: [ - <% @per_project_notifications.each do |project_key, notification| %> - <% project = Project.by_key(project_key) %> - { - project: { - internalId: <%= project.id -%>, - id: '<%= escape_javascript project.uuid -%>', - key: '<%= escape_javascript project.key -%>', - name: '<%= escape_javascript project.name -%>' - }, - notifications: [ - <% @per_project_dispatchers.each do |dispatcher| %> - { - dispatcher: '<%= escape_javascript dispatcher -%>', - channels: [ - <% - for channel in @channels - check_box_checked = notification[dispatcher].include?(channel.getKey()) - -%> - { - id: '<%= escape_javascript channel.getKey() -%>', - checked: <%= check_box_checked ? 'true' : 'false' %> - }, - <% end %> - ] - }, - <% end %> - ] - }, - <% end %> - ] - }; - </script> -<% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/api_documentation/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/api_documentation/index.html.erb deleted file mode 100644 index 3e12a98f45d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/api_documentation/index.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -<% content_for :extra_script do %> - <script> - window.sonarqube.urlRoot = window.baseUrl + '/web_api'; - </script> - <script src="<%= ApplicationController.root_context -%>/js/bundles/api-documentation.js?v=<%= sonar_version -%>"></script> -<% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/background_tasks/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/background_tasks/index.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/background_tasks/index.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/branding/_footer.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/branding/_footer.html.erb deleted file mode 100644 index 968b000588b..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/branding/_footer.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -<div> - This application is based on - <a href="http://www.sonarqube.org/" title="SonarQube™">SonarQube™</a> - but is <strong>not</strong> an official version provided by - <a href="http://www.sonarsource.com" title="SonarSource SA">SonarSource SA</a>. -</div> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/code/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/code/index.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/code/index.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/coding_rules/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/coding_rules/index.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/coding_rules/index.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/component/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/component/index.html.erb deleted file mode 100644 index aa8f970e11c..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/component/index.html.erb +++ /dev/null @@ -1,18 +0,0 @@ -<% content_for :extra_script do %> - <% if @resource %> - <script type="text/javascript"> - (function () { - window.sonarqube.el = '#body'; - window.sonarqube.file = { - uuid: '<%= @resource.uuid -%>', - key: '<%= @resource.key -%>' - <% if @line %>, line: <%= @line -%><% end %> - }; - })(); - </script> - <% end %> - <script src="<%= ApplicationController.root_context -%>/js/bundles/source-viewer.js?v=<%= sonar_version -%>"></script> -<% end %> - - - diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/component_issues/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/component_issues/index.html.erb deleted file mode 100644 index 6989a49b051..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/component_issues/index.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -<% content_for :extra_script do %> - <script> - (function () { - window.sonarqube.config = { - resource: '<%= escape_javascript @resource.uuid -%>', - resourceQualifier: '<%= escape_javascript @resource.qualifier -%>', - resourceName: '<%= escape_javascript @resource.name -%>', - periodDate: <% if @period %>'<%= escape_javascript @snapshot.period_datetime(@period) -%>'<% else %>null<% end %> - }; - })(); - </script> -<% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/component_measures/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/component_measures/index.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/component_measures/index.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/configuration/index.rhtml b/server/sonar-web/src/main/webapp/WEB-INF/app/views/configuration/index.rhtml deleted file mode 100644 index 53999f10bd6..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/configuration/index.rhtml +++ /dev/null @@ -1,4 +0,0 @@ -<div id='loading'><%= image_tag 'loading.gif' %> loading</div> -<div id="error" class="hidden">error</div> -<div id="main"></div> -<div id="sonarUrl" class="hidden"><%= url_for(:controller => '/', :action => '', :only_path => false, :trailing_slash => false)[0...-2] -%></div> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/confirm/_confirm.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/confirm/_confirm.html.erb deleted file mode 100644 index 64f47c4f522..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/confirm/_confirm.html.erb +++ /dev/null @@ -1,23 +0,0 @@ -<% - title_key = params[:tk] || 'confirm' - message_key = params[:mk] || 'are_you_sure' - message_params = params['mp'] || [] - button_key = params[:bk] || title_key -%> -<form id="confirm-form" method="post" action="<%= Api::Utils.absolute_to_relative_url(h(params[:url])) -%>"> - <fieldset> - <div class="modal-head"> - <h2><%= h message title_key -%></h2> - </div> - <div class="modal-body"> - <div class="info"> - <img src="<%= ApplicationController.root_context -%>/images/information.png" style="vertical-align: text-bottom"/> - <%= h message(message_key, :params => message_params) -%> - </div> - </div> - <div class="modal-foot"> - <input type="submit" value="<%= h message(button_key) -%>" id="confirm-submit"/> - <a href="#" onclick="return closeModalWindow()" id="confirm-cancel"><%= h message('cancel') -%></a> - </div> - </fieldset> -</form> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/custom_measures/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/custom_measures/index.html.erb deleted file mode 100644 index 6e435e85c27..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/custom_measures/index.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -<% content_for :extra_script do %> - <script> - window.sonarqube.projectId = '<%= @resource.uuid -%>'; - </script> -<% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/empty.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/empty.html.erb deleted file mode 100644 index f65e6d90e04..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/empty.html.erb +++ /dev/null @@ -1,11 +0,0 @@ -<div class="page"> - <% if @resource and !@snapshot %> - <div class="alert alert-warning"> - <%= h message('provisioning.no_analysis') -%> - </div> - <div className="big-spacer-top"> - <h4><%= h message('key') -%></h4> - <code><%= h @resource.key -%></code> - </div> - <% end %> -</div> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/no_dashboard.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/no_dashboard.html.erb deleted file mode 100644 index 6e88df08ff7..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/no_dashboard.html.erb +++ /dev/null @@ -1,13 +0,0 @@ -<% content_for :extra_script do %> - <script> - (function () { - jQuery('.navbar-context').remove(); - jQuery('.page-wrapper-context').addClass('page-wrapper-global').removeClass('page-wrapper-context'); - window.sonarqube.file = { - uuid: '<%= @resource.uuid -%>', - key: '<%= @resource.key -%>' - }; - })(); - </script> - <script src="<%= ApplicationController.root_context -%>/js/bundles/source-viewer.js?v=<%= sonar_version -%>"></script> -<% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/overview.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/overview.html.erb deleted file mode 100644 index 5ca6b6fba86..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/overview.html.erb +++ /dev/null @@ -1,83 +0,0 @@ -<% - links_size = @resource.project_links.size - - profiles = [] - if @snapshot - qprofiles_measure = @snapshot.measure(Metric::QUALITY_PROFILES) - if qprofiles_measure && !qprofiles_measure.data.blank? - profiles = JSON.parse qprofiles_measure.data - end - end - profiles_size = profiles.size - - is_gate_default = false - gate = nil - root = @resource.root_project - gate_id = Property.value('sonar.qualitygate', root.id, nil) - unless gate_id - gate_id=Property.value('sonar.qualitygate', nil, nil) - is_gate_default = false || gate_id - end - if gate_id - gate = Internal.quality_gates.get(gate_id.to_i) - end -%> - -<% - if @snapshot - m = @snapshot.measure(Metric::QUALITY_GATE_DETAILS) - alert_status = @snapshot.measure(Metric::ALERT_STATUS) - if m && !m.data.blank? - details = JSON.parse m.data - m.alert_status = details['level'] - raw_conditions = details['conditions'] - conditions = [] - raw_conditions.each do |condition| - if !metric(condition['metric']).nil? - conditions << condition - end - end - end - end -%> - -<% content_for :extra_script do %> - <script> - (function () { - var component = { - id: '<%= escape_javascript @resource.uuid %>', - key: '<%= escape_javascript @resource.key %>', - description: '<%= escape_javascript @resource.description %>', - links: [ - <% @resource.project_links.sort.each_with_index do |link, index| %> - { - name: '<%= escape_javascript link.name -%>', - type: '<%= escape_javascript link.link_type -%>', - href: '<%= escape_javascript link.href -%>' - }<% if index < links_size - 1 %>, <% end -%> - <% end %> - ], - profiles: [ - <% profiles.each_with_index do |profile, index| %> - { - name: '<%= escape_javascript profile['name'] -%>', - key: '<%= escape_javascript profile['key']-%>', - language: '<%= escape_javascript Api::Utils.language_name(profile['language']) -%>' - }<% if index < profiles_size - 1 %>, <% end -%> - <% end %> - ], - <% if gate %> - gate: { - name: '<%= escape_javascript gate.getName() -%>', - key: <%= escape_javascript gate_id -%>, - isDefault: <%= is_gate_default -%> - } - <% end %> - }; - - window.sonarqube.overview = { - component: component - }; - })(); - </script> -<% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/index.html.erb deleted file mode 100644 index edbc0bf98e9..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/index.html.erb +++ /dev/null @@ -1,20 +0,0 @@ -<div class="page admin_page"> - <ul style="float: right" class="horizontal"> - <li class="marginleft10"> - <i class="icon-plus"></i> - <%= link_to message('create'), {:action => :create_form, :resource => (@resource.id if @resource)}, :id => "create-link-dashboard", :class => 'open-modal link-action' %> - </li> - </ul> - - <h1><%= message('dashboard.my_global_dashboards') -%></h1> - <%= render_partial :partial => 'my_dashboards', :locals => { :is_admin => is_admin? } %> - - <h1><%= message('dashboard.available_dashboards') -%></h1> - <%= render_partial :partial => 'available_dashboards', :locals => { :is_admin => is_admin? } %> -</div> - -<% if params[:highlight] %> -<script type="text/javascript"> - new Effect.Highlight('dashboard-<%= h params[:highlight] -%>', {duration: 2, startcolor: '#cae3f2'}); -</script> -<% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/drilldown/issues.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/drilldown/issues.html.erb deleted file mode 100644 index 375fb397e3c..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/drilldown/issues.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -<script> - var config = { - metric: null, - resource: '<%= @resource.uuid -%>', - resourceQualifier: '<%= @resource.qualifier -%>', - rule: <% if @rule %>'<%= @rule.key -%>'<% else %>null<% end %>, - severity: <% if @severity %>'<%= @severity -%>'<% else %>null<% end %>, - periodDate: <% if @period %>'<%= @snapshot.period_datetime(@period) -%>'<% else %>null<% end %> - }, - url = window.baseUrl + '/component_issues/index?id=<%= @resource.key -%>#resolved=false'; - if (config.rule) { - url = url + '|rules=' + config.rule; - } - if (config.severity) { - url = url + '|severities=' + config.severity; - } - if (config.periodDate) { - var createdAfter = moment(config.periodDate).format('YYYY-MM-DD'); - url = url + '|createdAfter=' + createdAfter; - } - window.location = url; -</script> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/email_configuration/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/email_configuration/index.html.erb deleted file mode 100644 index 76265ab1097..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/email_configuration/index.html.erb +++ /dev/null @@ -1,94 +0,0 @@ -<form method="post" action="<%= ApplicationController.root_context -%>/email_configuration/save" class="marginbottom10"> - <table class="marginbottom10"> - <tbody> - <tr class="property"> - <th><label for="smtp_host"><h3><%= message('email_configuration.smtp_host') -%></h3></label></th> - <td> - <%= text_field_tag 'smtp_host', @smtp_host %> - <p class="marginbottom10"><%= message('email_configuration.smtp_host.description') -%></p> - </td> - </tr> - <tr class="property"> - <th><label for="smtp_port"><h3><%= message('email_configuration.smtp_port') -%></h3></label></th> - <td> - <%= text_field_tag 'smtp_port', @smtp_port %> - <p class="marginbottom10"><%= message('email_configuration.smtp_port.description') -%></p> - </td> - </tr> - <tr class="property"> - <th><label for="smtp_secure_connection"><h3><%= message('email_configuration.smtp_secure_connection') -%></h3></label></th> - <td> - <%= select_tag 'smtp_secure_connection', options_for_select({'No' => '', 'SSL/TLS' => 'ssl', 'STARTTLS' => 'starttls'}, @smtp_secure_connection) %> - <p class="marginbottom10"><%= message('email_configuration.smtp_secure_connection.description') -%></p> - </td> - </tr> - <tr class="property"> - <th><label for="smtp_username"><h3><%= message('email_configuration.smtp_username') -%></h3></label></th> - <td> - <%= text_field_tag 'smtp_username', @smtp_username %> - <p class="marginbottom10"><%= message('email_configuration.smtp_username.description') -%></p> - </td> - </tr> - <tr class="property"> - <th><label for="smtp_password"><h3><%= message('email_configuration.smtp_password') -%></h3></label></th> - <td> - <% value = Property::EXISTING_PASSWORD unless @smtp_password.blank? %> - <%= password_field_tag 'smtp_password', value, {:autocomplete => 'off'} %> - <p class="marginbottom10"><%= message('email_configuration.smtp_password.description') -%></p> - </td> - </tr> - <tr class="property"> - <th><label for="email_from"><h3><%= message('email_configuration.from_address') -%></h3></label></th> - <td> - <%= text_field_tag 'email_from', @email_from %> - <p class="marginbottom10"><%= message('email_configuration.from_address.description') -%></p> - </td> - </tr> - <tr class="property"> - <th><label for="email_prefix"><h3><%= message('email_configuration.email_prefix') -%></h3></label></th> - <td> - <%= text_field_tag 'email_prefix', @email_prefix %> - <p class="marginbottom10"><%= message('email_configuration.email_prefix.description') -%></p> - </td> - </tr> - </tbody> - <tfoot> - <tr> - <td colspan="2"> - <%= submit_tag message('email_configuration.save_settings'), :disable_with => message('email_configuration.saving_settings'), :id => 'submit_save' %> - </td> - </tr> - </tfoot> - </table> -</form> - -<form method="post" action="<%= ApplicationController.root_context -%>/email_configuration/send_test_email"> - <table class="data marginbottom10"> - <thead> - <tr> - <th colspan="2"><span><%= message('email_configuration.test.title') -%></span></th> - </tr> - </thead> - <tfoot> - <tr> - <td colspan="2"> - <%= submit_tag message('email_configuration.test.send'), :disable_with => message('email_configuration.test.sending'), :id => 'submit_test' %> - </td> - </tr> - </tfoot> - <tbody> - <tr class="property"> - <th><label for="to_address"><h3><%= message('email_configuration.test.to_address') -%></h3></label></th> - <td><%= text_field_tag 'to_address', current_user.email %></td> - </tr> - <tr class="property"> - <th><label for="subject"><h3><%= message('email_configuration.test.subject') -%></h3></label></th> - <td><%= text_field_tag 'subject', message('email_configuration.test.subject_text') %></td> - </tr> - <tr class="property"> - <th><label for="message"><h3><%= message('email_configuration.test.message') -%></h3></label></th> - <td><%= text_area_tag 'message', message('email_configuration.test.message_text') + ' ' + @server_base_url, {:cols => 40, :rows => 6} %></td> - </tr> - </tbody> - </table> -</form> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/groups/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/groups/index.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/groups/index.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_bulk_change_form.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_bulk_change_form.html.erb deleted file mode 100644 index 1d209e79cf9..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_bulk_change_form.html.erb +++ /dev/null @@ -1,177 +0,0 @@ -<% - project_uuid = @projectUuids.to_a.first if !@projectUuids.empty? && @projectUuids.to_a.size == 1 - project_key = Internal.component_api.findByUuid(project_uuid).key() if project_uuid - max_page_size_reached = @issues.size >= Internal.issues.maxPageSize() - - transitions_by_issues = {} - unresolved_issues = 0 - unresolved_issues_user_can_admin = 0 - at_least_one_issue_is_assigned = false - all_issues_are_assigned_to_current_user = true - @issues.each do |issue| - transitions = Internal.issues.listTransitions(issue) - transitions.each do |transition| - issues_for_transition = transitions_by_issues[transition.key] || 0 - issues_for_transition += 1 - transitions_by_issues[transition.key] = issues_for_transition - end - unresolved_issues += 1 unless issue.resolution() - if Internal.issues.isUserIssueAdmin(issue.projectUuid) - unresolved_issues_user_can_admin += 1 unless issue.resolution() - end - at_least_one_issue_is_assigned ||= issue.assignee() - all_issues_are_assigned_to_current_user &&= issue.assignee() == current_user.login - end -%> -<form id="bulk-change-form" method="post" action="<%= ApplicationController.root_context -%>/issues/bulk_change"> - <input type="hidden" name="issues" value="<%= @issues.map { |issue| issue.key() }.join(',') -%>"> - <input type="hidden" name="actions[]" id="bulk-change-transition-action"> - <fieldset> - <div class="modal-head"> - <h2><%= message('issue_bulk_change.form.title', {:params => @issues.size.to_s}) -%></h2> - </div> - <div class="modal-body"> - <div> - <% if max_page_size_reached %> - <p class="notes"><%= message('issue_bulk_change.max_issues_reached', :params => @issues.size) -%></p> - <% end %> - </div> - <div class="modal-error"/> - - <% if unresolved_issues > 0 %> - <div class="modal-field"> - <label for="assignee"> - <%= message('issue.assign.formlink') -%> - </label> - <input id="assign-action" name="actions[]" type="checkbox" value="assign"/> - <%= assign_added_choices = {} - # SONAR-4728 Display 'Not assigned' option only if at least one issue is assigned - assign_added_choices[''] = escape_javascript(message('unassigned')) if at_least_one_issue_is_assigned - # SONAR-4728 Display 'Assign to me' option only if not not all issues are asigned to current user - assign_added_choices[current_user.login] = escape_javascript(message('assigned_to_me')) unless all_issues_are_assigned_to_current_user - user_select_tag('assign.assignee', :html_id => 'assignee', :open => false, :selected_user => current_user, - :include_choices => assign_added_choices) - -%> - <span style="float:right" class="note">(<%= message('issue_bulk_change.x_issues', :params => unresolved_issues.to_s) -%>)</span> - </div> - - <% - type_options = [ - [message('issue.type.BUG'), 'BUG'], - [message('issue.type.VULNERABILITY'), 'VULNERABILITY'], - [message('issue.type.CODE_SMELL'), 'CODE_SMELL'] - ] - type_options = options_for_select(type_options, 'BUG') - %> - <div class="modal-field"> - <label for="type"> - <%= message('issue.set_type') -%> - </label> - <input id="set-type-action" name="actions[]" type="checkbox" value="set_type"/> - <%= dropdown_tag('set_type.type', type_options, {:show_search_box => false}, {:id => 'type'}) -%> - <span style="float:right" class="note">(<%= message('issue_bulk_change.x_issues', :params => unresolved_issues_user_can_admin.to_s) -%>)</span> - </div> - - <div class="modal-field"> - <label for="severity"> - <%= message('issue.set_severity') -%> - </label> - <input id="set-severity-action" name="actions[]" type="checkbox" value="set_severity"/> - <%= severity_dropdown_tag('set_severity.severity', severitiy_select_option_tags, {:show_search_box => false}, - {:id => 'severity'}) -%> - <span style="float:right" class="note">(<%= message('issue_bulk_change.x_issues', :params => unresolved_issues_user_can_admin.to_s) -%>)</span> - </div> - - <div class="modal-field"> - <label for="add_tags"> - <%= message('issue.add_tags') -%> - </label> - <input id="add-tags-action" name="actions[]" type="checkbox" value="add_tags"/> - - <input id="add_tags" name="add_tags.tags" type="text"/> - <span style="float:right" class="note">(<%= message('issue_bulk_change.x_issues', :params => unresolved_issues.to_s) -%>)</span> - </div> - - <div class="modal-field"> - <label for="remove_tags"> - <%= message('issue.remove_tags') -%> - </label> - <input id="remove-tags-action" name="actions[]" type="checkbox" value="remove_tags"/> - - <input id="remove_tags" name="remove_tags.tags" type="text"/> - <span style="float:right" class="note">(<%= message('issue_bulk_change.x_issues', :params => unresolved_issues.to_s) -%>)</span> - </div> - <% end %> - - <% if transitions_by_issues.size > 0 %> - <div class="modal-field"> - <label> - <%= message('issue.transition') -%> - </label> - <% transitions_by_issues.keys.sort.each do |transition| %> - <input type="radio" id="transition-<%= transition -%>" name="do_transition.transition" value="<%= transition -%>" - onClick="addTransitionAction();"> <label for="transition-<%= transition -%>" style="float: none; display: inline; left: 0; cursor: pointer;"><%= message("issue.transition.#{transition}") -%></label> - <span style="float:right" class="note">(<%= message('issue_bulk_change.x_issues', :params => transitions_by_issues[transition].to_s) %>)</span><br/> - <% end %> - </div> - <% end %> - - <div class="modal-field"> - <label> - <%= message('issue.comment.formlink') -%> - <span style="cursor: help;"><%= image_tag 'help.png', :title => h(message('issue_bulk_change.comment.help')) -%></span> - </label> - <div style="padding: 0 10px 10px 0;"> - <div> - <textarea rows="4" name="comment" id="comment" style="width: 100%"></textarea> - </div> - <div style="float:right"> - <%= render :partial => 'markdown/tips' -%> - </div> - </div> - </div> - - <div class="modal-field"> - <label for="send-notifications"> - <%= message('issue.send_notifications') -%> - </label> - <input id="send-notifications" name="sendNotifications" type="checkbox" value="true" /> - </div> - </div> - <div class="modal-foot"> - <span id="bulk-change-loading-image" class="loading-image hidden"><%= image_tag 'loading.gif' %></span> - <input type="submit" value="<%= message('apply') -%>" id="bulk-change-submit" class="bulk-change" onclick="return displayLoadingImage()" /> - <a href="#" onclick="return closeModalWindow()" id="bulk-change-cancel"><%= message('cancel') -%></a> - </div> - </fieldset> -</form> -<script> - $j("#bulk-change-form").modalForm({ - success: function () { - onBulkIssues(<%= json_escape(params.to_json) -%>); - } - }); - - function addTransitionAction() { - $j('#bulk-change-transition-action').val("do_transition"); - } - - function displayLoadingImage() { - $j('#bulk-change-loading-image').removeClass("hidden"); - } - - function check(id){ - $j('#'+ id).prop('checked', true); - } - - /** - * Attach some events on select boxes to automatically select associate check box when selecting an option - */ - $j('#assignee').click(function() { check('assign-action'); }); - $j('#severity').click(function() { check('set-severity-action'); }); - $j('#type').click(function() { check('set-type-action'); }); - $j('#add_tags').select2({tags: [ '<%= @tags.join("', '") -%>' ], width: '250px' }); - $j('#add_tags').click(function() { check('add-tags-action'); }); - $j('#remove_tags').select2({tags: [ '<%= @tags.join("', '") -%>' ], width: '250px' }); - $j('#remove_tags').click(function() { check('remove-tags-action'); }); -</script> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/index.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/index.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_footer.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_footer.html.erb deleted file mode 100644 index e4ff4db0048..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_footer.html.erb +++ /dev/null @@ -1,31 +0,0 @@ -<!--[if lte IE 7 ]> -<div style="position:fixed;z-index:99999;top:0;bottom:0;left:0;right:0;background:#fff;"> - <div style="margin-top:150px;text-align:center;line-height:1.4;color:#333;"> - The web interface cannot be displayed because your browser is not supported.<br> - Please switch to a <a target="_blank" - href="http://redirect.sonarsource.com/doc/requirements.html">supported version or another supported browser</a>. - </div> -</div> -<!--<![endif]--> - -<% if cookies['flash'] %> - <script> - var data = JSON.parse('<%= escape_javascript cookies['flash'] -%>'); - if (data['notice']) { - info(data['notice']); - } - if (data['warning']) { - warning(data['warning']); - } - if (data['error']) { - error(data['error']); - } - </script> -<% end %> -<% cookies.delete 'flash' %> - -<script src="<%= ApplicationController.root_context -%>/js/bundles/app.js?v=<%= sonar_version -%>"></script> -<%= yield :extra_script -%> - -</body> -</html> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_head.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_head.html.erb deleted file mode 100644 index afd65ce9196..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_head.html.erb +++ /dev/null @@ -1,47 +0,0 @@ -<!DOCTYPE html> -<!--[if IE 9 ]> <html class="ie9"> <![endif]--> -<!--[if (gt IE 9)|!(IE)]><!--> <html> <!--<![endif]--> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <link rel="shortcut icon" type="image/x-icon" href="<%= image_path('favicon.ico') -%>"> - <% - if @page_title - title="SonarQube - #{h(@page_title)}" - elsif @project - title="SonarQube - #{h(@project.name)}" - elsif @resource - title="#{h(@resource.long_name)}" - else - title='SonarQube' - end - %> - <title><%= title -%></title> - - <link href="<%= ApplicationController.root_context -%>/css/sonar.css?v=<%= sonar_version -%>" rel="stylesheet" media="all"> - <%= yield :style -%> - - <script> - var pageLang = '<%= I18n.locale.to_s.gsub(/-/, '_') -%>'; - <%# The two lines below mean that before full removal of Rails, we have to find a way to handle config properties %> - window.SS = { - hoursInDay: <%= configuration('sonar.technicalDebt.hoursInDay', 8) %>, - user: '<%= escape_javascript current_user.login if logged_in? -%>', - userName: '<%= escape_javascript current_user.name if logged_in? -%>', - userEmail: '<%= escape_javascript current_user.email if logged_in? -%>', - lf: { - enableGravatar: <%= configuration('sonar.lf.enableGravatar', true) %>, - gravatarServerUrl: '<%= configuration('sonar.lf.gravatarServerUrl') %>' - }, - updateCenterActive: <%= configuration('sonar.updatecenter.activate', true) %>, - 'sonar.technicalDebt.ratingGrid': '<%= configuration('sonar.technicalDebt.ratingGrid', "0.05,0.1,0.2,0.5") %>' - }; - </script> - <script src="<%= ApplicationController.root_context -%>/js/bundles/vendor.js?v=<%= sonar_version -%>"></script> - <script src="<%= ApplicationController.root_context -%>/js/bundles/sonar.js?v=<%= sonar_version -%>"></script> - <script> - window.baseUrl = '<%= ApplicationController.root_context -%>'; - </script> - <%= yield :script -%> -</head> -<body> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_iframe.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_iframe.html.erb deleted file mode 100644 index 5cc1498a0db..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_iframe.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -<div id="body" class="nolayout"> - <% if @snapshot %><div class="print"><h2><%= h @snapshot.project.name(true) %></h2></div><% end %> - <div class="error" id="error" style="display:none"><span id="errormsg"></span> [<a href="#" onclick="javascript:$j('#error').hide();return false;"><%= message('hide').downcase -%></a>]</div> - <div class="warning" id="warning" style="display:none"><span id="warningmsg"></span> [<a href="#" onclick="javascript:$j('#warning').hide();return false;"><%= message('hide').downcase -%></a>]</div> - <div class="notice" id="info" style="display:none"><span id="infomsg"></span> [<a href="#" onclick="javascript:$j('#info').hide();return false;"><%= message('hide').downcase -%></a>]</div> - <%= yield %> -</div>
\ No newline at end of file diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb deleted file mode 100644 index c723423852b..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb +++ /dev/null @@ -1,64 +0,0 @@ -<% - selected_section = controller.class::SECTION if defined?(controller.class::SECTION) - if selected_section==Navigation::SECTION_RESOURCE && !@project && !@resource - selected_section = Navigation::SECTION_HOME - end - @project=@resource unless @project || selected_section==Navigation::SECTION_HOME - has_context_nav = selected_section==Navigation::SECTION_RESOURCE || selected_section==Navigation::SECTION_CONFIGURATION - period_param = "period=#{u(params[:period])}" if params[:period] -%> -<div class="page-wrapper <% if has_context_nav %>page-wrapper-context<% else %>page-wrapper-global<% end %>" id="container"> - <nav class="navbar navbar-global page-container" id="global-navigation"></nav> - - <% if has_context_nav %> - <nav class="navbar navbar-context page-container" id="context-navigation"></nav> - <% end %> - - <%= yield :header -%> - - <div id="body" class="page-container"> - <div id="content"> - <div class="panel hidden" id="messages-panel"> - <div class="alert alert-danger hidden" id="error"> - <span id="errormsg"></span> [<a href="#" onclick="return hideError();"><%= message('hide').downcase -%></a>] - </div> - <div class="alert alert-info hidden" id="info"> - <span id="infomsg"></span> [<a href="#" onclick="return hideInfo();"><%= message('hide').downcase -%></a>] - </div> - <div class="alert alert-warning hidden" id="warning"> - <span id="warningmsg"></span> [<a href="#" onclick="return hideWarning();"><%= message('hide').downcase -%></a>] - </div> - </div> - <%= yield %> - </div> - </div> -</div> - -<% unless params[:hd]=='false' %> - <%= yield :footer %> - <div id="footer" class="page-footer page-container"> - <% controller.java_facade.getWebFooters().each do |footer| %> - <% if footer.getHtml() %> - <div><%= footer.getHtml().to_s %></div> - <% end %> - <% end %> - <% unless DatabaseVersion.production? %> - <div class="alert alert-danger"> - <p class="big" id="evaluation_warning">Embedded database should be used for evaluation purpose only</p> - <p>The embedded database will not scale, it will not support upgrading to newer versions of SonarQube, and there is no support for migrating your data out of it into a different database engine.</p> - </div> - <% end %> - <%= render 'branding/footer' -%> - <div> - Version <%= sonar_version -%> - - <a href="http://www.gnu.org/licenses/lgpl-3.0.txt" target="lgpl_v3">LGPL v3</a> - - <a href="http://www.sonarqube.org" target="sonar">Community</a> - - <a href="http://www.sonarqube.org/documentation" target="sonar_doc">Documentation</a> - - <a href="http://www.sonarqube.org/support" target="support">Get Support</a> - - <a href="http://redirect.sonarsource.com/doc/plugin-library.html" target="plugins">Plugins</a> - - <a href="<%= ApplicationController.root_context -%>/web_api">Web API</a> - - <a href="<%= ApplicationController.root_context -%>/about">About</a> - </div> - <!--[if lte IE 8 ]><p class="spacer-top alert alert-danger">IE 8 is not supported. Some widgets may not be properly displayed. Please switch to a <a target="_blank" href="http://redirect.sonarsource.com/doc/requirements.html">supported version or another supported browser</a>.</p><!--<![endif]--> - </div> -<% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_navbar.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_navbar.html.erb deleted file mode 100644 index a99e21339f7..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_navbar.html.erb +++ /dev/null @@ -1,23 +0,0 @@ -<% - selected_section = controller.class::SECTION if defined?(controller.class::SECTION) - if selected_section == Navigation::SECTION_RESOURCE && !@project && !@resource - selected_section = Navigation::SECTION_HOME - end - - @project = @resource unless @project || selected_section == Navigation::SECTION_HOME -%> - -<script> - (function () { - <% if selected_section == Navigation::SECTION_RESOURCE %> - window.sonarqube.space = 'component'; - window.sonarqube.componentKey = '<%= escape_javascript @project.key -%>'; - <% end %> - - <% if selected_section == Navigation::SECTION_CONFIGURATION %> - window.sonarqube.space = 'settings'; - <% end %> - - window.SS.isUserAdmin = <%= logged_in? && is_admin? ? 'true' : 'false' -%>; - })(); -</script> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_nolayout.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_nolayout.html.erb deleted file mode 100644 index 2a7d0e94282..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_nolayout.html.erb +++ /dev/null @@ -1,17 +0,0 @@ -<div id="body" class="page"> - <% if @resource %> - <div class="print"><h2><%= h @resource.name(true) %></h2></div> - <% end %> - <div class="hidden" id="messages-panel"> - <div class="alert alert-danger hidden" id="error"> - <span id="errormsg"></span> [<a href="#" onclick="return hideError();"><%= message('hide').downcase -%></a>] - </div> - <div class="alert alert-info hidden" id="info"> - <span id="infomsg"></span> [<a href="#" onclick="return hideInfo();"><%= message('hide').downcase -%></a>] - </div> - <div class="alert alert-warning hidden" id="warning"> - <span id="warningmsg"></span> [<a href="#" onclick="return hideWarning();"><%= message('hide').downcase -%></a>] - </div> - </div> - <%= yield %> -</div> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/application.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/application.html.erb deleted file mode 100644 index be9af4a1526..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/application.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<% - controller.java_facade.getCoreComponentByClassname('org.sonar.server.ui.PageDecorations').get().each do |decoration| - begin -%> - <%= render :inline => decoration.getTemplate() -%> - <% - rescue => error - logger.error(error) - end - end - %> -<%= render :partial => 'layouts/head' unless params[:hd]=='false' %> -<% if params[:layout]=='false' %> - <%= render :partial => 'layouts/nolayout' %> -<% else %> - <%= render :partial => 'layouts/layout' %> - <%= render :partial => 'layouts/navbar' %> -<% end %> -<%= render :partial => 'layouts/footer' unless params[:hd]=='false' %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/nonav.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/nonav.html.erb deleted file mode 100644 index 8eddafc65d3..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/nonav.html.erb +++ /dev/null @@ -1,42 +0,0 @@ -<%= render :partial => 'layouts/head' %> - -<nav class="navbar navbar-global page-container" id="global-navigation"> - <div class="navbar-header"> - <a class="navbar-brand" href="<%= ApplicationController.root_context -%>/"> - <img src="<%= ApplicationController.root_context -%>/images/logo.svg" height="30" - alt="<%= h message('layout.sonar.slogan') -%>" - title="<%= h message('layout.sonar.slogan') -%>"> - </a> - </div> -</nav> - -<div id="bd" class="page-wrapper page-wrapper-simple"> - <div id="nonav" class="page-simple"> - <div id="content"><%= yield %></div> - </div> -</div> - -<div id="footer" class="page-footer page-container"> - <div> - Version <%= sonar_version -%> - - <a href="http://www.gnu.org/licenses/lgpl-3.0.txt" target="lgpl_v3">LGPL v3</a> - - <a href="http://www.sonarqube.org" target="sonar">Community</a> - - <a href="http://www.sonarqube.org/documentation" target="sonar_doc">Documentation</a> - - <a href="http://www.sonarqube.org/support" target="support">Get Support</a> - - <a href="http://redirect.sonarsource.com/doc/plugin-library.html" target="plugins">Plugins</a> - - <a href="<%= ApplicationController.root_context -%>/web_api">Web API</a> - </div> - <%= render 'branding/footer' -%> -</div> - -<script> - window.sonarqube.bannedNavigation = true; - (function ($) { - $('html').addClass('dashboard-page'); - })(window.jQuery); -</script> - -<script src="<%= ApplicationController.root_context -%>/js/bundles/app.js?v=<%= sonar_version -%>"></script> -<%= yield :extra_script -%> - -</body></html> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/maintenance/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/maintenance/index.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/maintenance/index.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/markdown/_tips.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/markdown/_tips.html.erb deleted file mode 100644 index 546d38240d2..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/markdown/_tips.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -<div class="markdown-tips"> - <a href="#" onclick="window.open(baseUrl + '/markdown/help','markdown','height=300,width=600,scrollbars=1,resizable=1');return false;"><%= message('markdown.helplink')-%></a> : - *<%= message('bold') -%>* ``<%= message('code') -%>`` * <%= message('bulleted_point') -%> -</div>
\ No newline at end of file diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/markdown/help.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/markdown/help.html.erb deleted file mode 100644 index ff4b4bc60ae..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/markdown/help.html.erb +++ /dev/null @@ -1,102 +0,0 @@ -<div id="markdown-full-help"> - <h2 class="spacer-bottom">Markdown Syntax</h2> - <table class="width-100 data zebra"> - <thead> - <tr> - <th>Write:</th> - <th>To display:</th> - </tr> - </thead> - <tbody> - <tr> - <td>*this text is bold*</td> - <td class="markdown"><strong>this text is bold</strong></td> - </tr> - <tr> - <td>http://sonarqube.org</td> - <td class="markdown"><a href="http://sonarqube.org">http://sonarqube.org</a></td> - </tr> - <tr> - <td class="text-top"> - [SonarQube™ Home Page](http://www.sonarqube.org) - </td> - <td class="markdown text-top"> - <a href="http://www.sonarqube.org" target="_blank">SonarQube™ Home Page</a> - </td> - </tr> - <tr> - <td class="text-top">* first item<br> - * second item - </td> - <td class="markdown"> - <ul> - <li>first item</li> - <li>second item</li> - </ul> - </td> - </tr> - <tr> - <td class="text-top">1. first item<br> - 1. second item - </td> - <td class="markdown text-top"> - <ol> - <li>first item</li> - <li>second item</li> - </ol> - </td> - </tr> - <tr> - <td class="text-top"> - = Heading Level 1<br> - == Heading Level 2<br> - === Heading Level 3<br> - ==== Heading Level 4<br> - ===== Heading Level 5<br> - ====== Heading Level 6<br> - <td class="markdown text-top"> - <h1>Heading Level 1</h1> - <h2>Heading Level 2</h2> - <h3>Heading Level 3</h3> - <h4>Heading Level 4</h4> - <h5>Heading Level 5</h5> - <h6>Heading Level 6</h6> - </td> - </tr> - <tr> - <td class="text-top">``Lists#newArrayList()``</td> - <td class="markdown text-top"><code>Lists#newArrayList()</code></td> - </tr> - <tr> - <td class="text-top"> - ``<br> - // code on multiple lines<br> - public void foo() {<br> - // do some logic here<br> - }<br> - `` - </td> - <td class="markdown text-top"> -<pre> - // code on multiple lines - public void foo() { - // do some logic here - } -</pre> - </td> - </tr> - <tr> - <td class="text-top"> - Standard text<br> - > Blockquoted text<br> - > that spans multiple lines<br> - </td> - <td class="markdown text-top"> - <p>Standard text</p> - <blockquote>Blockquoted text<br> - that spans multiple lines<br></blockquote> - </td> - </tr> - </tbody> - </table> -</div> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/metrics/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/metrics/index.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/metrics/index.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/permission_templates/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/permission_templates/index.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/permission_templates/index.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/plugins/rails_page.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/plugins/rails_page.erb deleted file mode 100644 index 9eec0d172f8..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/plugins/rails_page.erb +++ /dev/null @@ -1 +0,0 @@ -<%= render :inline => @page.getTemplate() %>
\ No newline at end of file diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/profiles/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/profiles/index.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/profiles/index.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/_snapshot_title.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/_snapshot_title.html.erb deleted file mode 100644 index 9b77fc7808f..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/_snapshot_title.html.erb +++ /dev/null @@ -1,11 +0,0 @@ -<% if @snapshot %> -<div id="snapshot_title" class="spacer-bottom"> -<h4> -<% - profile_measure=@snapshot.measure(Metric::PROFILE) - %> -<%= link_to_favourite(@project) -%> Version <%= @snapshot.version -%> - <%= l @snapshot.created_at %> -<% if profile_measure %> - profile <%= link_to profile_measure.data, :controller => 'profiles', :action => 'show', :id => profile_measure.value.to_i %><% end %> -</h4> -</div> -<% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/background_tasks.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/background_tasks.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/background_tasks.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/deletion.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/deletion.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/deletion.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/history.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/history.html.erb deleted file mode 100644 index 81caa07835a..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/history.html.erb +++ /dev/null @@ -1,173 +0,0 @@ -<div class="page page-limited"> - <header class="page-header"> - <h1 class="page-title"><%= message('project_history.page') -%></h1> - <p class="page-description"><%= message('project_history.page.description') -%></p> - </header> - - <% if !@snapshot %> - - <div class="alert alert-warning"> - <%= h message('provisioning.no_analysis') -%> - </div> - - <div className="big-spacer-top"> - <h4><%= h message('key') -%></h4> - <code><%= h @project.key -%></code> - </div> - - <% elsif @project.root? %> - - <table id="project-history" class="data" style="width:1%"> - <thead> - <tr> - <th class="thin nowrap"><%= message('project_history.col.year') -%></th> - <th class="thin nowrap"><%= message('project_history.col.month') -%></th> - <th class="thin nowrap"><%= message('project_history.col.day') -%></th> - <th class="thin nowrap"><%= message('project_history.col.time') -%></th> - <th class="nowrap" style="padding-left: 20px; min-width: 100px;"><%= message('project_history.col.version') -%></th> - <th class="nowrap" style="padding-left: 20px; min-width: 100px;"><%= message('project_history.col.events') -%></th> - <th class="thin nowrap"></th> - <th class="thin nowrap"></th> - <th class="thin nowrap text-right" style="padding-left: 20px;"><%= message('project_history.col.action') -%></th> - </tr> - </thead> - <tbody> - <% - current_year = nil - current_month = nil - @analyses.each_with_index do |analysis, index| - time = analysis.created_at - version_event = analysis.event(EventCategory::KEY_VERSION) - alert_event = analysis.event(EventCategory::KEY_ALERT) - profile_event = analysis.event(EventCategory::KEY_PROFILE) - other_events = analysis.events.select{|e| e.category!=EventCategory::KEY_VERSION && e.category!=EventCategory::KEY_ALERT && e.category!=EventCategory::KEY_PROFILE} - %> - <tr class="<%= cycle 'even','odd' -%> snapshot"> - - <%# Year %> - <td class="thin nowrap"><b><%= time.year unless time.year == current_year -%></b></td> - - <%# Month %> - <td class="thin nowrap"><b><%= l(time, :format => '%B').capitalize unless time.month == current_month -%></b></td> - - <%# Day %> - <td class="thin nowrap"><%= l(time, :format => '%d') -%></td> - - <%# Time %> - <td class="thin nowrap"><%= l(time, :format => '%H:%M') -%></td> - - <%# Version %> - <td class="thin nowrap" style="padding-left: 20px;"> - <table class="width100"> - <tr id="version_<%= index -%>"> - - <% if version_event %> - <td class="width100"><%= h(version_event.name) if version_event -%></td> - <td class="small edit_actions" style="padding-left:20px"> - <a id="version_<%= index -%>_change" href="#" onclick="$j('#version_<%= index -%>').hide();$j('#version_<%= index -%>_form').show();$j('#version_name_<%= index -%>').focus();return false;"><%= message('project_history.rename_version') -%></a> - - <% if version_event && !analysis.islast? %> - <%= link_to( message('project_history.remove_version'), - { :action => 'delete_version', :sid => analysis.id}, - :confirm => message('project_history.do_you_want_to_remove_version', :params => version_event.name) ) -%> - <% end %> - </td> - - <% else %> - <td class="small edit_actions" colspan="2"> - <a id="version_<%= index -%>_change" href="#" onclick="$j('#version_<%= index -%>').hide();$j('#version_<%= index -%>_form').show();$j('#version_name_<%= index -%>').focus();return false;"><%= message('project_history.create_version') -%></a> - </td> - - <% end %> - </tr> - <tr id="version_<%= index -%>_form" style="display:none;"> - <td coslpan="2" class="admin"> - <% form_tag( {:action => 'update_version', :sid => analysis.id }) do -%> - <input id="version_name_<%= index -%>" name="version_name" type="text" value="<%= version_event ? h(version_event.name) : '' -%>" - onKeyUp="if (this.value=='') $j('#save_version_<%= index -%>').disabled='true'; else $j('#save_version_<%= index -%>').disabled='';"/> - <%= submit_tag message('save'), :id => 'save_version_' + index.to_s %> - <a href="#" onclick="$j('#version_<%= index -%>').show();$j('#version_<%= index -%>_form').hide();"><%= message('cancel') -%></a> - <% end %> - </td> - </tr> - </table> - </td> - - <%# Events %> - <td class="thin nowrap" style="padding-left: 20px;"> - <table class="width100"> - <% - other_events.each_with_index do |event, index2| - event_index = index.to_s + '-' + index2.to_s - %> - <tr id="event_<%= event_index -%>"> - <td class="width100"><%= h event.name -%></td> - <td class="small edit_actions" style="padding-left:20px"> - <a id="event_<%= event_index -%>_change" href="#" onclick="$j('#event_<%= event_index -%>').hide();$j('#event_<%= event_index -%>_form').show();$j('#event_name_<%= event_index -%>').focus();return false;"><%= message('project_history.rename_event') -%></a> - <%= link_to( message('project_history.remove_version'), - { :action => 'delete_event', :id => event.id}, - :confirm => message('project_history.do_you_want_to_remove_version', :params => event.name) ) -%> - </td> - </tr> - <tr id="event_<%= event_index -%>_form" style="display:none;"> - <td colspan="2" class="admin"> - <% form_tag( {:action => 'update_event', :id => event.id }) do -%> - <input id="event_name_<%= event_index -%>" name="event_name" type="text" value="<%= h event.name -%>" - onKeyUp="if (this.value=='') $j('#save_event_<%= event_index -%>').disabled='true'; else $j('#save_event_<%= event_index -%>').disabled='';"/> - <%= submit_tag message('save'), :id => 'save_event_' + event_index %> - <a href="#" onclick="$j('#event_<%= event_index -%>').show();$j('#event_<%= event_index -%>_form').hide();"><%= message('cancel') -%></a> - <% end %> - </td> - </tr> - <% end %> - <tr id="create_event_<%= index -%>"> - <td colspan="2" class="small create_actions"> - <a id="create_event_<%= index -%>_change" href="#" onclick="$j('#create_event_<%= index -%>').hide();$j('#create_event_<%= index -%>_form').show();$j('#create_event_name_<%= index -%>').focus();return false;"><%= message('project_history.create_event') -%></a> - </td> - </tr> - <tr id="create_event_<%= index -%>_form" style="display:none;"> - <td colspan="2" class="admin"> - <% form_tag( {:action => 'create_event', :sid => analysis.id }) do -%> - <input id="create_event_name_<%= index -%>" name="event_name" type="text" value="" - onKeyUp="if (this.value=='') $j('#create_save_event_<%= index -%>').disabled='true'; else $j('#create_save_event_<%= index -%>').disabled='';"/> - <%= submit_tag message('save'), :id => 'create_save_event_' + index.to_s %> - <a href="#" onclick="$j('#create_event_<%= index -%>').show();$j('#create_event_<%= index -%>_form').hide();"><%= message('cancel') -%></a> - <% end %> - </td> - </tr> - </table> - </td> - - <td class="thin nowrap"> - <%= image_tag "event_alert.png", :alt => (message('project_history.col.alert') + ": " + alert_event.name + ". " + alert_event.description_text) if alert_event -%> - </td> - - <td class="thin nowrap"> - <%= image_tag "event_profile.png", :alt => message('project_history.col.profile') + ": " + profile_event.name if profile_event -%> - </td> - - <td class="thin nowrap text-right" style="padding-left:10px; padding-right:10px"> - <% - cell_content = nil; - if analysis.islast? - cell_content = "<b>" + message('project_history.last_snapshot') + "</b>" - else - cell_content = button_to( message('project_history.delete_snapshot'), - { :action => "delete_snapshot_history", :id => @project.id, :snapshot_id => analysis.id }, - :class => 'button-red', - :confirm => message('project_history.are_you_sure_delete_snapshot_x', :params => l(time, :format => :long)) ) - end - %> - <%= cell_content -%> - </td> - </tr> - <% - current_year = time.year - current_month = time.month - end - %> - </tbody> - </table> - - <% end %> -</div> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/index.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/index.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/key.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/key.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/key.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/links.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/links.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/links.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/profile.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/profile.html.erb deleted file mode 100644 index d24f845572e..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/profile.html.erb +++ /dev/null @@ -1,45 +0,0 @@ -<div class="page"> - <header class="page-header"> - <h1 class="page-title"><%= message('project_quality_profiles.page') -%></h1> - <p class="page-description"><%= message('project_quality_profiles.page.description') -%></p> - </header> - - <table class="data"> - <thead> - <tr> - <th><%= message 'language' -%></th> - <th>Quality Profile</th> - </tr> - </thead> - <tbody> - <% - Api::Utils.languages.each do |language| - selected_profile = Internal.quality_profiles.findProfileByProjectAndLanguage(@project_id, language.getKey()) - %> - <tr class="<%= cycle 'even', 'odd' -%>"> - <td class="thin" nowrap><%= h language.getName() -%></td> - <td> - <form id="form-<%= language.getKey().parameterize -%>" method="POST" action="<%= ApplicationController.root_context -%>/project/set_profile"> - <input type="hidden" name="id" value="<%= @project_id -%>"/> - <input type="hidden" name="language" value="<%= language.getKey() -%>"/> - - <select id="select-profiles-<%= language.getKey().parameterize -%>" name="profile_id"> - <option value="" <%= "selected='selected'" unless selected_profile -%>><%= message 'project_quality_profile.default_profile' -%></option> - <optgroup> - <% - profiles = Api::Utils.insensitive_sort(@all_quality_profiles.select { |profile| profile.language == language.getKey() }) { |profile| profile.name } - profiles.each do |profile| - %> - <option value="<%= profile.id -%>" <%= "selected='selected'" if selected_profile && (selected_profile.id == profile.id) -%>><%= h profile.name -%></option> - <% end %> - </optgroup> - </select> - - <%= submit_tag message('update_verb'), :id => "submit-#{language.getKey()}", :disable_with => message('updating') %> - </form> - </td> - </tr> - <% end %> - </tbody> - </table> -</div> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/quality_gate.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/quality_gate.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/quality_gate.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/quality_profiles.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/quality_profiles.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/quality_profiles.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/settings.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/settings.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/settings.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project_roles/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/project_roles/index.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project_roles/index.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/projects/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/projects/index.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/projects/index.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/projects_admin/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/projects_admin/index.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/projects_admin/index.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/property_sets/_list.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/property_sets/_list.html.erb deleted file mode 100644 index 40e1057d674..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/property_sets/_list.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -<form id="edit-property-set-form" method="post" action="property-sets/update"> - <fieldset> - <div class="modal-head"> - </div> - - <div class="modal-body"> - <% @property_sets.each do |property_set| -%> - <% property_set.fields.each do |field| -%> - <%= field.name %> (<%= field.type %>)<br/> - <% end -%> - <% end -%> - </div> - - <div class="modal-foot"> - <a href="#" onclick="return closeModalWindow();" id="rename-cancel"><%= h message('cancel') -%></a> - </div> - </fieldset> -</form> - -<script> - $j("#edit-property-set-form").modalForm(); -</script> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/quality_gates/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/quality_gates/index.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/quality_gates/index.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/roles/global.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/roles/global.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/roles/global.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/sessions/_form.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/sessions/_form.html.erb deleted file mode 100644 index 3f1c87f5977..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/sessions/_form.html.erb +++ /dev/null @@ -1,95 +0,0 @@ -<h1 class="maintenance-title text-center">Log In to SonarQube</h1> - -<% auth_providers = Api::Utils.java_facade.getIdentityProviders().to_a %> -<% if auth_providers.size > 0 %> - <section class="oauth-providers"> - <ul> - <% auth_providers.each do |provider| %> - <li> - <a href="<%= ApplicationController.root_context -%>/sessions/init/<%= provider.getKey().to_s %>" - style="background-color: <%= provider.getDisplay().getBackgroundColor().to_s %>" - title="Log in with <%= provider.getName().to_s -%>"> - <img alt="<%= provider.getName().to_s -%>" width="20" height="20" - src="<%= ApplicationController.root_context + provider.getDisplay().getIconPath().to_s -%>"> - <span>Log in with <%= provider.getName().to_s -%></span> - </a> - </li> - <% end %> - </ul> - </section> -<% end %> - -<form id="login_form" action="<%= ApplicationController.root_context -%>/api/authentication/login" method="post"> - <input type="hidden" name="return_to_anchor" value="<%= h @return_to_anchor %>"> - - <div class="alert alert-danger alert-authentication-failed hidden"><%= message('session.flash_notice.authentication_failed') %></div> - <div class="hidden" id="messages-panel"> - <div class="alert alert-danger alert-flash hidden" id="error"> - <span id="errormsg"></span> - </div> - <div class="alert alert-info alert-flash hidden" id="info"> - <span id="infomsg"></span> - </div> - </div> - - <div class="big-spacer-bottom"> - <label for="login" class="login-label"><%= message('login') %></label> - <input type="text" id="login" name="login" class="login-input" maxlength="255" required - placeholder="<%= message('login') %>"> - <% if Property.value('sonar.allowUsersToSignUp')=='true' %> - <p class="note spacer-top spacer-left spacer-right"> - <%= message('sessions.new_account', :params => [url_for(:controller => 'users', :action => 'new')]) -%> - </p> - <% end %> - </div> - - <p class="big-spacer-bottom"> - <label for="password" class="login-label"><%= message('password') %></label> - <input type="password" id="password" name="password" class="login-input" required - placeholder="<%= message('password') %>"> - </p> - - <div> - <div class="text-right overflow-hidden"> - <button name="commit"><%= message('sessions.log_in') -%></button> - <a class="spacer-left" href="<%= home_path -%>"><%= message('cancel') -%></a> - </div> - </div> -</form> - -<script> - (function ($) { - $('#login').focus(); - var returnToAnchor = $('[name="return_to_anchor"]'); - if (!returnToAnchor.val()) { - returnToAnchor.val(window.location.hash); - } - - $("#login_form").modalForm({ - success: function () { - window.location = '<%= escape_javascript @return_to -%>' + $('[name="return_to_anchor"]').val(); - }, - error: function () { - $('.alert-flash').addClass('hidden'); - $('.alert-authentication-failed').removeClass('hidden'); - $('button').prop('disabled', false); - }, - statusCode: { - 401: null - } - }); - - <% if cookies['flash'] %> - var data = JSON.parse(unescape('<%= escape_javascript(cookies['flash']) -%>')); - if (data['loginerror']) { - error(data['loginerror'].toString().replace(/\+/g, ' ')); - } - if (data['info']) { - info(data['info'].toString().replace(/\+/g, ' ')); - } - <% cookies.delete 'flash' %> - <% end %> - - })(window.jQuery); -</script> - diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/sessions/login.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/sessions/login.html.erb deleted file mode 100644 index 786950e7048..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/sessions/login.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= render :partial => 'form' %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/sessions/new.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/sessions/new.html.erb deleted file mode 100644 index 786950e7048..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/sessions/new.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= render :partial => 'form' %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/sessions/unauthorized.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/sessions/unauthorized.html.erb deleted file mode 100644 index dee79e3add7..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/sessions/unauthorized.html.erb +++ /dev/null @@ -1,15 +0,0 @@ -<table class="spaced"> - <tr> - <td align="center"> - <div id="login_form"> - <p id="unauthorized">You're not authorized to access this page. Please contact the administrator.</p> - </div> - <br/> - <% if params[:message] %> - <div id="message">Reason : <%= params[:message] %></div> - <br/> - <% end %> - <a class="spacer-left" href="<%= home_path -%>"><%= message('layout.home') -%></a> - </td> - </tr> -</table> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/settings/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/settings/index.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/settings/index.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/setup/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/setup/index.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/setup/index.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/shared/_no_issues.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/shared/_no_issues.html.erb deleted file mode 100644 index 046be07f3c4..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/shared/_no_issues.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -<div style="margin-bottom: auto;" class="notes"> - <div style="float: left;"><%= message('issue_filter.no_result') -%></div> - <div style="cursor: help;"><%= image_tag 'help.png', :title => h(message('issue_filter.no_result.help')) -%></div> -</div>
\ No newline at end of file diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/shared/_result_messages.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/shared/_result_messages.html.erb deleted file mode 100644 index 9f8a57d72d2..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/shared/_result_messages.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -<% result.errors.each do |msg| %> - <div class="error"><%= h (msg.text ? msg.text : Api::Utils.message(msg.l10nKey, :params => msg.l10nParams)) -%></div> -<% end %> - - diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/system/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/system/index.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/system/index.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter/index.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter/index.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/users/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/users/index.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/users/index.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/users/new.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/users/new.html.erb deleted file mode 100644 index e779a8d23df..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/users/new.html.erb +++ /dev/null @@ -1,44 +0,0 @@ -<form action="<%= url_for :controller => 'users', :action => 'signup' -%>" method="post"> - - <h1 class="maintenance-title text-center">Sign Up to SonarQube</h1> - - <%= error_messages_for :user, :class => 'alert alert-danger', :header_message => nil, :message => nil %> - - <div class="big-spacer-bottom"> - <label for="user_login" class="login-label"><%= message('login') %></label> - <input type="text" id="user_login" name="user[login]" class="login-input" maxlength="30" required - placeholder="<%= message('login') %>"> - <p class="note spacer-top spacer-left spacer-right"> - <%= message('sessions.old_account', :params => [url_for(:controller => 'sessions', :action => 'new')]) -%> - </p> - </div> - - <div class="big-spacer-bottom"> - <label for="user_name" class="login-label"><%= message('name') %></label> - <input type="text" id="user_name" name="user[name]" class="login-input" maxlength="30" required - placeholder="<%= message('name') %>"> - </div> - - <p class="big-spacer-bottom"> - <label for="user_password" class="login-label"><%= message('password') %></label> - <input type="password" id="user_password" name="user[password]" class="login-input" required - placeholder="<%= message('password') %>"> - </p> - - <p class="big-spacer-bottom"> - <label for="user_password_confirmation" class="login-label"><%= message('sessions.confirm_password') %></label> - <input type="password" id="user_password_confirmation" name="user[password_confirmation]" class="login-input" required - placeholder="<%= message('sessions.confirm_password') %>"> - </p> - - <p class="text-right"> - <button name="commit"><%= message('sessions.sign_up') -%></button> - <a class="spacer-left" href="<%= home_path -%>"><%= message('cancel') -%></a> - </p> -</form> - -<script> - (function ($) { - $('#user_login').focus(); - })(window.jQuery); -</script> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/utils/_tfoot_pagination.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/utils/_tfoot_pagination.html.erb deleted file mode 100644 index a6a6c3ec537..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/utils/_tfoot_pagination.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -<% - # this template is deprecated. Please use the method table_pagination. -%> -<%= table_pagination(pagination, :colspan => (colspan||1)) { |label, page_id| link_to(label, params.merge({:page => page_id}))} -%>
\ No newline at end of file diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/view_projects/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/view_projects/index.html.erb deleted file mode 100644 index f5600f6ca03..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/view_projects/index.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<% content_for :extra_script do %> - <script src="<%= ApplicationController.root_context -%>/js/bundles/code.js?v=<%= sonar_version -%>"></script> -<% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/web_api/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/web_api/index.html.erb deleted file mode 100644 index e69de29bb2d..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/web_api/index.html.erb +++ /dev/null diff --git a/server/sonar-web/src/main/webapp/WEB-INF/config/routes.rb b/server/sonar-web/src/main/webapp/WEB-INF/config/routes.rb index a62b6c7af3c..2931db12590 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/config/routes.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/config/routes.rb @@ -13,26 +13,11 @@ ActionController::Routing::Routes.draw do |map| map.resources 'properties', :path_prefix => 'api', :controller => 'api/properties', :requirements => { :id => /.*/ } - # home page - map.home '', :controller => :landing, :action => :index - map.root :controller => :landing, :action => :index - # page plugins map.connect 'plugins/configuration/:page', :controller => 'plugins/configuration', :action => 'index', :requirements => { :page => /.*/ } map.connect 'plugins/home/:page', :controller => 'plugins/home', :action => 'index', :requirements => { :page => /.*/ } map.connect 'plugins/resource/:id', :controller => 'plugins/resource', :action => 'index', :requirements => { :id => /.*/ } - # to refactor - map.connect 'charts/:action/:project_id/:metric_id', :controller => 'charts' - map.connect 'rules_configuration/:action/:language/:name/:plugin.:format', :controller => 'rules_configuration' - - map.connect 'web_api/*other', :controller => 'web_api', :action => 'index' - map.connect 'quality_gates/*other', :controller => 'quality_gates', :action => 'index' - map.connect 'overview/*other', :controller => 'overview', :action => 'index' - map.connect 'component_measures/*other', :controller => 'component_measures', :action => 'index' - map.connect 'account/update_notifications', :controller => 'account', :action => 'update_notifications' - map.connect 'account/*other', :controller => 'account', :action => 'index' - # Install the default route as the lowest priority. map.connect ':controller/:action/:id', :requirements => { :id => /.*/ } |