<commit_before>.institution-detail
  .container
    .col-md-6.no-gutter
      %h2=@organization.name
    .col-md-6.no-gutter
      = select_tag "Otros servicios de esta institución", options_from_collection_for_select(@organization.services, "id", "name"), class: "form-control input-lg"

- if user_signed_in? && current_user.is_service_admin? && @service_version.proposed?
  .container-fluid.panel-error.warning.alert.fade.in{:"data-alert" => "alert"}
    .container
      .row
        .col-md-12
          %button.close{"aria-hidden" => "true", "data-dismiss" => "alert", :type => "button"} ×
          %h1= display_service_alert_msg(@service_version.status)['title']
          .actions
            = button_to t(:approve), state_organization_service_service_version_path(state: 'current'), method: :put, class: "btn btn-success"
            %button.btn.btn-danger{"data-target" => "#modalServiceRejected", "data-toggle" => "modal", :type => "button"}
              =t(:reject)
- elsif @service_version.rejected?
  .container-fluid.panel-error.alert.fade.in{:"data-alert" => "alert"}
    .container
      .row
        .col-md-12
          %button.close{"aria-hidden" => "true", "data-dismiss" => "alert", :type => "button"} ×
          %h1= display_service_alert_msg(@service_version.status)['title']
          %p= display_service_alert_msg(@service_version.status)['msg']
          =@service_version.reject_message

.container-fluid.instance-panel-services
  .container
    .row
      .col-md-8
        .title
          %h1
            = @service_version.service.name
            ="R" + @service_version.version_number.to_s
          %span{class: css_class_for_status(@service_version.status)}
            = t(@service_version.status)
        %br
        .description
          = t(:description) + ': '
          - if @service_version.description.present?
            = markdown.render(@service_version.description).html_safe
          -else
            = t(:description_not_found)
      .col-md-4.text-right
        =link_to @service_version.has_previous_version? ? organization_service_service_version_path(@organization, @service, @service_version.previous_version) : '' , class: "detail-action #{'deactivate' unless @service_version.has_previous_version? }" do
          %i.material-icons undo
          = t(:previous_version)
        %br
        =link_to @service_version.has_next_version? ? organization_service_service_version_path(@organization, @service, @service_version.next_version) : '' , class: "detail-action #{'deactivate' unless @service_version.has_next_version? }" do
          %i.material-icons redo
          = t(:next_version)
        %br
        =link_to organization_service_service_versions_path, class: "detail-action" do
          %i.material-icons list
          = t(:history)
        %br

    .row
      .col-md-12.principal-actions
        %a.btn.btn-primary Solicitar Convenio
        =link_to t(:new_version), new_organization_service_service_version_path, class: "btn btn-primary"
        %a.btn.btn-static Ver OAS
        %button.btn.btn-static{"data-target" => "#modalDownloadCode", "data-toggle" => "modal", :type => "button"}
          =t(:generate_code)
        %p.url-canonica
          %span
            %strong
              = t(:base_url) + ': '
            %a{href: organization_service_service_version_url(@service, @service_version, format: :json), target: "_blank"}
              = organization_service_service_version_url(@service, @service_version, format: :json)

