]> git.donarmstrong.com Git - neurodebian.git/blobdiff - neurodebian/templates/sources_lists.rst
New repository setup instruction.
[neurodebian.git] / neurodebian / templates / sources_lists.rst
index 58dd044565799ccb7b2036c2172f7da57c114583..e48025e9e727221448554203185f3325af1b84c7 100644 (file)
@@ -1,4 +1,65 @@
-{% for dist, mirrors in repos|dictsort %}
-* {{ dist }}: {% for mirror, list in mirrors|sort %}[`{{ mirror }} <_static/{{ list }}>`__] {% endfor %}
-{% endfor %}
+.. raw:: html
+
+ <select id="release" name="release">
+   <option value="">Select a release</option>
+{%- for id, relname in id2relname|dictsort(true, 'value') %}
+   <option value="{{ id }}">{{ relname }}</option>
+{%- endfor %}
+ </select>
+ <select id="mirror" name="mirror">
+{%- for id, mirrorname in mirror2name|dictsort %}
+{%- if id == 'us-nh' %}
+   <option selected value="{{ id }}">{{ mirrorname }}</option>
+{%- else %}
+   <option value="{{ id }}">{{ mirrorname }}</option>
+{%- endif %}
+{%- endfor %}
+ </select>
+
+ <div class="highlight-python" id="reposetup">
+ <pre id="code">
+ After selecting a release the setup code will be shown here.
+ </pre>
+ </div>
+ <script>
+ <!--
+  var rel2name =  {
+{%- for id, codename in id2codename|dictsort %}
+   "{{ id }}" : "{{ codename }}",
+{%- endfor %}
+  };
+
+  var mirrors =  {
+{%- for id, url in mirror2url|dictsort %}
+   "{{ id }}" : "{{ url }}",
+{%- endfor %}
+  };
+
+  function createrepourl(rel, mir) {
+    if(rel in rel2name && mir in mirrors) {
+
+        var retrepo = "sudo apt-key adv --recv-keys --keyserver pgp.mit.edu 2649A5A9\n" +
+         "wget -O- http://neuro.debian.net/lists/" + rel2name[rel] + "."
+         + mir + " | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list\n";
+        return retrepo;
+    }
+
+  };
+  function updateout(rel, mir) {
+        $('#code').text(createrepourl(rel, mir));
+  };
+   $('#release').change(function() {
+     var singleValues = $("#release").val();
+     var mirrorVal = $("#mirror").val();
+     updateout(singleValues, mirrorVal);
+   });
+   $('#mirror').change(function() {
+     var singleValues = $("#release").val();
+     var mirrorVal = $("#mirror").val();
+     updateout(singleValues, mirrorVal);
+   });
+
+ //-->
+ </script>