Explorar o código

HUE-777 [core] Hide disabled apps from the navigation bar

Modified common header to filter out all the apps that are not enabled for the user
Enrico Berti %!s(int64=14) %!d(string=hai) anos
pai
achega
437383e0f5
Modificáronse 72 ficheiros con 81 adicións e 84 borrados
  1. 1 1
      apps/about/src/about/templates/index.mako
  2. 1 1
      apps/beeswax/src/beeswax/templates/choose_delimiter.mako
  3. 1 1
      apps/beeswax/src/beeswax/templates/choose_file.mako
  4. 1 1
      apps/beeswax/src/beeswax/templates/configuration.mako
  5. 1 1
      apps/beeswax/src/beeswax/templates/create_table_index.mako
  6. 1 1
      apps/beeswax/src/beeswax/templates/create_table_manually.mako
  7. 1 1
      apps/beeswax/src/beeswax/templates/define_columns.mako
  8. 1 1
      apps/beeswax/src/beeswax/templates/describe_partitions.mako
  9. 1 1
      apps/beeswax/src/beeswax/templates/describe_table.mako
  10. 1 1
      apps/beeswax/src/beeswax/templates/execute.mako
  11. 1 1
      apps/beeswax/src/beeswax/templates/explain.mako
  12. 1 1
      apps/beeswax/src/beeswax/templates/index.mako
  13. 1 1
      apps/beeswax/src/beeswax/templates/list_designs.mako
  14. 1 1
      apps/beeswax/src/beeswax/templates/list_history.mako
  15. 1 1
      apps/beeswax/src/beeswax/templates/load_table.mako
  16. 1 1
      apps/beeswax/src/beeswax/templates/my_queries.mako
  17. 1 1
      apps/beeswax/src/beeswax/templates/parameterization.mako
  18. 1 1
      apps/beeswax/src/beeswax/templates/save_results.mako
  19. 1 1
      apps/beeswax/src/beeswax/templates/show_tables.mako
  20. 1 1
      apps/beeswax/src/beeswax/templates/watch_results.mako
  21. 1 1
      apps/beeswax/src/beeswax/templates/watch_wait.mako
  22. 1 1
      apps/filebrowser/src/filebrowser/templates/display.mako
  23. 1 1
      apps/filebrowser/src/filebrowser/templates/edit.mako
  24. 1 1
      apps/filebrowser/src/filebrowser/templates/fileop.mako
  25. 1 1
      apps/filebrowser/src/filebrowser/templates/listdir.mako
  26. 1 1
      apps/help/src/help/templates/display.mako
  27. 1 1
      apps/jobbrowser/src/jobbrowser/templates/attempt.mako
  28. 1 1
      apps/jobbrowser/src/jobbrowser/templates/job.mako
  29. 2 2
      apps/jobbrowser/src/jobbrowser/templates/jobs.mako
  30. 1 1
      apps/jobbrowser/src/jobbrowser/templates/task.mako
  31. 1 1
      apps/jobbrowser/src/jobbrowser/templates/tasks.mako
  32. 1 1
      apps/jobbrowser/src/jobbrowser/templates/tasktracker.mako
  33. 1 1
      apps/jobbrowser/src/jobbrowser/templates/tasktrackers.mako
  34. 1 1
      apps/jobsub/src/jobsub/templates/edit_design.mako
  35. 1 1
      apps/jobsub/src/jobsub/templates/list_designs.mako
  36. 1 1
      apps/jobsub/src/jobsub/templates/list_history.mako
  37. 1 1
      apps/jobsub/src/jobsub/templates/workflow.mako
  38. 1 1
      apps/oozie/src/oozie/templates/dashboard/list_oozie_coordinator.mako
  39. 1 1
      apps/oozie/src/oozie/templates/dashboard/list_oozie_coordinators.mako
  40. 1 1
      apps/oozie/src/oozie/templates/dashboard/list_oozie_workflow.mako
  41. 1 1
      apps/oozie/src/oozie/templates/dashboard/list_oozie_workflow_action.mako
  42. 1 1
      apps/oozie/src/oozie/templates/dashboard/list_oozie_workflows.mako
  43. 1 1
      apps/oozie/src/oozie/templates/editor/create_coordinator.mako
  44. 1 1
      apps/oozie/src/oozie/templates/editor/create_workflow.mako
  45. 1 1
      apps/oozie/src/oozie/templates/editor/edit_coordinator.mako
  46. 1 1
      apps/oozie/src/oozie/templates/editor/edit_workflow.mako
  47. 1 1
      apps/oozie/src/oozie/templates/editor/edit_workflow_action.mako
  48. 1 1
      apps/oozie/src/oozie/templates/editor/edit_workflow_fork.mako
  49. 1 1
      apps/oozie/src/oozie/templates/editor/list_coordinators.mako
  50. 1 1
      apps/oozie/src/oozie/templates/editor/list_history.mako
  51. 1 1
      apps/oozie/src/oozie/templates/editor/list_history_record.mako
  52. 1 1
      apps/oozie/src/oozie/templates/editor/list_workflows.mako
  53. 1 1
      apps/shell/src/shell/templates/failed_to_create.mako
  54. 2 2
      apps/shell/src/shell/templates/index.mako
  55. 1 1
      apps/shell/src/shell/templates/no_such_user.mako
  56. 1 1
      apps/shell/src/shell/templates/not_running_spawning.mako
  57. 1 1
      apps/useradmin/src/useradmin/templates/confirm.mako
  58. 1 1
      apps/useradmin/src/useradmin/templates/edit_group.mako
  59. 1 1
      apps/useradmin/src/useradmin/templates/edit_permissions.mako
  60. 1 1
      apps/useradmin/src/useradmin/templates/edit_user.mako
  61. 1 1
      apps/useradmin/src/useradmin/templates/list_groups.mako
  62. 1 1
      apps/useradmin/src/useradmin/templates/list_permissions.mako
  63. 1 1
      apps/useradmin/src/useradmin/templates/list_users.mako
  64. 1 1
      desktop/core/src/desktop/templates/404.mako
  65. 1 1
      desktop/core/src/desktop/templates/500.mako
  66. 1 1
      desktop/core/src/desktop/templates/check_config.mako
  67. 5 10
      desktop/core/src/desktop/templates/common_header.mako
  68. 1 1
      desktop/core/src/desktop/templates/dump_config.mako
  69. 1 1
      desktop/core/src/desktop/templates/error.mako
  70. 1 1
      desktop/core/src/desktop/templates/logs.mako
  71. 1 1
      desktop/core/src/desktop/templates/popup_error.mako
  72. 4 2
      desktop/core/src/desktop/views.py

