changeset 328:aed18b463206 feature_36

Created the "author", "publication" and "authorship" models and controllers.
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Tue, 29 Mar 2011 14:33:32 +0100
parents a41158bde9e0
children 4575b631f6ce
files vendor/plugins/redmine_bibliography/app/controllers/authors_controller.rb vendor/plugins/redmine_bibliography/app/controllers/authorships_controller.rb vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb vendor/plugins/redmine_bibliography/app/helpers/authors_helper.rb vendor/plugins/redmine_bibliography/app/helpers/authorships_helper.rb vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb vendor/plugins/redmine_bibliography/app/models/author.rb vendor/plugins/redmine_bibliography/app/models/authorship.rb vendor/plugins/redmine_bibliography/app/models/publication.rb vendor/plugins/redmine_bibliography/app/views/authors/index.html.erb vendor/plugins/redmine_bibliography/app/views/authorships/update.html.erb vendor/plugins/redmine_bibliography/app/views/publications/create.html.erb vendor/plugins/redmine_bibliography/app/views/publications/edit.html.erb vendor/plugins/redmine_bibliography/app/views/publications/index.html.erb vendor/plugins/redmine_bibliography/app/views/publications/update.html.erb vendor/plugins/redmine_bibliography/db/migrate/001_create_authors.rb vendor/plugins/redmine_bibliography/db/migrate/002_create_publications.rb vendor/plugins/redmine_bibliography/db/migrate/003_create_authorships.rb vendor/plugins/redmine_bibliography/test/fixtures/authors.yml vendor/plugins/redmine_bibliography/test/fixtures/authorships.yml vendor/plugins/redmine_bibliography/test/fixtures/publications.yml vendor/plugins/redmine_bibliography/test/functional/authors_controller_test.rb vendor/plugins/redmine_bibliography/test/functional/authorships_controller_test.rb vendor/plugins/redmine_bibliography/test/functional/publications_controller_test.rb vendor/plugins/redmine_bibliography/test/unit/author_test.rb vendor/plugins/redmine_bibliography/test/unit/authorship_test.rb vendor/plugins/redmine_bibliography/test/unit/publication_test.rb
diffstat 27 files changed, 191 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/controllers/authors_controller.rb	Tue Mar 29 14:33:32 2011 +0100
@@ -0,0 +1,7 @@
+class AuthorsController < ApplicationController
+  
+  def index
+    @authors = Author.find(:all)
+
+  end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/controllers/authorships_controller.rb	Tue Mar 29 14:33:32 2011 +0100
@@ -0,0 +1,10 @@
+class AuthorshipsController < ApplicationController
+  
+  def index
+    
+  end
+  
+
+  def update
+  end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb	Tue Mar 29 14:33:32 2011 +0100
@@ -0,0 +1,16 @@
+class PublicationsController < ApplicationController
+  unloadable
+
+
+  def index
+  end
+
+  def create
+  end
+
+  def edit
+  end
+
+  def update
+  end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/helpers/authors_helper.rb	Tue Mar 29 14:33:32 2011 +0100
@@ -0,0 +1,2 @@
+module AuthorsHelper
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/helpers/authorships_helper.rb	Tue Mar 29 14:33:32 2011 +0100
@@ -0,0 +1,2 @@
+module AuthorshipsHelper
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb	Tue Mar 29 14:33:32 2011 +0100
@@ -0,0 +1,2 @@
+module PublicationsHelper
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/models/author.rb	Tue Mar 29 14:33:32 2011 +0100
@@ -0,0 +1,4 @@
+class Author < ActiveRecord::Base
+  has_many :authorships
+  has_many :publications, :through => :authorships
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/models/authorship.rb	Tue Mar 29 14:33:32 2011 +0100
@@ -0,0 +1,4 @@
+class Authorship < ActiveRecord::Base
+  belongs_to :author
+  belongs_to :publication
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/models/publication.rb	Tue Mar 29 14:33:32 2011 +0100
@@ -0,0 +1,4 @@
+class Publication < ActiveRecord::Base
+  has_many :authorships
+  has_many :authors, :through => :authorships
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/authors/index.html.erb	Tue Mar 29 14:33:32 2011 +0100
@@ -0,0 +1,5 @@
+<h2>Authors#index</h2>
+
+<% @authors.each do |author| %>
+	<%= author.id %>
+<% end %>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/authorships/update.html.erb	Tue Mar 29 14:33:32 2011 +0100
@@ -0,0 +1,1 @@
+<h2>Authorships#update</h2>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/create.html.erb	Tue Mar 29 14:33:32 2011 +0100
@@ -0,0 +1,1 @@
+<h2>Publications#create</h2>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/edit.html.erb	Tue Mar 29 14:33:32 2011 +0100
@@ -0,0 +1,1 @@
+<h2>Publications#edit</h2>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/index.html.erb	Tue Mar 29 14:33:32 2011 +0100
@@ -0,0 +1,1 @@
+<h2>Publications#index</h2>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/update.html.erb	Tue Mar 29 14:33:32 2011 +0100
@@ -0,0 +1,1 @@
+<h2>Publications#update</h2>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/db/migrate/001_create_authors.rb	Tue Mar 29 14:33:32 2011 +0100
@@ -0,0 +1,11 @@
+class CreateAuthors < ActiveRecord::Migration
+  def self.up
+    create_table :authors do |t|
+      t.column :user_id, :integer
+    end
+  end
+
+  def self.down
+    drop_table :authors
+  end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/db/migrate/002_create_publications.rb	Tue Mar 29 14:33:32 2011 +0100
@@ -0,0 +1,12 @@
+class CreatePublications < ActiveRecord::Migration
+  def self.up
+    create_table :publications do |t|
+      t.column :title, :string
+      t.column :bibtex_entry_id, :string
+    end
+  end
+
+  def self.down
+    drop_table :publications
+  end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/db/migrate/003_create_authorships.rb	Tue Mar 29 14:33:32 2011 +0100
@@ -0,0 +1,16 @@
+class CreateAuthorships < ActiveRecord::Migration
+  def self.up
+    create_table :authorships do |t|
+      t.column :author_id, :integer
+      t.column :publication_id, :integer
+      t.column :name_on_paper, :string
+      t.column :order, :integer
+      t.column :institution, :string
+      t.column :email, :string
+    end
+  end
+
+  def self.down
+    drop_table :authorships
+  end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/test/fixtures/authors.yml	Tue Mar 29 14:33:32 2011 +0100
@@ -0,0 +1,11 @@
+# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
+one:
+  id: 1
+  user_id: 1
+  firstname: MyString
+  lastname: MyString
+two:
+  id: 2
+  user_id: 1
+  firstname: MyString
+  lastname: MyString
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/test/fixtures/authorships.yml	Tue Mar 29 14:33:32 2011 +0100
@@ -0,0 +1,17 @@
+# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
+one:
+  id: 1
+  author_id: 
+  publication_id: 
+  name_on_paper: 
+  order: 
+  institution: 
+  email: MyString
+two:
+  id: 2
+  author_id: 
+  publication_id: 
+  name_on_paper: 
+  order: 
+  institution: 
+  email: MyString
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/test/fixtures/publications.yml	Tue Mar 29 14:33:32 2011 +0100
@@ -0,0 +1,9 @@
+# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
+one:
+  id: 1
+  title: MyString
+  bibtex_entry_id: MyString
+two:
+  id: 2
+  title: MyString
+  bibtex_entry_id: MyString
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/test/functional/authors_controller_test.rb	Tue Mar 29 14:33:32 2011 +0100
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../test_helper'
+
+class AuthorsControllerTest < ActionController::TestCase
+  # Replace this with your real tests.
+  def test_truth
+    assert true
+  end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/test/functional/authorships_controller_test.rb	Tue Mar 29 14:33:32 2011 +0100
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../test_helper'
+
+class AuthorshipsControllerTest < ActionController::TestCase
+  # Replace this with your real tests.
+  def test_truth
+    assert true
+  end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/test/functional/publications_controller_test.rb	Tue Mar 29 14:33:32 2011 +0100
@@ -0,0 +1,8 @@
+require File.dirname(__FILE__) + '/../test_helper'
+
+class PublicationsControllerTest < ActionController::TestCase
+  # Replace this with your real tests.
+  def test_truth
+    assert true
+  end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/test/unit/author_test.rb	Tue Mar 29 14:33:32 2011 +0100
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../test_helper'
+
+class AuthorTest < ActiveSupport::TestCase
+  fixtures :authors
+
+  # Replace this with your real tests.
+  def test_truth
+    assert true
+  end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/test/unit/authorship_test.rb	Tue Mar 29 14:33:32 2011 +0100
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../test_helper'
+
+class AuthorshipTest < ActiveSupport::TestCase
+  fixtures :authorships
+
+  # Replace this with your real tests.
+  def test_truth
+    assert true
+  end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/test/unit/publication_test.rb	Tue Mar 29 14:33:32 2011 +0100
@@ -0,0 +1,10 @@
+require File.dirname(__FILE__) + '/../test_helper'
+
+class PublicationTest < ActiveSupport::TestCase
+  fixtures :publications
+
+  # Replace this with your real tests.
+  def test_truth
+    assert true
+  end
+end