<commit_before>extend ../layout

block title
  | #{ person.name }

block meta_headers
  meta(name="description", content="#{ person.name }. #{ person.summary || '' }")

block content            
  
  article(class="person", id="person-james_gordon_brown", itemscope, itemtype="http://schema.org/Person")

    header.person-header-nav(id="person-#{person.slug}")
      //- nav
        //- a.previous-person(href="https://github.com/mysociety/popit/issues/61", title="Previous Person: Person Name")
        //-   em Previous&nbsp;Person:
        //-   strong Person&nbsp;Name
        //- a.next-person(href="https://github.com/mysociety/popit/issues/61", title="Next Person: Person Name")
        //-   em Next&nbsp;Person:
        //-   strong Person&nbsp;Name
      h1.current-person( id="person-name-in-header", title="#{ person.name }", class="edit-in-place", data-api-url="/person/#{ person.id }", data-api-name="name") #{ person.name }
      //- div.find-person
      //-   label(for="person-search") Search for Person
      //-   input#person-search(type="search", name="person-search")
      
    aside
      ul.photos
        if person.images.length
          for image in person.images
            li
              if image.url
                //- TODO - proxy will need changes to allow us to proxy remote images
                img(src=image.url, width=280)
              else
                img(src="#{image_proxy(person.slug_url + "/images/" + image.id, "", 280)}")
              p.photo-source source:
                a(href="#photographer-url") Photographer
                abbr.license(title="Creative Commons - By Attribution - Share Alike") CC-BY-SA
                ul.admin-options
                  li
                    form(method="post", action="#{person.slug_url}/images/#{image.id}/delete")
                      input(type="submit", value="delete", style="width: 4em; display: inline")
                      |  this photograph
        else
          li
            img(src='/img/person_placeholder.svg', width=280)            
      ul.admin-options
        li
          a.add(href="#{person.slug_url}/images/upload")
              strong + add 
              | a photograph

      
    ul.admin-options
      li
        a(class="delete delete-person", data-id=person.id)
          strong - delete 
          | this person
      li
        a(class="edit activate-edit-in-place", data-edit-in-place-id="person-name-in-header", href="#")
          strong ^ edit
          |  this person's name

    section.description(itemprop="description")
                  
      p(class="edit-in-place-textarea", data-api-url="/person/#{ person.id }", data-api-name="summary") #{person.summary}
    
    section.personal-details
      ul.admin-options
        li
          a.add(href="https://github.com/mysociety/popit/issues/59")
            strong + add 
            | information
        li
          a.edit(href="https://github.com/mysociety/popit/issues/59")
            strong ^ edit 
            | this section
  
      h2 Name, birthday & similar:
      dl
        dt Full Name:
        dd(itemprop="name") #{ person.name }
        
        //- dt Birthdate:
        //- dd
        //-   time(itemprop="birthDate", datetime="1951-02-20") 20 February 1951

    if person.other_names.length
      section.personal-details

        
        h2 Alternative names:

        dl
          for name in person.other_names
            dt #{ name.comment || 'Alternative name' }:
            dd(itemprop="name") #{ name.name }
        
        

    section.positions
      ul.admin-options
        li
          span.admin-options
            a(data-url-root="#{api_url_root}", data-person-id=person.id, data-person-hide-field="1", class="add new-position")
              strong + add 
              | a new position


      h2 Positions:
      dl
        for position in positions
          dt #{ position.title }:
          dd
            if position.organisation
              a(href=position.organisation.slug_url) #{ position.organisation.name }
            else
              | unknown
            //- a.hover_edit(href="#{person.slug_url}/contacts/#{contact.id}/edit") edit
            
    section.contact-information
      h2 Contact Information:
      ul.detail-list
        - var api_url_root = person.api_url + '/contact_details/'
        for item in person.contact_details
          li
            include ../contact/view
        li
          span.admin-options
            a(data-url-root="#{api_url_root}", class="add contact-edit")
              strong + add 
              | a new contact detail
                

    section.links
      h2 Links:
      ul.detail-list
        - var api_url_root = person.api_url + '/links/'
        for item in person.links
          li
            include ../link/view
        li
          span.admin-options
            a(data-url-root="#{api_url_root}", class="add link-edit")
              strong + add 
              | a new link
  
    section.raw-data
      h2 Raw data
      p The details for this person are also available in 
        a(href="/api/v1/person/#{ person.id }") JSON
        | .
<commit_msg>Provide a link to activate the summary editing<commit_after>extend ../layout

block title
  | #{ person.name }

block meta_headers
  meta(name="description", content="#{ person.name }. #{ person.summary || '' }")

