[23800] users/jberry/mpwa/app

source_changes at macosforge.org source_changes at macosforge.org
Mon Apr 9 21:34:32 PDT 2007


Revision: 23800
          http://trac.macosforge.org/projects/macports/changeset/23800
Author:   jberry at macports.org
Date:     2007-04-09 21:34:31 -0700 (Mon, 09 Apr 2007)

Log Message:
-----------
mpwa: for a given port_pkg, show the list of files it contains.
Next up: links to access the files themselves, served using their mimetype!

Modified Paths:
--------------
    users/jberry/mpwa/app/models/port_pkg.rb
    users/jberry/mpwa/app/views/port_pkg/show.rhtml
    users/jberry/mpwa/app/views/port_pkg_file/_form.rhtml
    users/jberry/mpwa/app/views/port_pkg_file/show.rhtml

Modified: users/jberry/mpwa/app/models/port_pkg.rb
===================================================================
--- users/jberry/mpwa/app/models/port_pkg.rb	2007-04-10 04:08:22 UTC (rev 23799)
+++ users/jberry/mpwa/app/models/port_pkg.rb	2007-04-10 04:34:31 UTC (rev 23800)
@@ -55,7 +55,6 @@
             end
         end
         name = info['name']
-        puts "name: #{name}"
         raise "badpkg" if name.nil?
         
         # Ensure a port for this pkg

Modified: users/jberry/mpwa/app/views/port_pkg/show.rhtml
===================================================================
--- users/jberry/mpwa/app/views/port_pkg/show.rhtml	2007-04-10 04:08:22 UTC (rev 23799)
+++ users/jberry/mpwa/app/views/port_pkg/show.rhtml	2007-04-10 04:34:31 UTC (rev 23800)
@@ -10,6 +10,13 @@
 <h4>Submitter</h4>
 <p><%= link_to @port_pkg.submitter.user_name, :controller => 'person', :action => 'show', :id => @port_pkg.submitter %></p>
 
+<h4>Files</h4>
+<p>
+	<% for file in @port_pkg.files %>
+		<%= link_to file.file_path, :controller => 'port_pkg_file', :action => 'show', :id => file %><br />
+	<% end %>
+</p>
+
 <h4>Tags</h4>
 <p>
 	<% for tag in @port_pkg.tags %>

Modified: users/jberry/mpwa/app/views/port_pkg_file/_form.rhtml
===================================================================
--- users/jberry/mpwa/app/views/port_pkg_file/_form.rhtml	2007-04-10 04:08:22 UTC (rev 23799)
+++ users/jberry/mpwa/app/views/port_pkg_file/_form.rhtml	2007-04-10 04:34:31 UTC (rev 23800)
@@ -1,10 +1,18 @@
 <%= error_messages_for 'port_pkg_file' %>
 
 <!--[form:port_pkg_file]-->
-<p><label for="port_pkg_file_name">Name</label><br/>
-<%= text_field 'port_pkg_file', 'name'  %></p>
+<p><label for="port_pkg_file_file_path">Pathname</label><br/>
+<%= text_field 'port_pkg_file', 'file_path'  %></p>
 
-<p><label for="port_pkg_file_data">Data</label><br/>
+<p><label for="port_pkg_file_length">Length</label><br/>
+<%= text_field 'port_pkg_file', 'length'  %></p>
+
+<p><label for="port_pkg_file_mime_type">Length</label><br/>
+<%= text_field 'port_pkg_file', 'mime_type'  %></p>
+
+<p><label for="port_pkg_file_sha256">Length</label><br/>
+<%= text_field 'port_pkg_file', 'sha256'  %></p>
+
 </p>
 <!--[eoform:port_pkg_file]-->
 

Modified: users/jberry/mpwa/app/views/port_pkg_file/show.rhtml
===================================================================
--- users/jberry/mpwa/app/views/port_pkg_file/show.rhtml	2007-04-10 04:08:22 UTC (rev 23799)
+++ users/jberry/mpwa/app/views/port_pkg_file/show.rhtml	2007-04-10 04:34:31 UTC (rev 23800)
@@ -4,5 +4,14 @@
 </p>
 <% end %>
 
+<p>
+  <b>Port</b>
+	<%= link_to @port_pkg_file.port_pkg.port.name, :controller => 'port', :action => 'show',
+		:id => @port_pkg_file.port_pkg.port %><br />
+  <b>PortPkg</b>
+	<%= link_to @port_pkg_file.port_pkg.id, :controller => 'port_pkg', :action => 'show',
+		:id => @port_pkg_file.port_pkg %>
+</p>
+
 <%= link_to 'Edit', :action => 'edit', :id => @port_pkg_file %> |
 <%= link_to 'Back', :action => 'list' %>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070409/7499fe4d/attachment.html


More information about the macports-changes mailing list