|
36 | 36 | tableClass = "scroll_in_screen"; |
37 | 37 | } |
38 | 38 |
|
| 39 | + bool isPublic = false; |
| 40 | + |
| 41 | + if(ViewData["isPublic"]!=null) |
| 42 | + { |
| 43 | + isPublic = (bool)ViewData["isPublic"]; |
| 44 | + } |
39 | 45 | } |
40 | 46 |
|
41 | 47 | @section Scripts{ |
|
58 | 64 | } |
59 | 65 | <div id="downloadOptions" style="text-align:left;"> |
60 | 66 |
|
61 | | - @if (Model.DownloadAccess && Model.Data != null && Model.Data.Rows.Count > 0) |
62 | | - { |
63 | 67 |
|
64 | | - @*<button id="downloadExcelTemplateButton" class="bx-button function" title="Xlsx download" onclick="downloadExcelTemplate(@Model.DatasetId)">Download Template</button> |
| 68 | + @if (!isPublic || User.Identity.Name != "") /* dont sho download options if the dataset is public */ |
| 69 | + { |
| 70 | + if (Model.DownloadAccess && Model.Data != null && Model.Data.Rows.Count > 0) |
| 71 | + { |
| 72 | + |
| 73 | + @*<button id="downloadExcelTemplateButton" class="bx-button function" title="Xlsx download" onclick="downloadExcelTemplate(@Model.DatasetId)">Download Template</button> |
65 | 74 |
|
66 | | - <button id="downloadExcelButton" class="bx-button function" title="Xlsx download" onclick="downloadExcel(@Model.DatasetId)">Download Excel</button>*@ |
| 75 | + <button id="downloadExcelButton" class="bx-button function" title="Xlsx download" onclick="downloadExcel(@Model.DatasetId)">Download Excel</button>*@ |
67 | 76 |
|
68 | 77 | if (@total < 1048576) // hide Excel download for bigger datasets, which exceed the max number of rows in excel |
69 | 78 | { |
| 79 | + <span class="dropdown"> |
| 80 | + <button class="bx-button function" type="button" onclick="downloadExcel(@Model.DatasetId)"> |
| 81 | + Download Excel |
| 82 | + </button> |
| 83 | + @*<button class="bx-button function" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> |
| 84 | + Download Excel |
| 85 | + <span class="caret"></span> |
| 86 | + </button> |
| 87 | + <ul class="dropdown-menu" aria-labelledby="dropdownMenu2"> |
| 88 | + <li><a id="downloadExcelTemplateButton" onclick="downloadExcelTemplate(@Model.DatasetId)">Template (.xlsm)</a></li> |
| 89 | + <li><a id="downloadExcelButton" onclick="downloadExcel(@Model.DatasetId)">Excel (.xlsx)</a></li> |
| 90 | + </ul>*@ |
| 91 | + </span> |
| 92 | + } |
| 93 | + |
70 | 94 | <span class="dropdown"> |
71 | | - <button class="bx-button function" type="button" onclick="downloadExcel(@Model.DatasetId)"> |
72 | | - Download Excel |
73 | | - </button> |
74 | | - @*<button class="bx-button function" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> |
75 | | - Download Excel |
| 95 | + <button class="bx-button function" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> |
| 96 | + Download Text |
76 | 97 | <span class="caret"></span> |
77 | 98 | </button> |
78 | | - <ul class="dropdown-menu" aria-labelledby="dropdownMenu2"> |
79 | | - <li><a id="downloadExcelTemplateButton" onclick="downloadExcelTemplate(@Model.DatasetId)">Template (.xlsm)</a></li> |
80 | | - <li><a id="downloadExcelButton" onclick="downloadExcel(@Model.DatasetId)">Excel (.xlsx)</a></li> |
81 | | - </ul>*@ |
| 99 | + <ul class="dropdown-menu" aria-labelledby="dropdownMenu1"> |
| 100 | + |
| 101 | + @foreach (KeyValuePair<string, string> fileType in Model.AsciiFileDownloadSupport) |
| 102 | + { |
| 103 | + <li><a class="file-type-download-entry" ext="@fileType.Value"> @fileType.Key (@fileType.Value)</a></li> |
| 104 | + } |
| 105 | + </ul> |
| 106 | + </span> |
| 107 | + |
| 108 | + <span> |
| 109 | + @Html.CheckBox("WithUnits", false, new { text = "download data with units", @id = "WithUnits" }) |
| 110 | + Download data with units. |
82 | 111 | </span> |
83 | 112 | } |
| 113 | + else |
| 114 | + { |
84 | 115 |
|
85 | | - <span class="dropdown"> |
86 | | - <button class="bx-button function" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> |
| 116 | + <button title="Download Excel" |
| 117 | + name="Download Excel" |
| 118 | + class="t-button t-state-disabled margin" |
| 119 | + disabled="disabled"> |
| 120 | + Download Excel |
| 121 | + </button> |
| 122 | + <button title="Download Comma Separated" |
| 123 | + name="Download Comma Separated" |
| 124 | + class="t-button t-state-disabled margin" |
| 125 | + disabled="disabled"> |
87 | 126 | Download Text |
88 | | - <span class="caret"></span> |
89 | 127 | </button> |
90 | | - <ul class="dropdown-menu" aria-labelledby="dropdownMenu1"> |
91 | | - |
92 | | - @foreach (KeyValuePair<string, string> fileType in Model.AsciiFileDownloadSupport) |
93 | | - { |
94 | | - <li><a class="file-type-download-entry" ext="@fileType.Value"> @fileType.Key (@fileType.Value)</a></li> |
95 | | - } |
96 | | - </ul> |
97 | | - </span> |
98 | | - |
99 | | - <span> |
100 | | - @Html.CheckBox("WithUnits", false, new { text = "download data with units", @id = "WithUnits" }) |
101 | | - Download data with units. |
102 | | - </span> |
103 | 128 | } |
104 | | - else |
105 | | - { |
106 | | - |
107 | | - <button title="Download Excel" |
108 | | - name="Download Excel" |
109 | | - class="t-button t-state-disabled margin" |
110 | | - disabled="disabled"> |
111 | | - Download Excel |
112 | | - </button> |
113 | | - <button title="Download Comma Separated" |
114 | | - name="Download Comma Separated" |
115 | | - class="t-button t-state-disabled margin" |
116 | | - disabled="disabled"> |
117 | | - Download Text |
118 | | - </button> |
119 | 129 | } |
120 | 130 |
|
121 | 131 | <span> |
|
125 | 135 |
|
126 | 136 | <span id="preloaderContainer" style="float: right"></span> |
127 | 137 | </div> |
128 | | -<br /> |
| 138 | + |
129 | 139 | @(Html.Telerik().Grid(Model.Data) |
130 | 140 | .Name("PrimaryDataResultGrid") |
131 | 141 | .DataBinding(dataBinding => dataBinding |
|
0 commit comments