describe_partitions.mako 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. ## Licensed to Cloudera, Inc. under one
  2. ## or more contributor license agreements. See the NOTICE file
  3. ## distributed with this work for additional information
  4. ## regarding copyright ownership. Cloudera, Inc. licenses this file
  5. ## to you under the Apache License, Version 2.0 (the
  6. ## "License"); you may not use this file except in compliance
  7. ## with the License. You may obtain a copy of the License at
  8. ##
  9. ## http://www.apache.org/licenses/LICENSE-2.0
  10. ##
  11. ## Unless required by applicable law or agreed to in writing, software
  12. ## distributed under the License is distributed on an "AS IS" BASIS,
  13. ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. ## See the License for the specific language governing permissions and
  15. ## limitations under the License.
  16. <%!
  17. from filebrowser.views import location_to_url
  18. from desktop.views import commonheader, commonfooter
  19. from django.utils.translation import ugettext as _
  20. %>
  21. <%namespace name="components" file="components.mako" />
  22. ${ commonheader(_('Table Partitions: %(tableName)s') % dict(tableName=table.name), app_name, user) | n,unicode }
  23. ${ components.menubar() }
  24. <div class="container-fluid">
  25. <div class="row-fluid">
  26. <div class="span3">
  27. <div class="sidebar-nav card-small">
  28. <ul class="nav nav-list">
  29. <li class="nav-header">${_('Actions')}</li>
  30. <li><a href="${ url('metastore:describe_table', database=database, table=table.name) }"><i class="icon-reply"></i> ${_('Show Table')}</a></li>
  31. </ul>
  32. </div>
  33. </div>
  34. <div class="span9">
  35. <div class="card card-small">
  36. <h1 class="card-heading simple">${ components.breadcrumbs(breadcrumbs) }</h1>
  37. <div class="card-body">
  38. <p>
  39. % if partitions:
  40. <table class="table table-striped table-condensed datatables">
  41. <tr>
  42. % for field in table.partition_keys:
  43. <th>${field.name}</th>
  44. % endfor
  45. <th>${_('Path')}</th>
  46. </tr>
  47. % for partition_id, partition in enumerate(partitions):
  48. <tr>
  49. % for idx, key in enumerate(partition.values):
  50. <td><a href="${ url('metastore:read_partition', database=database, table=table.name, partition_id=partition_id) }" data-row-selector="true">${key}</a></td>
  51. % endfor
  52. <% location = location_to_url(partition.sd.location) %>
  53. % if url:
  54. <td data-row-selector-exclude="true">
  55. <a href="${location}">${partition.sd.location}</a>
  56. </td>
  57. % else:
  58. <td>
  59. ${partition.sd.location}
  60. </td>
  61. % endif
  62. </tr>
  63. % endfor
  64. </table>
  65. % else:
  66. <div class="alert">${_('The table %s has no partitions.' % table.name)}</div>
  67. % endif
  68. </p>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. <link rel="stylesheet" href="/metastore/static/css/metastore.css" type="text/css">
  75. <script type="text/javascript" charset="utf-8">
  76. $(document).ready(function () {
  77. $("a[data-row-selector='true']").jHueRowSelector();
  78. });
  79. </script>
  80. ${ commonfooter(messages) | n,unicode }