Pārlūkot izejas kodu

HUE-106. Make Jobsub use common JFrame filters

Aaron Newton 15 gadi atpakaļ
vecāks
revīzija
eb4c2f8241

+ 53 - 44
apps/jobsub/src/jobsub/templates/list.html

@@ -19,49 +19,58 @@ limitations under the License.
 {% block title %}Job Design List{% endblock %}
 {% block content %}
 <div id="jobsub_joblist" class="view">
-	<h1>Job Designer: Job Designs</h1>
-	<div class="jobsub_col_wrapper" data-filters="SplitView">
-		<div class="jobsub_left_col left_col">
-			{% include "types.html" %}
-		</div>
-		<div class="jobsub_right_col right_col">
-			<div class="jobsub_topsection clearfix">
-				<form class="jobsub_filter" data-filters="SubmitOnChange" action="{% url jobsub.list %}" method="get">
-					<span class="filter_text">Filter by owner:</span>
-					<input data-filters="OverText" name="owner" alt="filter by owner" value="{{ owner }}"/>
-					<input data-filters="OverText" name="name" alt="filter by name" value="{{ name }}"/>
-					<input class="submit" type="submit"/>
-				</form>
-			</div>
-		
-			<table data-filters="HtmlTable" class="sortable" cellpadding="0" cellspacing="0">
-				<thead>
-					<tr>
-						<th>Owner</th>
-						<th>Name</th>
-						<th colspan="2">Last Modified</th>
-					</tr>
-				</thead>
-				<tbody>
-			{% for jobdesign in jobdesigns %}
-					<tr {% ifequal saved jobdesign.id %} class="jobsub_saved"{% endifequal %}>
-						<td>{{ jobdesign.owner.username }}</td>
-						<td>{{ jobdesign.name }}</td>
-						<td>
-							<span class="jobsub_actual_date" style="display: none">{{ jobdesign.last_modified|date:"U" }}</span>
-							{{ jobdesign.last_modified|timesince }} ago
-						</td>
-						<td class="jobsub_listing_actions">
-							<a title="Copy design" class="copy frame_tip" href="{{ jobdesign.clone_url }}">copy</a> 
-							<a title="Edit this design" class="edit frame_tip" href="{{ jobdesign.edit_url }}">edit</a> 
-							<a title="Delete this design" alt="Are you sure you want to delete this design?" class="delete frame_tip" href="{{ jobdesign.delete_url }}">delete</a> 
-							<a title="Launch job with this design" class="run frame_tip" href="{{ jobdesign.submit_url }}">submit to cluster</a>
-						</td>
-					</tr>
-			{% endfor %}
-				</tbody>
-			</table>
-		</div>
-	</div>
+  <h1>Job Designer: Job Designs</h1>
+  <div class="jobsub_col_wrapper" data-filters="SplitView">
+    <div class="jobsub_left_col left_col">
+      {% include "types.html" %}
+    </div>
+    <div class="jobsub_right_col right_col">
+      <div class="jobsub_topsection clearfix">
+        <form class="jobsub_filter" data-filters="SubmitOnChange" action="{% url jobsub.list %}" method="get">
+          <span class="filter_text">Filter by owner:</span>
+          <input data-filters="ArtInput, OverText" data-art-input-type="search" name="owner" alt="filter by owner" value="{{ owner }}"/>
+          <input data-filters="ArtInput, OverText" data-art-input-type="search" name="name" alt="filter by name" value="{{ name }}"/>
+          <input class="submit" type="submit"/>
+        </form>
+      </div>
+    
+      <table data-filters="HtmlTable" class="selectable sortable" cellpadding="0" cellspacing="0">
+        <thead>
+          <tr>
+            <th>Owner</th>
+            <th>Name</th>
+            <th colspan="2">Last Modified</th>
+          </tr>
+        </thead>
+        <tbody>
+      {% for jobdesign in jobdesigns %}
+          <tr 
+            {% ifequal saved jobdesign.id %} class="jobsub_saved"{% endifequal %}
+            data-filters="ContextMenu"
+            data-context-menu-actions="[{'events':['contextmenu','click:relay(.item-options)'],'menu':'ul.context-menu'}]"
+            data-dblclick-delegate= "{'dblclick_loads':'a.run'}">
+            <td>
+              {{ jobdesign.owner.username }}
+              <ul class="context-menu">
+                <li><a title="Launch job with this design" class="run frame_tip" href="{{ jobdesign.submit_url }}">submit to cluster</a></li>
+                <li><a title="Copy design" class="copy frame_tip" href="{{ jobdesign.clone_url }}">copy</a></li>
+                <li><a title="Edit this design" class="edit frame_tip" href="{{ jobdesign.edit_url }}">edit</a></li>
+                <li><a title="Delete this design" alt="Are you sure you want to delete this design?" class="delete frame_tip" href="{{ jobdesign.delete_url }}">delete</a></li>
+              </ul>
+            </td>
+            <td>{{ jobdesign.name }}</td>
+            <td>
+              <span class="jobsub_actual_date" style="display: none">{{ jobdesign.last_modified|date:"U" }}</span>
+              {{ jobdesign.last_modified|timesince }} ago
+            </td>
+            <td>
+              <a class="item-options">options</a>
+            </td>
+          </tr>
+      {% endfor %}
+        </tbody>
+      </table>
+    </div>
+  </div>
 </div>
 {% endblock %}

