Commits

Miha Stajdohar  committed 554b348

Bookmark list.

  • Participants
  • Parent commits 1c02de6

Comments (0)

Files changed (8)

File benchmarks/static/benchmarks/css/benchmarks.css

+
+#benchmark-table {
+    table-layout: auto;
+    width: 1500px;
+    max-width: none;
+}
+
+.pagination {
+    margin: 0 20px 0 0;
+}
+
+.pagination.ng-scope {
+    margin-top: 20px;
+}
+
+.input-filter {
+    height: 34px;
+    padding: 6px 12px;
+    font-size: 14px;
+    line-height: 1.428571429;
+    color: #555555;
+    vertical-align: middle;
+    background-color: #ffffff;
+    border: 1px solid #cccccc;
+    border-radius: 4px;
+    -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+    -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
+    transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
+}
+
+#plot_placeholder {
+    display: none;
+    width: 600px;
+    height: 300px;
+    padding: 10px 5px 0 0;
+    margin: 15px auto 30px auto;
+    border: 1px solid #ddd;
+    background: #fff;
+    background: linear-gradient(#f6f6f6 0, #fff 50px);
+    background: -o-linear-gradient(#f6f6f6 0, #fff 50px);
+    background: -ms-linear-gradient(#f6f6f6 0, #fff 50px);
+    background: -moz-linear-gradient(#f6f6f6 0, #fff 50px);
+    background: -webkit-linear-gradient(#f6f6f6 0, #fff 50px);
+    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
+    -o-box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
+    -ms-box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
+    -moz-box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
+    -webkit-box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
+}
+
+.axisLabel {
+    position: absolute;
+    text-align: center;
+    font-size: 12px;
+}
+
+.yaxisLabel {
+    top: 50%;
+    left: 2px;
+    transform: rotate(-90deg);
+    -o-transform: rotate(-90deg);
+    -ms-transform: rotate(-90deg);
+    -moz-transform: rotate(-90deg);
+    -webkit-transform: rotate(-90deg);
+    transform-origin: 0 0;
+    -o-transform-origin: 0 0;
+    -ms-transform-origin: 0 0;
+    -moz-transform-origin: 0 0;
+    -webkit-transform-origin: 0 0;
+}
+
+.legend {
+    margin-top: 5px;
+}
+
+.legendColorBox {
+    padding-left: 10px;
+}
+
+.ie7 .yaxisLabel, .ie8 .yaxisLabel {
+    top: 40%;
+    font-size: 36px;
+    filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.0, M12=0.33, M21=-0.33, M22=0.0, sizingMethod='auto expand');
+}
+
+.multiselect-all {
+    font-weight: normal;
+}
+
+.multiselect-container .checkbox {
+    font-weight: normal;
+}

File benchmarks/static/benchmarks/js/controllers.js

 }
 
 function BookmarksCtrl($scope, $filter, ngTableParams, Bookmark) {
-    var bookmarks;
+    var data,
+        orderedData;
 
     $('#benchmarks-list-item').removeClass('active');
     $('#bookmarks-list-item').addClass('active');
 
-    bookmarks = Bookmark.query(function () {
-        $scope.bookmarks = bookmarks.objects;
+    $scope.tableBookmarks = new ngTableParams({
+        page: 1,            // show first page
+        total: 0,           // length of data
+        count: 10,          // count per page
+        filter: '',         // initial filter
+        sorting: {
+            date: 'desc'    // initial sorting
+        }
+    });
+
+    data = Bookmark.query(function () {
+        // watch for changes in table properties (sort, page...)
+        $scope.$watch('tableBookmarks', function (params) {
+            orderedData = params.sorting ?
+                $filter('orderBy')(data.objects, params.orderBy()) :
+                data.objects;
+
+            orderedData = params.filter ?
+                $filter('filter')(orderedData, params.filter) :
+                orderedData;
+
+            params.total = orderedData.length;
+            $scope.bookmarks = orderedData.slice((params.page - 1) * params.count, params.page * params.count);
+            // move select all checkbox from hidden filter to table header
+            $('#select_all').prependTo("table > thead > tr:first > th:first");
+        }, true);
+
     });
 }

File benchmarks/static/benchmarks/partials/benchmarks.html

 </div>
 <div class="row">
     <div class="col-md-12" style="overflow: auto;">
-        <table ng-table="tableBenchmarks" show-filter="false" class="table">
+        <table id="benchmark-table" ng-table="tableBenchmarks" show-filter="false" class="table">
             <tr ng-repeat="benchmark in benchmarks">
                 <td filter="{'checked': 'checkbox'}" style="text-align: left;">
                     <input type="checkbox" ng-model="checkboxes.items[benchmark.id]"/>

File benchmarks/static/benchmarks/partials/bookmarks.html

 <h1>Bookmarks</h1>
+
+<div class="row">
+    <div class="col-md-5">
+        <div class="form-group">
+            <input type="text" ng-model="tableBookmarks.filter" class="form-control" placeholder="Filter">
+        </div>
+    </div>
+</div>
+<div class="row">
+    <div class="col-md-12">
+        <table ng-table="tableBookmarks" show-filter="false" class="table">
+            <tr ng-repeat="bookmark in bookmarks">
+                <td data-title="'Date'" sortable="date" style="width: 140px;">
+                    {{ bookmark.date | date:'short' }}
+                </td>
+                <td data-title="'User'" sortable="user.username" style="width: 140px;">
+                    {{ bookmark.user.username }}
+                </td>
+                <td data-title="'Title'" sortable="title" style="width: 260px;">
+                    <a href="/benchmarks/#/{{ bookmark.id }}/">{{ bookmark.title }}</a>
+                </td>
+                <td data-title="'Description'">
+                    {{ bookmark.description }}
+                </td>
+            </tr>
+        </table>
+    </div>
+</div>

File benchmarks/templates/benchmarks/benchmarks.html

 
 {% block css %}
     <link href="{% static 'benchmarks/css/ng-table.css' %}" rel="stylesheet">
+    <link href="{% static 'benchmarks/css/benchmarks.css' %}" rel="stylesheet">
 {% endblock %}
 
 {% block js_body %}

File benchmarks/templates/benchmarks/submit.html

 {% block active_submit %}active{% endblock %}
 
 {% block js_body %}
-  <script src="{% static 'main/js/submit.js' %}"></script>
+  <script src="{% static 'benchmarks/js/submit.js' %}"></script>
 {% endblock %}
 
 {% block content %}

File main/static/main/css/main.css

     margin-bottom: 10px;
 }
 
-.ng-table {
-    table-layout: auto;
-    width: 1500px;
-    max-width: none;
-}
-
-.pagination {
-    margin: 0 20px 0 0;
-}
-
-.pagination.ng-scope {
-    margin-top: 20px;
-}
-
-.input-filter {
-    height: 34px;
-    padding: 6px 12px;
-    font-size: 14px;
-    line-height: 1.428571429;
-    color: #555555;
-    vertical-align: middle;
-    background-color: #ffffff;
-    border: 1px solid #cccccc;
-    border-radius: 4px;
-    -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-    -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
-    transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
-}
-
 .navbar-brand:hover {
     color: #999999 !important;
 }
-
-#plot_placeholder {
-    display: none;
-    width: 600px;
-    height: 300px;
-    padding: 10px 5px 0 0;
-    margin: 15px auto 30px auto;
-    border: 1px solid #ddd;
-    background: #fff;
-    background: linear-gradient(#f6f6f6 0, #fff 50px);
-    background: -o-linear-gradient(#f6f6f6 0, #fff 50px);
-    background: -ms-linear-gradient(#f6f6f6 0, #fff 50px);
-    background: -moz-linear-gradient(#f6f6f6 0, #fff 50px);
-    background: -webkit-linear-gradient(#f6f6f6 0, #fff 50px);
-    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
-    -o-box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
-    -ms-box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
-    -moz-box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
-    -webkit-box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
-}
-
-.axisLabel {
-    position: absolute;
-    text-align: center;
-    font-size: 12px;
-}
-
-.yaxisLabel {
-    top: 50%;
-    left: 2px;
-    transform: rotate(-90deg);
-    -o-transform: rotate(-90deg);
-    -ms-transform: rotate(-90deg);
-    -moz-transform: rotate(-90deg);
-    -webkit-transform: rotate(-90deg);
-    transform-origin: 0 0;
-    -o-transform-origin: 0 0;
-    -ms-transform-origin: 0 0;
-    -moz-transform-origin: 0 0;
-    -webkit-transform-origin: 0 0;
-}
-
-.legend {
-    margin-top: 5px;
-}
-
-.legendColorBox {
-    padding-left: 10px;
-}
-
-.ie7 .yaxisLabel, .ie8 .yaxisLabel {
-    top: 40%;
-    font-size: 36px;
-    filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.0, M12=0.33, M21=-0.33, M22=0.0, sizingMethod='auto expand');
-}
-
-.multiselect-all {
-    font-weight: normal;
-}
-
-.multiselect-container .checkbox {
-    font-weight: normal;
-}

File main/templates/main/home.html

             <div class="col-lg-12">
                 <h1>Welcome</h1>
 
-                <p>Start with <a href="/learn/">tutorial</a> to learn about benchmark analysis.</p>
+                <p>Start with <a href="/learn/">tutorial</a> to learn about benchmark analysis or jump to the <a href="/benchmarks/#/1/">bookmarked benchmark preview</a>.</p>
             </div>
         </div>
         <div class="row">