%section#content.thread
  %header
    - if @issue
      %p.pre-title= link_to @issue.title, issue_path(@issue)
    %h1= @thread.title
    .meta
      .privacy
        - if @thread.private_to_group?
          %p= t ".private_to_group_message", group: @thread.group.name
        - else
          %p= t ".public_message"
      = render partial: "message_thread/tags/panel", locals: {thread: @thread}
    - if @issue
      .description
        %p= @issue.description
    - if permitted_to?(:destroy, @thread)
      %menu.tools
        %ul
          %li= link_to t(".destroy"), thread_path(@thread), method: :delete, confirm: t(".are_you_sure")

  = render collection: @messages, partial: "messages/message"
  = render "messages/new"

%aside#sidebar
  = render "subscribe_panel", thread: @thread
  %section.map
    - m = tiny_display_map(@issue, geometry_issue_path(@issue, :json), "minimap") do |map, page, dom_id|
      %div{id: dom_id, class: "minimap"}
    != m.to_html
  = render "subscribers_panel", group: @thread.group, subscribers: @subscribers

%section#content.thread
  %header
    - if @issue
      %p.pre-title= link_to @issue.title, issue_path(@issue)
    %h1= @thread.title
    .meta
      .privacy
        - if @thread.private_to_group?
          %p= t ".private_to_group_message", group: @thread.group.name
        - else
          %p= t ".public_message"
      = render partial: "message_thread/tags/panel", locals: {thread: @thread}
    - if @issue
      .description
        %p= @issue.description
    - if permitted_to?(:destroy, @thread)
      %menu.tools
        %ul
          %li= link_to t(".destroy"), thread_path(@thread), method: :delete, confirm: t(".are_you_sure")

  = render collection: @messages, partial: "messages/message"
  = render "messages/new"

%aside#sidebar
  = render "subscribe_panel", thread: @thread
  - if @issue
    %section.map
      - m = tiny_display_map(@issue, geometry_issue_path(@issue, :json), "minimap") do |map, page, dom_id|
        %div{id: dom_id, class: "minimap"}
      != m.to_html
  = render "subscribers_panel", group: @thread.group, subscribers: @subscribers

Add guard for existence of an issue attached to thread.
Add guard for existence of an issue attached to thread.
