Skip to content

Commit

Permalink
Replacing index page with angular app.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonpitts committed Aug 20, 2014
1 parent c7b338b commit 80a6bf9
Show file tree
Hide file tree
Showing 9 changed files with 200 additions and 361 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Transformer Service
===================
An experimental sinatra based web-service that transforms excel files into mods format.
An sinatra based web-service that transforms excel files into mods format.
AngularJS used for much of the front end.

Excel has been a popular tool for cataloging library meta-data.
It is much better to store this type of data in xml following a schema.
Expand Down Expand Up @@ -68,5 +69,8 @@ Notes - Issues - TODO
* Ruby 1.9.3 has problems when multiple threads are both inside chdir blocks.
* Shared resources such as the included java app create conflicts
* Ruby gem 'roo' has an api for reading excel spreadsheets. Will need to investigate.
* Moved the angular test page as the main content page.
* Older view still available as 'Alternate Page' link
* Angular will not work for 100% of users but otherwise is really nice.


6 changes: 3 additions & 3 deletions lib/app/deletes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
content_type 'application/json'
"success"
else
redirect '/'
redirect '/old/'
end
else
message = "No such file #{collection_id}.zip"
Expand All @@ -19,7 +19,7 @@
halt status, body
else
error 400, message
redirect "/", 301
redirect "/old/", 301
end
end
end
Expand All @@ -31,7 +31,7 @@
content_type 'application/json'
"success"
else
redirect '/'
redirect '/old/'
end
else
if request.xhr?
Expand Down
6 changes: 3 additions & 3 deletions lib/app/gets.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Index view

get '/' do
erb :index, :layout => :layout
erb :index, :layout => false
end

get '/user' do
Expand Down Expand Up @@ -36,6 +36,6 @@
packages = @@session[@user].listPackages.to_json
end

get '/test/' do
erb :test, :layout => false
get '/old/' do
erb :content, :layout => :layout
end
4 changes: 2 additions & 2 deletions lib/app/posts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#transform xml into mods
Thread.new{@@session[@user].transform tempfile, collection_id, institution}

redirect '/'
redirect '/old/'
end

end
Expand All @@ -69,7 +69,7 @@
@@session[@user].modsTags.each do |key, value|
puts "#{key} => #{value}"
end
redirect '/'
redirect '/old/'
end
end

Expand Down
4 changes: 2 additions & 2 deletions public/js/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ $(document).ready(function() {
success: function(responseTxt, textStatus, xhr)
{
alert(responseTxt);
$("#collections").load("/ #collections");
$("#errors").load("/ #errors");
$("#collections").load("/old/ #collections");
$("#errors").load("/old/ #errors");
},
error: function(jqXHR, textStatus, errorThrown)
{
Expand Down
2 changes: 1 addition & 1 deletion public/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
var formElement = document.getElementById("submitForm");
var formData = new FormData(formElement);
formElement[0].value = '';

formElement[1].value = '';
//remove error message
if(document.getElementById("error")) {
var parent = document.getElementById("submitPanel")
Expand Down
Loading

0 comments on commit 80a6bf9

Please sign in to comment.