Skip to content
Snippets Groups Projects
Commit b8d4033e authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Only edit fields that should be editable, and more.

Added VOICE_SPOOL configuration.  Adjust to moria settings.  Only edit
fields that should be editable.  Make the list prettier.  Sort the
list output.
parent f1f4108e
No related branches found
No related tags found
No related merge requests found
== 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 == Welcome to Rails
Rails is a web-application and persistence framework that includes everything Rails is a web-application and persistence framework that includes everything
......
...@@ -11,7 +11,8 @@ class RecordingsController < ApplicationController ...@@ -11,7 +11,8 @@ class RecordingsController < ApplicationController
:redirect_to => { :action => :list } :redirect_to => { :action => :list }
def list def list
@recording_pages, @recordings = paginate :recordings, :per_page => 10 @recording_pages, @recordings = paginate :recordings, :per_page => 10,
:order => "`when` desc"
end end
def list_owned def list_owned
...@@ -80,7 +81,7 @@ class RecordingsController < ApplicationController ...@@ -80,7 +81,7 @@ class RecordingsController < ApplicationController
def import def import
@recordings = [] @recordings = []
dir = "/home/ceder/incoming-samples" dir = VOICE_SPOOL
Dir.entries(dir + "/incoming").each do |filename| Dir.entries(dir + "/incoming").each do |filename|
if filename =~ /^v-([0-9]+)-([0-9]+)-([A-Z0-9]+)\.rmd$/ if filename =~ /^v-([0-9]+)-([0-9]+)-([A-Z0-9]+)\.rmd$/
pid = $1 pid = $1
...@@ -107,8 +108,8 @@ class RecordingsController < ApplicationController ...@@ -107,8 +108,8 @@ class RecordingsController < ApplicationController
:archived => 0) :archived => 0)
recording.save! recording.save!
@recordings << recording @recordings << recording
# File.rename(dir + "/incoming/" + filename, File.rename(dir + "/incoming/" + filename,
# dir + "/archived/" + filename) dir + "/archived/" + filename)
end end
end end
@recordings.sort! @recordings.sort!
......
<%= error_messages_for 'recording' %> <%= error_messages_for 'recording' %>
<!--[form:recording]--> <!--[form:recording]-->
<p><label for="recording_cid">Cid</label><br/>
<%= text_field 'recording', 'cid' %></p>
<p><label for="recording_from">From</label><br/> <p><label for="recording_from">From</label><br/>
<%= text_field 'recording', 'from' %></p> <%= text_field 'recording', 'from' %></p>
<p><label for="recording_when">When</label><br/> <p><label for="recording_from">Comment</label><br/>
<%= datetime_select 'recording', 'when' %></p> <%= text_field 'recording', 'comment' %></p>
<p><label for="recording_file">File</label><br/>
<%= text_field 'recording', 'file' %></p>
<p><label for="recording_seen">Seen</label><br/> <p><label for="recording_seen">Seen</label><br/>
<%= text_field 'recording', 'seen' %></p> <%= text_field 'recording', 'seen' %></p>
......
...@@ -9,15 +9,17 @@ ...@@ -9,15 +9,17 @@
<table border="1"> <table border="1">
<tr> <tr>
<th>&nbsp;</th> <th colspan="2">&nbsp;</th>
<% for column_name in sorted_columns %> <% for column_name in sorted_columns %>
<th><%= Recording.columns_hash[column_name].human_name %></th> <th><%= Recording.columns_hash[column_name].human_name %></th>
<%end%> <%end%>
<th>&nbsp;</th>
</tr> </tr>
<% for recording in @recordings %> <% for recording in @recordings %>
<tr> <tr>
<td><%= link_to 'Play', :action => 'play', :id => recording %></td> <td><%= link_to 'Play', :action => 'play', :id => recording %></td>
<td><%= link_to 'Edit', :action => 'edit', :id => recording %></td>
<% for column_name in sorted_columns %> <% for column_name in sorted_columns %>
<td> <td>
<% case column_name <% case column_name
...@@ -31,8 +33,6 @@ ...@@ -31,8 +33,6 @@
</td> </td>
<% end %> <% end %>
<td><%= link_to 'Show', :action => 'show', :id => recording %></td> <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> </tr>
<% end %> <% end %>
</table> </table>
...@@ -6,5 +6,3 @@ ...@@ -6,5 +6,3 @@
<%= link_to 'Next page', { :page => @recording_pages.current.next } if @recording_pages.current.next %> <%= link_to 'Next page', { :page => @recording_pages.current.next } if @recording_pages.current.next %>
<br /> <br />
<%= link_to 'New recording', :action => 'new' %>
...@@ -10,5 +10,3 @@ ...@@ -10,5 +10,3 @@
:user_id => @owner.id } if @recording_pages.current.next %> :user_id => @owner.id } if @recording_pages.current.next %>
<br /> <br />
<%= link_to 'New recording', :action => 'new' %>
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# ENV['RAILS_ENV'] ||= 'production' # ENV['RAILS_ENV'] ||= 'production'
# Specifies gem version of Rails to use when vendor/rails is not present # 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 # Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot') require File.join(File.dirname(__FILE__), 'boot')
...@@ -51,3 +51,5 @@ end ...@@ -51,3 +51,5 @@ end
# end # end
# Include your application configuration below # Include your application configuration below
VOICE_SPOOL = "/var/spool/voice"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment