myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [2385] trunk: added main categories to content ty


From: noreply
Subject: [myexperiment-hackers] [2385] trunk: added main categories to content types
Date: Fri, 23 Apr 2010 05:07:03 -0400 (EDT)

Revision
2385
Author
dgc
Date
2010-04-23 05:07:02 -0400 (Fri, 23 Apr 2010)

Log Message

added main categories to content types

Modified Paths

Added Paths

Diff

Modified: trunk/app/views/content_types/show.rhtml (2384 => 2385)


--- trunk/app/views/content_types/show.rhtml	2010-04-21 15:59:46 UTC (rev 2384)
+++ trunk/app/views/content_types/show.rhtml	2010-04-23 09:07:02 UTC (rev 2385)
@@ -1,10 +1,10 @@
 <% t "#{h @content_type.title}" -%>
 
 <ul class="sectionIcons">
-  <li><%= icon('workflow', content_types_path, nil, nil, 'All Content Types')%></li>
+  <li><%= icon('workflow', content_types_path, nil, nil, 'All Types')%></li>
 </ul>
 
-<h1>Content Type: <%= h @content_type.title %></h1>
+<h1><%= visible_name(@content_type.category) -%> Type: <%= h @content_type.title %></h1>
 
 <div class="contribution_left_box">
 	
@@ -56,14 +56,14 @@
 
   <div class="contribution_section_box">
     <p class="heading">
-      <%= info_icon_with_tooltip("General statistics about this Content Type.") %>
+      <%= info_icon_with_tooltip("General statistics about this #{visible_name(@content_type.category)} Type.") %>
       Statistics
     </p>
     <p style="font-size: 108%;">
       <center>
 
         <% if @total_count.zero? %>
-          <p><small>There are no contributables in <%= Conf.sitename %> of this Content Type.</small></p>
+          <p><small>There are no contributables in <%= Conf.sitename %> of this <%= visible_name(@content_type.category) -%> Type.</small></p>
         <% else %>
           <ul>
             <% if @workflow_count > 0 %>

Added: trunk/config/base_schema.xml (0 => 2385)


--- trunk/config/base_schema.xml	                        (rev 0)
+++ trunk/config/base_schema.xml	2010-04-23 09:07:02 UTC (rev 2385)
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<schema>
+
+  <table name="content_types">
+
+    <column type="integer"  name="user_id"/>
+    <column type="string"   name="title"/>
+    <column type="text"     name="description"/>
+    <column type="text"     name="description_html"/>
+    <column type="string"   name="category"/>
+    <column type="string"   name="mime_type"/>
+    <column type="datetime" name="created_at"/>
+    <column type="datetime" name="updated_at"/>
+
+  </table>
+  
+</schema>
+

Added: trunk/db/migrate/084_assign_categories_to_content_types.rb (0 => 2385)


--- trunk/db/migrate/084_assign_categories_to_content_types.rb	                        (rev 0)
+++ trunk/db/migrate/084_assign_categories_to_content_types.rb	2010-04-23 09:07:02 UTC (rev 2385)
@@ -0,0 +1,23 @@
+# myExperiment: db/migrate/084_assign_categories_to_content_types.rb
+#
+# Copyright (c) 2010 University of Manchester and the University of Southampton.
+# See license.txt for details.
+
+class AssignCategoriesToContentTypes < ActiveRecord::Migration
+  def self.up
+    workflow_content_types = Workflow.find(:all).group_by do |w| w.content_type_id end.keys
+
+    ContentType.find(:all).each do |content_type|
+      if workflow_content_types.include?(content_type.id)
+        category = "Workflow"
+      else
+        category = "Blob"
+      end
+
+      content_type.update_attribute("category", category)
+    end
+  end
+
+  def self.down
+  end
+end

reply via email to

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