+ 1 - 1
apps/about/src/about/templates/index.mako

@@ -17,7 +17,7 @@
 from desktop.views import commonheader, commonfooter
 from django.utils.translation import ugettext as _
 %>
-${commonheader(_('About Hue'), "about", "100px")}
+${commonheader(_('About Hue'), "about", user, "100px")}
 
 	<div class="subnav subnav-fixed">
 		<div class="container-fluid">

+ 1 - 1
apps/beeswax/src/beeswax/templates/choose_delimiter.mako

@@ -20,7 +20,7 @@ from django.utils.translation import ugettext as _
 <%namespace name="layout" file="layout.mako" />
 <%namespace name="comps" file="beeswax_components.mako" />
 <%namespace name="util" file="util.mako" />
-${commonheader(_('Create table from file'), "beeswax", "100px")}
+${commonheader(_('Create table from file'), "beeswax", user, "100px")}
 ${layout.menubar(section='tables')}
 
 <div class="container-fluid">

+ 1 - 1
apps/beeswax/src/beeswax/templates/choose_file.mako

@@ -19,7 +19,7 @@ from django.utils.translation import ugettext as _
 %>
 <%namespace name="layout" file="layout.mako" />
 <%namespace name="comps" file="beeswax_components.mako" />
-${commonheader(_('Create table from file'), "beeswax", "100px")}
+${commonheader(_('Create table from file'), "beeswax", user, "100px")}
 ${layout.menubar(section='tables')}
 
 

+ 1 - 1
apps/beeswax/src/beeswax/templates/configuration.mako

@@ -20,7 +20,7 @@ from django.utils.translation import ugettext as _
 <%namespace name="layout" file="layout.mako" />
 <%namespace name="util" file="util.mako" />
 
-${commonheader(_('Configuration Variables'), "beeswax", "100px")}
+${commonheader(_('Configuration Variables'), "beeswax", user, "100px")}
 ${layout.menubar(section='configuration')}
 
 <div class="container-fluid">

+ 1 - 1
apps/beeswax/src/beeswax/templates/create_table_index.mako

@@ -18,7 +18,7 @@ from desktop.views import commonheader, commonfooter
 from django.utils.translation import ugettext as _
 %>
 <%namespace name="layout" file="layout.mako" />
-${commonheader(_('Create Table'), "beeswax", "100px")}
+${commonheader(_('Create Table'), "beeswax", user, "100px")}
 <div class="container-fluid">
   <div class="toolbar">
   </div>

+ 1 - 1
apps/beeswax/src/beeswax/templates/create_table_manually.mako

@@ -19,7 +19,7 @@
 %>
 <%namespace name="comps" file="beeswax_components.mako" />
 <%namespace name="layout" file="layout.mako" />
-${commonheader(_("Create table manually"), "beeswax", "100px")}
+${commonheader(_("Create table manually"), "beeswax", user, "100px")}
 ${layout.menubar(section='tables')}
 
 <div class="container-fluid">

+ 1 - 1
apps/beeswax/src/beeswax/templates/define_columns.mako

@@ -20,7 +20,7 @@ from django.utils.translation import ugettext as _
 <%namespace name="layout" file="layout.mako" />
 <%namespace name="comps" file="beeswax_components.mako" />
 <%namespace name="util" file="util.mako" />
-${commonheader(_('Create table from file'), "beeswax", "100px")}
+${commonheader(_('Create table from file'), "beeswax", user, "100px")}
 ${layout.menubar(section='tables')}
 
 <div class="container-fluid">

+ 1 - 1
apps/beeswax/src/beeswax/templates/describe_partitions.mako

@@ -20,7 +20,7 @@
   from django.utils.translation import ugettext as _
 %>
 <%namespace name="layout" file="layout.mako" />
-${commonheader(_('Beeswax Table Partitions: %(tableName)s') % dict(tableName=table.tableName), "beeswax", "100px")}
+${commonheader(_('Beeswax Table Partitions: %(tableName)s') % dict(tableName=table.tableName), "beeswax", user, "100px")}
 ${layout.menubar(section='tables')}
 
 <div class="container-fluid">

+ 1 - 1
apps/beeswax/src/beeswax/templates/describe_table.mako

@@ -27,7 +27,7 @@ from django.utils.translation import ugettext as _
   else:
     view_or_table_noun = _("Table")
 %>
-${commonheader(_("%s Metadata: %s") % (view_or_table_noun, table.tableName), "beeswax", "100px")}
+${commonheader(_("%s Metadata: %s") % (view_or_table_noun, table.tableName), "beeswax", user, "100px")}
 ${layout.menubar(section='tables')}
 
 <%def name="column_table(cols)">

