<!--show_tags
	<dt>Tags</dt>
    <dd id="the_tags">
        [%=render_partial('static_tags',{tags:tags,is_editing:false});%]
    </dd>
    <dd class="add-tags">
        [%=render_partial('deletable_tags',{tags:tags,is_editing:false});%]

        <span class="tag-field action-field">
            <label>Add tags</label><input name="new_tag" type="text"/>
            <ul>
            <li><input class="add-atag-action" type="button" value="add tag"/></li>
            <li><a class="close-tag-action" href="#">close</a></li>
            </ul>
        </span>
    </dd>
-->
<!--static_tags
	
	<ul class="static-tags">[%
    if(tags!=null && tags.tag!=null && tags.tag.length!=0){
        if(tags.tag.length>0){
        $.each(tags.tag,function(i,n){
            %]<li>[%=n.label%], </li>[%
        });
        %]
            <li><a class="open-tag-edit edit-tags-action" href="#">Edit Tags</a></li>
        [%
    }
    }else{
    %]
        <li><a class="open-tag-edit" href="#">Add Tags</a></li>
    [%
    }
    %]</ul>
-->

<!--deletable_tags

	<ul class="deletable-tags">[%

    if(tags!=null && tags.tag!=null){
    if(tags.tag.length>0){
    $.each(tags.tag,function(i,n){
        %]<li><a href="#" rel="[%=i%]">[%=n.label%]</a></li>[%
    });
    }
    }%]</ul>
-->

<!--edit_contact_inline
	<div class="contact-info-header">
        <img  src="/api/contacts/[%=contact.id%]/avatar" alt="photo" class="photo"/>
        <span style="float: left;">
            <span class="first-name">[%=contact.firstName %] [%=contact.lastName %]</span>
            <span class="job-title" >[%=contact.title %]</span>
        </span>
  </div>

  <div class="contact-info-details">
    [%
    with(contact){
        var j=0;

        %]
        <dl class="tags-list">
        [%=render_partial('show_tags',{tags:tags,is_editing:false});%]
        </dl>
        [%

        if(emailAddresses!=null){
            %]<dl><dt>asdasd</dt>[%
            /* Show First */
            %]<dd><strong>[%=emailAddresses.emailAddress[0].type.value%]</strong> : <a href="mailto:[%=emailAddresses.emailAddress[0].email%]">[%=emailAddresses.emailAddress[0].email%]</a></dd>[%


            if(emailAddresses.emailAddress.length>1){
                /* Show Others */
                $.each(emailAddresses.emailAddress,function(i,n){
                    if(i!=0){
                        %]<dd>[%=n.type.value%] : <a href="mailto:[%=n.email%]">[%=n.email%]</a></dd>[%
                    }

                });

            }
            %]</dl>[%
        }

        if(phoneNumbers!=null){
                %]<dl><dt>Phone</dt>[%
                /* Show First */
                %]<dd><strong>[%=phoneNumbers.phoneNumber[0].type.value%]</strong> : [%=phoneNumbers.phoneNumber[0].number%]</dd>[%
                 if(phoneNumbers.phoneNumber.length>1){
                    /* Show Others */
                    $.each(phoneNumbers.phoneNumber,function(i,n){
                        if(i!=0){
                        %]<dd>[%=n.type.value%] : <a href="callto:[%=n.number%]">[%=n.number%]</a></dd>[%
                        }

                    });

                }
                %]</dl>[%
            }

            if(websites!=null){
                %]<dl><dt>Website</dt>[%
                /* Show First */
                %]<dd><strong>[%=websites.website[0].type.value%]</strong> : <a href="http://[%=websites.website[0].url%]" target="blank">[%=websites.website[0].url%]</a></dd>[%
                if(websites.website.length>1){
                  /* Show Others */
                  $.each(websites.website,function(i,n){
                      if(i!=0){
                      %]<dd>[%=n.type.value%] : <a href="http://[%=n.url%]" target="blank">[%=n.url%]</a></dd>[%
                      }

                  });
              }
                %]</dl>[%
            }

            if(addresses!=null){
                %]<dl><dt>Address</dt>[%
                /* Show First */
                %]<dd><strong>[%=addresses.address[0].type.value%]</strong> : [%=addresses.address[0].street%]</dd>[%
                 if(addresses.address.length>1){

                    /* Show Others */
                    $.each(addresses.address,function(i,n){
                        if(i!=0){
                        %]<dd>[%=n.type.value%] : [%=n.street%]</dd>[%
                        }

                    });

                }
                 %]</dl>[%
            }

    }
    %]
  </div>
