Commit 45d7233bfa6eb7f02754baa5daa5d0a04b85fcd3

Authored by valessio
1 parent c20a2199
Exists in master and in 1 other branch add_vagrant

fix bugs, and show next button only choice a radio button.

@@ -40,7 +40,8 @@ class Config(): @@ -40,7 +40,8 @@ class Config():
40 self.output = "/dev/null" 40 self.output = "/dev/null"
41 self.survey_mode = 1 41 self.survey_mode = 1
42 self.axi = "/var/lib/apt-xapian-index/index" 42 self.axi = "/var/lib/apt-xapian-index/index"
43 - self.dde_url = "http://dde.debian.net/dde/q/udd/packs/all/%s?t=json" 43 +# self.dde_url = "http://dde.debian.net/dde/q/udd/packs/all/%s?t=json"
  44 + self.dde_url = "http://46.4.235.200:8000/q/udd/packages/all/%s?t=json"
44 self.popcon_index = os.path.expanduser("~/.app-recommender/popcon_index") 45 self.popcon_index = os.path.expanduser("~/.app-recommender/popcon_index")
45 self.popcon_dir = os.path.expanduser("~/.app-recommender/popcon_dir") 46 self.popcon_dir = os.path.expanduser("~/.app-recommender/popcon_dir")
46 self.clusters_dir = os.path.expanduser("~/.app-recommender/clusters_dir") 47 self.clusters_dir = os.path.expanduser("~/.app-recommender/clusters_dir")
src/web/static/coda-slider-2.0/javascripts/jquery.coda-slider-2.0.js
@@ -8,7 +8,7 @@ $(function(){ @@ -8,7 +8,7 @@ $(function(){
8 // Remove the coda-slider-no-js class from the body 8 // Remove the coda-slider-no-js class from the body
9 $("body").removeClass("coda-slider-no-js"); 9 $("body").removeClass("coda-slider-no-js");
10 // Preloader 10 // Preloader
11 - $(".coda-slider").children('.panel').hide().end().prepend('<p class="loading">Loading...<br /><img src="images/ajax-loader.gif" alt="loading..." /></p>'); 11 + $(".coda-slider").children('.panel').hide().end().prepend('<p class="loading">Loading...<br /><img src="/static/images/ajax-loader.gif" alt="loading..." /></p>');
12 }); 12 });
13 13
14 var sliderCount = 1; 14 var sliderCount = 1;
@@ -47,7 +47,7 @@ $.fn.codaSlider = function(settings) { @@ -47,7 +47,7 @@ $.fn.codaSlider = function(settings) {
47 if (settings.dynamicArrows) { 47 if (settings.dynamicArrows) {
48 slider.parent().addClass("arrows"); 48 slider.parent().addClass("arrows");
49 slider.before('<div class="coda-nav-left" id="coda-nav-left-' + sliderCount + '"><a href="#">' + settings.dynamicArrowLeftText + '</a></div>'); 49 slider.before('<div class="coda-nav-left" id="coda-nav-left-' + sliderCount + '"><a href="#">' + settings.dynamicArrowLeftText + '</a></div>');
50 - slider.after('<div class="coda-nav-right" id="coda-nav-right-' + sliderCount + '"><a href="#">' + settings.dynamicArrowRightText + '</a></div>'); 50 + slider.after('<div class="coda-nav-right" id="coda-nav-right-' + sliderCount + '"><a accesskey="n" class="glass" id="next-button" onClick="document.getElementById(\'coda-nav-right-1\').style.display = \'none\';" href="#">' + settings.dynamicArrowRightText + '</a></div>');
51 }; 51 };
52 52
53 var panelWidth = slider.find(".panel").width(); 53 var panelWidth = slider.find(".panel").width();
src/web/static/coda-slider-2.0/stylesheets/coda-slider-2.0.css
@@ -25,9 +25,10 @@ @@ -25,9 +25,10 @@
25 .coda-slider-wrapper.arrows .coda-slider, .coda-slider-wrapper.arrows .coda-slider .panel { width: 500px } 25 .coda-slider-wrapper.arrows .coda-slider, .coda-slider-wrapper.arrows .coda-slider .panel { width: 500px }
26 .coda-slider-wrapper.arrows .coda-slider { margin: 0 10px } 26 .coda-slider-wrapper.arrows .coda-slider { margin: 0 10px }
27 27
28 - /* Arrow styling */  
29 - .coda-nav-left a, .coda-nav-right a { background: #000; color: #fff; padding: 5px; width: 100px }  
30 - 28 + /* Arrow styling
  29 + * .coda-nav-left a, .coda-nav-right a { background: #000; color: #fff; padding: 5px; width: 100px }
  30 + */
  31 +
31 /* Tab nav */ 32 /* Tab nav */
32 .coda-nav ul li a.current { background: #39c } 33 .coda-nav ul li a.current { background: #39c }
33 34
src/web/static/css/style.css
@@ -51,14 +51,7 @@ blockquote:before, blockquote:after, q:before, q:after { content: &quot;&quot;; } @@ -51,14 +51,7 @@ blockquote:before, blockquote:after, q:before, q:after { content: &quot;&quot;; }
51 */ 51 */
52 52
53 body{ 53 body{
54 -background: #f2f6f8; /* Old browsers */  
55 -background: -moz-linear-gradient(top, #f2f6f8 0%, #d8e1e7 50%, #b5c6d0 51%, #e0eff9 100%); /* FF3.6+ */  
56 -background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f2f6f8), color-stop(50%,#d8e1e7), color-stop(51%,#b5c6d0), color-stop(100%,#e0eff9)); /* Chrome,Safari4+ */  
57 -background: -webkit-linear-gradient(top, #f2f6f8 0%,#d8e1e7 50%,#b5c6d0 51%,#e0eff9 100%); /* Chrome10+,Safari5.1+ */  
58 -background: -o-linear-gradient(top, #f2f6f8 0%,#d8e1e7 50%,#b5c6d0 51%,#e0eff9 100%); /* Opera11.10+ */  
59 -background: -ms-linear-gradient(top, #f2f6f8 0%,#d8e1e7 50%,#b5c6d0 51%,#e0eff9 100%); /* IE10+ */  
60 -filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f2f6f8', endColorstr='#e0eff9',GradientType=0 ); /* IE6-9 */  
61 -background: linear-gradient(top, #f2f6f8 0%,#d8e1e7 50%,#b5c6d0 51%,#e0eff9 100%); /* W3C */ 54 +background: #d8e1e7; /* f2f6f8 */
62 font-family: Arial, Verdana, sans-serif; 55 font-family: Arial, Verdana, sans-serif;
63 font-size: 0.9em; 56 font-size: 0.9em;
64 line-height: 1.1; 57 line-height: 1.1;
src/web/static/css/survey.css
@@ -20,8 +20,8 @@ top: 40px; @@ -20,8 +20,8 @@ top: 40px;
20 width: 420px; 20 width: 420px;
21 } 21 }
22 22
23 -#tip-bar,  
24 -#tip-finish, 23 +#tip-restart .tip,
  24 +#tip-finish .tip,
25 #tip-strategy .tip { 25 #tip-strategy .tip {
26 display: none; 26 display: none;
27 position: absolute; 27 position: absolute;
@@ -33,14 +33,14 @@ font-weight: normal; @@ -33,14 +33,14 @@ font-weight: normal;
33 color: #000000; 33 color: #000000;
34 } 34 }
35 35
36 -a:hover #tip-bar,  
37 -a:hover #tip-finish, 36 +#tip-restart:hover .tip,
  37 +#tip-finish:hover .tip,
38 #tip-strategy:hover .tip { 38 #tip-strategy:hover .tip {
39 display: block; 39 display: block;
40 z-index: 3; 40 z-index: 3;
41 } 41 }
42 42
43 -#controls-form a:hover, 43 +#next-button:hover,
44 #controls-form input:hover { 44 #controls-form input:hover {
45 background: white; 45 background: white;
46 } 46 }
@@ -66,6 +66,7 @@ min-height: 450px; @@ -66,6 +66,7 @@ min-height: 450px;
66 /* Display None itens Survey */ 66 /* Display None itens Survey */
67 #footer, 67 #footer,
68 #coda-nav-left-1, 68 #coda-nav-left-1,
  69 +#coda-nav-right-1,
69 body.survey #header, 70 body.survey #header,
70 #recommender-box #upfile, 71 #recommender-box #upfile,
71 #advanced-button, 72 #advanced-button,
@@ -80,13 +81,6 @@ float: right; @@ -80,13 +81,6 @@ float: right;
80 margin: 5px; 81 margin: 5px;
81 } 82 }
82 83
83 -.content-pkg {  
84 -overflow: auto;  
85 -display: block;  
86 -height: 400px;  
87 -min-height: 400px;  
88 -}  
89 -  
90 .content-pkg ul { 84 .content-pkg ul {
91 list-style: none; 85 list-style: none;
92 } 86 }
@@ -95,7 +89,8 @@ list-style: none; @@ -95,7 +89,8 @@ list-style: none;
95 margin-bottom: 10px; 89 margin-bottom: 10px;
96 } 90 }
97 91
98 -#bar-button, 92 +#next-button,
  93 +#restart-button,
