Skip to content

Commit 88ebb39

Browse files
committed
textbook url fix
1 parent 46d6fa3 commit 88ebb39

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

app/assets/javascripts/textbooks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@
192192
messages = check_completeness(true);
193193
if (messages.length !== 0) {
194194
form_alert(messages);
195-
$('#btn-gen-textbook').prop('disabled', false);
195+
$('#btn-gen-textbook').attr('disabled', false);
196196
return;
197197
}
198198
organization_id = $('#organization-select').val();

app/views/courses/show.html.haml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,14 @@
6464
- course = Course.find_by(id:offering.course_id)
6565
- organization = Organization.find_by(id:course.organization_id)
6666
- term = Term.find_by(id:offering.term_id)
67-
- if ENV["opendsa_branch"] == "staging"
68-
= link_to "Textbook URL", "https://opendsax.cs.vt.edu/ODSA/" + "/Books/#{organization.slug}/#{course.slug}/#{term.slug}/#{offering.label}/html/"
67+
- route = "Books/#{organization.slug}/#{course.slug}/#{term.slug}/#{offering.label}/html/".gsub(" ","_")
68+
- if ENV["host_url"].include? "localhost"
69+
- route = ENV["host_url"].gsub("-lti","") +"/" + route + "index.html"
70+
- elsif ENV["opendsa_branch"] == "staging"
71+
- route = "https://opendsax.cs.vt.edu/ODSA/" + route
6972
- elsif ENV["opendsa_branch"] == "master"
70-
= link_to "Textbook URL", "https://opendsa-server.cs.vt.edu/ODSA/" + "/Books/#{organization.slug}/#{course.slug}/#{term.slug}/#{offering.label}/html/"
71-
- else
72-
= link_to "Textbook URL", ENV["config_api_link"].gsub("/api/configure/","/Books/#{organization.slug}/#{course.slug}/#{term.slug}/#{offering.label}/html/index.html")
73+
- route = "https://opendsa-server.cs.vt.edu/ODSA/" + route
74+
= link_to "Textbook URL", route
7375
%td
7476
- inst_book = InstBook.find_by(course_offering_id:offering.id)
7577
- form_name = 'compile_book_' + inst_book.id.to_s

0 commit comments

Comments
 (0)