+ 2 - 2
apps/jobsub/src/jobsub/templates/watch.html

@@ -23,7 +23,7 @@ limitations under the License.
 {% block content %}
   <div id="jobsub_history" class="view">
     <h1>Recently Launched Jobs</h1>
-    <table data-filters="HtmlTable" class="sortable">
+    <table data-filters="HtmlTable" class="selectable sortable">
       <thead>
         <tr>
           <th>Owner</th>
@@ -34,7 +34,7 @@ limitations under the License.
       </thead>
       <tbody>
         {% for submission in submissions %}
-          <tr>
+          <tr data-dblclick-delegate= "{'dblclick_loads':'a'}">
             <td>{{ submission.owner }}</td>
             <td>{{ submission.name }}</td>
             <td>

+ 16 - 9
apps/jobsub/static/css/jobsub.css

@@ -50,25 +50,31 @@
 .jobsub_joblist form span, .jobsub_joblist form input.submit {
 	display: none;
 }
-.jobsub_joblist td.jobsub_listing_actions a {
+.jobsub_joblist .context-menu a {
+	padding-left: 22px;
 	display: block;
-	float: right;
-	width: 18px;
 	height: 18px;
+}
+.item-options {
+	background: url(/static/art/led-icons/ui_combo_box.png) no-repeat;
+	display: block;
+	width: 16px;
+	height: 16px;
+	text-indent: -500px;
 	overflow: hidden;
-	text-indent: -9999999px;
-	margin-left: 6px;
+	float: right;
 }
-.jobsub_joblist td a.copy {
+
+.jobsub_joblist a.copy {
 	background: url('../art/line_icons.png') no-repeat;	
 }
-.jobsub_joblist td a.edit {
+.jobsub_joblist a.edit {
 	background: url('../art/line_icons.png') no-repeat 0 -23px;
 }
-.jobsub_joblist td a.delete {
+.jobsub_joblist a.delete {
 	background: url('../art/line_icons.png') no-repeat 0 -70px;
 }
-.jobsub_joblist td a.run {
+.jobsub_joblist a.run {
 	background: url('../art/line_icons.png') no-repeat 0 -47px;
 }
 .jobsub_left_col {
@@ -217,6 +223,7 @@ ul.jobsub_new li a:hover {
 	height: 14px;
 	background: url(/static/art/info.png);
 	text-indent: -999999px;
+	float: right;
 }
 
 .jobsub_output h1 {