.container-fluid
  .row
    .col-md-12.wrapper-operation.no-gutter
      .container-verbs.in
        .header
          %i#collapseVerbs.material-icons keyboard_arrow_right
          %h3.col-title
            = t(:operations)
        %ul.list-operations
          - @service_version.operations.each do |(verb, path), operation|
            %li
              %a{href: operation_organization_service_service_version_path(verb: verb, path: path, anchor: 'operation-doc')}
                %label.btn-status.full{class: css_class_for_http_verb(verb)}= verb
                %span.path= path
      .container-service
        #operation-doc.operation.in
          %h2
            %label.btn-status.full{class: css_class_for_http_verb(@verb)}= @verb
            = @path
          .description-summary
            - if @operation['summary']
              %p= @operation['summary']
            - if @operation['description']
              %div= markdown.render(@operation['description']).html_safe
          %button.btn.btn-success.collapseConsole
            =t(:test_service)
          .parameters
            %h2.subtitle= t(:parameters)
            .schema-panel-set.detail
              - if @service_version.has_parameters?(@verb, @path)
                - @service_version.parameter_locations(@verb, @path).each do |location|
                  %h3= parameter_section_name(location)
                  = service_operation_parameters_markup(@service_version, @verb, @path, location)
              - else
                %p= t(:operation_without_parameters)
          .responses
            %h2.subtitle= t(:responses)
            .schema-panel-set.detail
              = service_operation_responses_markup(@service_version, @verb, @path)
        .console
          .inner-console
            .title
              %i#fullConsole.material-icons.pull-left zoom_out_map
              %i#closeConsole.material-icons.pull-right clear
            .schema-panel-set
              - if @service_version.has_parameters?(@verb, @path)
                - @service_version.parameter_locations(@verb, @path).each do |location|
                  %h3= parameter_section_name(location)
                  = form_tag(format: :json) do
                    = service_operation_parameters_form(@service_version, @verb, @path, location)
                    = submit_tag("Enviar")
              - else
                %p= t(:operation_without_parameters)


#modalDownloadCode.modal.fade{:role => "dialog", :tabindex => "-1"}
  .modal-dialog
    .modal-content
      .modal-header
        %button.close{"aria-label" => "Close", "data-dismiss" => "modal", :type => "button"}
          %span{"aria-hidden" => "true"} ×
        %h1
          =t(:generate_code)
      .modal-body
        .row
          %form#code-options
            .col-md-6
              %h4
                =t(:download_client)
              .input-languages<commit_msg>Slight refactor to the DOM structure of the console<commit_after>.institution-detail
  .container
    .col-md-6.no-gutter
      %h2=@organization.name
    .col-md-6.no-gutter
      = select_tag "Otros servicios de esta institución", options_from_collection_for_select(@organization.services, "id", "name"), class: "form-control input-lg"

- if user_signed_in? && current_user.is_service_admin? && @service_version.proposed?
  .container-fluid.panel-error.warning.alert.fade.in{:"data-alert" => "alert"}
    .container
      .row
        .col-md-12
          %button.close{"aria-hidden" => "true", "data-dismiss" => "alert", :type => "button"} ×
          %h1= display_service_alert_msg(@service_version.status)['title']
          .actions
            = button_to t(:approve), state_organization_service_service_version_path(state: 'current'), method: :put, class: "btn btn-success"
            %button.btn.btn-danger{"data-target" => "#modalServiceRejected", "data-toggle" => "modal", :type => "button"}
              =t(:reject)
- elsif @service_version.rejected?
  .container-fluid.panel-error.alert.fade.in{:"data-alert" => "alert"}
    .container
      .row
        .col-md-12
          %button.close{"aria-hidden" => "true", "data-dismiss" => "alert", :type => "button"} ×
          %h1= display_service_alert_msg(@service_version.status)['title']
          %p= display_service_alert_msg(@service_version.status)['msg']
          =@service_version.reject_message