block content            
  
  article(class="person", id="person-james_gordon_brown", itemscope, itemtype="http://schema.org/Person")

    header.person-header-nav(id="person-#{person.slug}")
      //- nav
        //- a.previous-person(href="https://github.com/mysociety/popit/issues/61", title="Previous Person: Person Name")
        //-   em Previous&nbsp;Person:
        //-   strong Person&nbsp;Name
        //- a.next-person(href="https://github.com/mysociety/popit/issues/61", title="Next Person: Person Name")
        //-   em Next&nbsp;Person:
        //-   strong Person&nbsp;Name
      h1.current-person( id="person-name-in-header", title="#{ person.name }", class="edit-in-place", data-api-url="/person/#{ person.id }", data-api-name="name") #{ person.name }
      //- div.find-person
      //-   label(for="person-search") Search for Person
      //-   input#person-search(type="search", name="person-search")
      
    aside
      ul.photos
        if person.images.length
          for image in person.images
            li
              if image.url
                //- TODO - proxy will need changes to allow us to proxy remote images
                img(src=image.url, width=280)
              else
                img(src="#{image_proxy(person.slug_url + "/images/" + image.id, "", 280)}")
              p.photo-source source:
                a(href="#photographer-url") Photographer
                abbr.license(title="Creative Commons - By Attribution - Share Alike") CC-BY-SA
                ul.admin-options
                  li
                    form(method="post", action="#{person.slug_url}/images/#{image.id}/delete")
                      input(type="submit", value="delete", style="width: 4em; display: inline")
                      |  this photograph
        else
          li
            img(src='/img/person_placeholder.svg', width=280)            
      ul.admin-options
        li
          a.add(href="#{person.slug_url}/images/upload")
              strong + add 
              | a photograph

      
    ul.admin-options
      li
        a(class="delete delete-person", data-id=person.id)
          strong - delete 
          | this person
      li
        a(class="edit activate-edit-in-place", data-edit-in-place-id="person-name-in-header", href="#")
          strong ^ edit
          |  this person's name

    section.description(itemprop="description")
                  
      ul.admin-options
        li
          a(class="edit activate-edit-in-place", data-edit-in-place-id="person-summary-text", href="#")
            strong ^ edit
            |  this summary

      p#person-summary-text(class="edit-in-place-textarea", data-api-url="/person/#{ person.id }", data-api-name="summary") #{person.summary}
    
    section.personal-details
      ul.admin-options
        li
          a.add(href="https://github.com/mysociety/popit/issues/59")
            strong + add 
            | information
        li
          a.edit(href="https://github.com/mysociety/popit/issues/59")
            strong ^ edit 
            | this section
  
      h2 Name, birthday & similar:
      dl
        dt Full Name:
        dd(itemprop="name") #{ person.name }
        
        //- dt Birthdate:
        //- dd
        //-   time(itemprop="birthDate", datetime="1951-02-20") 20 February 1951

    if person.other_names.length
      section.personal-details

        
        h2 Alternative names:

        dl
          for name in person.other_names
            dt #{ name.comment || 'Alternative name' }:
            dd(itemprop="name") #{ name.name }
        
        

    section.positions
      ul.admin-options
        li
          span.admin-options
            a(data-url-root="#{api_url_root}", data-person-id=person.id, data-person-hide-field="1", class="add new-position")
              strong + add 
              | a new position


      h2 Positions:
      dl
        for position in positions
          dt #{ position.title }:
          dd
            if position.organisation
              a(href=position.organisation.slug_url) #{ position.organisation.name }
            else
              | unknown
            //- a.hover_edit(href="#{person.slug_url}/contacts/#{contact.id}/edit") edit
            
    section.contact-information
      h2 Contact Information:
      ul.detail-list
        - var api_url_root = person.api_url + '/contact_details/'
        for item in person.contact_details
          li
            include ../contact/view
        li
          span.admin-options
            a(data-url-root="#{api_url_root}", class="add contact-edit")
              strong + add 
              | a new contact detail
                

    section.links
      h2 Links:
      ul.detail-list
        - var api_url_root = person.api_url + '/links/'
        for item in person.links
          li
            include ../link/view
        li
          span.admin-options
            a(data-url-root="#{api_url_root}", class="add link-edit")
              strong + add 
              | a new link
  
    section.raw-data
      h2 Raw data
      p The details for this person are also available in 
        a(href="/api/v1/person/#{ person.id }") JSON
        | .

{'fraction_non_alphanumeric': 0.12870352896772977, 'fraction_numerical': 0.007737308926212493, 'mean_word_length': 1.665074176514961, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3500387', 'n_tokens_mistral': 3097, 'n_tokens_neox': 2961, 'n_words': 599}