Revision 5841646f
b/snf-astakos-app/astakos/im/forms.py | ||
---|---|---|
532 | 532 |
label="", |
533 | 533 |
widget=forms.HiddenInput() |
534 | 534 |
) |
535 |
name = forms.URLField(widget=forms.TextInput(attrs={'placeholder': 'eg. foo.ece.ntua.gr'})) |
|
535 |
name = forms.URLField(widget=forms.TextInput(attrs={'placeholder': 'eg. foo.ece.ntua.gr'}), help_text="Name should be in the form of dns",)
|
|
536 | 536 |
moderation_enabled = forms.BooleanField( |
537 | 537 |
help_text="Check if you want to approve members participation manually", |
538 | 538 |
required=False, |
b/snf-astakos-app/astakos/im/static/im/css/dropkick.css | ||
---|---|---|
10 | 10 |
|
11 | 11 |
/***** Begin Theme, feel free to edit in here! ******/ |
12 | 12 |
|
13 |
|
|
14 |
/* dropkick select extra styles */ |
|
15 |
|
|
16 |
.form-row .dk_container { border-radius:0; margin-bottom:0; border: 1px solid #ccc; height: 21px; letter-spacing: 1px; line-height: 22px; margin-bottom: -1px; width:240px; padding:5px 0; font-weight:normal; font-family: 'Didact Gothic', Verdana, sans-serif; font-size:1em; background:transparent; color:#808080;} |
|
17 |
.form-row .dk_toggle { border-radius:0; padding:0; border:0 none; text-indent:1.5em; text-decoration:none;background-image:url(../images/arrow-down_black.png); background-position:90% 5px;} |
|
18 |
.form-row .dk_toggle:hover { text-decoration:none; } |
|
19 |
.form-row .dk_open { background:transparent; box-shadow: none; } |
|
20 |
.form-row .dk_open .dk_toggle { background-color:transparent; border:0 none; color:#000; box-shadow: none;} |
|
21 |
.form-row .dk_focus .dk_toggle { background-color:transparent; border:0 none; color:#000; box-shadow: none;} |
|
22 |
.1form-row .dk_options { display:block; } |
|
23 |
.form-row .dk_options { box-shadow:none; border-radius:0; z-index:3; margin:6px -1px 0; width:auto; left:0;} |
|
24 |
.form-row .dk_options a { font-weight:normal;color:#808080; padding:5px 0; text-indent:1.5em; border-bottom-color: #ccc } |
|
25 |
.form-row .dk_options a:hover { border-bottom-color: #ccc } |
|
26 |
.form-row .dk_options_inner { padding:0; margin:0; box-shadow:none; text-shadow:none; border-radius:0; border:1px solid #ccc ; margin-top:4px;} |
|
27 |
.form-row .dk-options_inner li { list-style:none outside; } |
|
28 |
.form-row .dk_options a:hover, |
|
29 |
.form-row .dk_option_current a { text-shadow:none; background-color: #fff; text-decoration:none; color:#F89A1C} |
|
30 |
|
|
31 |
/* end custom theme */ |
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
|
13 | 37 |
/* One container to bind them... */ |
14 | 38 |
.dk_container { |
15 |
font-family: 'Antic', sans-serif; |
|
16 |
|
|
17 |
font-weight: normal; |
|
18 |
line-height: 42px; |
|
19 |
letter-spacing: 1px; |
|
20 |
border: 1px solid #808080; |
|
21 |
height:42px; |
|
22 |
display: inline-block; |
|
23 |
margin-bottom: -1px; |
|
24 |
padding-left:21px; |
|
25 |
|
|
26 |
z-index: 2; |
|
27 |
width:308px; |
|
39 |
background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#f5f5f5)); |
|
40 |
background: -moz-linear-gradient(top, #fff, #f5f5f5); |
|
41 |
background: -o-linear-gradient(top, #fff, #f5f5f5); |
|
42 |
background-color: #f5f5f5; |
|
43 |
font-family: 'Helvetica', Arial, sans-serif; |
|
44 |
font-size: 12px; |
|
45 |
font-weight: bold; |
|
46 |
line-height: 14px; |
|
47 |
margin-bottom: 18px; |
|
48 |
border-radius: 5px; |
|
49 |
-moz-border-radius: 5px; |
|
50 |
-webkit-border-radius: 5px; |
|
28 | 51 |
} |
29 | 52 |
.dk_container:focus { |
30 | 53 |
outline: 0; |
... | ... | |
32 | 55 |
.dk_container a { |
33 | 56 |
cursor: pointer; |
34 | 57 |
text-decoration: none; |
35 |
color:#808080; |
|
36 |
|
|
37 | 58 |
} |
38 | 59 |
|
39 | 60 |
/* Opens the dropdown and holds the menu label */ |
... | ... | |
42 | 63 |
* Help: Arrow image not appearing |
43 | 64 |
* Try updating this property to your correct dk_arrows.png path |
44 | 65 |
*/ |
45 |
background:url(../images/arrow_02.jpg) no-repeat 276px center; |
|
46 |
|
|
66 |
background-image: url('images/dk_arrows.png'); |
|
67 |
background-repeat: no-repeat; |
|
68 |
background-position: 90% center; |
|
69 |
border: 1px solid #ccc; |
|
70 |
color: #333; |
|
71 |
padding: 7px 45px 7px 10px; |
|
72 |
text-shadow: #fff 1px 1px 0; |
|
73 |
border-radius: 5px; |
|
74 |
-moz-border-radius: 5px; |
|
75 |
-webkit-border-radius: 5px; |
|
76 |
-webkit-transition: border-color .5s; |
|
77 |
-moz-transition: border-color .5s; |
|
78 |
-o-transition: border-color .5s; |
|
79 |
transition: border-color .5s; |
|
47 | 80 |
} |
48 | 81 |
.dk_toggle:hover { |
49 |
|
|
82 |
border-color: #8c8c8c; |
|
50 | 83 |
} |
51 | 84 |
/* Applied when the dropdown is focused */ |
52 | 85 |
.dk_focus .dk_toggle { |
53 |
|
|
86 |
border-color: #40b5e2; |
|
54 | 87 |
} |
55 | 88 |
.dk_focus .dk_toggle { |
56 |
|
|
89 |
box-shadow: 0 0 5px #40b5e2; |
|
90 |
-moz-box-shadow: 0 0 5px #40b5e2; |
|
91 |
-webkit-box-shadow: 0 0 5px #40b5e2; |
|
57 | 92 |
} |
58 | 93 |
|
59 | 94 |
/* Applied whenever the dropdown is open */ |
60 | 95 |
.dk_open { |
61 |
|
|
96 |
box-shadow: 0 0 5px #40b5e2; |
|
97 |
-moz-box-shadow: 0 0 5px #40b5e2; |
|
98 |
-webkit-box-shadow: 0 0 5px #40b5e2; |
|
62 | 99 |
/** |
63 | 100 |
* Help: Dropdown menu is covered by something |
64 | 101 |
* Try setting this value higher |
... | ... | |
66 | 103 |
z-index: 10; |
67 | 104 |
} |
68 | 105 |
.dk_open .dk_toggle { |
69 |
|
|
70 |
|
|
106 |
background-color: #ececec; |
|
107 |
border-color: #8c8c8c; |
|
108 |
color: #ccc; |
|
109 |
box-shadow: inset 0 -2px 5px #ccc; |
|
110 |
border-radius: 5px 5px 0 0; |
|
111 |
-moz-border-radius: 5px 5px 0 0; |
|
112 |
-webkit-border-radius: 5px 5px 0 0; |
|
71 | 113 |
} |
72 | 114 |
|
73 | 115 |
/* The outer container of the options */ |
74 | 116 |
.dk_options { |
75 |
|
|
117 |
box-shadow: rgba(0, 0, 0, .2) 0 2px 8px; |
|
118 |
-moz-box-shadow: rgba(0, 0, 0, .2) 0 2px 8px; |
|
119 |
-webkit-box-shadow: rgba(0, 0, 0, .2) 0 2px 8px; |
|
120 |
border-radius: 0 0 5px 5px; |
|
121 |
-moz-border-radius: 0 0 5px 5px; |
|
122 |
-webkit-border-radius: 0 0 5px 5px; |
|
76 | 123 |
} |
77 | 124 |
.dk_options a { |
78 | 125 |
background-color: #fff; |
79 | 126 |
border-bottom: 1px solid #999; |
80 |
padding: 8px 20px; |
|
127 |
font-weight: bold; |
|
128 |
padding: 8px 10px; |
|
81 | 129 |
} |
82 | 130 |
.dk_options li:last-child a { |
83 | 131 |
border-bottom: none; |
84 | 132 |
} |
85 | 133 |
.dk_options a:hover, |
86 | 134 |
.dk_option_current a { |
87 |
|
|
135 |
background-color: #0084c7; |
|
136 |
border-bottom-color: #004c72; |
|
137 |
color: #fff; |
|
138 |
text-decoration: none; |
|
139 |
text-shadow: rgba(0, 0, 0, .5) 0 1px 0; |
|
88 | 140 |
} |
89 | 141 |
|
90 | 142 |
/* Inner container for options, this is what makes the scrollbar possible. */ |
91 |
.dk_options_inner { |
|
92 |
padding:0; |
|
93 |
margin:0; |
|
94 |
border: 1px solid #808080; |
|
95 |
border-top:0 none; |
|
143 |
.dk_options_inner { |
|
144 |
border: 1px solid #8c8c8e; |
|
145 |
border-bottom-width: 2px; |
|
146 |
border-bottom-color: #999; |
|
147 |
color: #333; |
|
148 |
max-height: 250px; |
|
149 |
text-shadow: #fff 0 1px 0; |
|
150 |
border-radius: 0 0 5px 5px; |
|
151 |
-moz-border-radius: 0 0 5px 5px; |
|
152 |
-webkit-border-radius: 0 0 5px 5px; |
|
96 | 153 |
} |
97 |
.dk_options_inner li { list-style:none outside;} |
|
98 | 154 |
|
99 | 155 |
/* Set a max-height on the options inner */ |
100 | 156 |
.dk_options_inner, |
... | ... | |
108 | 164 |
|
109 | 165 |
.dk_container { |
110 | 166 |
display: none; |
167 |
float: left; |
|
111 | 168 |
position: relative; |
112 | 169 |
} |
113 | 170 |
.dk_container a { |
b/snf-astakos-app/astakos/im/static/im/css/forms.css | ||
---|---|---|
5 | 5 |
#forms input:focus { position: relative; border: 1px solid #000; z-index: 100; } |
6 | 6 |
#forms .input:focus label, |
7 | 7 |
#forms input:focus label { z-index: 300; } |
8 |
form.withlabels label { width: 224px; display: block; float: left; padding-top: 1em; }
|
|
8 |
form.withlabels label { width: 224px; display: block; float: left; padding-top: 0.8em; }
|
|
9 | 9 |
form.withlabels input[type=text], |
10 | 10 |
form.withlabels input[type=password] { width: 270px; } |
11 | 11 |
form.withlabels input[type=text].long, |
... | ... | |
69 | 69 |
div.form-stacked { margin-bottom: 4em; } |
70 | 70 |
.checkbox-widget.checked { background-color: #FF0000; background-image: url("../images/checkbox.png"); background-position: 50% 50%; } |
71 | 71 |
.content a.checkbox-widget { border: 1px solid #808080; cursor: pointer; display: block; float: left; height: 25px; margin:5px 20px 0 0 ; width: 25px; } |
72 |
form.withlabels .checkbox-widget { margin-top:20px; }
|
|
72 |
form.withlabels .checkbox-widget { margin-top:12px; }
|
|
73 | 73 |
form.innerlabels .checkbox-widget + label { position:static; line-height:36px; color:#808080; } |
74 | 74 |
form.innerlabels .checkbox-widget + label + a { border-bottom:1px solid #F89A1C; font-size: 1.1em; } |
75 | 75 |
form span.info { position:absolute;z-index:101; top:10px; } |
... | ... | |
77 | 77 |
form.withlabels span.info { left:485px; } |
78 | 78 |
form span.info em { display:block; overflow:hidden; position:absolute; left:0; text-indent:-100px; top:0; height:21px; width:21px; background:url(../images/symbols.png) no-repeat -4px -31px;cursor:pointer; } |
79 | 79 |
form span.info:hover em { background-position:-4px -3px; } |
80 |
form span.info span { position:absolute; left:29px; top:-2px; width:120px; padding-left:30px; background:url(../images/black-line.jpg ) no-repeat left 12px; min-height:50px; display:none; font-size:0.846em;}
|
|
80 |
form span.info span { position:absolute; left:29px; top:-2px; width:120px; padding-left:30px; background:url(../images/black-line.jpg ) no-repeat left 8px; min-height:50px; display:none; font-size:0.846em;}
|
|
81 | 81 |
form span.info:hover span { display:block; } |
82 | 82 |
form .with-errors span.info { display:none;} |
83 | 83 |
form p { margin-bottom:0;position:relative;} |
... | ... | |
133 | 133 |
form.withfieldset select { width: 256px; background:#fff;} |
134 | 134 |
form+p:first-child, form legend + p { margin-bottom:2em; } |
135 | 135 |
|
136 |
/* dropkick select extra styles */ |
|
137 |
|
|
138 |
.form-row .dk_container { border-radius:0; margin-bottom:0; border: 1px solid #808080; height: 21px; letter-spacing: 1px; line-height: 22px; margin-bottom: -1px; width:300px; padding:0.8em 0; font-weight:normal; font-family: 'Didact Gothic', Verdana, sans-serif; font-size:1em; background:transparent; color:#808080;} |
|
139 |
.form-row .dk_toggle { border-radius:0; padding:2px 0 10px; border:0 none; text-indent:1.5em; text-decoration:none;background-image:url(../images/arrow-down_black.png); background-position:90% 5px;} |
|
140 |
.form-row .dk_toggle:hover { text-decoration:none; } |
|
141 |
.form-row .dk_open { background:transparent; box-shadow: none; } |
|
142 |
.form-row .dk_open .dk_toggle { background-color:transparent; border:0 none; color:#000; box-shadow: none;} |
|
143 |
.form-row .dk_focus .dk_toggle { background-color:transparent; border:0 none; color:#000; box-shadow: none;} |
|
144 |
.1form-row .dk_options { display:block; } |
|
145 |
.form-row .dk_options { box-shadow:none; border-radius:0; z-index:3; margin:6px -1px 0; width:auto; left:0;} |
|
146 |
.form-row .dk_options a { font-weight:normal;color:#808080 } |
|
147 |
.form-row .dk_options_inner { padding:0; margin:0; box-shadow:none; text-shadow:none; border-radius:0; border:1px solid #8C8C8E ;} |
|
148 |
.form-row .dk-options_inner li { list-style:none outside; } |
|
149 |
.form-row .dk_options a:hover, |
|
150 |
.form-row .dk_option_current a { text-shadow:none; background-color: #E7E7E3; text-decoration:none;} |
|
151 | 136 |
|
152 | 137 |
form.link-like { display:inline-block; margin:0 5px; float:right;} |
153 | 138 |
form.link-like input[type="submit"] { margin:0; padding:0 5px; background:transparent; color:#F89A1C; cursor:pointer; height:auto; line-height:120%; } |
... | ... | |
159 | 144 |
.projects form .with-checkbox { margin:20px 0; } |
160 | 145 |
.projects form .with-checkbox label { padding-top:7px; } |
161 | 146 |
.projects form .with-checkbox span.info { bottom:24px; } |
162 |
.projects .minimal { float:right; position:relative; margin-bottom:-20px;}
|
|
147 |
.projects .minimal { float:right; position:relative; margin-bottom:-28px;}
|
|
163 | 148 |
.projects .minimal select { padding:3px; width:250px; } |
164 | 149 |
.projects .minimal label { position:absolute; right:290px; top:5px; white-space:nowrap} |
165 | 150 |
|
b/snf-astakos-app/astakos/im/static/im/css/global.css | ||
---|---|---|
3 | 3 |
@import url(colorbox.css); |
4 | 4 |
@import url(browser-fixes.css); |
5 | 5 |
@import url(forms.css); |
6 |
@import url(dropkick.css); |
b/snf-astakos-app/astakos/im/static/im/css/modules.css | ||
---|---|---|
224 | 224 |
|
225 | 225 |
/* Style for im/projects */ |
226 | 226 |
table.alt-style { color:#000; width:100%; } |
227 |
table.alt-style caption { font-weight:normal; font-size:1.154em; } |
|
227 |
table.alt-style caption { font-weight:normal; font-size:1.154em; margin-bottom:15px;}
|
|
228 | 228 |
table.alt-style tr th { font-weight:normal; color:#3582AC } |
229 | 229 |
table.alt-style tr td { color:#222; } |
230 | 230 |
table.alt-style tr td:first-child, |
... | ... | |
374 | 374 |
/* quotas-form */ |
375 | 375 |
|
376 | 376 |
.quotas-form fieldset { background:url(../images/dots.jpg) repeat-x scroll center bottom transparent; margin-bottom:3em; padding-bottom:3em; position:relative; } |
377 |
.quotas-form legend { color:#55B577; font-size:1.154em; margin-bottom:3em; position:relative; }
|
|
377 |
.quotas-form legend { color:#55B577; font-size:1.308em; margin-bottom:3em; position:relative; }
|
|
378 | 378 |
.quotas-form legend span { color:#222; font-size:0.867em; } |
379 | 379 |
form.quotas-form legend span.info { position:relative; display:inline-block; top:auto; left:auto; margin-left:10px;} |
380 | 380 |
form.quotas-form legend span.info em { position:static; } |
381 | 381 |
form.quotas-form legend span.info span { width:395px; } |
382 |
.quotas-form .with-checkbox .checkbox-widget { margin-top:12px; }
|
|
383 |
.quotas-form .with-checkbox span.info { top:15px; }
|
|
382 |
.quotas-form .with-checkbox .checkbox-widget { margin-top:9px; }
|
|
383 |
.quotas-form .with-checkbox span.info { top:12px; }
|
|
384 | 384 |
.quotas-form .form-row.submit { text-align:center; } |
385 | 385 |
.quotas-form input[type="submit"] { margin:15px 0; background-color:#B3B3B3 } |
386 | 386 |
.quotas-form input[type="submit"]:hover { background:#55B577 } |
... | ... | |
458 | 458 |
table .msg-wrap .dialog .no.submit { float:right; } |
459 | 459 |
table.alt-style .centered { text-align:center; } |
460 | 460 |
table.alt-style form.link-like { float:none } |
461 |
form.quotas-form span.error-msg span { display:block; color:red; } |
|
462 |
form.quotas-form span.error-msg em, |
|
463 |
form.quotas-form span.error-msg:hover em { background-position:-58px -3px; } |
b/snf-astakos-app/astakos/im/static/im/js/common.js | ||
---|---|---|
112 | 112 |
}); |
113 | 113 |
|
114 | 114 |
|
115 |
//$('select').dropkick(); |
|
115 |
$('select.dropkicked').dropkick({ |
|
116 |
change: function (value, label) { |
|
117 |
$(this).parents('form').submit(); |
|
118 |
} |
|
119 |
}); |
|
116 | 120 |
|
117 | 121 |
$('.top-msg .success').parents('.top-msg').addClass('success'); |
118 | 122 |
$('.top-msg .error').parents('.top-msg').addClass('error'); |
... | ... | |
239 | 243 |
if ($('.quotas-form .group .form-row.with-errors').length>0 ){ |
240 | 244 |
return false; |
241 | 245 |
} |
242 |
$('.quotas-form .group .form-row.with-errors')[0].focus(); |
|
243 |
|
|
246 |
var flag = 0; |
|
247 |
$('.quotas-form .group input[type="text"]').each(function() { |
|
248 |
// get value from input |
|
249 |
var value = $(this).val(); |
|
250 |
if (value){ |
|
251 |
flag =1; |
|
252 |
} |
|
253 |
}); |
|
254 |
if (flag =='0') { |
|
255 |
$('#icons span.info').addClass('error-msg'); |
|
256 |
return false; |
|
257 |
|
|
258 |
} |
|
244 | 259 |
}); |
245 | 260 |
|
246 | 261 |
|
... | ... | |
248 | 263 |
$("input.leave, input.join").click(function () { |
249 | 264 |
$(this).parents('.msg-wrap').find('.dialog').show(); |
250 | 265 |
return false; |
266 |
|
|
251 | 267 |
}); |
252 | 268 |
|
253 | 269 |
$('.msg-wrap .no').click( function(e){ |
b/snf-astakos-app/astakos/im/static/im/js/quotas.js | ||
---|---|---|
9 | 9 |
$(this).find('input')[0].focus() |
10 | 10 |
} |
11 | 11 |
}); |
12 |
|
|
12 |
if ($('.quotas-form .with-info .with-errors input[type="text"]')){ |
|
13 |
$(this)[0].focus(); |
|
14 |
} |
|
15 |
|
|
13 | 16 |
} |
14 | 17 |
|
15 | 18 |
|
... | ... | |
116 | 119 |
value = value.replace(",","."); |
117 | 120 |
var num = parseFloat(value); |
118 | 121 |
|
119 |
if ( value && !num ) { flag = 1} |
|
122 |
if ( value && !num ) { flag = 1 ; msg="Invalid format"}
|
|
120 | 123 |
|
121 | 124 |
var bytes = num; |
122 | 125 |
|
... | ... | |
148 | 151 |
bytes = num; |
149 | 152 |
} |
150 | 153 |
} else { |
151 |
if (value) { |
|
152 |
flag = 1; |
|
153 |
} |
|
154 |
if (num) { |
|
155 |
flag = 1; |
|
156 |
msg ="You must specify correct units" |
|
157 |
} |
|
154 | 158 |
|
155 | 159 |
} |
156 | 160 |
|
157 | 161 |
if ( flag == '1' ){ |
158 | 162 |
$(this).parents('.form-row').addClass('with-errors'); |
163 |
$(this).parents('.form-row').find('.error-msg').html(msg); |
|
159 | 164 |
bytes = value; |
160 | 165 |
$(this).focus(); |
161 | 166 |
|
... | ... | |
173 | 178 |
|
174 | 179 |
var is_int = value.match (new RegExp('^[0-9]*$')); |
175 | 180 |
if ( !is_int ){ |
176 |
$(this).parents('.form-row').find('.error-msg').html('Enter a whole number');
|
|
181 |
$(this).parents('.form-row').find('.error-msg').html('Enter a positive intiger');
|
|
177 | 182 |
$(this).parents('.form-row').addClass('with-errors'); |
178 | 183 |
|
179 | 184 |
} else { |
b/snf-astakos-app/astakos/im/templates/im/astakosgroup_detail.html | ||
---|---|---|
17 | 17 |
{% endif %} |
18 | 18 |
</em> |
19 | 19 |
{% endif %} |
20 |
<span>{{object.kindname|upper}}</span>
|
|
20 |
<span>{{ object.name|strip_http|upper }}</span>
|
|
21 | 21 |
</h2> |
22 | 22 |
|
23 | 23 |
<div class="details"> |
... | ... | |
84 | 84 |
<h3>RESOURCES:</h3> |
85 | 85 |
{% if quota %} |
86 | 86 |
<dl class="alt-style"> |
87 |
|
|
88 | 87 |
{% for k in quota|dkeys %} |
89 | 88 |
{% with resource_catalog|lookup:'resources' as resources %} |
90 | 89 |
{% with resources|lookup_uni:k as info %} |
91 | 90 |
{% with resource_presentation|lookup_uni:k as resource_info %} |
92 |
|
|
93 | 91 |
<dt> |
94 |
Max {% if resource_info.is_abbreviation %}{{ info.resource|upper }}{% else %}{{ r.resource }}{% endif %}{% if not info.unit %}s {% endif %} per user
|
|
92 |
Max {% if resource_info.is_abbreviation %}{{ info.name|upper }}{% else %}{{ info.name }}{% endif %}{% if not info.unit %}s {% endif %} per user
|
|
95 | 93 |
</dt> |
96 | 94 |
<dd> |
97 | 95 |
{% with quota|lookup:k as uplimit%} |
98 |
{% if uplimit == "inf" %} |
|
99 |
unlimited |
|
100 |
{% else %} |
|
101 |
{{ uplimit }} |
|
102 |
{% endif %} |
|
96 |
{% if uplimit %} |
|
97 |
{% if info.unit %} |
|
98 |
{{ uplimit|sizeof_fmt }} |
|
99 |
{% else %} |
|
100 |
{{ uplimit|isinf }} |
|
101 |
{% endif %} |
|
102 |
|
|
103 |
{% endif %} |
|
103 | 104 |
|
104 | 105 |
{% endwith%} |
105 | 106 |
</dd> |
... | ... | |
119 | 120 |
{% if membership %} |
120 | 121 |
<form method="GET" class="minimal" action=""> |
121 | 122 |
<div class="form-row"> |
122 |
<select name="sorting" onchange="this.form.submit();"> |
|
123 |
<select name="sorting" onchange="this.form.submit();" class="dropkicked">
|
|
123 | 124 |
<option value="">Sort by</option> |
124 | 125 |
<option value="person__email" {% if sorting == 'person__email' %}selected{% endif %}>User Id</option> |
125 | 126 |
<option value="person__first_name" {% if sorting == 'person__first_name' %}selected{% endif %}>Name</option> |
b/snf-astakos-app/astakos/im/templates/im/astakosgroup_form.html | ||
---|---|---|
8 | 8 |
{% block page.body %} |
9 | 9 |
|
10 | 10 |
|
11 |
<form action="" method="post" class="withlabels quotas-form" id="group_create_form">{% csrf_token %} |
|
11 |
<form action="#top" method="post" class="withlabels quotas-form" id="group_create_form">{% csrf_token %}
|
|
12 | 12 |
|
13 |
<fieldset class="with-info"> |
|
13 |
<fieldset class="with-info" id="top">
|
|
14 | 14 |
<legend> |
15 | 15 |
1. CREATE GROUP |
16 | 16 |
<span class="info"> |
17 | 17 |
<em>more info</em> |
18 |
<span>Help Text Help Text Help Text Help Text Help Text Help Text Help Text Help Text Help Text Help Text Help Text Help Text Help Text Help Text</span>
|
|
18 |
<span>Fill in the required fields to create a group. Group details will be visible to the users of the group.</span>
|
|
19 | 19 |
</span> |
20 | 20 |
</legend> |
21 | 21 |
|
... | ... | |
28 | 28 |
2. ADD RESOURCES |
29 | 29 |
<span class="info"> |
30 | 30 |
<em>more info</em> |
31 |
<span>Help Text Help Text Help Text Help Text Help Text Help Text Help Text Help Text Help Text Help Text Help Text Help Text Help Text Help Text</span>
|
|
31 |
<span>You need to specify at least one resource</span>
|
|
32 | 32 |
</span> |
33 | 33 |
</legend> |
34 | 34 |
|
b/snf-astakos-app/astakos/im/templates/im/astakosgroup_list.html | ||
---|---|---|
27 | 27 |
<a href="{% url group_search %}">Join an existing one</a> |
28 | 28 |
or |
29 | 29 |
<!--<a href="{% url group_create_list %}">Create a new group</a>--> |
30 |
<a href="{% url group_add 'course' %}">create a new group</a>.
|
|
30 |
<a href="{% url group_add 'default' %}">create a new group</a>.
|
|
31 | 31 |
</p> |
32 | 32 |
|
33 | 33 |
<div class="widjets"> |
... | ... | |
39 | 39 |
<h2>WELCOME!</h2> |
40 | 40 |
<p><a href="{% url group_add 'course' %}"><img alt="THINK ABOUT IT" src="/static/im/images/create.png"></a></p> |
41 | 41 |
<p class="txt">Connect with a world of people who share your passions.<br>With millions of groups at your fingertips, it's easy to find the group that's best for you -- no matter your interest.</p> |
42 |
<p><a href="{% url group_add 'course' %}">create a group ></a></p>
|
|
42 |
<p><a href="{% url group_add 'default' %}">create a group ></a></p>
|
|
43 | 43 |
<!--<p class="btn"><a href="{% url group_create_list %}" class="submit">CREATE</a></p>--> |
44 | 44 |
</div> |
45 | 45 |
</div> |
... | ... | |
65 | 65 |
<div class="full-dotted"> |
66 | 66 |
<form method="GET" class="minimal" action="#searchResults"> |
67 | 67 |
<div class="form-row"> |
68 |
<select name="sorting" onchange="this.form.submit();"> |
|
68 |
<select name="sorting" onchange="this.form.submit();" class="dropkicked">
|
|
69 | 69 |
<option value="">Sort by</option> |
70 | 70 |
<option value="groupname" {% if sorting == 'groupname' %}selected{% endif %}>Name</option> |
71 | 71 |
<!--option value="kindname" {% if sorting == 'kindname' %}selected{% endif %}>Type</option--> |
... | ... | |
191 | 191 |
{% with q|paginate:args as page_obj %} |
192 | 192 |
|
193 | 193 |
<div > |
194 |
<form method="GET" class="minimal" action="#allGroups"> |
|
194 |
<form method="GET" class="minimal" action="#allGroups" id="mygroups">
|
|
195 | 195 |
<div class="form-row"> |
196 |
<select name="sorting" onchange="this.form.submit();">
|
|
196 |
<select name="sorting" class="dropkicked">
|
|
197 | 197 |
<option value="">Sort by</option> |
198 | 198 |
<option value="groupname" {% if sorting == 'groupname' %}selected{% endif %}>Name</option> |
199 | 199 |
<!--<option value="kindname" {% if sorting == 'kindname' %}selected{% endif %}>Type</option>--> |
b/snf-astakos-app/astakos/im/templatetags/filters.py | ||
---|---|---|
33 | 33 |
|
34 | 34 |
import calendar |
35 | 35 |
import datetime |
36 |
import math |
|
36 | 37 |
|
37 | 38 |
from collections import defaultdict |
38 | 39 |
|
... | ... | |
40 | 41 |
from django.core.paginator import Paginator, EmptyPage |
41 | 42 |
from django.db.models.query import QuerySet |
42 | 43 |
|
44 |
|
|
43 | 45 |
from astakos.im.settings import PAGINATE_BY |
44 | 46 |
|
47 |
|
|
45 | 48 |
register = template.Library() |
46 | 49 |
|
47 | 50 |
DELIM = ',' |
... | ... | |
76 | 79 |
|
77 | 80 |
@register.filter |
78 | 81 |
def lookup(d, key): |
82 |
print d, key |
|
79 | 83 |
return d.get(key) |
80 | 84 |
|
81 | 85 |
@register.filter |
... | ... | |
165 | 169 |
|
166 | 170 |
@register.filter |
167 | 171 |
def sizeof_fmt(num): |
172 |
|
|
168 | 173 |
"""Human friendly file size""" |
174 |
if math.isinf(num): |
|
175 |
return 'Unlimited' |
|
169 | 176 |
if num > 1: |
170 | 177 |
exponent = min(int(log(num, 1024)), len(unit_list) - 1) |
171 | 178 |
quotient = float(num) / 1024**exponent |
172 | 179 |
unit, num_decimals = unit_list[exponent] |
173 |
format_string = '{:.%sf} {0}' % (num_decimals)
|
|
180 |
format_string = '{0:.%sf} {1}' % (num_decimals)
|
|
174 | 181 |
return format_string.format(quotient, unit) |
175 | 182 |
if num == 0: |
176 | 183 |
return '0 bytes' |
177 | 184 |
if num == 1: |
178 | 185 |
return '1 byte' |
179 | 186 |
else: |
180 |
return ''; |
|
187 |
return '0'; |
|
188 |
|
|
189 |
@register.filter |
|
190 |
def isinf(v): |
|
191 |
if math.isinf(v): |
|
192 |
return 'Unlimited' |
|
193 |
else: |
|
194 |
return v |
b/snf-astakos-app/astakos/im/views.py | ||
---|---|---|
729 | 729 |
@login_required |
730 | 730 |
def group_add(request, kind_name='default'): |
731 | 731 |
result = callpoint.list_resources() |
732 |
print '###', result |
|
732 | 733 |
resource_catalog = {'resources':defaultdict(defaultdict), |
733 | 734 |
'groups':defaultdict(list)} |
734 | 735 |
if result.is_success: |
... | ... | |
764 | 765 |
form_class=AstakosGroupCreationForm |
765 | 766 |
) |
766 | 767 |
|
768 |
resources = resource_catalog['resources'] |
|
769 |
|
|
770 |
|
|
767 | 771 |
if request.method == 'POST': |
768 | 772 |
form = form_class(request.POST, request.FILES) |
769 | 773 |
if form.is_valid(): |
... | ... | |
772 | 776 |
context_instance=get_context(request), |
773 | 777 |
form = AstakosGroupCreationSummaryForm(form.cleaned_data), |
774 | 778 |
policies = form.policies(), |
775 |
resource_catalog=resource_catalog, |
|
776 |
resource_presentation=resource_presentation |
|
779 |
resource_presentation=resource_presentation, |
|
780 |
resource_catalog= resource_catalog, |
|
781 |
resources = resources, |
|
782 |
|
|
777 | 783 |
) |
778 | 784 |
else: |
779 | 785 |
now = datetime.now() |
... | ... | |
850 | 856 |
@login_required |
851 | 857 |
def group_list(request): |
852 | 858 |
none = request.user.astakos_groups.none() |
859 |
sorting = request.GET.get('sorting') |
|
853 | 860 |
q = AstakosGroup.objects.raw(""" |
854 | 861 |
SELECT auth_group.id, |
855 | 862 |
%s AS groupname, |
... | ... | |
875 | 882 |
im_astakosuser_owner.astakosuser_id = owner.id) |
876 | 883 |
WHERE im_membership.person_id = %s |
877 | 884 |
""" % (DB_REPLACE_GROUP_SCHEME, request.user.id, request.user.id)) |
878 |
|
|
885 |
|
|
886 |
|
|
879 | 887 |
# Create the template, context, response |
880 | 888 |
template_name = "%s/%s_list.html" % ( |
881 | 889 |
q.model._meta.app_label, |
... | ... | |
968 | 976 |
group = r.get('group', '') |
969 | 977 |
unit = r.get('unit', '') |
970 | 978 |
fullname = '%s%s%s' % (service, RESOURCE_SEPARATOR, name) |
971 |
resource_catalog['resources'][fullname] = dict(unit=unit) |
|
979 |
resource_catalog['resources'][fullname] = dict(unit=unit, name=name)
|
|
972 | 980 |
resource_catalog['groups'][group].append(fullname) |
973 | 981 |
|
974 | 982 |
resource_catalog = dict(resource_catalog) |
Also available in: Unified diff