Revision 54417a11
b/ui/static/ie.css | ||
---|---|---|
2 | 2 |
height:31px; |
3 | 3 |
} |
4 | 4 |
|
5 |
#error-success .popup-body-inner { |
|
5 |
div.machine div.actions a { |
|
6 |
width: 180px; |
|
7 |
} |
|
8 |
|
|
9 |
#error-success .popup-body-inner, .notification-box .popup-body-inner { |
|
6 | 10 |
margin-left: 12px; |
11 |
padding-bottom: 30px; |
|
12 |
height: 140px; |
|
7 | 13 |
} |
8 | 14 |
|
9 | 15 |
|
... | ... | |
209 | 215 |
} |
210 | 216 |
|
211 | 217 |
#view-select { |
212 |
top: -45px !important; |
|
218 |
top: -35px !important; |
|
219 |
right: 10px; |
|
213 | 220 |
} |
214 | 221 |
|
215 | 222 |
.running { |
216 | 223 |
height: 80px; |
217 | 224 |
padding-top: 70px; |
225 |
margin-top: -70px; |
|
218 | 226 |
} |
219 | 227 |
|
220 | 228 |
.editbuttons { |
... | ... | |
463 | 471 |
bottom: 9px; |
464 | 472 |
} |
465 | 473 |
|
466 |
#notification-box .popup-body-inner { |
|
467 |
width: 445px; |
|
474 |
|
|
475 |
#error-success, .notification-box { |
|
476 |
top: 50px !important; |
|
477 |
position: absolute !important; |
|
478 |
} |
|
479 |
|
|
480 |
.notification-box .popup-body-inner { |
|
481 |
width: 455px !important; |
|
482 |
padding-right: 10px !important; |
|
468 | 483 |
} |
469 | 484 |
|
470 | 485 |
|
471 | 486 |
#invsent h3 span { |
472 | 487 |
font-size: 0.8em; |
473 |
margin-top: -15px; |
|
474 | 488 |
} |
475 | 489 |
|
476 | 490 |
#invsent li { |
... | ... | |
512 | 526 |
.vm-metadata { |
513 | 527 |
width: 110px; |
514 | 528 |
} |
529 |
|
|
530 |
.error-report { |
|
531 |
float: right; |
|
532 |
text-align: right; |
|
533 |
} |
b/ui/static/main.css | ||
---|---|---|
242 | 242 |
} |
243 | 243 |
|
244 | 244 |
#ie-fix { |
245 |
z-index: 1000;
|
|
245 |
z-index: 600;
|
|
246 | 246 |
position: relative; |
247 | 247 |
} |
248 |
|
|
248 | 249 |
#createcontainer { |
249 | 250 |
margin-top: 20px; |
250 | 251 |
margin-bottom: 10px; |
251 |
z-index: 1000;
|
|
252 |
z-index: 800;
|
|
252 | 253 |
} |
253 | 254 |
|
254 | 255 |
#create { |
... | ... | |
1867 | 1868 |
margin-top: 15px; |
1868 | 1869 |
} |
1869 | 1870 |
|
1870 |
#error-success, #notification-box {
|
|
1871 |
#error-success, .notification-box {
|
|
1871 | 1872 |
z-index: 9999; |
1872 | 1873 |
border-bottom: 5px solid #4085A5; |
1873 | 1874 |
min-height: 150px; |
1874 |
top: 120px !important;
|
|
1875 |
top: 50px !important;
|
|
1875 | 1876 |
position: absolute !important; |
1876 | 1877 |
} |
1877 | 1878 |
|
1878 |
#error-success p, #notification-box p {
|
|
1879 |
#error-success p, .notification-box p {
|
|
1879 | 1880 |
margin-top: 5px; |
1880 | 1881 |
} |
1881 | 1882 |
|
1882 |
#error-success strong, #notification-box strong { |
|
1883 |
.error-report { |
|
1884 |
display: none; |
|
1885 |
} |
|
1886 |
|
|
1887 |
#error-success .error-report { |
|
1888 |
position: absolute; |
|
1889 |
top: 140px; |
|
1890 |
right: 40px; |
|
1891 |
} |
|
1892 |
|
|
1893 |
.error .error-report { |
|
1894 |
display: block; |
|
1895 |
} |
|
1896 |
|
|
1897 |
#error-success .error-report .errormsg { |
|
1898 |
display: none; |
|
1899 |
} |
|
1900 |
|
|
1901 |
#error-success .error-report .success { |
|
1902 |
display: none; |
|
1903 |
} |
|
1904 |
|
|
1905 |
#error-success .error-report .sending { |
|
1906 |
display: none; |
|
1907 |
} |
|
1908 |
|
|
1909 |
#error-success .error-report .send-btn { |
|
1910 |
color: #4085A5; |
|
1911 |
text-decoration: underline; |
|
1912 |
cursor: pointer; |
|
1913 |
} |
|
1914 |
|
|
1915 |
#error-success strong, .notification-box strong { |
|
1883 | 1916 |
color: #F49C1A; |
1884 | 1917 |
} |
1885 | 1918 |
|
1886 |
#error-success .close, #notification-box .close {
|
|
1919 |
#error-success .close, .notification-box .close {
|
|
1887 | 1920 |
background-image: url("./close-popup.png"); |
1888 | 1921 |
background-repeat: no-repeat; |
1889 | 1922 |
cursor: pointer; |
... | ... | |
1911 | 1944 |
margin-bottom: 5px !important; |
1912 | 1945 |
} |
1913 | 1946 |
|
1914 |
#error-success .popup-header, #notification-box .popup-header {
|
|
1947 |
#error-success .popup-header, .notification-box .popup-header {
|
|
1915 | 1948 |
background-color: #4085A5; |
1916 | 1949 |
color: white; |
1917 | 1950 |
font-size: 95%; |
... | ... | |
1927 | 1960 |
} |
1928 | 1961 |
|
1929 | 1962 |
|
1930 |
#error-success.success h3 span.header-box, #notification-box h3 span.header-box {
|
|
1963 |
#error-success.success h3 span.header-box, .notification-box h3 span.header-box {
|
|
1931 | 1964 |
background-color: #71c837; |
1932 | 1965 |
display: block; |
1933 | 1966 |
background-image: url("./save-green.png"); |
... | ... | |
1940 | 1973 |
margin-left: -11px; |
1941 | 1974 |
} |
1942 | 1975 |
|
1943 |
#error-success .popup-body, #notification-box .popup-body {
|
|
1976 |
#error-success .popup-body, .notification-box .popup-body {
|
|
1944 | 1977 |
background: url("./popup-bg.png") repeat-x scroll 0 0 transparent; |
1945 | 1978 |
margin-left: -16px; |
1946 | 1979 |
margin-right: -16px; |
... | ... | |
1949 | 1982 |
padding-top: 10px; |
1950 | 1983 |
} |
1951 | 1984 |
|
1952 |
#error-success .popup-body-inner, #notification-box .popup-body-inner {
|
|
1985 |
#error-success .popup-body-inner, .notification-box .popup-body-inner {
|
|
1953 | 1986 |
background: url("./popup-inner-bg.png") repeat-x scroll 0 0 transparent; |
1954 | 1987 |
font-size: 80%; |
1955 | 1988 |
min-height: 120px; |
... | ... | |
1958 | 1991 |
width: 460px; |
1959 | 1992 |
} |
1960 | 1993 |
|
1961 |
#error-success .popup-separator, #notification-box .popup-seperator {
|
|
1994 |
#error-success .popup-separator, .notification-box .popup-seperator {
|
|
1962 | 1995 |
background-color: #74AEC9; |
1963 | 1996 |
height: 1px; |
1964 | 1997 |
font-size:1%; |
... | ... | |
1976 | 2009 |
padding-bottom: 14px !important; |
1977 | 2010 |
} |
1978 | 2011 |
|
1979 |
#error-success .password-container, #notification-box .password-container {
|
|
2012 |
#error-success .password-container, .notification-box .password-container {
|
|
1980 | 2013 |
width: 430px; |
1981 | 2014 |
padding: 5px; |
1982 | 2015 |
border: 2px solid #75b54a; |
1983 | 2016 |
background-color: #aade87; |
1984 | 2017 |
} |
1985 | 2018 |
|
1986 |
#error-success .password-header, #notification-box .password-header {
|
|
2019 |
#error-success .password-header, .notification-box .password-header {
|
|
1987 | 2020 |
margin-bottom: 5px; |
1988 | 2021 |
} |
1989 | 2022 |
|
1990 |
#error-success .password, #notification-box .password {
|
|
2023 |
#error-success .password, .notification-box .password {
|
|
1991 | 2024 |
color: #447821; |
1992 | 2025 |
} |
1993 | 2026 |
|
1994 |
#error-success .popup-details { |
|
2027 |
#error-success .popup-details, .notification-box .popup-details {
|
|
1995 | 2028 |
border: 2px solid #FF7F2A; |
1996 | 2029 |
float: left; |
1997 | 2030 |
margin-left: 10px; |
1998 | 2031 |
padding: 2px; |
1999 | 2032 |
} |
2000 | 2033 |
|
2001 |
#error-success.success .popup-details { |
|
2034 |
#error-success.success .popup-details, .notification-box .popup-details {
|
|
2002 | 2035 |
border: none !important; |
2003 | 2036 |
float: none !important; |
2004 | 2037 |
margin-left: none !important; |
2005 | 2038 |
margin-top: 10px; |
2006 | 2039 |
} |
2007 | 2040 |
|
2008 |
#error-success.success .popup-separator { |
|
2041 |
#error-success.success .popup-separator, .notification-box .popup-seperator {
|
|
2009 | 2042 |
margin-bottom: 14px !important; |
2010 | 2043 |
} |
2011 | 2044 |
|
2012 |
#error-success .write-password { |
|
2045 |
#error-success .write-password, .notification-box .write-password {
|
|
2013 | 2046 |
margin-bottom: 5px; |
2014 | 2047 |
padding-left: 30px; |
2015 | 2048 |
} |
2016 | 2049 |
|
2017 |
#error-success .write-password-password { |
|
2050 |
#error-success .write-password-password, .notification-box .write-password-password {
|
|
2018 | 2051 |
padding-left: 30px; |
2019 | 2052 |
color: #447821; |
2020 | 2053 |
display: inline; |
... | ... | |
2022 | 2055 |
font-weight: bold; |
2023 | 2056 |
} |
2024 | 2057 |
|
2025 |
#error-success .write-password-details { |
|
2058 |
#error-success .write-password-details, .notification-box .write-password-details {
|
|
2026 | 2059 |
font-size: 75%; |
2027 | 2060 |
} |
2028 | 2061 |
|
... | ... | |
2030 | 2063 |
display: block; |
2031 | 2064 |
} |
2032 | 2065 |
|
2033 |
#notification-box h3 span.header-box {
|
|
2066 |
.notification-box h3 span.header-box {
|
|
2034 | 2067 |
background: transparent; |
2035 | 2068 |
} |
2036 | 2069 |
|
2037 |
#notification-box .machine-now-building {
|
|
2070 |
.notification-box .machine-now-building {
|
|
2038 | 2071 |
padding: 20px 0; |
2039 | 2072 |
} |
2040 | 2073 |
|
2041 |
#notification-box .header-box {
|
|
2074 |
.notification-box .header-box {
|
|
2042 | 2075 |
width: auto !important; |
2043 | 2076 |
} |
2044 | 2077 |
|
2045 |
#notification-box .password {
|
|
2078 |
.notification-box .password {
|
|
2046 | 2079 |
text-align: center; |
2047 | 2080 |
} |
2048 |
#notification-box .password a:hover {
|
|
2081 |
.notification-box .password a:hover {
|
|
2049 | 2082 |
background-color: #447821; |
2050 | 2083 |
color: #fff; |
2051 | 2084 |
} |
2052 | 2085 |
|
2053 |
#notification-box .password a {
|
|
2086 |
.notification-box .password a {
|
|
2054 | 2087 |
padding: 0.2em; |
2055 | 2088 |
text-align: center; |
2056 | 2089 |
color: #447821; |
... | ... | |
2205 | 2238 |
font-size: 75%; |
2206 | 2239 |
margin-top: 38px; |
2207 | 2240 |
padding-bottom: 10px; |
2208 |
z-index: 400;
|
|
2241 |
z-index: 8000;
|
|
2209 | 2242 |
position: absolute; |
2210 | 2243 |
right:0; |
2211 | 2244 |
} |
... | ... | |
2271 | 2304 |
border-top:1px solid #fff; |
2272 | 2305 |
position: relative; |
2273 | 2306 |
top: 1px; |
2307 |
box-shadow: 1px 1px 1px #aaa; |
|
2308 |
-moz-box-shadow: 1px 1px 1px #aaa; |
|
2309 |
-webkit-box-shadow: 1px 1px 1px #aaa; |
|
2310 |
z-index: 2000; |
|
2274 | 2311 |
} |
2275 | 2312 |
|
2276 | 2313 |
div#user .useractions li { |
2277 |
padding: 5px 10px;
|
|
2314 |
padding: 2px 10px;
|
|
2278 | 2315 |
border-bottom: 1px solid #efefef; |
2279 | 2316 |
text-align: right; |
2280 | 2317 |
display: block; |
... | ... | |
3943 | 3980 |
.machine-container .separator { |
3944 | 3981 |
background-color: #B0D1E0; |
3945 | 3982 |
} |
3983 |
|
|
3984 |
#feedback-form .empty-error-msg { |
|
3985 |
display: none; |
|
3986 |
} |
|
3987 |
|
|
3988 |
#feedback-form .data-text { |
|
3989 |
display: none; |
|
3990 |
} |
|
3991 |
|
|
3992 |
#feedback-form .message { |
|
3993 |
display: none; |
|
3994 |
} |
|
3995 |
|
|
3996 |
#feedback-form label { |
|
3997 |
display: block; |
|
3998 |
} |
|
3999 |
|
|
4000 |
#feedback-form label.inline { |
|
4001 |
display: inline; |
|
4002 |
padding-left: 5px; |
|
4003 |
} |
|
4004 |
|
|
4005 |
#feedback-form p { |
|
4006 |
padding: 1em 0; |
|
4007 |
color: #444; |
|
4008 |
} |
|
4009 |
|
|
4010 |
#feedback-form .description { |
|
4011 |
font-style: italic; |
|
4012 |
font-size: 0.9em; |
|
4013 |
color: #888; |
|
4014 |
padding-left: 2px; |
|
4015 |
} |
|
4016 |
|
|
4017 |
#feedback-form .feedback-text { |
|
4018 |
width: 98%; |
|
4019 |
height: 100px; |
|
4020 |
margin-top: 10px; |
|
4021 |
margin-bottom: 10px; |
|
4022 |
} |
|
4023 |
|
|
4024 |
#feedback-form .submit { |
|
4025 |
margin-top: 10px; |
|
4026 |
background-color: #4085A5; |
|
4027 |
color: #fff; |
|
4028 |
float: right; |
|
4029 |
border: 1px solid #445566; |
|
4030 |
padding: 5px; |
|
4031 |
cursor: pointer; |
|
4032 |
font-size: 0.9em; |
|
4033 |
} |
|
4034 |
|
|
4035 |
.popup-body .message { |
|
4036 |
padding: 20px 5px; |
|
4037 |
display: none; |
|
4038 |
} |
|
4039 |
|
|
4040 |
.popup-body .loading { |
|
4041 |
color: #fff; |
|
4042 |
} |
|
4043 |
|
|
4044 |
.popup-body .success { |
|
4045 |
color: #1F921A; |
|
4046 |
} |
|
4047 |
|
|
4048 |
.popup-body .errormsg { |
|
4049 |
color: #E32424; |
|
4050 |
} |
|
4051 |
|
|
4052 |
|
|
4053 |
.close-msg-box { |
|
4054 |
display: block; |
|
4055 |
margin-top: 10px; |
|
4056 |
cursor: pointer; |
|
4057 |
color: #4085A5; |
|
4058 |
text-decoration: underline; |
|
4059 |
} |
b/ui/static/synnefo.js | ||
---|---|---|
63 | 63 |
} |
64 | 64 |
}); |
65 | 65 |
|
66 |
Object.prototype.toString = function(o){ |
|
67 |
|
|
68 |
var parse = function(_o){ |
|
69 |
var a = [], t; |
|
70 |
for(var p in _o){ |
|
71 |
if(_o.hasOwnProperty(p)){ |
|
72 |
t = _o[p]; |
|
73 |
if(t && typeof t == "object"){ |
|
74 |
a[a.length]= p + ":{ " + arguments.callee(t).join(", ") + "}"; |
|
75 |
} |
|
76 |
else { |
|
77 |
if(typeof t == "string"){ |
|
78 |
a[a.length] = [ p+ ": \"" + t.toString() + "\"" ]; |
|
79 |
} |
|
80 |
else{ |
|
81 |
a[a.length] = [ p+ ": " + t.toString()]; |
|
82 |
} |
|
83 |
} |
|
84 |
} |
|
85 |
} |
|
86 |
return a; |
|
87 |
|
|
88 |
} |
|
89 |
return "{" + parse(o).join(", ") + "}"; |
|
90 |
|
|
91 |
} |
|
66 | 92 |
|
67 | 93 |
// jquery show/hide events |
68 | 94 |
var _oldshow = $.fn.show; |
... | ... | |
364 | 390 |
Instead 304 it returns 0. To dealt with this we treat 0 as an |
365 | 391 |
304, which should be corrected (Bug #317). |
366 | 392 |
*/ |
367 |
//ajax_error(jqXHR.status, undefined, 'Update VMs', jqXHR.responseText);
|
|
393 |
// ajax_error(jqXHR.status, "Ajax error", 'Update VMs', jqXHR.responseText);
|
|
368 | 394 |
} |
369 | 395 |
return false; |
370 | 396 |
} |
... | ... | |
1804 | 1830 |
try { |
1805 | 1831 |
$("a#msgbox").overlay().close(); |
1806 | 1832 |
} catch(err) {} |
1833 |
try { |
|
1834 |
$("a#feedbackbox").overlay().close(); |
|
1835 |
} catch(err) {} |
|
1807 | 1836 |
} |
1808 | 1837 |
|
1809 | 1838 |
// logout |
... | ... | |
2104 | 2133 |
|
2105 | 2134 |
|
2106 | 2135 |
// generic info box |
2136 |
function show_feedback_form() { |
|
2137 |
var box = $("#feedback-form"); |
|
2138 |
box.addClass("notification-box"); |
|
2139 |
|
|
2140 |
// initialize |
|
2141 |
box.find(".form-container").show(); |
|
2142 |
box.find("textarea").val(""); |
|
2143 |
box.find(".message").hide(); |
|
2144 |
|
|
2145 |
var triggers = $("a#feedbackbox").overlay({ |
|
2146 |
// some mask tweaks suitable for modal dialogs |
|
2147 |
mask: '#666', |
|
2148 |
top: '10px', |
|
2149 |
fixed: false, |
|
2150 |
closeOnClick: false, |
|
2151 |
oneInstance: false, |
|
2152 |
load: false, |
|
2153 |
onClose: function () { |
|
2154 |
// With partial refresh working properly, |
|
2155 |
// it is no longer necessary to refresh the whole page |
|
2156 |
// choose_view(); |
|
2157 |
} |
|
2158 |
}); |
|
2159 |
|
|
2160 |
$("#feedback-form form").unbind("submit"); |
|
2161 |
$("#feedback-form form").submit(function(event) { |
|
2162 |
event.preventDefault(); |
|
2163 |
|
|
2164 |
// empty msg |
|
2165 |
if ($("textarea.feedback-text").val().replace(/^\s*|\s*$/,"") == "") { |
|
2166 |
alert($(".empty-error-msg", this).text()); |
|
2167 |
return; |
|
2168 |
} |
|
2169 |
|
|
2170 |
$("textarea.data-text", this).val("").val(JSON.stringify(get_user_data())); |
|
2171 |
|
|
2172 |
$.ajax({ |
|
2173 |
url: FEEDBACK_URL, |
|
2174 |
data: $(this).serialize(), |
|
2175 |
type: "POST", |
|
2176 |
// show loading |
|
2177 |
beforeSend: function() {box.find(".form-container").hide(); box.find(".sending").fadeIn() }, |
|
2178 |
// hide form |
|
2179 |
complete: function() { box.find(".form-container").hide(); box.find(".sending").hide() }, |
|
2180 |
// on success display success message |
|
2181 |
success: function() { box.find(".success").fadeIn(); box.find(".sending").hide() }, |
|
2182 |
// display error message |
|
2183 |
error: function() { box.find(".errormsg").fadeIn(); box.find(".sending").hide() } |
|
2184 |
}) |
|
2185 |
}); |
|
2186 |
|
|
2187 |
$("a#feedbackbox").data('overlay').load(); |
|
2188 |
return false; |
|
2189 |
} |
|
2190 |
|
|
2191 |
function get_user_data(extra_data) { |
|
2192 |
return $.extend({ |
|
2193 |
'cookie': $.cookie("X-Auth-Token"), |
|
2194 |
'servers': $.extend({}, servers), |
|
2195 |
'client': {'browser': $.browser, 'screen': $.extend({}, screen), 'client': $.client}, |
|
2196 |
'dates': {'now': new Date, 'lastUpdate': changes_since_date} |
|
2197 |
}, extra_data); |
|
2198 |
} |
|
2107 | 2199 |
|
2108 | 2200 |
function msg_box(config) { |
2109 | 2201 |
var config = $.extend({'title':'Info message', 'content': 'this is an info message', 'ajax': false, 'extra':false}, config); |
... | ... | |
2111 | 2203 |
// bring up success notification |
2112 | 2204 |
|
2113 | 2205 |
var box = $("#notification-box"); |
2206 |
box.addClass("notification-box"); |
|
2114 | 2207 |
box.addClass('success'); |
2115 | 2208 |
box.removeClass('error'); |
2116 | 2209 |
|
2117 | 2210 |
var sel = function(s){return $(s, box)}; |
2118 |
|
|
2119 | 2211 |
// reset texts |
2120 | 2212 |
sel("h3 span.header-box").html(""); |
2121 | 2213 |
sel(".sub-text").html(""); |
... | ... | |
2140 | 2232 |
var triggers = $("a#msgbox").overlay({ |
2141 | 2233 |
// some mask tweaks suitable for modal dialogs |
2142 | 2234 |
mask: '#666', |
2143 |
top: 'center',
|
|
2235 |
top: '10px',
|
|
2144 | 2236 |
closeOnClick: false, |
2145 | 2237 |
oneInstance: false, |
2146 | 2238 |
load: false, |
2239 |
fixed: false, |
|
2147 | 2240 |
onClose: function () { |
2148 | 2241 |
// With partial refresh working properly, |
2149 | 2242 |
// it is no longer necessary to refresh the whole page |
... | ... | |
2174 | 2267 |
sel("div.machine-now-building").html(data); |
2175 | 2268 |
} else { |
2176 | 2269 |
|
2177 |
if (data.title) |
|
2270 |
if (data.title) {
|
|
2178 | 2271 |
sel("h3 span.header-box").text(data.title); |
2272 |
} |
|
2179 | 2273 |
|
2180 | 2274 |
if (data.content) { |
2181 | 2275 |
sel("div.machine-now-building").html(data.content); |
... | ... | |
2194 | 2288 |
if (user_success) { |
2195 | 2289 |
user_success($("div.machine-now-building")); |
2196 | 2290 |
} |
2291 |
}, |
|
2292 |
error: function(xhr, status, err) { |
|
2293 |
ajax_error(-5, "UI Error", "Machine connect", err); |
|
2197 | 2294 |
} |
2198 | 2295 |
}, config.ajax_config)); |
2199 | 2296 |
} |
... | ... | |
2213 | 2310 |
$("#invform #removable-name-container-1").dynamicField(); |
2214 | 2311 |
|
2215 | 2312 |
$(".invitations-left").hide(); |
2216 |
$(".header-box").html(""); |
|
2217 |
$(".header-box").html("Invitations " + $($(".invitations-left")[0]).text()); |
|
2313 |
$("#notification-box .header-box").html("");
|
|
2314 |
$("#notification-box .header-box").html("Invitations " + $($(".invitations-left")[0]).text());
|
|
2218 | 2315 |
|
2219 | 2316 |
form.submit(function(evn){ |
2220 | 2317 |
evn.preventDefault(); |
... | ... | |
2225 | 2322 |
return false; |
2226 | 2323 |
}); |
2227 | 2324 |
} |
2325 |
|
|
2228 | 2326 |
msg_box({title:window.INVITATIONS_TITLE, content:'', ajax:INVITATIONS_URL, html:true, success: function(el){ |
2229 | 2327 |
handle_invitations(el)} |
2230 | 2328 |
}); |
b/ui/templates/home.html | ||
---|---|---|
72 | 72 |
var TIMEOUT = {{timeout}}; |
73 | 73 |
var UPDATE_INTERVAL = {{update_interval}}; |
74 | 74 |
var LOGOUT_REDIRECT = undefined; |
75 |
var INVITATIONS_URL = "{% url invitations %}" |
|
76 |
var INVITATIONS_TITLE = "{% trans "Invitations" %}" |
|
75 |
var INVITATIONS_URL = "{% url invitations %}";
|
|
76 |
var INVITATIONS_TITLE = "{% trans "Invitations" %}";
|
|
77 | 77 |
var APP_DEBUG = {% if DEBUG %}true{% else %}false{% endif %}; |
78 |
var FEEDBACK_URL = "{% url feedback %}"; |
|
79 |
var FEEDBACK_TITLE = "{% trans "Feedback" %}"; |
|
78 | 80 |
|
79 | 81 |
// server statuses and transitions |
80 | 82 |
var STATUSES = { |
... | ... | |
271 | 273 |
} |
272 | 274 |
} |
273 | 275 |
|
276 |
|
|
277 |
// prepare ajax call to get called when user clicks on |
|
278 |
// send error report button |
|
279 |
function initialize_error_report(cont, extra_data) { |
|
280 |
var cont = $(cont); |
|
281 |
var sel = function(sel) {return $(sel, cont)}; |
|
282 |
var btn = sel(".send-btn"); |
|
283 |
var extra_data = extra_data; |
|
284 |
|
|
285 |
// clear previous callbacks |
|
286 |
btn.unbind('click'); |
|
287 |
btn.click(function(){ |
|
288 |
|
|
289 |
// wrap in its own try catch to avoid retriggering ajax_error |
|
290 |
|
|
291 |
try { |
|
292 |
var data = $.extend({'error_info': $.extend({}, extra_data)}, get_user_data()); |
|
293 |
var payload = {'feedback-msg': "Automated error report", 'feedback-data': JSON.stringify(data)}; |
|
294 |
|
|
295 |
$.ajax({ |
|
296 |
url: FEEDBACK_URL, |
|
297 |
type: "POST", |
|
298 |
data: $.param(payload), |
|
299 |
beforeSend: function() { |
|
300 |
sel(".send-btn").hide(); |
|
301 |
sel(".sending").fadeIn(); |
|
302 |
}, |
|
303 |
error: function() { |
|
304 |
sel(".sending").hide(); |
|
305 |
sel(".errormsg").fadeIn(); |
|
306 |
}, |
|
307 |
success: function() { |
|
308 |
sel(".sending").hide(); |
|
309 |
sel(".success").fadeIn(); |
|
310 |
} |
|
311 |
}); |
|
312 |
|
|
313 |
} catch (err) { |
|
314 |
console.error(err); |
|
315 |
} |
|
316 |
}); |
|
317 |
} |
|
318 |
|
|
274 | 319 |
// bring up error notification |
275 | 320 |
var triggers = $("a#notification").overlay({ |
276 | 321 |
// some mask tweaks suitable for modal dialogs |
277 | 322 |
mask: '#666', |
278 | 323 |
top: 'center', |
279 | 324 |
closeOnClick: false, |
325 |
fixed: false, |
|
280 | 326 |
oneInstance: false, |
281 | 327 |
load: false, |
282 | 328 |
onClose: function () { |
283 |
// refresh the whole page |
|
284 |
location.reload(); |
|
329 |
// refresh the whole page |
|
330 |
location.reload(); |
|
331 |
}, |
|
332 |
onLoad: function() { |
|
333 |
initialize_error_report($(this.getOverlay()), [status, serverID, action, responseText]); |
|
285 | 334 |
} |
335 |
|
|
286 | 336 |
}); |
287 | 337 |
|
288 | 338 |
// we need to give the browser some time to close the old overlays before opening the new one |
... | ... | |
351 | 401 |
<div class="usermenu"> |
352 | 402 |
<div class="username">{{ request.user.uniq }}</div> |
353 | 403 |
<ul class="useractions"> |
354 |
<li class="invitations"><a class="action" href="#">{% trans "Invitations" %}</a></li> |
|
404 |
<li class="invitations"><a class="action" href="#">{% trans "invitations" %}</a></li> |
|
405 |
<li class="feedback"><a class="action" href="#">{% trans "feedback" %}</a></li> |
|
355 | 406 |
<li class="logout last"><a class="action" href="#">{% trans "logout" %}</a></li> |
356 | 407 |
</ul> |
357 | 408 |
</div> |
... | ... | |
445 | 496 |
} |
446 | 497 |
|
447 | 498 |
$(document).ready(function(){ |
499 |
|
|
500 |
$(".close-msg-box").live('click', close_all_overlays); |
|
448 | 501 |
|
449 | 502 |
{% if current_lang == "el" and not DEBUG %} |
450 | 503 |
window.location = "/lang/?l=en"; |
... | ... | |
472 | 525 |
}); |
473 | 526 |
|
474 | 527 |
$(".usermenu .invitations").click(show_invitations); |
475 |
|
|
528 |
$(".usermenu .feedback").click(show_feedback_form); |
|
529 |
|
|
476 | 530 |
}); |
477 | 531 |
</script> |
478 | 532 |
<!-- base notification for error/success reporting --> |
479 | 533 |
<a id="notification" rel="#error-success" href="#"></a> |
480 | 534 |
<a id="msgbox" rel="#notification-box" href="#"></a> |
535 |
<a id="feedbackbox" rel="#feedback-form" href="#"></a> |
|
481 | 536 |
|
482 | 537 |
<div class="modal" id="error-success"> |
483 | 538 |
<h3 class="popup-header"> |
484 |
<span class="header-box"></span> |
|
539 |
<span class="header-box">{% trans "Feedback form" %}</span>
|
|
485 | 540 |
</h3> |
486 | 541 |
<div class="popup-body"> |
487 | 542 |
<div class="popup-body-inner"> |
543 |
<div class="error-report"> |
|
544 |
<div class="send-btn">{% trans "send error report" %}</div> |
|
545 |
<div class="sending">{% trans "sending...." %}</div> |
|
546 |
<div class="errormsg">{% trans "cannot send error report" %}</div> |
|
547 |
<div class="success">{% trans "report send successfully" %}</div> |
|
548 |
</div> |
|
488 | 549 |
<div class="machine-now-building"></div> |
489 | 550 |
<div class="popup-separator"></div> |
490 | 551 |
<div class="password-container"> |
... | ... | |
499 | 560 |
</div> |
500 | 561 |
</div> |
501 | 562 |
|
502 |
<div class="modal" id="notification-box"> |
|
563 |
<div class="modal" id="feedback-form" class="feedback notification-box"> |
|
564 |
<h3 class="popup-header"> |
|
565 |
<span class="header-box">{% trans "Feedback form" %}</span> |
|
566 |
</h3> |
|
567 |
<div class="popup-body"> |
|
568 |
<div class="popup-body-inner"> |
|
569 |
<div class="form-container"> |
|
570 |
<p class="feedback-intro"> |
|
571 |
{% blocktrans %} |
|
572 |
Feedback form intro text ..... .. ... .. ..... .. .. . .. . .. .. .. ...... .. . |
|
573 |
Feedback form intro text ..... .. ... .. ..... .. .. . .. . .. .. .. ...... .. . |
|
574 |
Feedback form intro text ..... .. ... .. ..... .. .. . .. . .. .. .. ...... .. . |
|
575 |
{% endblocktrans %}</p> |
|
576 |
<form id="feedback-form"> |
|
577 |
<label for="feedback-msg">{% trans "Feedback or question" %}</label> |
|
578 |
<div class="description">{% trans "please describe here .... blah blah blah" %}</div> |
|
579 |
<div class="empty-error-msg">{% trans "Please fill out the feedback form" %}</div> |
|
580 |
<textarea name="feedback-msg" class="feedback-text"></textarea> |
|
581 |
<input type="checkbox" name="submit-submit-data"/><label class="inline" for="submit-submit-data">{% trans "submit application data" %}</label> |
|
582 |
<div class="description">{% trans "describe what application data checkbox does" %}</div> |
|
583 |
<input type="submit" value="{% trans "submit feedback" %}" class="submit" /> |
|
584 |
<textarea name="feedback-data" class="data-text"></textarea> |
|
585 |
</form> |
|
586 |
</div> |
|
587 |
|
|
588 |
<div class="message sending">{% trans "submiting your data....." %}</div> |
|
589 |
<div class="message success"> |
|
590 |
{% trans "thank you for submiting your feedback" %} |
|
591 |
<span class="close-msg-box"> {% trans "close feedback" %}</span></div> |
|
592 |
<div class="message errormsg"> |
|
593 |
{% trans "some error occured submiting submiting your feedback, please try again later" %} |
|
594 |
<span class="close-msg-box"> {% trans "close feedback" %}</span></div> |
|
595 |
</div> |
|
596 |
</div> |
|
597 |
</div> |
|
598 |
</div> |
|
599 |
|
|
600 |
<div class="modal" id="notification-box" class="notification-box"> |
|
503 | 601 |
<h3 class="popup-header"> |
504 | 602 |
<span class="header-box"></span> |
505 | 603 |
</h3> |
Also available in: Unified diff