myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [2383] trunk: initial content type pages


From: noreply
Subject: [myexperiment-hackers] [2383] trunk: initial content type pages
Date: Wed, 21 Apr 2010 11:56:36 -0400 (EDT)

Revision
2383
Author
dgc
Date
2010-04-21 11:56:36 -0400 (Wed, 21 Apr 2010)

Log Message

initial content type pages

Modified Paths

Added Paths

Diff

Added: trunk/app/controllers/content_types_controller.rb (0 => 2383)


--- trunk/app/controllers/content_types_controller.rb	                        (rev 0)
+++ trunk/app/controllers/content_types_controller.rb	2010-04-21 15:56:36 UTC (rev 2383)
@@ -0,0 +1,47 @@
+# myExperiment: app/controllers/content_types_controller.rb
+#
+# Copyright (c) 2007 University of Manchester and the University of Southampton.
+# See license.txt for details.
+
+class ContentTypesController < ApplicationController
+
+  before_filter :find_content_type, : [ :show ]
+
+  # GET /content_types
+  def index
+
+    params[:num] = 25 unless params[:num]
+
+    @content_types = ContentType.find(:all,
+        :page => { :size => params[:num], :current => params[:page] })
+  end
+
+  # GET /content_types/1
+  def show
+    @workflow_count = Workflow.count(:conditions => ['content_type_id = ?', @content_type.id])
+    @blob_count = Blob.count(:conditions => ['content_type_id = ?', @content_type.id])
+
+    @total_count = @workflow_count + @blob_count
+  end
+
+  private
+
+  def find_content_type
+    @content_type = ContentType.find_by_id(params[:id])
+
+    if @content_type.nil?
+      error("Content type not found", "is invalid")
+      return false
+    end
+  end
+
+  def error(notice, message, attr=:id)
+    flash[:error] = notice
+     (err = ContentType.new.errors).add(attr, message)
+    
+    respond_to do |format|
+      format.html { redirect_to content_types_url }
+    end
+  end
+end
+

Modified: trunk/app/views/workflows/new.rhtml (2382 => 2383)


--- trunk/app/views/workflows/new.rhtml	2010-04-21 15:55:43 UTC (rev 2382)
+++ trunk/app/views/workflows/new.rhtml	2010-04-21 15:56:36 UTC (rev 2383)
@@ -54,12 +54,12 @@
 	
 	<br/>
 
-	<!-- Upload and save -->
+	<!-- Upload and Continue -->
 	
-	<p class="step_text">5. Upload and save</p>
+	<p class="step_text">5. Upload and Continue</p>
 
   <p style="text-align: center;">
-    <%= submit_tag "Upload and Save", :disable_with => "Uploading and saving..." %>
+    <%= submit_tag "Upload and Continue", :disable_with => "Uploading..." %>
   </p>
   
 <% end %>

Modified: trunk/app/views/workflows/show.rhtml (2382 => 2383)


--- trunk/app/views/workflows/show.rhtml	2010-04-21 15:55:43 UTC (rev 2382)
+++ trunk/app/views/workflows/show.rhtml	2010-04-21 15:56:36 UTC (rev 2383)
@@ -148,7 +148,7 @@
 			
 			<p>
 				<b>Type:</b>
-				<%= h(@workflow.type_display_name) %>
+				<%= link_to(h(@workflow.content_type.title), content_type_path(@workflow.content_type)) %>
 			</p>
 			
 			<br/>
@@ -273,8 +273,9 @@
 </div>
 
 <div class="contribution_right_box">
-	<div class="contribution_section_box" style= "font-size: 100%; color: #CC0000; padding: 0.7em 0.9em; font-weight: bold;">
-		<%= @workflow.type_display_name -%> workflow
+	<div class="contribution_section_box" style= "font-size: 100%; padding: 0.7em 0.9em; font-weight: bold;">
+		<p><%= info_icon_with_tooltip("The type of workflow system that this Workflow is designed for.") %> Workflow Type</p>
+    <p><%= link_to(h(@workflow.content_type.title), content_type_path(@workflow.content_type)) %></p>
 	</div>
 	
 	<%= render :partial => "contributions/uploader_box", :locals => { :contributable => @workflow } %>

Modified: trunk/config/routes.rb (2382 => 2383)


--- trunk/config/routes.rb	2010-04-21 15:55:43 UTC (rev 2382)
+++ trunk/config/routes.rb	2010-04-21 15:56:36 UTC (rev 2383)
@@ -119,6 +119,9 @@
     blog.resources :blog_posts
   end
   
+  # content_types
+  map.resources :content_types
+
   # all downloads and viewings
   map.resources :downloads, :viewings
 

Modified: trunk/public/_javascript_s/tag_suggestions.js (2382 => 2383)


--- trunk/public/_javascript_s/tag_suggestions.js	2010-04-21 15:55:43 UTC (rev 2382)
+++ trunk/public/_javascript_s/tag_suggestions.js	2010-04-21 15:56:36 UTC (rev 2383)
@@ -43,7 +43,6 @@
 
   separator  = ' <span style="color: #999999;">|</span> ';
   markup     = "";
-  submitText = "";
   summary    = "";
 
   if (suggestions.length == 0) {
@@ -72,16 +71,13 @@
   }
 
   if (tagsToAdd.length == 0) {
-    submitText = 'Skip this step';
     summary = "<p>You have no tags to add to this workflow.</p>";
   } else {
-    submitText = 'Tag';
     summary = "<p>You are about tag this workflow with: " + commaList(tagsToAdd.sort()) + ".";
   }
 
   document.getElementById("suggestions").innerHTML  = markup;
   document.getElementById("tag_list").value         = tagsToAdd.join(", ");
-  document.getElementById("submit-button").value    = submitText;
   document.getElementById("summary-text").innerHTML = summary;
 }
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]