diff --git a/README b/README index b8e3569258ce9ba4eb234ee3204200e7ab9ba8ff..b90150ec5930bf65315f576f077f1d02f0b0677a 100644 --- a/README +++ b/README @@ -1,3 +1,23 @@ +== Welcome to ansaphonehandler + +To install: + + - create config/database.yml from config/database.yml.template + + - install ruby-mp3info (http://rubyforge.org/projects/ruby-mp3info/) + + - edit config/environment.rb, especially the application + configuration paths near the end of the file. + + - run "rake migrate". Edit RAILS_GEM_VERSION in + config/environment.rb if rake tells you to do so. + + - run "script/server". + + - point a browser at the URL that script/server prints. That's all! + +Below is the default Rails README file. + == Welcome to Rails Rails is a web-application and persistence framework that includes everything diff --git a/app/controllers/recordings_controller.rb b/app/controllers/recordings_controller.rb index 4c9879a7e44346a59933051d5525fbe8109d8a85..86f0e9bf352485037da0cf38c2af557cadc164be 100644 --- a/app/controllers/recordings_controller.rb +++ b/app/controllers/recordings_controller.rb @@ -11,7 +11,8 @@ class RecordingsController < ApplicationController :redirect_to => { :action => :list } def list - @recording_pages, @recordings = paginate :recordings, :per_page => 10 + @recording_pages, @recordings = paginate :recordings, :per_page => 10, + :order => "`when` desc" end def list_owned @@ -80,7 +81,7 @@ class RecordingsController < ApplicationController def import @recordings = [] - dir = "/home/ceder/incoming-samples" + dir = VOICE_SPOOL Dir.entries(dir + "/incoming").each do |filename| if filename =~ /^v-([0-9]+)-([0-9]+)-([A-Z0-9]+)\.rmd$/ pid = $1 @@ -107,8 +108,8 @@ class RecordingsController < ApplicationController :archived => 0) recording.save! @recordings << recording - # File.rename(dir + "/incoming/" + filename, - # dir + "/archived/" + filename) + File.rename(dir + "/incoming/" + filename, + dir + "/archived/" + filename) end end @recordings.sort! diff --git a/app/views/recordings/_form.rhtml b/app/views/recordings/_form.rhtml index 91d7548f846b730f6cd1455aa8852a4eca17bf0e..4823d6abe339d005cb2009dd377fc3fba83d3b3d 100644 --- a/app/views/recordings/_form.rhtml +++ b/app/views/recordings/_form.rhtml @@ -1,17 +1,11 @@ <%= error_messages_for 'recording' %> <!--[form:recording]--> -<p><label for="recording_cid">Cid</label><br/> -<%= text_field 'recording', 'cid' %></p> - <p><label for="recording_from">From</label><br/> <%= text_field 'recording', 'from' %></p> -<p><label for="recording_when">When</label><br/> -<%= datetime_select 'recording', 'when' %></p> - -<p><label for="recording_file">File</label><br/> -<%= text_field 'recording', 'file' %></p> +<p><label for="recording_from">Comment</label><br/> +<%= text_field 'recording', 'comment' %></p> <p><label for="recording_seen">Seen</label><br/> <%= text_field 'recording', 'seen' %></p> diff --git a/app/views/recordings/_list.rhtml b/app/views/recordings/_list.rhtml index 0d496df06354bcf6990c0fd8b113fddd41bdda93..4c9a7fa1696038c7979477a0504b06dffbd7fd58 100644 --- a/app/views/recordings/_list.rhtml +++ b/app/views/recordings/_list.rhtml @@ -9,15 +9,17 @@ <table border="1"> <tr> - <th> </th> + <th colspan="2"> </th> <% for column_name in sorted_columns %> <th><%= Recording.columns_hash[column_name].human_name %></th> <%end%> + <th> </th> </tr> <% for recording in @recordings %> <tr> <td><%= link_to 'Play', :action => 'play', :id => recording %></td> + <td><%= link_to 'Edit', :action => 'edit', :id => recording %></td> <% for column_name in sorted_columns %> <td> <% case column_name @@ -31,8 +33,6 @@ </td> <% end %> <td><%= link_to 'Show', :action => 'show', :id => recording %></td> - <td><%= link_to 'Edit', :action => 'edit', :id => recording %></td> - <td><%= link_to 'Destroy', { :action => 'destroy', :id => recording }, :confirm => 'Are you sure?', :post => true %></td> </tr> <% end %> </table> diff --git a/app/views/recordings/list.rhtml b/app/views/recordings/list.rhtml index f8a71483b9e14bce7de097b756ceb22d0df37d2c..d15ad35a0f2f5cde4ba270e5eb59a459444dd7da 100644 --- a/app/views/recordings/list.rhtml +++ b/app/views/recordings/list.rhtml @@ -6,5 +6,3 @@ <%= link_to 'Next page', { :page => @recording_pages.current.next } if @recording_pages.current.next %> <br /> - -<%= link_to 'New recording', :action => 'new' %> diff --git a/app/views/recordings/list_owned.rhtml b/app/views/recordings/list_owned.rhtml index 39e06b652958b02139060e47b0519655c953a09f..83c55c67351b03318fbd24dde12d15b866174967 100644 --- a/app/views/recordings/list_owned.rhtml +++ b/app/views/recordings/list_owned.rhtml @@ -10,5 +10,3 @@ :user_id => @owner.id } if @recording_pages.current.next %> <br /> - -<%= link_to 'New recording', :action => 'new' %> diff --git a/config/environment.rb b/config/environment.rb index 667638f6d292c275701b4c232a6a9ee9401dacfa..bf7ee9db0ae40f5d3859562e29d5cc2eac8e2740 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -5,7 +5,7 @@ # ENV['RAILS_ENV'] ||= 'production' # Specifies gem version of Rails to use when vendor/rails is not present -RAILS_GEM_VERSION = '1.1.2' +RAILS_GEM_VERSION = '1.1.4' # Bootstrap the Rails environment, frameworks, and default configuration require File.join(File.dirname(__FILE__), 'boot') @@ -50,4 +50,6 @@ end # inflect.uncountable %w( fish sheep ) # end -# Include your application configuration below \ No newline at end of file +# Include your application configuration below + +VOICE_SPOOL = "/var/spool/voice"