99 #strategy-button, 94 #strategy-button,
100 #finish-button { 95 #finish-button {
101 border: 1px solid #888a85; 96 border: 1px solid #888a85;
@@ -114,6 +109,10 @@ z-index: 2; @@ -114,6 +109,10 @@ z-index: 2;
114 cursor: pointer; 109 cursor: pointer;
115 } 110 }
116 111
  112 +#next-button {
  113 +height: 20px;
  114 +}
  115 +
117 #panel-controls, 116 #panel-controls,
118 #controls-form { 117 #controls-form {
119 float: right; 118 float: right;
src/web/templates/layout.html
@@ -89,7 +89,7 @@ function validateForm() @@ -89,7 +89,7 @@ function validateForm()
89 or run the following command and upload generated 'packages.list' file. 89 or run the following command and upload generated 'packages.list' file.
90 </p> 90 </p>
91 <p> 91 <p>
92 - <code> # dpkg-query --show > packages.list </code> 92 + <code> # dpkg --get-selections > packages.list </code>
93 </p> 93 </p>
94 </div><!-- id="tip-upload" --> 94 </div><!-- id="tip-upload" -->
95 </fieldset> 95 </fieldset>
src/web/templates/survey.html
@@ -7,15 +7,17 @@ $var jsfiles: static/coda-slider-2.0/javascripts/jquery-1.3.2.min.js static/coda @@ -7,15 +7,17 @@ $var jsfiles: static/coda-slider-2.0/javascripts/jquery-1.3.2.min.js static/coda
7 7
8 <script type="text/javascript"> 8 <script type="text/javascript">
9 $$(document).ready(function() { 9 $$(document).ready(function() {
10 - $$("#bar-button").click(function () {  
11 - $$("#header").slideToggle("slow"); 10 + $$("input[type=radio]").click(function () {
  11 + $$("#coda-nav-right-1").show("fast");
12 }); 12 });
  13 +
13 $$('a[rel*=facebox]').facebox({ 14 $$('a[rel*=facebox]').facebox({
14 loadingImage : '/static/images/loading.gif', 15 loadingImage : '/static/images/loading.gif',
15 closeImage : '/static/images/closelabel.png' 16 closeImage : '/static/images/closelabel.png'
16 }); 17 });
17 - $$('#coda-slider-1').codaSlider({dynamicTabs: false, dynamicArrowLeftText: "&#171; back", dynamicArrowRightText:"next &#187;" }); 18 + $$('#coda-slider-1').codaSlider({dynamicTabs: false, dynamicArrowLeftText: "L", dynamicArrowRightText:"Next" });
18 }); 19 });
  20 +
