<commit_before><%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ taglib tagdir="/WEB-INF/tags" prefix="im"%>

<!-- objectDetails.jsp -->
<html:xhtml/>

<script type="text/javascript">
<!--//<![CDATA[

queue = [];

function queueInlineTemplateQuery(placement, templateName, id) {
  queue.push([placement, templateName, id]);
}

/* Called onload */
function loadInlineTemplates() {
  loadInlineTemplate(0);
}

function loadInlineTemplate(i) {
  if (i >= queue.length) {
    return;
  }

  var placement = queue[i][0];
  var templateName = queue[i][1];
  var id = queue[i][2];
  var uid = placement.replace(/ /, '_') + '_' + templateName;

  Element.show('table_'+uid+'_int');
  $('table_'+uid+'_int').innerHTML = placement + templateName + id;

  new Ajax.Updater('table_'+uid+'_int', '<html:rewrite action="/modifyDetails"/>', {
    parameters:'method=ajaxTemplateCount&template='+templateName+'&object='+id+'&type=global&placement='+placement, asynchronous:true,
    onComplete: function() {
      var count = $('count_'+uid).innerHTML;
      if (count == '0')
        $('img_'+uid).src='images/blank.gif';
      else
        $('img_'+uid).src='images/plus.gif';
      // load the next one
      loadInlineTemplate(i+1);
    },
    evalScripts: true
  });
}

function toggleCollectionVisibility(placement, field, object_id) {
  if ($('coll_'+placement+'_'+field+'_inner').innerHTML=='') {
    // need to fetch
    new Ajax.Updater('coll_'+placement+'_'+field+'_inner', '<html:rewrite action="/modifyDetails"/>', {
      parameters:'method=ajaxVerbosify&placement='+placement+'&field='+field+'&id='+object_id,
      asynchronous:true
    });
  } else {
    new Ajax.Request('<html:rewrite action="/modifyDetails"/>', {
      parameters:'method=ajaxVerbosify&placement='+placement+'&field='+field+'&id='+object_id,
      asynchronous:true
    });
  }
  toggleSlide(placement, field);
  return false;
}

function toggleSlide(placement, field) {
  var img = $('img_'+placement+'_'+field).src;
  $('img_'+placement+'_'+field).src = (img.indexOf('images/minus.gif') >= 0 ? 'images/plus.gif' : 'images/minus.gif');
  Element.toggle('coll_'+placement+'_'+field);//, 'blind');//, {duration: 0.2});
}

function toggleTemplateList(placement, template) {
  var img = $('img_'+placement+'_'+template).src;
  $('img_'+placement+'_'+template).src = (img.indexOf('images/minus.gif') >= 0 ? 'images/plus.gif' : 'images/minus.gif');
  Element.toggle('table_'+placement+'_'+template);
  return false;
}

Event.observe(window, 'load', loadInlineTemplates, false);

//]]>-->
</script>

<c:set var="helpUrl"
       value="${WEB_PROPERTIES['project.helpLocation']}/manual/manualObjectDetails.shtml"/>

<%-- figure out whether we should show templates or not --%>
<c:set var="showTemplatesFlag" value="false"/>
<c:set var="showImportantTemplatesFlag" value="false"/>

<c:forEach items="${object.clds}" var="cld">
  <c:set var="className" value="${cld.name}"/>
  <c:if test="${!empty CLASS_CATEGORY_TEMPLATES[className]}">
    <c:set var="showTemplatesFlag" value="true"/>
    <c:forEach items="${CLASS_CATEGORY_TEMPLATES[className]}" var="cats">
      <c:forEach items="${cats.value}" var="tmpl">
        <c:if test="${tmpl.important}">
          <c:set var="showImportantTemplatesFlag" value="true"/>
        </c:if>
      </c:forEach>
    </c:forEach>
  </c:if>
</c:forEach>

<im:box helpUrl="${helpUrl}"
        titleKey="objectDetails.heading.details">

<tiles:get name="objectTrail.tile"/>

