Ernesto Menéndez avatar Ernesto Menéndez committed dcf5d67

apps.admin: estilo mantenimiento de programas

Comments (0)

Files changed (4)

nxweb/apps/admin/html/js/program-controller.js

         Program.delete({program_key:program_key});
         refresh();
     }
+
+    $scope.showCreateWindow = function() {
+        $("#program-window").data("kendoWindow").refresh("/window.html#/program/").center().open().unbind('close').bind('close', refresh);
+    }
+
+    $scope.showEditWindow = function(program_name, program_version) {
+        var id = program_name + "+" + program_version;
+        $("#program-window").data("kendoWindow").refresh("/window.html#/program/"+id).center().open().unbind('close').bind('close', refresh);
+    }
+
     refresh();
 }
 

nxweb/apps/admin/html/partials/pkey.html

-
 <form name="form" class="css-form" novalidate>
 
 <table>

nxweb/apps/admin/html/partials/program-list.html

-<a href="/#/program">Create</a>
-<table>
-  <tr>
-    <td>Name</td><td>Version</td><td>Runner</td><td>Delete</td>
-  </tr>
+<div class="k-content">
+    <div class="k-grid k-widget" tabindex="0" style="height: 540px;">
+        <div class="k-toolbar k-grid-toolbar">
+            <!-- <a href="/#/program" class="k-button k-button-icontext k-grid-add"> -->
+            <a ng-click="showCreateWindow()" class="k-button k-button-icontext k-grid-add">
+                <span class="k-icon k-add"></span>
+                Create new program
+            </a>
+        </div>
+        <div class="k-grid-header" style="padding-right: 16px;">
+            <div class="k-grid-header-wrap">
+                <table cellspacing="0">
+                    <colgroup><col><col><col><col></colgroup>
+                    <thead>
+                        <tr>
+                            <th class="k-header">Name</th>
+                            <th class="k-header">Version</th>
+                            <th class="k-header">Runner</th>
+                            <th class="k-header"></th>
+                        </tr>
+                    </thead>
+                </table>
+            </div>
+        </div>
 
-  <tr ng-repeat="(program, metadata) in programs">
-    <td><a ng-href="#/program/{{program}}+{{metadata['version']}}">{{program}}</a></td>
-    <td>{{metadata['version']}}</td>
-    <td>{{metadata['runner_name']}}</td>
-    <td><a ng-click="delete(program, metadata['version'])">X</a></td>
-  </tr>
-</table>
+        <div class="k-grid-content" style="height: 468px;">
+            <table cellspacing="0" id="grid" style="height: auto;" class="k-focusable">
+                <colgroup><col><col><col><col></colgroup>
+                <tbody>
+                    <tr ng-repeat="(program, metadata) in programs" ng-class-even="'k-alt'">
+                        <td>
+                            {{program}}
+                        </td>
+                        <td>
+                            {{metadata['version']}}
+                        </td>
+                        <td>
+                            {{metadata['runner_name']}}
+                        </td>
+                        <td>
+                            <!-- <a ng-href="#/program/{{program}}+{{metadata['version']}}" class="k-button k-button-icontext k-grid-edit"> -->
+                            <a ng-click="showEditWindow(program, metadata['version'])" class="k-button k-button-icontext k-grid-edit">
+                                <span class="k-icon k-edit"></span>
+                                Edit
+                            </a>
+                            <a ng-click="delete(program, metadata['version'])" class="k-button k-button-icontext k-grid-delete">
+                                <span class="k-icon k-delete"></span>
+                                Delete
+                            </a>
+                        </td>
+                    </tr>
+                </tbody>
+            </table>
+        </div>
+    </div>
+</div>
+
+<div id="program-window">
+</div>
+
+<script type="text/javascript">
+    $(document).ready(function() {
+        $("#program-window").kendoWindow({
+            iframe: true,
+            modal: true,
+            content: "about:blank",
+            height: "400px",
+            width: "600px",
+            visible: false
+        });
+    });
+</script>

nxweb/apps/admin/html/partials/program.html

 <button ng-click="update()">Upload</button>
 
 </form>
-<a href="#/programs">Back</a>
+<!-- <a href="#/programs">Back</a> -->
 <p ng-show=message> {{message}} </p>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.