19 </script> 21 </script>
20 22
21 23
@@ -30,17 +32,27 @@ $var jsfiles: static/coda-slider-2.0/javascripts/jquery-1.3.2.min.js static/coda @@ -30,17 +32,27 @@ $var jsfiles: static/coda-slider-2.0/javascripts/jquery-1.3.2.min.js static/coda
30 <input type="hidden" name="strategy" value=$request.strategy> 32 <input type="hidden" name="strategy" value=$request.strategy>
31 <div id="controls-form" style="display: none;"><!-- display show in the end form --> 33 <div id="controls-form" style="display: none;"><!-- display show in the end form -->
32 34
33 -<!--<a id="finish-button" class="glass">Finish  
34 - <div class="tip important" id="tip-bar"><p>Conclude your participation in this survey</p></div>  
35 -</a>  
36 -<a id="bar-button" class="glass" href="http://localhost:8080">Restart  
37 - <div class="tip note" id="tip-finish"><p>Restart the survey with a new packages list.</p></div>  
38 -</a>--> 35 +<label for="restart_button" id="tip-restart">
  36 + <div class="tip note">
  37 + <p>Restart the survey with a new packages list.</p>
  38 + </div>
  39 + <input id="restart-button" name="restart_button" type="submit" value="Restart" class="glass" />
  40 +</label>
39 41
40 -<input id="restart-button" name="restart_button" type="submit" value="Restart" class="glass" />  
41 -<input id="finish-button" name="finish_button" type="submit" value="Finish" class="glass" /> 42 +<label for="finish_button" id="tip-finish">
  43 + <div class="tip important">
  44 + <p>Conclude your participation in this survey</p>
  45 + </div>
  46 + <input id="finish-button" name="finish_button" type="submit" value="Finish" class="glass" rel="facebox" />
  47 +</label>
  48 +
  49 +<label for="strategy_button" id="tip-strategy">
  50 + <div class="tip tip">
  51 + <p> New round of evaluations for the same list of packages and suggestions produced by a different recommendation strategy. </p>
  52 + </div>
  53 + <input id="strategy-button" name="strategy_button" type="submit" value="New Round" class="glass" />
  54 +</label>