<c:if test="${!empty object}">

  <table width="100%">
    <tr>
      <td valign="top" width="30%">

        <im:heading id="summary">
          Summary for selected
          <c:forEach items="${object.clds}" var="cld">
            ${cld.unqualifiedName}
          </c:forEach>
        </im:heading>

        <im:body id="summary">
          <table cellpadding="5" border="0" cellspacing="0" class="objSummary">

            <%-- Show the summary fields (fields that are shown in tables of this object type) --%>
            <c:forEach items="${object.fieldExprs}" var="expr">
              <c:if test="${object.fieldConfigMap[expr].showInSummary}">
                <im:eval evalExpression="object.object.${expr}" evalVariable="outVal"/>
                <tr>
                  <td nowrap>
                    <b><span class="attributeField">${expr}</span></b>
                    <c:forEach items="${object.clds}" var="cld">
                      <im:typehelp type="${cld.unqualifiedName}.${expr}"/>
                    </c:forEach>
                  </td>
                  <td>
                    <c:choose>
                      <c:when test="${empty outVal}">
                        &nbsp;
                      </c:when>
                      <c:otherwise>
                        <b><im:value>${outVal}</im:value></b>
                      </c:otherwise>
                    </c:choose>
                  </td>
                </tr>
              </c:if>
            </c:forEach>

            <%-- Show all other fields --%>
            <c:forEach items="${object.attributes}" var="entry">
              <c:if test="${! object.fieldConfigMap[entry.key].showInSummary && !object.fieldConfigMap[entry.key].sectionOnRight}">
                <tr>
                  <td>
                    <span class="attributeField">${entry.key}</span>
                  </td>
                  <td>
                    <c:set var="maxLength" value="60"/>
                    <c:choose>
                      <c:when test="${entry.value.class.name ==<commit_msg>Put help "?" on all fields in the object details page summary, not just the configured ones.<commit_after><%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ taglib tagdir="/WEB-INF/tags" prefix="im"%>

<!-- objectDetails.jsp -->
<html:xhtml/>

<script type="text/javascript">
<!--//<![CDATA[

queue = [];

function queueInlineTemplateQuery(placement, templateName, id) {
  queue.push([placement, templateName, id]);
}

/* Called onload */
function loadInlineTemplates() {
  loadInlineTemplate(0);
}

function loadInlineTemplate(i) {
  if (i >= queue.length) {
    return;
  }

  var placement = queue[i][0];
  var templateName = queue[i][1];
  var id = queue[i][2];
  var uid = placement.replace(/ /, '_') + '_' + templateName;

  Element.show('table_'+uid+'_int');
  $('table_'+uid+'_int').innerHTML = placement + templateName + id;

  new Ajax.Updater('table_'+uid+'_int', '<html:rewrite action="/modifyDetails"/>', {
    parameters:'method=ajaxTemplateCount&template='+templateName+'&object='+id+'&type=global&placement='+placement, asynchronous:true,
    onComplete: function() {
      var count = $('count_'+uid).innerHTML;
      if (count == '0')
        $('img_'+uid).src='images/blank.gif';
      else
        $('img_'+uid).src='images/plus.gif';
      // load the next one
      loadInlineTemplate(i+1);
    },
    evalScripts: true
  });
}

function toggleCollectionVisibility(placement, field, object_id) {
  if ($('coll_'+placement+'_'+field+'_inner').innerHTML=='') {
    // need to fetch
    new Ajax.Updater('coll_'+placement+'_'+field+'_inner', '<html:rewrite action="/modifyDetails"/>', {
      parameters:'method=ajaxVerbosify&placement='+placement+'&field='+field+'&id='+object_id,
      asynchronous:true
    });
  } else {
    new Ajax.Request('<html:rewrite action="/modifyDetails"/>', {
      parameters:'method=ajaxVerbosify&placement='+placement+'&field='+field+'&id='+object_id,
      asynchronous:true
    });
  }
  toggleSlide(placement, field);
  return false;
}

