configurable base URL for direct links to OverDrive site
[sitka/overdrive-evergreen-opac.git] / src / od_pages_myopac.coffee
index e30a791..2628307 100644 (file)
@@ -4,10 +4,11 @@
 define [
        'jquery'
        'lodash'
+       'od_config'
        'jquery-ui'
        'od_action'
        'od_pages_opac'
-], ($, _) ->
+], ($, _, config) ->
 
        $.fn.extend
 
@@ -357,7 +358,7 @@ define [
                                <li>Hold will expire <%= expires %></li>
                                </ul>
                        </div>
-                       <a href="http://downloads.bclibrary.ca/ContentDetails.htm?ID=<%= id %>">Link to Overdrive Account to change preferences</a>
+                       <a href="<%= baseURL %>?ID=<%= id %>">Link to Overdrive Account to change preferences</a>
                        """
                        @empty().append tpl
                                position:  hold.holdListPosition
@@ -366,6 +367,7 @@ define [
                                expires:   hold.holdExpires.fromNow()
                                placed:    hold.holdPlacedDate.fromNow()
                                activates: hold.holdSuspension?.numberOfDays.calendar()
+                               baseURL:   config.baseURL
                                id:        hold.reserveId
 
                        # Illuminate areas of this row according to the hold status
@@ -470,11 +472,12 @@ define [
                        tpl = _.template """
                        <div>Expires <%= expires_relatively %></div>
                        <div><%= expires_exactly %></div>
-                       <a href="http://downloads.bclibrary.ca/ContentDetails.htm?ID=<%= id %>">Click to access online (library card required)</a>
+                       <a href="<%= baseURL %>?ID=<%= id %>">Click to access online (library card required)</a>
                        """
                        @empty().append tpl
                                expires_relatively: circ.expires.fromNow()
                                expires_exactly:    circ.expires.format 'YYYY MMM D, h:mm:ss a'
+                               baseURL:            config.baseURL
                                id:                 circ.reserveId
 
                # Build a <tr> element to show the available actions of an item.