Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 1 | [# Show top-level tabs. |
| 2 | |
| 3 | Args: |
| 4 | arg0: Can be "showtabs", or "showusertabs" to select which |
| 5 | top-level tabs are shown. |
| 6 | arg1: String like "t1", "t2", "t3" to identify the currently active tab. |
| 7 | ] |
| 8 | [if-any projectname] |
| 9 | |
| 10 | [# Non-fixed container around mr-header to allow the fixed header to "take up space". ] |
| 11 | <div style="width: 100%; height: var(--monorail-header-height); margin-bottom: -1px;"> |
| 12 | <mr-header |
| 13 | [if-any logged_in_user] |
| 14 | userDisplayName="[logged_in_user.email]" |
| 15 | [end] |
| 16 | projectThumbnailUrl="[project_thumbnail_url]" |
| 17 | projectName="[projectname]" |
| 18 | loginUrl="[login_url]" |
| 19 | logoutUrl="[logout_url]" |
| 20 | ></mr-header> |
| 21 | </div> |
| 22 | [else] |
| 23 | <table id="monobar" width="100%" cellpadding="0" cellspacing="0" role="presentation"> |
| 24 | <tr> |
| 25 | <th class="padded"> |
| 26 | <a href="/" id="wordmark">[site_name]</a> |
| 27 | </th> |
| 28 | [if-any viewed_user] |
| 29 | <th class="padded"> |
| 30 | User: <a href="[viewed_user.profile_url]">[viewed_user.display_name]</a> |
| 31 | [if-any viewed_user_pb.is_site_admin_bool]<i>(Administrator)</i>[end] |
| 32 | </th> |
| 33 | [end] |
| 34 | [if-any hotlist_id] |
| 35 | <th class="toptabs padded"> |
| 36 | <a href="[hotlist.url]" title="[hotlist_id]" |
| 37 | id = "hotlists-dropdown">Hotlist: [hotlist.name] <small>▼</small></a> |
| 38 | <a href="[hotlist.url]" class="[is main_tab_mode "ht2"]active[end]">Issues</a> |
| 39 | <a href="[hotlist.url]/people" class="[is main_tab_mode "ht3"]active[end]">People</a> |
| 40 | <a href="[hotlist.url]/details" class="[is main_tab_mode "ht4"]active[end]">Settings</a> |
| 41 | </th> |
| 42 | [end] |
| 43 | |
| 44 | <td width="100%" id="userbar"> |
| 45 | [include "user-bar.ezt"] |
| 46 | </td> |
| 47 | </tr> |
| 48 | </table> |
| 49 | [end] |
| 50 | |
| 51 | <script type="text/javascript" nonce="[nonce]"> |
| 52 | runOnLoad(function() { |
| 53 | if ($("hotlists-dropdown")) |
| 54 | $("hotlists-dropdown").addEventListener("click", function(event) { |
| 55 | event.preventDefault(); |
| 56 | }); |
| 57 | }); |
| 58 | </script> |
| 59 | |
| 60 | [is arg0 "showtabs"] |
| 61 | <div class="subt"> |
| 62 | [include "projecttabs.ezt"] |
| 63 | </div> |
| 64 | [else][is arg0 "showusertabs"] |
| 65 | <div class="subt"> |
| 66 | [include "../sitewide/usertabs.ezt" arg1] |
| 67 | </div> |
| 68 | [else][is arg0 "showusergrouptabs"] |
| 69 | <div class="subt"> |
| 70 | [include "../sitewide/usergrouptabs.ezt" arg1] |
| 71 | </div> |
| 72 | [end][end][end] |
| 73 | |
| 74 | [if-any warnings] |
| 75 | <table align="center" border="0" cellspacing="0" cellpadding="0" style="margin-bottom: 6px"> |
| 76 | [for warnings] |
| 77 | <tr><td class="notice"> |
| 78 | [warnings] |
| 79 | </td></tr> |
| 80 | [end] |
| 81 | </table> |
| 82 | [end] |
| 83 | [if-any errors.query] |
| 84 | <table align="center" border="0" cellspacing="0" cellpadding="0" style="margin-bottom: 6px"> |
| 85 | <tr><td class="notice"> |
| 86 | [errors.query] |
| 87 | </td></tr> |
| 88 | </table> |
| 89 | [end] |
| 90 | |
| 91 | [if-any site_read_only][else] |
| 92 | [if-any project_alert] |
| 93 | <div style="font-weight: bold; color: #c00; margin-top: 5px; display: block;"> |
| 94 | [project_alert] |
| 95 | </div> |
| 96 | [end] |
| 97 | [end] |
| 98 | |
| 99 | [include "../features/cues.ezt"] |