+ 1 - 1
apps/beeswax/src/beeswax/templates/execute.mako

@@ -60,7 +60,7 @@
 </%def>
 
 
-${commonheader(_('Query'), "beeswax", "100px")}
+${commonheader(_('Query'), "beeswax", user, "100px")}
 ${layout.menubar(section='query')}
 
 <div class="container-fluid">

+ 1 - 1
apps/beeswax/src/beeswax/templates/explain.mako

@@ -20,7 +20,7 @@ from django.utils.translation import ugettext as _
 <%namespace name="comps" file="beeswax_components.mako" />
 <%namespace name="layout" file="layout.mako" />
 <%namespace name="util" file="util.mako" />
-${commonheader(_('Query Explanation'), "beeswax", "100px")}
+${commonheader(_('Query Explanation'), "beeswax", user, "100px")}
 ${layout.menubar(section='saved queries')}
 
 <div class="container-fluid">

+ 1 - 1
apps/beeswax/src/beeswax/templates/index.mako

@@ -20,7 +20,7 @@ from django.utils.translation import ugettext as _
 <%namespace name="comps" file="beeswax_components.mako" />
 <%namespace name="layout" file="layout.mako" />
 
-${commonheader(_('Beeswax'), "beeswax", "100px")}
+${commonheader(_('Beeswax'), "beeswax", user, "100px")}
 ${layout.menubar(section='tables')}
 
 <div class="container-fluid">

+ 1 - 1
apps/beeswax/src/beeswax/templates/list_designs.mako

@@ -21,7 +21,7 @@
 %>
 <%namespace name="comps" file="beeswax_components.mako" />
 <%namespace name="layout" file="layout.mako" />
-${commonheader(_('Queries'), "beeswax", "100px")}
+${commonheader(_('Queries'), "beeswax", user, "100px")}
 ${layout.menubar(section='saved queries')}
 <div class="container-fluid">
     <h1>${_('Queries')}</h1>

+ 1 - 1
apps/beeswax/src/beeswax/templates/list_history.mako

@@ -23,7 +23,7 @@ from django.utils.translation import ugettext as _
 <%namespace name="comps" file="beeswax_components.mako" />
 <%!  from beeswax.views import collapse_whitespace %>
 
-${commonheader(_('Query History'), "beeswax", "100px")}
+${commonheader(_('Query History'), "beeswax", user, "100px")}
 ${layout.menubar(section='history')}
 
 <%def name="show_saved_query(design, history)">

+ 1 - 1
apps/beeswax/src/beeswax/templates/load_table.mako

@@ -19,7 +19,7 @@ from django.utils.translation import ugettext as _
 %>
 <%namespace name="layout" file="layout.mako" />
 <%namespace name="util" file="util.mako" />
-${commonheader(_('Load Data into %(table)s') % dict(table=table), "beeswax", "100px")}
+${commonheader(_('Load Data into %(table)s') % dict(table=table), "beeswax", user, "100px")}
 ${layout.menubar()}
 <div class="container-fluid">
   <h1>${_('Load Data into %(table)s') % dict(table=table)}</h1>

+ 1 - 1
apps/beeswax/src/beeswax/templates/my_queries.mako

@@ -22,7 +22,7 @@ from django.utils.translation import ugettext as _
 <%namespace name="comps" file="beeswax_components.mako" />
 <%namespace name="layout" file="layout.mako" />
 <%!  from beeswax.views import collapse_whitespace %>
