%tr{id: planning_application.id}
  %td
    %div.map
      = planning_application.tinymap
  %td.title
    - title_length= planning_application.part_hidden? ? 80 : 200
    %h3{title: planning_application.title}= link_to (truncate planning_application.title, length: title_length, separator: ' '),
      show_uid_planning_applications_path(planning_application.uid)
    - if planning_application.part_hidden?
      .tag-item
        = t ".part_hidden"
      &nbsp;
    - if planning_application.has_issue?
      %p= t ".converted_to_issue"
      %p= planning_application.issue_link
    -else
      = link_to t(".convert_to_issue_html"), new_planning_application_issue_path(planning_application), class: "btn-green"
      &nbsp;
      - if planning_application.users.include? current_user
        = link_to t(".unhide"), unhide_planning_application_path(planning_application),
          method: :put, class: "btn-grey", remote: :true
      -else
        = link_to t(".hide"), hide_planning_application_path(planning_application),
          method: :put, title: t('.hide_tooltip'), class: "btn-grey", remote: :true

  %td
    %p= planning_application.authority_name
  %td{title: planning_application.description}
    %p= planning_application.description.truncate(300)
  %td
    %p= link_to planning_application.uid, planning_application.url


%tr{id: planning_application.id}
  %td
    %div.map
      = planning_application.tinymap
  %td.title
    - title_length= planning_application.part_hidden? ? 80 : 200
    %h3{title: planning_application.title}= link_to (truncate planning_application.title, length: title_length, separator: ' '),
      show_uid_planning_applications_path(planning_application.uid)
    - if planning_application.part_hidden?
      .tag-item
        = t ".part_hidden"
      &nbsp;
    - if planning_application.has_issue?
      %p= t ".converted_to_issue"
      %p= planning_application.issue_link
    -else
      = link_to t(".convert_to_issue_html"), new_planning_application_issue_path(planning_application), class: "btn-green"
      &nbsp;
      - if planning_application.users.include? current_user
        = link_to t(".unhide"), unhide_planning_application_path(planning_application),
          method: :put, class: "btn-grey", remote: :true
      -else
        = link_to t(".hide"), hide_planning_application_path(planning_application),
          method: :put, title: t('.hide_tooltip'), class: "btn-grey", remote: :true

  %td
    %p= planning_application.authority_name
  %td{title: planning_application.description}
    %p= planning_application.description.try(:truncate, 300)
  %td
    %p= link_to planning_application.uid, planning_application.url


Fix when planning app description is nil
Fix when planning app description is nil
