add a link to the new redmine bug tracker; fixes #72
[photo-tags.git] / index.php
index e5131db62d13d5975b99b8371dbb1b32b2e5bb6a..5ee661ff8a40d4776d432915981650b0ab6dc643 100644 (file)
--- a/index.php
+++ b/index.php
@@ -49,7 +49,7 @@ else
 
 <footer>
   This gallery belongs to <?php echo htmlspecialchars($admin) ?>.
-  <div class="copyright"> code: copyright 2011 Arun Persaud arun@nubati.net, code available at nubati.net/git/f-spot-gallery</div>
+  <div class="copyright"> photo-tags: copyright 2011 Arun Persaud arun@nubati.net, code available at <a href="http://source.nubati.net/projects/photo-tags">source.nubati.net/projects/photo-tags</a></div>
 </footer>
 
 
@@ -70,7 +70,7 @@ d3.json("<?php echo $webbase?>/getjson.php?S", function(json) {
 
 /* update form to point to new link */
 d3.select("input").on("keyup", function(d) {
-    d3.select('form').attr("action","<?php echo $webbase?>/tag/"+document.getElementById('MyTagsInput').value);
+    d3.select('form').attr("action","<?php echo $webbase?>/tag/"+document.getElementById('MyTagsInput').value.replace(" ","+"));
 });
 
 function myreload(a) {
@@ -84,49 +84,52 @@ function myreload(a) {
   d3.json(url, function(json) {
 
       /* update index, show only page +-5 pages max */
-      s="page ";
       n = Math.floor(json[0][0].total/N);
+      s = "";
 
-      if(a>7)
+      if(n>1)
        {
-         s+=" <a href=\"<?php echo $webbase?>";
-         if(T!="")
-           s+="/tag/"+T;
-         s+="/page/1\">1</a>...";
-         start = a-5;
-       }
-      else
-       start=1;
-
-      for(i=start;i<=Math.min(n+1,a+5);i++)
-       {
-         if(i==a)
-           s+= " "+i+" ";
-         else
+         s="page ";
+
+         if(a>7)
            {
              s+=" <a href=\"<?php echo $webbase?>";
              if(T!="")
                s+="/tag/"+T;
-             s+="/page/"+i+"\">"+i+"</a>";
+             s+="/page/1\">1</a>...";
+             start = a-5;
            }
-       }
-
-      if(a+5<n)
-       {
-         s+="... <a href=\"<?php echo $webbase?>";
-         if(T!="")
-           s+="/tag/"+T;
-         s+="/page/"+(n+1)+"\">"+(n+1)+"</a>";
-       }
-      else if(a+5==n)
-       {
-         s+=" <a href=\"<?php echo $webbase?>";
-         if(T!="")
-           s+="/tag/"+T;
-         s+="/page/"+(n+1)+"\">"+(n+1)+"</a>";
-       };
+         else
+           start=1;
 
+         for(i=start;i<=Math.min(n+1,a+5);i++)
+           {
+             if(i==a)
+               s+= " "+i+" ";
+             else
+               {
+                 s+=" <a href=\"<?php echo $webbase?>";
+                 if(T!="")
+                   s+="/tag/"+T;
+                 s+="/page/"+i+"\">"+i+"</a>";
+               }
+           }
 
+         if(a+5<n)
+           {
+             s+="... <a href=\"<?php echo $webbase?>";
+             if(T!="")
+               s+="/tag/"+T;
+             s+="/page/"+(n+1)+"\">"+(n+1)+"</a>";
+           }
+         else if(a+5==n)
+           {
+             s+=" <a href=\"<?php echo $webbase?>";
+             if(T!="")
+               s+="/tag/"+T;
+             s+="/page/"+(n+1)+"\">"+(n+1)+"</a>";
+           };
+       };
       d3.select(".index").html(s);
 
       /* update pics */