-->


<!--contact_tasks_and_notes
	<div class="Tabs">
        <ul>
            <li><a href="#contact-notes">Notes</a></li>
            <li><a href="#contact-tasks">Todos</a></li>
        </ul>
    </div>


    <div id="contact-notes" class="contact-tab-panel hide">
        <div id="id-add-note-container" class="show-hide Pane" rel="id-add-note-panel">
            <a class="more-show" href="#">Add a note</a>
            <div id="id-add-note-panel" class="hide">
                <h2>Add a note to this contact.</h2>
                <form action="/api/notes" id="add-note-form">
                    <span class="Field">
                        <label class="hide">Subject</label>
                        <textarea id="add-note-body" class="expanding"/>
                    </span>

                    <div class="Actions">
                        <ul>
                            <li><input type="button" value="Add note" id="add-note-action"/></li>
                            <li><a class="less-hide" href="#">Cancel</a></li>
                        </ul>
                    </div>
                </form>
            </div>
        </div>
        <div class="Pane" id="contact-notes-list">
        [%
            if(contact.note!=null && contact.note[0]!=null){
                var _groups=group_notes(contact.note);

                $.each(_groups,function(i,n){
                    if(n.notes.length!=0 && n.notes[0]!=null){
                        %]<dl class="note-list [%=n.css%]">
                            <dt class="note-group">[%=n.title%]</dt>
                        [%
                        $.each(n.notes,function(ii,nn){
                        %]
                        <dd>
                        <div class="CommentItem hentry">
                            <h3>
                                 <span class="perma"><a title="Permalink" href="#comment_196" rel="bookmark">#</a></span>

                                 <span class="vcard"><a href="/profile/[%=nn.createdBy%]"><strong class="fn author">username</strong></a></span>
                                    <em>
                                        <abbr title="[%=get_time_ago(nn.createdAt)%]" class="published updated timeago">[%=nn.createdAt.toString()%]</abbr>
                                    </em>
                            </h3>
                            <img alt="Mark Forster" src="/profile/[%=nn.createdBy%]/avatar" class="photo avatar hide"/>
                            <div style="background-image: url(/images/contacts/people_logo.jpg);" class="indented">
                            <div class="entry-content">
                            <p>[%=parse_note_body(nn.body)%]</p></div>
                            </div>
                        </div>
                        </dd>
                        [%
                        });
                    }
                });
            }
            %]
        </div>

    </div>




    <div id="contact-tasks" class="contact-tab-panel hide">
    <div id="id-add-task-container" class="show-hide Pane" rel="id-add-note-panel">
        <a class="more-show" href="#">Add a todo</a>
        <div id="id-add-task-panel" class="hide">
            <h2>Need to...</h2>
            <form action="/api/task" id="add-task-form">
                <span class="Field ClearedField">
                    <label class="hide">Title</label>
                    <input type="text" id="add-task-title" name="description"/>
                </span>

                <span class="Field ">
                    <label>Type</label>
                    <select name="taskType">
                    [%
                        $.each(tasktypes.taskType,function(o,p){
                    %]
                        <option value="[%=p.id%]">[%=p.name%]</option>
                    [%
                        });
                    %]
                    </select>
                </span>

                <span class="Field">
                    <label>Assigned To</label>
                    <select name="assignTo">
                    [%
                        $.each(users.user,function(o,p){
                    %]
                        <option value="[%=p.id%]">[%=p.firstName%] [%=p.lastName%]</option>
                    [%
                        });
                    %]</select>
                </span>

                <span class="Field">
                    <label>Due</label>
                    <input type="text" name="due"/>
                </span>

                <div class="Actions">
                    <ul>
                        <li><input type="button" value="Add todo" id="add-task-action"/></li>
                        <li><a class="less-hide" href="#">Cancel</a></li>
                    </ul>
                </div>
            </form>

        </div>
    </div>


    </div>




-->

<div class="contact-holder">
  <div class="contact-panel"">
      <div class="gen-toolbar toolbar ">
          <ul id="general_toolbar">
              <li><a title="Edit" href="#" id="link-contact-edit">Edit</a></li>
              <li><a title="Delete" href="#" id="link-contact-delete">Delete</a></li>
          </ul>
          <ul id="edit_toolbar" class="hide">
            <li><a title="Save changes" href="#" id="link-contact-confirm">Done</a></li>
            

          </ul>
      </div>
      <div id="contact-information" class="contact-tab-panel contact-metadata ">
         
      </div>
  </div>

  <div class="contact-information-pane">
      
  </div>
</div>