-${commonheader(_('My Queries'), "beeswax", "100px")}
+${commonheader(_('My Queries'), "beeswax", user, "100px")}
 ${layout.menubar(section='my queries')}
 <style>
     .tab-content {

+ 1 - 1
apps/beeswax/src/beeswax/templates/parameterization.mako

@@ -20,7 +20,7 @@ from django.utils.translation import ugettext as _
 <%namespace name="comps" file="beeswax_components.mako" />
 <%namespace name="layout" file="layout.mako" />
 
-${commonheader(_('Parameterize Query'), "beeswax", "100px")}
+${commonheader(_('Parameterize Query'), "beeswax", user, "100px")}
 
 ${layout.menubar()}
 

+ 1 - 1
apps/beeswax/src/beeswax/templates/save_results.mako

@@ -20,7 +20,7 @@ from django.utils.translation import ugettext as _
 <%namespace name="layout" file="layout.mako" />
 <%namespace name="comps" file="beeswax_components.mako" />
 <%namespace name="util" file="util.mako" />
-${commonheader(_('Create table from file'), "beeswax", "100px")}
+${commonheader(_('Create table from file'), "beeswax", user, "100px")}
 ${layout.menubar(section='history')}
 <div class="container-fluid">
 % if error_msg:

+ 1 - 1
apps/beeswax/src/beeswax/templates/show_tables.mako

@@ -18,7 +18,7 @@ from desktop.views import commonheader, commonfooter
 from django.utils.translation import ugettext as _
 %>
 <%namespace name="layout" file="layout.mako" />
-${commonheader(_('Table List'), "beeswax", "100px")}
+${commonheader(_('Table List'), "beeswax", user, "100px")}
 ${layout.menubar(section='tables')}
 
 <div class="container-fluid">

+ 1 - 1
apps/beeswax/src/beeswax/templates/watch_results.mako

@@ -20,7 +20,7 @@ from django.utils.translation import ugettext as _
 <%namespace name="layout" file="layout.mako" />
 <%namespace name="util" file="util.mako" />
 <%namespace name="comps" file="beeswax_components.mako" />
-${commonheader(_('Query Results'), "beeswax", "100px")}
+${commonheader(_('Query Results'), "beeswax", user, "100px")}
 ${layout.menubar(section='query')}
 
 <div class="container-fluid">

+ 1 - 1
apps/beeswax/src/beeswax/templates/watch_wait.mako

@@ -19,7 +19,7 @@ from django.utils.translation import ugettext as _
 %>
 <%namespace name="layout" file="layout.mako" />
 <%namespace name="util" file="util.mako" />
-${commonheader(_('Waiting for query...'), "beeswax", "100px")}
+${commonheader(_('Waiting for query...'), "beeswax", user, "100px")}
 ${layout.menubar(section='query')}
 
 <meta http-equiv="refresh" content="3;${url('beeswax.views.watch_query', query.id)}?${fwd_params}" />

+ 1 - 1
apps/filebrowser/src/filebrowser/templates/display.mako

@@ -28,7 +28,7 @@
 %>
 <%namespace name="fb_components" file="fb_components.mako" />
 
-${commonheader(_('%(filename)s - File Viewer') % dict(filename=truncate(filename)), 'filebrowser')}
+${commonheader(_('%(filename)s - File Viewer') % dict(filename=truncate(filename)), 'filebrowser', user)}
 
 
 

+ 1 - 1
apps/filebrowser/src/filebrowser/templates/edit.mako

@@ -26,7 +26,7 @@
 %>
 <%namespace name="fb_components" file="fb_components.mako" />
 
-${commonheader(_('%(filename)s - File Viewer') % dict(filename=truncate(filename)), 'filebrowser')}
+${commonheader(_('%(filename)s - File Viewer') % dict(filename=truncate(filename)), 'filebrowser', user)}
 
 <div class="container-fluid">
 	% if breadcrumbs:

+ 1 - 1
apps/filebrowser/src/filebrowser/templates/fileop.mako

@@ -22,7 +22,7 @@ from django.utils.translation import ugettext as _
 
 
 
-${commonheader(_('File Operation'), 'filebrowser')}
+${commonheader(_('File Operation'), 'filebrowser', user)}
 
 ## Not sure if enctype breaks anything if used for things other than file upload.
 

+ 1 - 1
apps/filebrowser/src/filebrowser/templates/listdir.mako

@@ -22,7 +22,7 @@ from django.utils.translation import ugettext as _
 <%namespace name="dir" file="listdir_components.mako" />
 <%namespace name="fb_components" file="fb_components.mako" />
 
-${commonheader(_('File Browser'), 'filebrowser')}
+${commonheader(_('File Browser'), 'filebrowser', user)}
 
 <div class="container-fluid">
     <h1>${_('File Browser')}</h1>

+ 1 - 1
apps/help/src/help/templates/display.mako

@@ -16,7 +16,7 @@
 <%!
 from desktop.views import commonheader, commonfooter
 %>
-${commonheader("Hue Help", "help", "100px")}
+${commonheader("Hue Help", "help", user, "100px")}
 	<div class="subnav subnav-fixed">
 		<div class="container-fluid">
 		<ul class="nav nav-pills">

+ 1 - 1
apps/jobbrowser/src/jobbrowser/templates/attempt.mako

@@ -19,7 +19,7 @@
 %>
 <%namespace name="comps" file="jobbrowser_components.mako" />
 
-${commonheader(_('Task Attempt: %(attemptId)s - Job Browser') % dict(attemptId=attempt.attemptId), "jobbrowser")}
+${commonheader(_('Task Attempt: %(attemptId)s - Job Browser') % dict(attemptId=attempt.attemptId), "jobbrowser", user)}
 <div class="container-fluid">
     <h1>${_('Task Attempt: %(attemptId)s - Job Browser') % dict(attemptId=attempt.attemptId)}</h1>
     <div class="row-fluid">

+ 1 - 1
apps/jobbrowser/src/jobbrowser/templates/job.mako

@@ -77,7 +77,7 @@
         </tr>
     % endfor
 </%def>
-${commonheader(_('Job: %(jobId)s - Job Browser') % dict(jobId=job.jobId), "jobbrowser")}
+${commonheader(_('Job: %(jobId)s - Job Browser') % dict(jobId=job.jobId), "jobbrowser", user)}
 
 <div class="container-fluid">
     <h1>${_('Job: %(jobId)s - Job Browser') % dict(jobId=job.jobId)}</h1>

+ 2 - 2
apps/jobbrowser/src/jobbrowser/templates/jobs.mako

@@ -29,7 +29,7 @@
 </%def>
 
 % if jobs or filtered:
-${commonheader(_('Job Browser'), "jobbrowser")}
+${commonheader(_('Job Browser'), "jobbrowser", user)}
 <div class="container-fluid">
 <h1>${_('Job Browser')}</h1>
 <form class="well form-inline" action="/jobbrowser/jobs" method="GET">
@@ -146,7 +146,7 @@ ${commonheader(_('Job Browser'), "jobbrowser")}
     % endif
 
     % else:
-    ${commonheader(_('Job Browser'), "jobbrowser")}
+    ${commonheader(_('Job Browser'), "jobbrowser", user)}
     <div class="container-fluid">
     <h1>${_('Welcome to the Job Browser')}</h1>
     <div>

+ 1 - 1
apps/jobbrowser/src/jobbrowser/templates/task.mako

@@ -19,7 +19,7 @@
 %>
 <%namespace name="comps" file="jobbrowser_components.mako" />
 
-${commonheader(_('Job Task: %(taskId)s - Job Browser') % dict(taskId=task.taskId), "jobbrowser")}
+${commonheader(_('Job Task: %(taskId)s - Job Browser') % dict(taskId=task.taskId), "jobbrowser", user)}
 
 <div class="container-fluid">
     <h1>${_('Job Task: %(taskId)s - Job Browser') % dict(taskId=task.taskId)}</h1>

+ 1 - 1
apps/jobbrowser/src/jobbrowser/templates/tasks.mako

@@ -21,7 +21,7 @@
 
 <%namespace name="comps" file="jobbrowser_components.mako" />
 
-${commonheader(_('Task View: Job: %(jobId)s - Job Browser') % dict(jobId=jobid), "jobbrowser")}
+${commonheader(_('Task View: Job: %(jobId)s - Job Browser') % dict(jobId=jobid), "jobbrowser", user)}
 
 <%def name="selected(val, state)">
     %   if val is not None and state is not None and val in state:

+ 1 - 1
apps/jobbrowser/src/jobbrowser/templates/tasktracker.mako

@@ -19,7 +19,7 @@
 %>
 <%namespace name="comps" file="jobbrowser_components.mako" />
 
-${commonheader(_('Tracker: %(trackerId)s - Job Browser') % dict(trackerId=tracker.trackerId), "jobbrowser")}
+${commonheader(_('Tracker: %(trackerId)s - Job Browser') % dict(trackerId=tracker.trackerId), "jobbrowser", user)}
 <div class="container-fluid">
 	<h1>${_('Tracker at %(trackerHost)s on port %(trackerPort)s') % dict(trackerHost=tracker.host, trackerPort=tracker.httpPort)}</h1>
 	<div>

+ 1 - 1
apps/jobbrowser/src/jobbrowser/templates/tasktrackers.mako

@@ -18,7 +18,7 @@
   from django.utils.translation import ugettext as _
 %>
 <%namespace name="comps" file="jobbrowser_components.mako" />
-${commonheader(_('Task Trackers - Job Browser'), "jobbrowser")}
+${commonheader(_('Task Trackers - Job Browser'), "jobbrowser", user)}
 <div class="container-fluid">
 <table class="datatables">
 	<thead>

+ 1 - 1
apps/jobsub/src/jobsub/templates/edit_design.mako

@@ -23,7 +23,7 @@ from django.utils.translation import ugettext as _
 
 <%namespace name="layout" file="layout.mako" />
 
-${commonheader(_('Job Designer'), "jobsub", "100px")}
+${commonheader(_('Job Designer'), "jobsub", user, "100px")}
 ${layout.menubar(section='designs')}
 
 

+ 1 - 1
apps/jobsub/src/jobsub/templates/list_designs.mako

@@ -25,7 +25,7 @@ from django.utils.translation import ugettext as _
 %>
 <%namespace name="layout" file="layout.mako" />
 
-${commonheader(_('Job Designer'), "jobsub", "100px")}
+${commonheader(_('Job Designer'), "jobsub", user, "100px")}
 ${layout.menubar(section='designs')}
 
 <script src="/static/ext/js/datatables-paging-0.1.js" type="text/javascript" charset="utf-8"></script>

+ 1 - 1
apps/jobsub/src/jobsub/templates/list_history.mako

@@ -23,7 +23,7 @@ from django.utils.translation import ugettext as _
 %>
 <%namespace name="layout" file="layout.mako" />
 
-${commonheader(_('Job Designer'), "jobsub", "100px")}
+${commonheader(_('Job Designer'), "jobsub", user, "100px")}
 ${layout.menubar(section='history')}
 
 <script src="/static/ext/js/datatables-paging-0.1.js" type="text/javascript" charset="utf-8"></script>

+ 1 - 1
apps/jobsub/src/jobsub/templates/workflow.mako

@@ -22,7 +22,7 @@
 %>
 <%namespace name="layout" file="layout.mako" />
 
-${commonheader(_("Job Designer"), "jobsub", "100px")}
+${commonheader(_("Job Designer"), "jobsub", user, "100px")}
 ${layout.menubar(section='history')}
 
 <%def name="format_time(st_time)">

+ 1 - 1
apps/oozie/src/oozie/templates/dashboard/list_oozie_coordinator.mako

@@ -22,7 +22,7 @@
 <%namespace name="layout" file="../navigation-bar.mako" />
 <%namespace name="utils" file="../utils.inc.mako" />
 
-${ commonheader(_("Oozie App"), "oozie", "100px") }
+${ commonheader(_("Oozie App"), "oozie", user, "100px") }
 ${ layout.menubar(section='dashboard') }
 
 

+ 1 - 1
apps/oozie/src/oozie/templates/dashboard/list_oozie_coordinators.mako

@@ -22,7 +22,7 @@
 <%namespace name="layout" file="../navigation-bar.mako" />
 <%namespace name="utils" file="../utils.inc.mako" />
 
-${commonheader(_("Oozie App"), "oozie", "100px")}
+${commonheader(_("Oozie App"), "oozie", user, "100px")}
 ${layout.menubar(section='dashboard')}
 
 

+ 1 - 1
apps/oozie/src/oozie/templates/dashboard/list_oozie_workflow.mako

@@ -22,7 +22,7 @@
 <%namespace name="layout" file="../navigation-bar.mako" />
 <%namespace name="utils" file="../utils.inc.mako" />
 
-${ commonheader(_("Oozie App"), "oozie", "100px") }
+${ commonheader(_("Oozie App"), "oozie", user, "100px") }
 ${ layout.menubar(section='dashboard') }
 
 

+ 1 - 1
apps/oozie/src/oozie/templates/dashboard/list_oozie_workflow_action.mako

@@ -22,7 +22,7 @@
 <%namespace name="layout" file="../navigation-bar.mako" />
 <%namespace name="utils" file="../utils.inc.mako" />
 
-${ commonheader(_("Oozie App"), "oozie", "100px") }
+${ commonheader(_("Oozie App"), "oozie", user, "100px") }
 ${ layout.menubar(section='running') }
 
 

+ 1 - 1
apps/oozie/src/oozie/templates/dashboard/list_oozie_workflows.mako

@@ -23,7 +23,7 @@
 <%namespace name="utils" file="../utils.inc.mako" />
 
 
-${ commonheader(_("Oozie App"), "oozie", "100px") }
+${ commonheader(_("Oozie App"), "oozie", user, "100px") }
 ${ layout.menubar(section='dashboard') }
 
 

+ 1 - 1
apps/oozie/src/oozie/templates/editor/create_coordinator.mako

@@ -22,7 +22,7 @@
 <%namespace name="layout" file="../navigation-bar.mako" />
 <%namespace name="utils" file="../utils.inc.mako" />
 
-${ commonheader(_("Oozie App"), "oozie", "100px") }
+${ commonheader(_("Oozie App"), "oozie", user, "100px") }
 ${ layout.menubar(section='coordinators') }
 
 

+ 1 - 1
apps/oozie/src/oozie/templates/editor/create_workflow.mako

@@ -22,7 +22,7 @@
 <%namespace name="layout" file="../navigation-bar.mako" />
 <%namespace name="utils" file="../utils.inc.mako" />
 
-${ commonheader(_("Oozie App"), "oozie", "100px") }
+${ commonheader(_("Oozie App"), "oozie", user, "100px") }
 ${ layout.menubar(section='workflows') }
 
 

+ 1 - 1
apps/oozie/src/oozie/templates/editor/edit_coordinator.mako

@@ -24,7 +24,7 @@
 <%namespace name="properties" file="coordinator_properties.mako" />
 <%namespace name="coordinator_data" file="create_coordinator_data.mako" />
 
-${ commonheader(_("Oozie App"), "oozie", "100px") }
+${ commonheader(_("Oozie App"), "oozie", user, "100px") }
 ${ layout.menubar(section='coordinators') }
 
 

+ 1 - 1
apps/oozie/src/oozie/templates/editor/edit_workflow.mako

@@ -23,7 +23,7 @@
 <%namespace name="utils" file="../utils.inc.mako" />
 <%namespace name="properties" file="job_action_properties.mako" />
 
-${ commonheader(_("Oozie App"), "oozie", "100px") }
+${ commonheader(_("Oozie App"), "oozie", user, "100px") }
 ${ layout.menubar(section='workflows') }
 
 

+ 1 - 1
apps/oozie/src/oozie/templates/editor/edit_workflow_action.mako

@@ -22,7 +22,7 @@
 <%namespace name="layout" file="../navigation-bar.mako" />
 <%namespace name="utils" file="../utils.inc.mako" />
 
-${ commonheader(_("Oozie App"), "oozie", "100px") }
+${ commonheader(_("Oozie App"), "oozie", user, "100px") }
 ${ layout.menubar(section='workflows') }
 
 

+ 1 - 1
apps/oozie/src/oozie/templates/editor/edit_workflow_fork.mako

@@ -22,7 +22,7 @@
 <%namespace name="layout" file="../navigation-bar.mako" />
 <%namespace name="utils" file="../utils.inc.mako" />
 
-${ commonheader(_("Oozie App"), "oozie", "100px") }
+${ commonheader(_("Oozie App"), "oozie", user, "100px") }
 ${ layout.menubar(section='workflows') }
 
 

+ 1 - 1
apps/oozie/src/oozie/templates/editor/list_coordinators.mako

@@ -22,7 +22,7 @@
 <%namespace name="layout" file="../navigation-bar.mako" />
 <%namespace name="utils" file="../utils.inc.mako" />
 
-${ commonheader(_("Oozie App"), "oozie", "100px") }
+${ commonheader(_("Oozie App"), "oozie", user, "100px") }
 ${ layout.menubar(section='coordinators') }
 
 

+ 1 - 1
apps/oozie/src/oozie/templates/editor/list_history.mako

@@ -23,7 +23,7 @@
 <%namespace name="layout" file="../navigation-bar.mako" />
 <%namespace name="utils" file="../utils.inc.mako" />
 
-${ commonheader(_("Oozie App"), "oozie", "100px") }
+${ commonheader(_("Oozie App"), "oozie", user, "100px") }
 ${ layout.menubar(section='history') }
 
 

+ 1 - 1
apps/oozie/src/oozie/templates/editor/list_history_record.mako

@@ -22,7 +22,7 @@
 <%namespace name="utils" file="../utils.inc.mako" />
 <%namespace name="layout" file="../navigation-bar.mako" />
 
-${ commonheader(_("Oozie App"), "oozie", "100px") }
+${ commonheader(_("Oozie App"), "oozie", user, "100px") }
 ${ layout.menubar(section='history') }
 
 

+ 1 - 1
apps/oozie/src/oozie/templates/editor/list_workflows.mako

@@ -22,7 +22,7 @@
 <%namespace name="layout" file="../navigation-bar.mako" />
 <%namespace name="utils" file="../utils.inc.mako" />
 
-${ commonheader( _("Oozie App"), "oozie", "100px") }
+${ commonheader( _("Oozie App"), "oozie", user, "100px") }
 ${ layout.menubar(section='workflows') }
 
 

+ 1 - 1
apps/shell/src/shell/templates/failed_to_create.mako

@@ -18,7 +18,7 @@ from desktop.views import commonheader, commonfooter
 from django.utils.translation import ugettext as _
 %>
 
-${commonheader(_('Hue Shell'), "shell")}
+${commonheader(_('Hue Shell'), "shell", user)}
 <div class="container-fluid">
 <div>
     ${_('Failed to create a shell of the given type. The possible reasons for this are:')}

+ 2 - 2
apps/shell/src/shell/templates/index.mako

@@ -19,9 +19,9 @@ from django.utils.translation import ugettext as _
 %>
 
 % if shells:
-    ${commonheader(_('Hue Shell'), "shell", "100px")}
+    ${commonheader(_('Hue Shell'), "shell", user, "100px")}
 % else:
-    ${commonheader(_('Hue Shell'), "shell")}
+    ${commonheader(_('Hue Shell'), "shell", user)}
 % endif
 
 

+ 1 - 1
apps/shell/src/shell/templates/no_such_user.mako

@@ -18,7 +18,7 @@ from desktop.views import commonheader, commonfooter
 from django.utils.translation import ugettext as _
 %>
 
-${commonheader(_('Hue Shell'), "shell")}
+${commonheader(_('Hue Shell'), "shell", user)}
 <div class="container-fluid">
 <div>
     ${_('The Shell application requires a Unix user account for every user of Hue on the remote webserver.')}

+ 1 - 1
apps/shell/src/shell/templates/not_running_spawning.mako

@@ -18,7 +18,7 @@ from desktop.views import commonheader, commonfooter
 from django.utils.translation import ugettext as _
 %>
 
-${commonheader(_('Hue Shell'), "shell")}
+${commonheader(_('Hue Shell'), "shell", user)}
 <div class="container-fluid">
 <div>
 	<h3>${_('The webserver currently running Hue does not support the Shell application. Please contact your administrator.')}</h3>

+ 1 - 1
apps/useradmin/src/useradmin/templates/confirm.mako

@@ -17,7 +17,7 @@
 from desktop.views import commonheader, commonfooter
 from django.utils.translation import ugettext as _
 %>
-${commonheader(title, "useradmin")}
+${commonheader(title, "useradmin", user)}
 <div class="container-fluid">
 	<h1>${_('Confirm')}</h1>
 	<form action="${path}" method="POST">

+ 1 - 1
apps/useradmin/src/useradmin/templates/edit_group.mako

@@ -23,7 +23,7 @@ from django.utils.translation import ugettext as _
 
 <%namespace name="layout" file="layout.mako" />
 
-${commonheader(_('Hue Groups'), "useradmin", "100px")}
+${commonheader(_('Hue Groups'), "useradmin", user, "100px")}
 ${layout.menubar(section='groups', _=_)}
 
 <%def name="render_field(field)">

+ 1 - 1
apps/useradmin/src/useradmin/templates/edit_permissions.mako

@@ -20,7 +20,7 @@ from django.utils.translation import ugettext as _
 %>
 <%namespace name="layout" file="layout.mako" />
 
-${commonheader(_('Hue Permissions'), "useradmin", "100px")}
+${commonheader(_('Hue Permissions'), "useradmin", user, "100px")}
 ${layout.menubar(section='permissions', _=_)}
 
 

+ 1 - 1
apps/useradmin/src/useradmin/templates/edit_user.mako

@@ -21,7 +21,7 @@ from django.utils.translation import ugettext as _
 %>
 <%namespace name="layout" file="layout.mako" />
 
-${commonheader(_('Hue Users'), "useradmin", "100px")}
+${commonheader(_('Hue Users'), "useradmin", user, "100px")}
 ${layout.menubar(section='users', _=_)}
 
 <%def name="render_field(field)">

+ 1 - 1
apps/useradmin/src/useradmin/templates/list_groups.mako

@@ -21,7 +21,7 @@ from useradmin.models import group_permissions
 %>
 
 <%namespace name="layout" file="layout.mako" />
-${commonheader(_('Hue Groups'), "useradmin", "100px")}
+${commonheader(_('Hue Groups'), "useradmin", user, "100px")}
 ${layout.menubar(section='groups', _=_)}
 
 <div class="container-fluid">

+ 1 - 1
apps/useradmin/src/useradmin/templates/list_permissions.mako

@@ -22,7 +22,7 @@ from django.contrib.auth.models import Group
 %>
 
 <%namespace name="layout" file="layout.mako" />
-${commonheader(_('Hue Permissions'), "useradmin", "100px")}
+${commonheader(_('Hue Permissions'), "useradmin", user, "100px")}
 ${layout.menubar(section='permissions', _=_)}
 
 <div class="container-fluid">

+ 1 - 1
apps/useradmin/src/useradmin/templates/list_users.mako

@@ -21,7 +21,7 @@ from django.utils.translation import ugettext as _
 %>
 
 <%namespace name="layout" file="layout.mako" />
-${commonheader(_('Hue Users'), "useradmin", "100px")}
+${commonheader(_('Hue Users'), "useradmin", user, "100px")}
 ${layout.menubar(section='users', _=_)}
 
 <div class="container-fluid">

+ 1 - 1
desktop/core/src/desktop/templates/404.mako

@@ -17,7 +17,7 @@
 from desktop.views import commonheader, commonfooter
 from django.utils.translation import ugettext as _
 %>
-${commonheader(_('Not Found'), "")}
+${commonheader(_('Not Found'), "", user)}
 
   <div class="container-fluid">
     <h1>${_('Page not found')}</h1>

+ 1 - 1
desktop/core/src/desktop/templates/500.mako

@@ -17,7 +17,7 @@
 from desktop.views import commonheader, commonfooter
 from django.utils.translation import ugettext as _
 %>
-${commonheader(_('Error'), "")}
+${commonheader(_('Error'), "", user)}
 
   <div class="container-fluid">
     <h1>${_('Server Error (500)')}</h1>

+ 1 - 1
desktop/core/src/desktop/templates/check_config.mako

@@ -19,7 +19,7 @@ from desktop.views import commonheader, commonfooter
 from django.utils.translation import ugettext as _
 %>
 <%namespace name="layout" file="about_layout.mako" />
-${commonheader(_('About'), "about", "100px")}
+${commonheader(_('About'), "about", user, "100px")}
 ${layout.menubar(section='check_config')}
 
     <div class="container-fluid">

+ 5 - 10
desktop/core/src/desktop/templates/common_header.mako

@@ -15,6 +15,7 @@
 ## limitations under the License.
 <%!
 from desktop import conf
+import urllib
 from desktop.lib.i18n import smart_unicode
 from django.utils.translation import ugettext as _
 %>
@@ -72,12 +73,6 @@ from django.utils.translation import ugettext as _
 
   <script type="text/javascript" charset="utf-8">
     $(document).ready(function(){
-      $("#username").jHueUsername({
-        onLoad: function(user){
-            $(".userProfile").attr("href","/useradmin/users/edit/"+user.username);
-            $("#usernameDropdown").show();
-        }
-      });
       $("input:text[placeholder]").simplePlaceholder();
       $(".submitter").keydown(function(e){
         if (e.keyCode==13){
@@ -110,13 +105,13 @@ from django.utils.translation import ugettext as _
     <div class="navbar-inner">
       <div class="container-fluid">
         <a class="brand nav-tooltip" title="${_('About Hue')}" href="/about">Hue</a>
-        <div id="usernameDropdown" class="btn-group pull-right hide">
+        <div id="usernameDropdown" class="btn-group pull-right">
           <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
-            <i class="icon-user"></i> <span id="username"></span>
+            <i class="icon-user"></i> ${user.username}
             <span class="caret"></span>
           </a>
           <ul class="dropdown-menu">
-            <li><a class="userProfile" href="#">${_('Profile')}</a></li>
+            <li><a class="userProfile" href="${ url('useradmin.views.edit_user', username=urllib.quote(user.username)) }">${_('Profile')}</a></li>
             <li class="divider"></li>
             <li><a href="/accounts/logout/">${_('Sign Out')}</a></li>
           </ul>
@@ -125,7 +120,7 @@ from django.utils.translation import ugettext as _
         <div class="nav-collapse">
           <ul class="nav">
             %for app in apps:
-              %if app.icon_path:
+              %if app.icon_path and user.has_hue_permission(action="access", app=app.display_name):
               <li id="${app.display_name}Icon" ${is_selected(section, app.display_name)}>
                 <a class="nav-tooltip" title="${app.nice_name}" href="/${app.display_name}"><img src="${app.icon_path}" /></a>
               </li>

+ 1 - 1
desktop/core/src/desktop/templates/dump_config.mako

@@ -21,7 +21,7 @@ from desktop.views import commonheader, commonfooter
 from django.utils.translation import ugettext as _
 %>
 <%namespace name="layout" file="about_layout.mako" />
-${commonheader(_('About'), "about", "100px")}
+${commonheader(_('About'), "about", user, "100px")}
 ${layout.menubar(section='dump_config')}
 
 	<div class="container-fluid">

+ 1 - 1
desktop/core/src/desktop/templates/error.mako

@@ -18,7 +18,7 @@ from desktop.views import commonheader, commonfooter
 from desktop.lib.i18n import smart_unicode
 from django.utils.translation import ugettext as _
 %>
-${commonheader(_('Error'), "")}
+${commonheader(_('Error'), "", user)}
 
   <div class="container-fluid">
     <h1>${_('Error!')}</h1>

+ 1 - 1
desktop/core/src/desktop/templates/logs.mako

@@ -21,7 +21,7 @@ from django.utils.translation import ugettext as _
 import re
 %>
 <%namespace name="layout" file="about_layout.mako" />
-${commonheader(_('About'), "about", "100px")}
+${commonheader(_('About'), "about", user, "100px")}
 ${layout.menubar(section='log_view')}
 	<div class="container-fluid">
 		<h1>${_('Log entries (most recent first)')}</h1>

+ 1 - 1
desktop/core/src/desktop/templates/popup_error.mako

@@ -19,7 +19,7 @@ from desktop.lib.i18n import smart_unicode
 from django.utils.translation import ugettext as _
 %>
 
-${commonheader(title, "", "60px")}
+${commonheader(title, "", user)}
 
 
 	<div class="container-fluid">

+ 4 - 2
desktop/core/src/desktop/views.py

@@ -263,17 +263,19 @@ def who_am_i(request):
   time.sleep(sleep)
   return HttpResponse(request.user.username + "\t" + request.fs.user + "\n")
 
-def commonheader(title, section, padding="60px"):
+def commonheader(title, section, user, padding="60px"):
   """
   Returns the rendered common header
   """
   apps_list = sorted(appmanager.DESKTOP_APPS[:], key=lambda app: app.menu_index)
+  #apps_list = sorted(appmanager.get_apps(user), key=lambda app: app.menu_index)
 
   return django_mako.render_to_string("common_header.mako", dict(
     apps=apps_list,
     title=title,
     section=section,
-    padding=padding
+    padding=padding,
+    user=user
   ))
 
 def commonfooter(messages=None):