Commit efca0781c67fb9065b9f572727833fd6d0ce75e0
1 parent
cc913e63
Exists in
master
and in
1 other branch
fixed bugs on upload file and theme survey
Showing
4 changed files
with
50 additions
and
66 deletions
Show diff stats
src/web/static/css/style.css
@@ -442,7 +442,7 @@ cursor: pointer; | @@ -442,7 +442,7 @@ cursor: pointer; | ||
442 | 442 | ||
443 | #advanced-button:hover { color: black; } | 443 | #advanced-button:hover { color: black; } |
444 | 444 | ||
445 | - | 445 | +#upload-slide, |
446 | #advanced-slide { display: none; } | 446 | #advanced-slide { display: none; } |
447 | 447 | ||
448 | #advanced-slide legend { | 448 | #advanced-slide legend { |
@@ -0,0 +1,23 @@ | @@ -0,0 +1,23 @@ | ||
1 | +#upload-slide { | ||
2 | +display: block; | ||
3 | +position: absolute; | ||
4 | +top: 10px; | ||
5 | +left: 10px; | ||
6 | +} | ||
7 | + | ||
8 | +#header, | ||
9 | +#recommender-box { | ||
10 | +height: 80px; | ||
11 | +} | ||
12 | + | ||
13 | +.innertube { | ||
14 | +margin: 50px; | ||
15 | +} | ||
16 | + | ||
17 | +/* Display None itens Survey */ | ||
18 | +#recommender-box #upfile, | ||
19 | +#advanced-button, | ||
20 | +#copyright span, | ||
21 | +#pkgs_list { | ||
22 | +display: none; | ||
23 | +} |
src/web/templates/layout.html
@@ -31,10 +31,11 @@ window.onload = function() { | @@ -31,10 +31,11 @@ window.onload = function() { | ||
31 | 31 | ||
32 | function validateForm() | 32 | function validateForm() |
33 | { | 33 | { |
34 | +var u=document.forms["weboptions"]["pkgs_file"].value | ||
34 | var x=document.forms["weboptions"]["pkgs_list"].value | 35 | var x=document.forms["weboptions"]["pkgs_list"].value |
35 | -if (x==null || x=="Write your list App here or send a file list this icon:") | 36 | +if ((u==null) && (x==null) || (x=="Write your list App here or send a file list this icon:") && (u=="") ) |
36 | { | 37 | { |
37 | - alert("Write your list App!"); | 38 | + alert("Choice your list App or create a list!"); |
38 | return false; | 39 | return false; |
39 | } | 40 | } |
40 | } | 41 | } |
@@ -44,6 +45,9 @@ if (x==null || x=="Write your list App here or send a file list this icon:") | @@ -44,6 +45,9 @@ if (x==null || x=="Write your list App here or send a file list this icon:") | ||
44 | $$("#advanced-button").click(function () { | 45 | $$("#advanced-button").click(function () { |
45 | $$("#advanced-slide").toggle("slow"); | 46 | $$("#advanced-slide").toggle("slow"); |
46 | }); | 47 | }); |
48 | + $$("#upfile").click(function () { | ||
49 | + $$("#upload-slide").toggle("slow"); | ||
50 | + }); | ||
47 | }); | 51 | }); |
48 | </script> | 52 | </script> |
49 | 53 | ||
@@ -59,10 +63,10 @@ if (x==null || x=="Write your list App here or send a file list this icon:") | @@ -59,10 +63,10 @@ if (x==null || x=="Write your list App here or send a file list this icon:") | ||
59 | <fieldset> | 63 | <fieldset> |
60 | <div id="submit-box"> | 64 | <div id="submit-box"> |
61 | <input type="submit" value="RECOMMENDER" id="submit-button"><br /> | 65 | <input type="submit" value="RECOMMENDER" id="submit-button"><br /> |
62 | - <!--<a id="advanced-button">advanced query?</a>--> | 66 | + <a id="advanced-button">advanced query?</a> |
63 | </div> | 67 | </div> |
64 | <div id="input-box"> | 68 | <div id="input-box"> |
65 | - <a href="#attachfile" rel="facebox" id="upfile"><span style="display: none;">Upload a file.</span></a> | 69 | + <a id="upfile"><span style="display: none;">Upload a file.</span></a> |
66 | <label title="App list"><textarea class="focused" onfocus="this.form.className='focused'; | 70 | <label title="App list"><textarea class="focused" onfocus="this.form.className='focused'; |
67 | if(this.value=='Write your list App here or send a file list this icon:'){this.value=''}" onblur="this.form.className=''; | 71 | if(this.value=='Write your list App here or send a file list this icon:'){this.value=''}" onblur="this.form.className=''; |
68 | if(/^\s*$$/.test(this.value)){ this.value='Write your list App here or send a file list this icon:'; | 72 | if(/^\s*$$/.test(this.value)){ this.value='Write your list App here or send a file list this icon:'; |
@@ -118,45 +122,24 @@ if (x==null || x=="Write your list App here or send a file list this icon:") | @@ -118,45 +122,24 @@ if (x==null || x=="Write your list App here or send a file list this icon:") | ||
118 | </div> | 122 | </div> |
119 | </div> | 123 | </div> |
120 | </fieldset> | 124 | </fieldset> |
121 | - <fieldset> | ||
122 | - <legend>Your packages</legend> | ||
123 | - <div> | ||
124 | - <label>Upload file<input type="file" id="pkgs_file" name="pkgs_file" size="18"/></label> | ||
125 | - </div> | ||
126 | - </fieldset> | ||
127 | </div><!-- id="advanced-slide" --> | 125 | </div><!-- id="advanced-slide" --> |
128 | - | 126 | + <div id="upload-slide"> |
127 | + <fieldset> | ||
128 | + <p> | ||
129 | + <label title="Upload file">Upload file: <input type="file" name="pkgs_file" size="18" /></label> | ||
130 | + </p> | ||
131 | + <p> | ||
132 | + You can use file <strong>/var/log/popularity-contest</strong> or create a with <strong>dpkg</strong>, use: | ||
133 | + </p> | ||
134 | + <p> | ||
135 | + <code> # dpkg -l > blih.list </code> | ||
136 | + </p> | ||
137 | + </fieldset> | ||
138 | + </div><!-- id="upload-slide" --> | ||
129 | </form> | 139 | </form> |
130 | </div> | 140 | </div> |
131 | 141 | ||
132 | 142 | ||
133 | - | ||
134 | -<!-- BOX ATTACHMENT FILE --> | ||
135 | -<div id="attachfile" style="display: none;"> | ||
136 | -<h2>Recommendation with file list</h2> | ||
137 | -<form action="apprec" enctype="multipart/form-data" method="post" name="uploadform"> | ||
138 | - <fieldset> | ||
139 | - <label title="Upload file">Upload file: <input type="file" name="pkgs_file" size="18"/></label> | ||
140 | -<p> | ||
141 | -You can use file <strong>/var/log/popularity-contest</strong> or create a with <strong>dpkg</strong>, use: | ||
142 | -<code> | ||
143 | -# dpkg -l > blih | ||
144 | -</code> | ||
145 | -</p> | ||
146 | -<p> | ||
147 | - <p align="center"><input type="submit" value="Recommender!"></p> | ||
148 | - <input type="hidden" name="weight" value="BM25" checked="checked"> | ||
149 | - <input type="hidden" name="strategy" value="content" checked="checked"> | ||
150 | - <input type="hidden" name="profile_size" value="10" size="4"> | ||
151 | - <input type="hidden" name="limit" value="10" size="4"> | ||
152 | - <input type="hidden" name="neighbours" class="DEPENDS ON strategy BEING hybrid" value="50" size="4"> | ||
153 | - </fieldset> | ||
154 | -</form> | ||
155 | -</p> | ||
156 | -</div><!-- id="attachfile" --> | ||
157 | -<!-- END BOX ATTACHMENT FILE --> | ||
158 | - | ||
159 | - | ||
160 | </div><!-- id="header" --> | 143 | </div><!-- id="header" --> |
161 | <div id="content"> | 144 | <div id="content"> |
162 | 145 | ||
@@ -171,9 +154,9 @@ $:content | @@ -171,9 +154,9 @@ $:content | ||
171 | <li><a href="http://github.com/tassia/AppRecommender">Development</a></li> | 154 | <li><a href="http://github.com/tassia/AppRecommender">Development</a></li> |
172 | </ul> | 155 | </ul> |
173 | </div><!-- id="navbar" --> | 156 | </div><!-- id="navbar" --> |
174 | -<!-- <p id="copyright"> | ||
175 | - Copyright © 2011 AppRecommender team. | ||
176 | - </p> --> | 157 | + <div id="copyright"> <span> Copyright © 2011 AppRecommender team. </span> |
158 | + </div><!-- id="copyright" --> | ||
159 | +<br style="clear: both;" /> | ||
177 | </div><!-- id="footer" --> | 160 | </div><!-- id="footer" --> |
178 | 161 | ||
179 | 162 |
src/web/templates/survey_index.html
1 | $var title: Survey | 1 | $var title: Survey |
2 | $var mod = 'index'; | 2 | $var mod = 'index'; |
3 | -$var cssfiles: static/css/tabs.css static/css/debtags.css static/css/facebox.css | ||
4 | -$var jsfiles: static/js/facebox.js | 3 | +$var cssfiles: static/css/tabs.css static/css/debtags.css static/css/facebox.css static/css/survey.css |
4 | +$var jsfiles: | ||
5 | 5 | ||
6 | 6 | ||
7 | <!-- Dynamic form --> | 7 | <!-- Dynamic form --> |
@@ -11,28 +11,6 @@ window.onload = function() { | @@ -11,28 +11,6 @@ window.onload = function() { | ||
11 | }; | 11 | }; |
12 | </script> | 12 | </script> |
13 | 13 | ||
14 | -<script type="application/x-javascript"> | ||
15 | -$$(document).ready(function() { | ||
16 | - $$('a[rel*=facebox]').facebox({ | ||
17 | - loadingImage : '/static/images/loading.gif', | ||
18 | - closeImage : '/static/images/closelabel.png' | ||
19 | - }); | ||
20 | - $$("#tags-box").click(function () { | ||
21 | - $$("#tags-box").hide(1000); | ||
22 | - }); | ||
23 | - | ||
24 | -}); | ||
25 | -</script> | ||
26 | - | ||
27 | - | ||
28 | -<div id="sidebar"> | ||
29 | -<div class="innertube"> | ||
30 | - | ||
31 | - | ||
32 | -<br style="clear: both" /> | ||
33 | -</div><!-- class="innertube" --> | ||
34 | -</div><!-- id="sidebar" --> | ||
35 | - | ||
36 | <div id="maincontent"> | 14 | <div id="maincontent"> |
37 | <div class="innertube"> | 15 | <div class="innertube"> |
38 | 16 |