42 55
43 -<label for="strategy_button" id="tip-strategy"><div class="tip tip"><p> New round of evaluations for the same list of packages and suggestions produced by a different recommendation strategy. </p></div><input id="strategy-button" name="strategy_button" type="submit" value="New Round" class="glass" /></label>  
44 </div><!-- id="controls-form" --> 56 </div><!-- id="controls-form" -->
45 57
46 <div class="coda-slider-wrapper"> 58 <div class="coda-slider-wrapper">
@@ -50,12 +62,11 @@ $for pkg in pkg_details: @@ -50,12 +62,11 @@ $for pkg in pkg_details:
50 <div class="panel-wrapper"> 62 <div class="panel-wrapper">
51 <div id="panel-controls"> 63 <div id="panel-controls">
52 <label for="poor">Poor</label> 64 <label for="poor">Poor</label>
53 - <input class="radio" type="radio" name="evaluation-$pkg_details.index(pkg)" value="poor" /><br /> 65 + <input accesskey="p" class="radio" type="radio" onClick="; showNext();" name="evaluation-$pkg_details.index(pkg)" value="poor" /><br />
54 <label for="good">Good</label> 66 <label for="good">Good</label>
55 - <input class="radio" type="radio" name="evaluation-$pkg_details.index(pkg)" value="good" /><br /> 67 + <input accesskey="g" class="radio" type="radio" onClick="javascript: showNext();" name="evaluation-$pkg_details.index(pkg)" value="good" /><br />
56 <label for="surprising">Surprising</label> 68 <label for="surprising">Surprising</label>
57 - <input class="radio" type="radio"  
58 - name="evaluation-$pkg_details.index(pkg)" value="surprising" /> 69 + <input accesskey="s" class="radio" type="radio" onClick="showNext()" name="evaluation-$pkg_details.index(pkg)" value="surprising" />
59 </div><!-- #panel-controls --> 70 </div><!-- #panel-controls -->
60 <h1 id="title_pkg">$pkg['package'] <br /> 71 <h1 id="title_pkg">$pkg['package'] <br />
61 <span>$pkg['description']</span></h1> 72 <span>$pkg['description']</span></h1>
@@ -78,17 +89,6 @@ $for pkg in pkg_details: @@ -78,17 +89,6 @@ $for pkg in pkg_details:
78 <li><b>Origin</b>: $pkg['origin']</li> 89 <li><b>Origin</b>: $pkg['origin']</li>
79 <li><b>Maintainer</b>: $pkg['maintainer']</li> 90 <li><b>Maintainer</b>: $pkg['maintainer']</li>
80 </ul> 91 </ul>
81 - <div id="debresources_box" class="graybox vert-grad">  
82 - <h2>Debian resources:</h2>  
83 - <ul>  
84 - <li><a href="http://packages.debian.org/$pkg['package']">Package page on debian.org</a></li>  
85 - <li><a href="http://bugs.debian.org/$pkg['package']">Debian bug tracking system (BTS)</a></li>  
86 - <li><a href="http://packages.qa.debian.org/$pkg['package']">Debian package tracking system (PTS)</a></li>  
87 - <li><a href="http://qa.debian.org/popcon.php?package=$pkg['package']">Popularity contest statistics (Popcon)</a></li>  
88 - <li><a href="http://patch-tracker.debian.org/package/$pkg['package']">Debian patch tracking system</a></li>  
89 - <li><a href="http://screenshots.debian.net/package/$pkg['package']">Screenshots</a></li>  
90 - </ul>  
91 - </div><!-- id="debresources_box -->  
92 </div><!-- id="content-pkg" --> 92 </div><!-- id="content-pkg" -->
93 </div><!-- .panel-wrapper --> 93 </div><!-- .panel-wrapper -->
94 </div><!-- .panel --> 94 </div><!-- .panel -->
@@ -99,3 +99,4 @@ $for pkg in pkg_details: @@ -99,3 +99,4 @@ $for pkg in pkg_details:
99 99
100 </div><!-- class="innertube" --> 100 </div><!-- class="innertube" -->
101 </div><!-- id="maincontent" --> 101 </div><!-- id="maincontent" -->
  102 +
src/web/templates/thanks.html
1 $var title: Feedback 1 $var title: Feedback
2 $var mod = 'thanks'; 2 $var mod = 'thanks';
  3 +$var cssfiles: static/css/survey.css
  4 +$var jsfiles:
3 5
4 <div class="index_include"> 6 <div class="index_include">
5 <center> 7 <center>