changeset 152:4829c054751a

improved navigation in Orthanc Explorer
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 23 Oct 2012 15:02:54 +0200
parents 11e48e70c039
children 5b6b5c9f280f 66c2605532b3
files NEWS OrthancExplorer/explorer.css OrthancExplorer/explorer.html OrthancExplorer/explorer.js
diffstat 4 files changed, 45 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Tue Oct 23 14:34:57 2012 +0200
+++ b/NEWS	Tue Oct 23 15:02:54 2012 +0200
@@ -2,7 +2,7 @@
 ===============================
 
 * URI "/system"
-* Help on the command line
+* Versioning info and help on the command line
 * Improved logging
 * Possibility of dynamic linking against jsoncpp, sqlite, boost and dmctk
 * Fix some bugs
--- a/OrthancExplorer/explorer.css	Tue Oct 23 14:34:57 2012 +0200
+++ b/OrthancExplorer/explorer.css	Tue Oct 23 15:02:54 2012 +0200
@@ -32,3 +32,8 @@
     width: 0%; 
     background-color: green; 
 }
+
+.ui-title a {
+    text-decoration: none;
+    color: white !important;
+}
--- a/OrthancExplorer/explorer.html	Tue Oct 23 14:34:57 2012 +0200
+++ b/OrthancExplorer/explorer.html	Tue Oct 23 15:02:54 2012 +0200
@@ -71,7 +71,7 @@
 
     <div data-role="page" id="patient" >
       <div data-role="header" >
-	<h1><span class="orthanc-name"></span>List of the studies of one patient</h1>
+	<h1><span class="orthanc-name"></span>Patient</h1>
         <a href="#find-patients" data-icon="search" class="ui-btn-left" data-direction="reverse">Find patient</a>
         <a href="#upload" data-icon="gear" class="ui-btn-right">Upload DICOM</a>
       </div>
@@ -99,7 +99,11 @@
 
     <div data-role="page" id="study">
       <div data-role="header">
-	<h1><span class="orthanc-name"></span>List of the series of one study</h1>
+	<h1>
+          <span class="orthanc-name"></span>
+          <a href="#" class="patient-link">Patient</a> &raquo; 
+          Study
+        </h1>
         <a href="#find-patients" data-icon="search" class="ui-btn-left" data-direction="reverse">Find patient</a>
         <a href="#upload" data-icon="gear" class="ui-btn-right">Upload DICOM</a>
       </div>
@@ -126,7 +130,13 @@
 
     <div data-role="page" id="series">
       <div data-role="header">
-	<h1><span class="orthanc-name"></span>List of the instances of one series</h1>
+	<h1>
+          <span class="orthanc-name"></span>
+          <a href="#" class="patient-link">Patient</a> &raquo; 
+          <a href="#" class="study-link">Study</a> &raquo; 
+          Series
+        </h1>
+
         <a href="#find-patients" data-icon="search" class="ui-btn-left" data-direction="reverse">Find patient</a>
         <a href="#upload" data-icon="gear" class="ui-btn-right">Upload DICOM</a>
       </div>
@@ -155,7 +165,13 @@
 
     <div data-role="page" id="instance">
       <div data-role="header">
-	<h1><span class="orthanc-name"></span>One DICOM instance</h1>
+	<h1>
+          <span class="orthanc-name"></span>
+          <a href="#" class="patient-link">Patient</a> &raquo; 
+          <a href="#" class="study-link">Study</a> &raquo; 
+          <a href="#" class="series-link">Series</a> &raquo; 
+          Instance
+        </h1>
         <a href="#find-patients" data-icon="search" class="ui-btn-left" data-direction="reverse">Find patient</a>
         <a href="#upload" data-icon="gear" class="ui-btn-right">Upload DICOM</a>
       </div>
--- a/OrthancExplorer/explorer.js	Tue Oct 23 14:34:57 2012 +0200
+++ b/OrthancExplorer/explorer.js	Tue Oct 23 15:02:54 2012 +0200
@@ -319,19 +319,20 @@
 }
 
 
+$('[data-role="page"]').live('pagebeforeshow', function() {
+  $.ajax({
+    url: '/system',
+    dataType: 'json',
+    async: false,
+    success: function(s) {
+      $('.orthanc-name').html('<a class="ui-link" href="explorer.html">' + s.Name + '</a> &raquo; ');
+    }
+  });
+});
+
 
 
 $('#find-patients').live('pagebeforeshow', function() {
-  //$('.orthanc-name').each(
-  
-  $.ajax({
-    url: '/system',
-    dataType: 'json',
-    success: function(s) {
-      $('.orthanc-name').html(s.Name + ' &raquo; ');
-    }
-  });
-
   GetMultipleResources('patients', null, function(patients) {
     var target = $('#all-patients');
     $('li', target).remove();
@@ -388,6 +389,7 @@
         GetMultipleResources('series', study.Series, function(series) {
           SortOnDicomTag(series, 'SeriesDate', false, true);
 
+          $('#study .patient-link').attr('href', '#patient?uuid=' + patient.ID);
           $('#study-info li').remove();
           $('#study-info')
             .append('<li data-role="list-divider">Patient</li>')
@@ -422,6 +424,9 @@
           GetMultipleResources('instances', series.Instances, function(instances) {
             Sort(instances, function(x) { return x.IndexInSeries; }, true, false);
 
+            $('#series .patient-link').attr('href', '#patient?uuid=' + patient.ID);
+            $('#series .study-link').attr('href', '#study?uuid=' + study.ID);
+
             $('#series-info li').remove();
             $('#series-info')
               .append('<li data-role="list-divider">Patient</li>')
@@ -504,6 +509,10 @@
       GetSingleResource('series', instance.ParentSeries, function(series) {
         GetSingleResource('studies', series.ParentStudy, function(study) {
           GetSingleResource('patients', study.ParentPatient, function(patient) {
+
+            $('#instance .patient-link').attr('href', '#patient?uuid=' + patient.ID);
+            $('#instance .study-link').attr('href', '#study?uuid=' + study.ID);
+            $('#instance .series-link').attr('href', '#series?uuid=' + series.ID);
             
             $('#instance-info li').remove();
             $('#instance-info')