Project import generated by Copybara.
GitOrigin-RevId: d9e9e3fb4e31372ec1fb43b178994ca78fa8fe70
diff --git a/templates/tracker/component-detail-page.ezt b/templates/tracker/component-detail-page.ezt
new file mode 100644
index 0000000..01757d1
--- /dev/null
+++ b/templates/tracker/component-detail-page.ezt
@@ -0,0 +1,169 @@
+[# Use raw format because the title variable will be escaped when used.]
+[define title]Component [format "raw"][component_def.path][end][end]
+[define category_css]css/ph_detail.css[end]
+[include "../framework/header.ezt" "showtabs"]
+
+<a href="/p/[projectname]/adminComponents">‹ Back to component list</a><br><br>
+
+
+<h4>Component</h4>
+[if-any creator]
+ Created by <a href="[creator.profile_url]">[creator.display_name]</a> [created]<br/>
+[end]
+[if-any modifier]
+ Last modified by <a href="[modifier.profile_url]">[modifier.display_name]</a> [modified]<br/>
+[end]
+
+<br/>
+<form action="detail.do" method="POST">
+<input type="hidden" name="token" value="[form_token]">
+<input type="hidden" name="component" value="[component_def.path]">
+<table cellspacing="8" class="rowmajor vt">
+ <tr>
+ <th width="1%">Name:</th>
+ <td>
+ [if-any allow_edit]
+ [if-any component_def.parent_path][component_def.parent_path]>[end]
+ <input id="leaf_name" name="leaf_name" value="[initial_leaf_name]" size="30" class="acob">
+ <span id="leafnamefeedback" class="fielderror" style="margin-left:1em">
+ [if-any errors.leaf_name][errors.leaf_name][end]
+ </span>
+ [else]
+ [component_def.path]
+ [end]
+ </td>
+ </tr>
+
+ <tr>
+ <th>Description:</th>
+ <td>
+ [if-any allow_edit]
+ <textarea name="docstring" rows="4" cols="75">[initial_docstring]</textarea>
+ [else]
+ [component_def.docstring]
+ [end]
+ </td>
+ </tr>
+
+ <tr>
+ <th>Admins:</th>
+ <td>
+ [if-any allow_edit]
+ <textarea id="member_admins" name="admins" rows="3" cols="75">[for initial_admins][initial_admins], [end]</textarea>
+ <span id="memberadminsfeedback" class="fielderror" style="margin-left:1em">
+ [if-any errors.member_admins][errors.member_admins][end]
+ </span>
+ [else]
+ [for component_def.admins]
+ <div>[include "../framework/user-link.ezt" component_def.admins]</div>
+ [end]
+ [end]
+ </td>
+ </tr>
+
+ <tr>
+ <th>Auto Cc:</th>
+ <td>
+ [if-any allow_edit]
+ <textarea id="member_cc" name="cc" rows="3" cols="75">[for initial_cc][initial_cc], [end]</textarea>
+ <span id="memberccfeedback" class="fielderror" style="margin-left:1em">
+ [if-any errors.member_cc][errors.member_cc][end]
+ </span>
+ [else]
+ [for component_def.cc]
+ <div>[include "../framework/user-link.ezt" component_def.cc]</div>
+ [end]
+ [end]
+ </td>
+ </tr>
+
+ <tr>
+ <th>Add Labels:</th>
+ <td>
+ [if-any allow_edit]
+ <textarea id="labels" name="labels" rows="3" cols="75">[for initial_labels][initial_labels], [end]</textarea>
+ <span id="labelsfeedback" class="fielderror" style="margin-left:1em">
+ [if-any errors.labels][errors.labels][end]
+ </span>
+ [else]
+ [for component_def.labels]
+ <div>[component_def.labels]</div>
+ [end]
+ [end]
+ </td>
+ </tr>
+
+ <tr>
+ <th>Deprecated:</th>
+ <td>
+ <input type="checkbox" id="deprecated" name="deprecated" [if-any initial_deprecated]checked="checked"[end]
+ [if-any allow_edit][else]disabled[end]>
+ </td>
+ </tr>
+
+ <tr>
+ <td></td>
+ <td>
+ [if-any allow_edit]
+ <div>
+ <span style="float:left;">
+ <input type="submit" name="submit" id="submit_btn" value="Submit changes">
+ <input type="submit" class="secondary" name="deletecomponent" value="Delete component"
+ [if-any allow_delete][else]disabled[end]
+ id="deletecomponent">
+ </span>
+ <span style="float:right;">
+ <a href="/p/[projectname]/components/create?component=[component_def.path]">Create new subcomponent</a>
+ </span>
+ <div style="clear:both;"></div>
+ </div>
+ [if-any allow_delete][else]
+ <br/><br/>
+ <b>Note:</b>
+ [if-any subcomponents]
+ <br/>
+ Can not delete this component because it has the following subcomponents:<br/>
+ [for subcomponents]<div style="margin-left:1em">[subcomponents.path]</div>[end]
+ [end]
+ [if-any templates]
+ <br/>
+ Can not delete this component because it is listed in the following templates:<br/>
+ [for templates]<div style="margin-left:1em">[templates.name]</div>[end]
+ [end]
+ [end]
+ [end]
+ </td>
+ </tr>
+
+</table>
+</form>
+
+[if-any allow_edit]
+<script type="text/javascript" nonce="[nonce]">
+runOnLoad(function() {
+ function checkSubmit() {
+ _checkLeafName('[format "js"][projectname][end]', '[format "js"][component_def.parent_path][end]', '[format "js"][component_def.leaf_name][end]', CS_env.token);
+ }
+ setInterval(checkSubmit, 700);
+
+ if ($("deletecomponent")) {
+ $("deletecomponent").addEventListener("click", function(event) {
+ if (!confirm("Are you sure you want to delete [component_def.path]?\nThis operation cannot be undone."))
+ event.preventDefault();
+ });
+ }
+
+ var acobElements = document.getElementsByClassName("acob");
+ for (var i = 0; i < acobElements.length; ++i) {
+ var el = acobElements[[]i];
+ el.addEventListener("focus", function(event) {
+ _acrob(null);
+ _acof(event);
+ });
+ }
+});
+</script>
+[end]
+
+
+[include "../framework/footer.ezt"]