<script type="text/javascript">
  /* display resource */
  function d(resourceId, is_file) {
    var action = is_file ? 'index' : 'view';
    var url = '<%= ApplicationController.root_context -%>/resource/' + action + '/' + resourceId + '?metric=<%= @metric.id if @metric -%>' +
        '&rule=<%= @rule ? @rule.id : @severity -%>&period=<%= @period -%>&project=<%= @resource.id -%>';
    openAccordionItem(url);
    return false;
  }

  // refresh page after issues bulk change
  function onBulkIssues(issues_query_params){
    if (issues_query_params['components'] != null) {
      d(issues_query_params['components']);
      closeModalWindow();
    } else {
      window.location.reload();
    }
  }
</script>
