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.

src/config.py
... ... @@ -40,7 +40,8 @@ class Config():
40 40 self.output = "/dev/null"
41 41 self.survey_mode = 1
42 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 45 self.popcon_index = os.path.expanduser("~/.app-recommender/popcon_index")
45 46 self.popcon_dir = os.path.expanduser("~/.app-recommender/popcon_dir")
46 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 8 // Remove the coda-slider-no-js class from the body
9 9 $("body").removeClass("coda-slider-no-js");
10 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 14 var sliderCount = 1;
... ... @@ -47,7 +47,7 @@ $.fn.codaSlider = function(settings) {
47 47 if (settings.dynamicArrows) {
48 48 slider.parent().addClass("arrows");
49 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 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 25 .coda-slider-wrapper.arrows .coda-slider, .coda-slider-wrapper.arrows .coda-slider .panel { width: 500px }
26 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 32 /* Tab nav */
32 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 51 */
52 52  
53 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 55 font-family: Arial, Verdana, sans-serif;
63 56 font-size: 0.9em;
64 57 line-height: 1.1;
... ...
src/web/static/css/survey.css
... ... @@ -20,8 +20,8 @@ top: 40px;
20 20 width: 420px;
21 21 }
22 22  
23   -#tip-bar,
24   -#tip-finish,
  23 +#tip-restart .tip,
  24 +#tip-finish .tip,
25 25 #tip-strategy .tip {
26 26 display: none;
27 27 position: absolute;
... ... @@ -33,14 +33,14 @@ font-weight: normal;
33 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 38 #tip-strategy:hover .tip {
39 39 display: block;
40 40 z-index: 3;
41 41 }
42 42  
43   -#controls-form a:hover,
  43 +#next-button:hover,
44 44 #controls-form input:hover {
45 45 background: white;
46 46 }
... ... @@ -66,6 +66,7 @@ min-height: 450px;
66 66 /* Display None itens Survey */
67 67 #footer,
68 68 #coda-nav-left-1,
  69 +#coda-nav-right-1,
69 70 body.survey #header,
70 71 #recommender-box #upfile,
71 72 #advanced-button,
... ... @@ -80,13 +81,6 @@ float: right;
80 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 84 .content-pkg ul {
91 85 list-style: none;
92 86 }
... ... @@ -95,7 +89,8 @@ list-style: none;
95 89 margin-bottom: 10px;
96 90 }
97 91  
98   -#bar-button,
  92 +#next-button,
  93 +#restart-button,
99 94 #strategy-button,
100 95 #finish-button {
101 96 border: 1px solid #888a85;
... ... @@ -114,6 +109,10 @@ z-index: 2;
114 109 cursor: pointer;
115 110 }
116 111  
  112 +#next-button {
  113 +height: 20px;
  114 +}
  115 +
117 116 #panel-controls,
118 117 #controls-form {
119 118 float: right;
... ...
src/web/templates/layout.html
... ... @@ -89,7 +89,7 @@ function validateForm()
89 89 or run the following command and upload generated 'packages.list' file.
90 90 </p>
91 91 <p>
92   - <code> # dpkg-query --show > packages.list </code>
  92 + <code> # dpkg --get-selections > packages.list </code>
93 93 </p>
94 94 </div><!-- id="tip-upload" -->
95 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 7  
8 8 <script type="text/javascript">
9 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 14 $$('a[rel*=facebox]').facebox({
14 15 loadingImage : '/static/images/loading.gif',
15 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 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 32 <input type="hidden" name="strategy" value=$request.strategy>
31 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 56 </div><!-- id="controls-form" -->
45 57  
46 58 <div class="coda-slider-wrapper">
... ... @@ -50,12 +62,11 @@ $for pkg in pkg_details:
50 62 <div class="panel-wrapper">
51 63 <div id="panel-controls">
52 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 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 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 70 </div><!-- #panel-controls -->
60 71 <h1 id="title_pkg">$pkg['package'] <br />
61 72 <span>$pkg['description']</span></h1>
... ... @@ -78,17 +89,6 @@ $for pkg in pkg_details:
78 89 <li><b>Origin</b>: $pkg['origin']</li>
79 90 <li><b>Maintainer</b>: $pkg['maintainer']</li>
80 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 92 </div><!-- id="content-pkg" -->
93 93 </div><!-- .panel-wrapper -->
94 94 </div><!-- .panel -->
... ... @@ -99,3 +99,4 @@ $for pkg in pkg_details:
99 99  
100 100 </div><!-- class="innertube" -->
101 101 </div><!-- id="maincontent" -->
  102 +
... ...
src/web/templates/thanks.html
1 1 $var title: Feedback
2 2 $var mod = 'thanks';
  3 +$var cssfiles: static/css/survey.css
  4 +$var jsfiles:
3 5  
4 6 <div class="index_include">
5 7 <center>
... ...