1 | @* HeuristicLab
|
---|
2 | * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
3 | *
|
---|
4 | * This file is part of HeuristicLab.
|
---|
5 | *
|
---|
6 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
7 | * it under the terms of the GNU General Public License as published by
|
---|
8 | * the Free Software Foundation, either version 3 of the License, or
|
---|
9 | * (at your option) any later version.
|
---|
10 | *
|
---|
11 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
14 | * GNU General Public License for more details.
|
---|
15 | *
|
---|
16 | * You should have received a copy of the GNU General Public License
|
---|
17 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
18 | *@
|
---|
19 |
|
---|
20 | @helper UserList(string destinationTag, string url, bool multiline) {
|
---|
21 | <script>
|
---|
22 | $.ajax({
|
---|
23 | url: "@(new HtmlString(url))", datatype: "json", success: function (result) {
|
---|
24 | $("#" + "@destinationTag").html("");
|
---|
25 | @if(multiline) {
|
---|
26 | @:$("#" + "@destinationTag").attr("size", result.length);
|
---|
27 | }
|
---|
28 | else {
|
---|
29 | @:$("#" + "@destinationTag").append("<option></option>");
|
---|
30 | }
|
---|
31 | for (var i = 0; i < result.length; i++) {
|
---|
32 | $("#" + "@destinationTag").append("<option>" + result[i] + "</option>");
|
---|
33 | }
|
---|
34 | }
|
---|
35 | });
|
---|
36 | </script>
|
---|
37 | }
|
---|
38 |
|
---|
39 | @helper UserTaskStats(string destinationTag, string url, string userName, string start, string end)
|
---|
40 | {
|
---|
41 | if (userName != "" || userName != null) {
|
---|
42 | <text>
|
---|
43 | $.ajax({
|
---|
44 | url: "@(new HtmlString(url))?start=" + @start + "&end=" + @end, datatype: "json", success: function (overallResult) {
|
---|
45 | $.ajax({
|
---|
46 | url: "@(new HtmlString(url))?start=" + @start + "&end=" + @end + "&userName=" + @userName, datatype: "json", success: function (userResult) {
|
---|
47 | $("#" + "@destinationTag").html("");
|
---|
48 | for (var i = 0; i < userResult.length; i++) {
|
---|
49 | $("#" + "@destinationTag").append('<label class="barLabel">' + userResult[i].Key + '</label>');
|
---|
50 | $("#" + "@destinationTag").append('<div class="outerBar"><div class="innerBar" id="InnerBar' + i + '"><label class="innerBarText">' + +userResult[i].Value.toFixed(4) + '</label></div></div><label class="outerBarText" id="OuterText' + i + '">' + +overallResult[i].Value.toFixed(4) + '</label>');
|
---|
51 | $("#InnerBar" + i).css('width',((userResult[i].Value/overallResult[i].Value)*100).toFixed(2) + '%');
|
---|
52 | }
|
---|
53 | }
|
---|
54 | });
|
---|
55 | }
|
---|
56 | });
|
---|
57 | </text>
|
---|
58 | }
|
---|
59 | } |
---|