.container-fluid.instance-panel-services
  .container
    .row
      .col-md-8
        .title
          %h1
            = @service_version.service.name
            ="R" + @service_version.version_number.to_s
          %span{class: css_class_for_status(@service_version.status)}
            = t(@service_version.status)
        %br
        .description
          = t(:description) + ': '
          - if @service_version.description.present?
            = markdown.render(@service_version.description).html_safe
          -else
            = t(:description_not_found)
      .col-md-4.text-right
        =link_to @service_version.has_previous_version? ? organization_service_service_version_path(@organization, @service, @service_version.previous_version) : '' , class: "detail-action #{'deactivate' unless @service_version.has_previous_version? }" do
          %i.material-icons undo
          = t(:previous_version)
        %br
        =link_to @service_version.has_next_version? ? organization_service_service_version_path(@organization, @service, @service_version.next_version) : '' , class: "detail-action #{'deactivate' unless @service_version.has_next_version? }" do
          %i.material-icons redo
          = t(:next_version)
        %br
        =link_to organization_service_service_versions_path, class: "detail-action" do
          %i.material-icons list
          = t(:history)
        %br

    .row
      .col-md-12.principal-actions
        %a.btn.btn-primary Solicitar Convenio
        =link_to t(:new_version), new_organization_service_service_version_path, class: "btn btn-primary"
        %a.btn.btn-static Ver OAS
        %button.btn.btn-static{"data-target" => "#modalDownloadCode", "data-toggle" => "modal", :type => "button"}
          =t(:generate_code)
        %p.url-canonica
          %span
            %strong
              = t(:base_url) + ': '
            %a{href: organization_service_service_version_url(@service, @service_version, format: :json), target: "_blank"}
              = organization_service_service_version_url(@service, @service_version, format: :json)

.container-fluid
  .row
    .col-md-12.wrapper-operation.no-gutter
      .container-verbs.in
        .header
          %i#collapseVerbs.material-icons keyboard_arrow_right
          %h3.col-title
            = t(:operations)
        %ul.list-operations
          - @service_version.operations.each do |(verb, path), operation|
            %li
              %a{href: operation_organization_service_service_version_path(verb: verb, path: path, anchor: 'operation-doc')}
                %label.btn-status.full{class: css_class_for_http_verb(verb)}= verb
                %span.path= path
      .container-service
        #operation-doc.operation.in
          %h2
            %label.btn-status.full{class: css_class_for_http_verb(@verb)}= @verb
            = @path
          .description-summary
            - if @operation['summary']
              %p= @operation['summary']
            - if @operation['description']
              %div= markdown.render(@operation['description']).html_safe
          %button.btn.btn-success.collapseConsole
            =t(:test_service)
          .parameters
            %h2.subtitle= t(:parameters)
            .schema-panel-set.detail
              - if @service_version.has_parameters?(@verb, @path)
                - @service_version.parameter_locations(@verb, @path).each do |location|
                  %h3= parameter_section_name(location)
                  = service_operation_parameters_markup(@service_version, @verb, @path, location)
              - else
                %p= t(:operation_without_parameters)
          .responses
            %h2.subtitle= t(:responses)
            .schema-panel-set.detail
              = service_operation_responses_markup(@service_version, @verb, @path)
        .console
          .inner-console
            .title
              %i#fullConsole.material-icons.pull-left zoom_out_map
              %i#closeConsole.material-icons.pull-right clear
              - if @service_version.has_parameters?(@verb, @path)
                - @service_version.parameter_locations(@verb, @path).each do |location|
                  .console-parameter-group{data: {location: location}}
                    %h3= parameter_section_name(location)
                    = form_tag(format: :json) do
                      .schema-panel-set
                        = service_operation_parameters_form(@service_version, @verb, @path, location)
                      = submit_tag("Enviar")
                    .raw-json
              - else
                %p= t(:operation_without_parameters)


#modalDownloadCode.modal.fade{:role => "dialog", :tabindex => "-1"}
  .modal-dialog
    .modal-content
      .modal-header
        %button.close{"aria-label" => "Close", "data-dismiss" => "modal", :type => "button"}
          %span{"aria-hidden" => "true"} ×
        %h1
          =t(:generate_code)
      .modal-body
        .row
          %form#code-options
            .col-md-6
              %h4
                =t(:download_client)
              .input-languages
{'fraction_non_alphanumeric': 0.12874182377837629, 'fraction_numerical': 0.004001539053482109, 'mean_word_length': 2.301829268292683, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7307975', 'n_tokens_mistral': 3876, 'n_tokens_neox': 3776, 'n_words': 597}