af83/chouette-core

View on GitHub
app/views/point_of_interests/show.html.slim

Summary

Maintainability
Test Coverage
- breadcrumb :point_of_interest, @workbench, @point_of_interest
- page_header_content_for @point_of_interest

.page_content
  .container-fluid
    .row
      .col-lg-6.col-md-6.col-sm-12.col-xs-12
        = simple_block_for @point_of_interest, title: t('point_of_interests.form.sections.identification') do |d|
          = d.attribute :name
          = d.attribute :url, link: @point_of_interest.url
          = d.attribute :point_of_interest_category, as: :association, link: ->(category) { workbench_shape_referential_point_of_interest_category_path(@workbench, category) }
          = d.attribute :position_input
          = d.attribute :address_line_1
          = d.attribute :zip_code
          = d.attribute :city_name
          = d.attribute :postal_region
          = d.attribute :country
          = d.attribute :email
          = d.attribute :phone

      .col-lg-6.col-md-6.col-sm-12.col-xs-12
        = render 'codes/block', model: @point_of_interest
    .row
      .col-lg-6.col-md-6.col-sm-12.col-xs-12
        = simple_block_for @point_of_interest, title: t('point_of_interests.form.sections.hours') do |d|
          - if @point_of_interest.point_of_interest_hours.empty?
            .mb-xs
              = replacement_msg t('point_of_interests.no_hours')
          - else
            - @point_of_interest.point_of_interest_hours.each do |c|
              = d.attribute :opening_time_of_day, as: :time_of_day, object: c
              = d.attribute :closing_time_of_day, as: :time_of_day, object: c
              = d.attribute :week_days, value: %w(monday tuesday wednesday thursday friday saturday sunday).collect{ |d| content_tag(:span, t("calendars.days.#{d}"), class: "label label-default #{c.week_days.send(d + '?') ? '' : 'disabled'}") }.join.html_safe, object: c