- opts ||= {}
- cache([photograph, photograph.metadata, opts]) do
  div class="row"
    aside class="metadata large-12 columns"
      header
        h5= t("photographs.metadata.title")
      
      table
        - sections = photograph.show_copyright_info? ? [:camera, :image, :settings, :creator] : [:camera, :image, :settings]
        - sections.each do |attr|
          - if metadata_values_for_attr(photograph, attr, opts).size > 0
            thead
              tr
                td colspan="2"
                  = t("photographs.metadata.#{attr}")
            tbody
              - metadata_values_for_attr(photograph, attr, opts).each do |key, value|
                tr
                  td= t("photographs.metadata.#{key}")
                  td= parse_and_display_metadata_value(key, value)

        thead
          tr
            td colspan="2"
              = t("photographs.metadata.details")
        tbody
          - if photograph.category.present?
            tr
              td= t("photographs.metadata.category")
              td= link_to photograph.category.name, category_path(photograph.category)

          tr
            td= t("photographs.metadata.license")
            td
              - if photograph.license.present?
                = photograph.license.name
              - else
                = t("photographs.metadata.default_license")

- opts ||= {}
- cache([photograph, photograph.metadata, opts], expires_in: 1.hour) do
  div class="row"
    aside class="metadata large-12 columns"
      header
        h5= t("photographs.metadata.title")
      
      table
        - sections = photograph.show_copyright_info? ? [:camera, :image, :settings, :creator] : [:camera, :image, :settings]
        - sections.each do |attr|
          - if metadata_values_for_attr(photograph, attr, opts).size > 0
            thead
              tr
                td colspan="2"
                  = t("photographs.metadata.#{attr}")
            tbody
              - metadata_values_for_attr(photograph, attr, opts).each do |key, value|
                tr
                  td= t("photographs.metadata.#{key}")
                  td= parse_and_display_metadata_value(key, value)

        thead
          tr
            td colspan="2"
              = t("photographs.metadata.details")
        tbody
          - if photograph.category.present?
            tr
              td= t("photographs.metadata.category")
              td= link_to photograph.category.name, category_path(photograph.category.slug)

          tr
            td= t("photographs.metadata.license")
            td
              - if photograph.license.present?
                = photograph.license.name
              - else
                = t("photographs.metadata.default_license")

Fix category links on metadata
Fix category links on metadata

damoguyan8844/photographer-io,arnkorty/photographer-io,arnkorty/photographer-io,wangjun/photographer-io,arnkorty/photographer-io,damoguyan8844/photographer-io,wangjun/photographer-io,xuewenfei/photographer-io,damoguyan8844/photographer-io,robotmay/photographer-io,xuewenfei/photographer-io,xuewenfei/photographer-io,laputaer/photographer-io,robotmay/photographer-io,robotmay/photographer-io,laputaer/photographer-io,wangjun/photographer-io,laputaer/photographer-io