function toggleSlide(placement, field) {
  var img = $('img_'+placement+'_'+field).src;
  $('img_'+placement+'_'+field).src = (img.indexOf('images/minus.gif') >= 0 ? 'images/plus.gif' : 'images/minus.gif');
  Element.toggle('coll_'+placement+'_'+field);//, 'blind');//, {duration: 0.2});
}

function toggleTemplateList(placement, template) {
  var img = $('img_'+placement+'_'+template).src;
  $('img_'+placement+'_'+template).src = (img.indexOf('images/minus.gif') >= 0 ? 'images/plus.gif' : 'images/minus.gif');
  Element.toggle('table_'+placement+'_'+template);
  return false;
}

Event.observe(window, 'load', loadInlineTemplates, false);

//]]>-->
</script>

<c:set var="helpUrl"
       value="${WEB_PROPERTIES['project.helpLocation']}/manual/manualObjectDetails.shtml"/>

<%-- figure out whether we should show templates or not --%>
<c:set var="showTemplatesFlag" value="false"/>
<c:set var="showImportantTemplatesFlag" value="false"/>

<c:forEach items="${object.clds}" var="cld">
  <c:set var="className" value="${cld.name}"/>
  <c:if test="${!empty CLASS_CATEGORY_TEMPLATES[className]}">
    <c:set var="showTemplatesFlag" value="true"/>
    <c:forEach items="${CLASS_CATEGORY_TEMPLATES[className]}" var="cats">
      <c:forEach items="${cats.value}" var="tmpl">
        <c:if test="${tmpl.important}">
          <c:set var="showImportantTemplatesFlag" value="true"/>
        </c:if>
      </c:forEach>
    </c:forEach>
  </c:if>
</c:forEach>

<im:box helpUrl="${helpUrl}"
        titleKey="objectDetails.heading.details">

<tiles:get name="objectTrail.tile"/>

<c:if test="${!empty object}">

  <table width="100%">
    <tr>
      <td valign="top" width="30%">

        <im:heading id="summary">
          Summary for selected
          <c:forEach items="${object.clds}" var="cld">
            ${cld.unqualifiedName}
          </c:forEach>
        </im:heading>

        <im:body id="summary">
          <table cellpadding="5" border="0" cellspacing="0" class="objSummary">

            <%-- Show the summary fields as configured in webconfig.xml --%>
            <c:forEach items="${object.fieldExprs}" var="expr">
              <c:if test="${object.fieldConfigMap[expr].showInSummary}">
                <im:eval evalExpression="object.object.${expr}" evalVariable="outVal"/>
                <tr>
                  <td nowrap>
                    <b><span class="attributeField">${expr}</span></b>
                    <c:forEach items="${object.clds}" var="cld">
                      <im:typehelp type="${cld.unqualifiedName}.${expr}"/>
                    </c:forEach>
                  </td>
                  <td>
                    <c:choose>
                      <c:when test="${empty outVal}">
                        &nbsp;
                      </c:when>
                      <c:otherwise>
                        <b><im:value>${outVal}</im:value></b>
                      </c:otherwise>
                    </c:choose>
                  </td>
                </tr>
              </c:if>
            </c:forEach>

            <%-- Show all other fields --%>
            <c:forEach items="${object.attributes}" var="entry">
              <c:if test="${! object.fieldConfigMap[entry.key].showInSummary && !object.fieldConfigMap[entry.key].sectionOnRight}">
                <tr>
                  <td>
                    <span class="attributeField">${entry.key}</span>
                    <c:forEach items="${object.clds}" var="cld">
                      <im:typehelp type="${cld.unqualifiedName}.${entry.key}"/>
                    </c:forEach>
                  </td>
                  <td>
                    <c:set var="maxLength" value="60"/>
                    <c:choose>
                      <c:when test="${entry.value.class.name ==
{'fraction_non_alphanumeric': 0.19575870226427847, 'fraction_numerical': 0.0033795201081446434, 'mean_word_length': 2.768545049347342, 'pattern_counts': {'":': 0, '<': 176, '<?xml version=': 0, '>': 180, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, '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': '4889268', 'n_tokens_mistral': 3874, 'n_tokens_neox': 3719, 'n_words': 603}