diff --git a/.gitignore b/.gitignore
index cf96fa998..2524dd184 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,4 +10,5 @@
/public/images/avatars/*
/Gemfile
/Gemfile.lock
-/db/schema.da
+/db/schema.rb
+/Gemfile.lock
\ No newline at end of file
diff --git a/.metadata/.lock b/.metadata/.lock
new file mode 100644
index 000000000..e69de29bb
diff --git a/.metadata/.log b/.metadata/.log
new file mode 100644
index 000000000..0cb16378c
--- /dev/null
+++ b/.metadata/.log
@@ -0,0 +1,211 @@
+!SESSION 2014-03-11 16:33:06.446 -----------------------------------------------
+eclipse.buildId=3.4.0.201304151603
+java.version=1.6.0_24
+java.vendor=Sun Microsystems Inc.
+BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=zh_CN
+Command-line arguments: -os win32 -ws win32 -arch x86
+
+!ENTRY org.eclipse.equinox.p2.transport.ecf 2 0 2014-03-11 16:33:20.829
+!MESSAGE Connection to http://download.aptana.com/studio3-rcp/plugin/update/p2.index failed on download.aptana.com. Retry attempt 0 started
+!STACK 0
+java.net.UnknownHostException: download.aptana.com
+ at java.net.PlainSocketImpl.connect(Unknown Source)
+ at java.net.SocksSocketImpl.connect(Unknown Source)
+ at java.net.Socket.connect(Unknown Source)
+ at org.eclipse.ecf.provider.filetransfer.events.socket.SocketEventCreateUtil.createSocket(SocketEventCreateUtil.java:43)
+ at org.eclipse.ecf.internal.provider.filetransfer.httpclient.ECFHttpClientProtocolSocketFactory.createSocket(ECFHttpClientProtocolSocketFactory.java:81)
+ at org.eclipse.ecf.internal.provider.filetransfer.httpclient.ECFHttpClientProtocolSocketFactory.createSocket(ECFHttpClientProtocolSocketFactory.java:73)
+ at org.eclipse.ecf.internal.provider.filetransfer.httpclient.ECFHttpClientProtocolSocketFactory.createSocket(ECFHttpClientProtocolSocketFactory.java:65)
+ at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
+ at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
+ at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
+ at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
+ at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
+ at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
+ at org.eclipse.ecf.provider.filetransfer.httpclient.HttpClientRetrieveFileTransfer.performConnect(HttpClientRetrieveFileTransfer.java:1142)
+ at org.eclipse.ecf.provider.filetransfer.httpclient.HttpClientRetrieveFileTransfer.openStreams(HttpClientRetrieveFileTransfer.java:710)
+ at org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer.sendRetrieveRequest(AbstractRetrieveFileTransfer.java:889)
+ at org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer.sendRetrieveRequest(AbstractRetrieveFileTransfer.java:576)
+ at org.eclipse.ecf.provider.filetransfer.retrieve.MultiProtocolRetrieveAdapter.sendRetrieveRequest(MultiProtocolRetrieveAdapter.java:106)
+ at org.eclipse.equinox.internal.p2.transport.ecf.FileReader.sendRetrieveRequest(FileReader.java:349)
+ at org.eclipse.equinox.internal.p2.transport.ecf.FileReader.readInto(FileReader.java:295)
+ at org.eclipse.equinox.internal.p2.transport.ecf.RepositoryTransport.download(RepositoryTransport.java:87)
+ at org.eclipse.equinox.internal.p2.transport.ecf.RepositoryTransport.download(RepositoryTransport.java:137)
+ at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadIndexFile(AbstractRepositoryManager.java:721)
+ at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:640)
+ at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:96)
+ at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:92)
+ at org.eclipse.equinox.internal.p2.updatechecker.UpdateChecker.getAvailableRepositories(UpdateChecker.java:150)
+ at org.eclipse.equinox.internal.p2.updatechecker.UpdateChecker.checkForUpdates(UpdateChecker.java:128)
+ at org.eclipse.equinox.internal.p2.updatechecker.UpdateChecker$UpdateCheckThread.run(UpdateChecker.java:72)
+
+!ENTRY org.eclipse.equinox.p2.transport.ecf 4 1006 2014-03-11 16:33:21.110
+!MESSAGE Unknown Host: http://download.aptana.com/studio3-rcp/plugin/update/content.xml
+!STACK 0
+java.net.UnknownHostException: download.aptana.com
+ at java.net.PlainSocketImpl.connect(Unknown Source)
+ at java.net.SocksSocketImpl.connect(Unknown Source)
+ at java.net.Socket.connect(Unknown Source)
+ at org.eclipse.ecf.provider.filetransfer.events.socket.SocketEventCreateUtil.createSocket(SocketEventCreateUtil.java:43)
+ at org.eclipse.ecf.internal.provider.filetransfer.httpclient.ECFHttpClientProtocolSocketFactory.createSocket(ECFHttpClientProtocolSocketFactory.java:81)
+ at org.eclipse.ecf.internal.provider.filetransfer.httpclient.ECFHttpClientProtocolSocketFactory.createSocket(ECFHttpClientProtocolSocketFactory.java:73)
+ at org.eclipse.ecf.internal.provider.filetransfer.httpclient.ECFHttpClientProtocolSocketFactory.createSocket(ECFHttpClientProtocolSocketFactory.java:65)
+ at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
+ at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
+ at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
+ at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
+ at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
+ at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
+ at org.eclipse.ecf.provider.filetransfer.httpclient.HttpClientFileSystemBrowser.runRequest(HttpClientFileSystemBrowser.java:227)
+ at org.eclipse.ecf.provider.filetransfer.browse.AbstractFileSystemBrowser$DirectoryJob.run(AbstractFileSystemBrowser.java:69)
+ at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
+!SESSION 2014-03-11 16:46:11.935 -----------------------------------------------
+eclipse.buildId=3.4.0.201304151603
+java.version=1.6.0_24
+java.vendor=Sun Microsystems Inc.
+BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=zh_CN
+Command-line arguments: -os win32 -ws win32 -arch x86
+
+!ENTRY org.eclipse.equinox.p2.transport.ecf 2 0 2014-03-11 16:46:21.061
+!MESSAGE Connection to http://download.aptana.com/studio3-rcp/plugin/update/p2.index failed on download.aptana.com. Retry attempt 0 started
+!STACK 0
+java.net.UnknownHostException: download.aptana.com
+ at java.net.PlainSocketImpl.connect(Unknown Source)
+ at java.net.SocksSocketImpl.connect(Unknown Source)
+ at java.net.Socket.connect(Unknown Source)
+ at org.eclipse.ecf.provider.filetransfer.events.socket.SocketEventCreateUtil.createSocket(SocketEventCreateUtil.java:43)
+ at org.eclipse.ecf.internal.provider.filetransfer.httpclient.ECFHttpClientProtocolSocketFactory.createSocket(ECFHttpClientProtocolSocketFactory.java:81)
+ at org.eclipse.ecf.internal.provider.filetransfer.httpclient.ECFHttpClientProtocolSocketFactory.createSocket(ECFHttpClientProtocolSocketFactory.java:73)
+ at org.eclipse.ecf.internal.provider.filetransfer.httpclient.ECFHttpClientProtocolSocketFactory.createSocket(ECFHttpClientProtocolSocketFactory.java:65)
+ at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
+ at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
+ at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
+ at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
+ at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
+ at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
+ at org.eclipse.ecf.provider.filetransfer.httpclient.HttpClientRetrieveFileTransfer.performConnect(HttpClientRetrieveFileTransfer.java:1142)
+ at org.eclipse.ecf.provider.filetransfer.httpclient.HttpClientRetrieveFileTransfer.openStreams(HttpClientRetrieveFileTransfer.java:710)
+ at org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer.sendRetrieveRequest(AbstractRetrieveFileTransfer.java:889)
+ at org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer.sendRetrieveRequest(AbstractRetrieveFileTransfer.java:576)
+ at org.eclipse.ecf.provider.filetransfer.retrieve.MultiProtocolRetrieveAdapter.sendRetrieveRequest(MultiProtocolRetrieveAdapter.java:106)
+ at org.eclipse.equinox.internal.p2.transport.ecf.FileReader.sendRetrieveRequest(FileReader.java:349)
+ at org.eclipse.equinox.internal.p2.transport.ecf.FileReader.readInto(FileReader.java:295)
+ at org.eclipse.equinox.internal.p2.transport.ecf.RepositoryTransport.download(RepositoryTransport.java:87)
+ at org.eclipse.equinox.internal.p2.transport.ecf.RepositoryTransport.download(RepositoryTransport.java:137)
+ at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadIndexFile(AbstractRepositoryManager.java:721)
+ at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:640)
+ at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:96)
+ at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:92)
+ at org.eclipse.equinox.internal.p2.updatechecker.UpdateChecker.getAvailableRepositories(UpdateChecker.java:150)
+ at org.eclipse.equinox.internal.p2.updatechecker.UpdateChecker.checkForUpdates(UpdateChecker.java:128)
+ at org.eclipse.equinox.internal.p2.updatechecker.UpdateChecker$UpdateCheckThread.run(UpdateChecker.java:72)
+
+!ENTRY org.eclipse.equinox.p2.transport.ecf 4 1006 2014-03-11 16:46:21.311
+!MESSAGE Unknown Host: http://download.aptana.com/studio3-rcp/plugin/update/content.xml
+!STACK 0
+java.net.UnknownHostException: download.aptana.com
+ at java.net.PlainSocketImpl.connect(Unknown Source)
+ at java.net.SocksSocketImpl.connect(Unknown Source)
+ at java.net.Socket.connect(Unknown Source)
+ at org.eclipse.ecf.provider.filetransfer.events.socket.SocketEventCreateUtil.createSocket(SocketEventCreateUtil.java:43)
+ at org.eclipse.ecf.internal.provider.filetransfer.httpclient.ECFHttpClientProtocolSocketFactory.createSocket(ECFHttpClientProtocolSocketFactory.java:81)
+ at org.eclipse.ecf.internal.provider.filetransfer.httpclient.ECFHttpClientProtocolSocketFactory.createSocket(ECFHttpClientProtocolSocketFactory.java:73)
+ at org.eclipse.ecf.internal.provider.filetransfer.httpclient.ECFHttpClientProtocolSocketFactory.createSocket(ECFHttpClientProtocolSocketFactory.java:65)
+ at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
+ at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
+ at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
+ at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
+ at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
+ at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
+ at org.eclipse.ecf.provider.filetransfer.httpclient.HttpClientFileSystemBrowser.runRequest(HttpClientFileSystemBrowser.java:227)
+ at org.eclipse.ecf.provider.filetransfer.browse.AbstractFileSystemBrowser$DirectoryJob.run(AbstractFileSystemBrowser.java:69)
+ at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
+
+!ENTRY org.eclipse.core.resources 4 1 2014-03-11 16:49:31.442
+!MESSAGE Problems occurred while refreshing local changes
+!SUBENTRY 1 org.eclipse.core.resources 4 1 2014-03-11 16:49:31.442
+!MESSAGE Problems occurred while refreshing local changes
+!STACK 1
+org.eclipse.core.internal.resources.ResourceException: Errors occurred while refreshing resources with the local file system.
+ at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:923)
+ at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904)
+ at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1663)
+ at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167)
+ at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
+ at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
+Contains: The project description file (.project) for 'trustie2' is missing. This file contains important information about the project. The project will not function properly until this file is restored.
+!SUBENTRY 2 org.eclipse.core.resources 4 271 2014-03-11 16:49:31.442
+!MESSAGE Errors occurred while refreshing resources with the local file system.
+!SUBENTRY 3 org.eclipse.core.resources 4 567 2014-03-11 16:49:31.442
+!MESSAGE The project description file (.project) for 'trustie2' is missing. This file contains important information about the project. The project will not function properly until this file is restored.
+
+!ENTRY com.aptana.ruby.core 4 0 2014-03-11 17:05:47.412
+!MESSAGE (eval):1: Use RbConfig instead of obsolete and deprecated Config.
+(eval):1: warning: variable $= is no longer effective
+(eval):1: warning: variable $KCODE is no longer effective
+(eval):1: warning: variable $KCODE is no longer effective
+D:/Users/nudt/AppData/Local/Aptana Studio 3/configuration/org.eclipse.osgi/bundles/93/1/.cp/ruby/core_stubber.rb:180:in `eval': Permission denied - E:\code\trustie\trustie2\.metadata\.plugins\com.aptana.ruby.core\1184073882\4 (Errno::EACCES)
+ from D:/Users/nudt/AppData/Local/Aptana Studio 3/configuration/org.eclipse.osgi/bundles/93/1/.cp/ruby/core_stubber.rb:180:in `eval'
+ from D:/Users/nudt/AppData/Local/Aptana Studio 3/configuration/org.eclipse.osgi/bundles/93/1/.cp/ruby/core_stubber.rb:180:in `block (3 levels) in '
+ from D:/Users/nudt/AppData/Local/Aptana Studio 3/configuration/org.eclipse.osgi/bundles/93/1/.cp/ruby/core_stubber.rb:179:in `each'
+ from D:/Users/nudt/AppData/Local/Aptana Studio 3/configuration/org.eclipse.osgi/bundles/93/1/.cp/ruby/core_stubber.rb:179:in `block (2 levels) in '
+ from D:/Users/nudt/AppData/Local/Aptana Studio 3/configuration/org.eclipse.osgi/bundles/93/1/.cp/ruby/core_stubber.rb:178:in `open'
+ from D:/Users/nudt/AppData/Local/Aptana Studio 3/configuration/org.eclipse.osgi/bundles/93/1/.cp/ruby/core_stubber.rb:178:in `block in '
+ from D:/Users/nudt/AppData/Local/Aptana Studio 3/configuration/org.eclipse.osgi/bundles/93/1/.cp/ruby/core_stubber.rb:152:in `each'
+ from D:/Users/nudt/AppData/Local/Aptana Studio 3/configuration/org.eclipse.osgi/bundles/93/1/.cp/ruby/core_stubber.rb:152:in `'
+
+
+!ENTRY com.aptana.ruby.core 4 0 2014-03-11 17:05:50.704
+!MESSAGE (Build 3.4.0.201304151603) [ERROR] Not supported yet.
+!STACK 0
+java.lang.UnsupportedOperationException: Not supported yet.
+ at org.jrubyparser.ast.LambdaNode.accept(LambdaNode.java:58)
+ at com.aptana.ruby.core.ast.AbstractVisitor.acceptNode(AbstractVisitor.java:37)
+ at com.aptana.ruby.core.ast.InOrderVisitor.visitHashNode(InOrderVisitor.java:414)
+ at org.jrubyparser.ast.HashNode.accept(HashNode.java:57)
+ at com.aptana.ruby.core.ast.AbstractVisitor.acceptNode(AbstractVisitor.java:37)
+ at com.aptana.ruby.core.ast.InOrderVisitor.visitCallNode(InOrderVisitor.java:193)
+ at com.aptana.ruby.core.ast.SourceElementVisitor.visitCallNode(SourceElementVisitor.java:230)
+ at org.jrubyparser.ast.CallNode.accept(CallNode.java:70)
+ at com.aptana.ruby.core.ast.AbstractVisitor.acceptNode(AbstractVisitor.java:53)
+ at com.aptana.ruby.core.ast.InOrderVisitor.visitLocalAsgnNode(InOrderVisitor.java:456)
+ at com.aptana.ruby.core.ast.SourceElementVisitor.visitLocalAsgnNode(SourceElementVisitor.java:839)
+ at org.jrubyparser.ast.LocalAsgnNode.accept(LocalAsgnNode.java:62)
+ at com.aptana.ruby.core.ast.AbstractVisitor.acceptNode(AbstractVisitor.java:53)
+ at com.aptana.ruby.core.ast.InOrderVisitor.visitIfNode(InOrderVisitor.java:438)
+ at org.jrubyparser.ast.IfNode.accept(IfNode.java:65)
+ at com.aptana.ruby.core.ast.AbstractVisitor.acceptNode(AbstractVisitor.java:53)
+ at com.aptana.ruby.core.ast.InOrderVisitor.visitNewlineNode(InOrderVisitor.java:525)
+ at org.jrubyparser.ast.NewlineNode.accept(NewlineNode.java:67)
+ at com.aptana.ruby.core.ast.AbstractVisitor.acceptNode(AbstractVisitor.java:37)
+ at com.aptana.ruby.core.ast.InOrderVisitor.visitDefnNode(InOrderVisitor.java:299)
+ at com.aptana.ruby.core.ast.SourceElementVisitor.visitDefnNode(SourceElementVisitor.java:346)
+ at org.jrubyparser.ast.DefnNode.accept(DefnNode.java:51)
+ at com.aptana.ruby.core.ast.AbstractVisitor.acceptNode(AbstractVisitor.java:53)
+ at com.aptana.ruby.core.ast.InOrderVisitor.visitNewlineNode(InOrderVisitor.java:525)
+ at org.jrubyparser.ast.NewlineNode.accept(NewlineNode.java:67)
+ at com.aptana.ruby.core.ast.AbstractVisitor.acceptNode(AbstractVisitor.java:37)
+ at com.aptana.ruby.core.ast.InOrderVisitor.visitClassNode(InOrderVisitor.java:213)
+ at com.aptana.ruby.core.ast.SourceElementVisitor.visitClassNode(SourceElementVisitor.java:260)
+ at org.jrubyparser.ast.ClassNode.accept(ClassNode.java:68)
+ at com.aptana.ruby.core.ast.AbstractVisitor.acceptNode(AbstractVisitor.java:53)
+ at com.aptana.ruby.core.ast.InOrderVisitor.visitNewlineNode(InOrderVisitor.java:525)
+ at org.jrubyparser.ast.NewlineNode.accept(NewlineNode.java:67)
+ at com.aptana.ruby.core.ast.AbstractVisitor.acceptNode(AbstractVisitor.java:37)
+ at com.aptana.ruby.core.ast.InOrderVisitor.visitModuleNode(InOrderVisitor.java:517)
+ at com.aptana.ruby.core.ast.SourceElementVisitor.visitModuleNode(SourceElementVisitor.java:824)
+ at org.jrubyparser.ast.ModuleNode.accept(ModuleNode.java:66)
+ at com.aptana.ruby.core.ast.AbstractVisitor.acceptNode(AbstractVisitor.java:53)
+ at com.aptana.ruby.core.ast.InOrderVisitor.visitNewlineNode(InOrderVisitor.java:525)
+ at org.jrubyparser.ast.NewlineNode.accept(NewlineNode.java:67)
+ at com.aptana.ruby.core.ast.AbstractVisitor.acceptNode(AbstractVisitor.java:37)
+ at com.aptana.ruby.core.ast.InOrderVisitor.visitRootNode(InOrderVisitor.java:668)
+ at com.aptana.ruby.core.ast.SourceElementVisitor.visitRootNode(SourceElementVisitor.java:848)
+ at org.jrubyparser.ast.RootNode.accept(RootNode.java:84)
+ at com.aptana.ruby.core.ast.AbstractVisitor.acceptNode(AbstractVisitor.java:53)
+ at com.aptana.ruby.internal.core.index.RubyFileIndexingParticipant.indexAST(RubyFileIndexingParticipant.java:73)
+ at com.aptana.ruby.internal.core.index.RubyFileIndexingParticipant.indexSource(RubyFileIndexingParticipant.java:61)
+ at com.aptana.ruby.internal.core.index.RubyFileIndexingParticipant.index(RubyFileIndexingParticipant.java:37)
+ at com.aptana.index.core.IndexRequestJob.indexFileStores(IndexRequestJob.java:205)
+ at com.aptana.index.core.IndexContainerJob.run(IndexContainerJob.java:114)
+ at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
diff --git a/.metadata/.plugins/com.aptana.core.io/connections.9 b/.metadata/.plugins/com.aptana.core.io/connections.9
new file mode 100644
index 000000000..4371c4759
--- /dev/null
+++ b/.metadata/.plugins/com.aptana.core.io/connections.9
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/.metadata/.plugins/com.aptana.index.core/2874248206.index b/.metadata/.plugins/com.aptana.index.core/2874248206.index
new file mode 100644
index 000000000..2200403a8
Binary files /dev/null and b/.metadata/.plugins/com.aptana.index.core/2874248206.index differ
diff --git a/.metadata/.plugins/com.aptana.index.core/2924452064.index b/.metadata/.plugins/com.aptana.index.core/2924452064.index
new file mode 100644
index 000000000..982acfcbc
Binary files /dev/null and b/.metadata/.plugins/com.aptana.index.core/2924452064.index differ
diff --git a/.metadata/.plugins/com.aptana.index.core/3084350319.index b/.metadata/.plugins/com.aptana.index.core/3084350319.index
new file mode 100644
index 000000000..bac4484c7
Binary files /dev/null and b/.metadata/.plugins/com.aptana.index.core/3084350319.index differ
diff --git a/.metadata/.plugins/com.aptana.index.core/3380472453.index b/.metadata/.plugins/com.aptana.index.core/3380472453.index
new file mode 100644
index 000000000..bac4484c7
Binary files /dev/null and b/.metadata/.plugins/com.aptana.index.core/3380472453.index differ
diff --git a/.metadata/.plugins/com.aptana.index.core/3406049957.index b/.metadata/.plugins/com.aptana.index.core/3406049957.index
new file mode 100644
index 000000000..70530b4a9
Binary files /dev/null and b/.metadata/.plugins/com.aptana.index.core/3406049957.index differ
diff --git a/.metadata/.plugins/com.aptana.index.core/4010369919.index b/.metadata/.plugins/com.aptana.index.core/4010369919.index
new file mode 100644
index 000000000..e2902378c
Binary files /dev/null and b/.metadata/.plugins/com.aptana.index.core/4010369919.index differ
diff --git a/.metadata/.plugins/com.aptana.index.core/645869811.index b/.metadata/.plugins/com.aptana.index.core/645869811.index
new file mode 100644
index 000000000..28be99cab
Binary files /dev/null and b/.metadata/.plugins/com.aptana.index.core/645869811.index differ
diff --git a/.metadata/.plugins/com.aptana.projects/dialog_settings.xml b/.metadata/.plugins/com.aptana.projects/dialog_settings.xml
new file mode 100644
index 000000000..1c46e88dd
--- /dev/null
+++ b/.metadata/.plugins/com.aptana.projects/dialog_settings.xml
@@ -0,0 +1,5 @@
+
+
diff --git a/.metadata/.plugins/com.aptana.ruby.core/1184073882/4/argumenterror.rb b/.metadata/.plugins/com.aptana.ruby.core/1184073882/4/argumenterror.rb
new file mode 100644
index 000000000..5ad22a1c4
--- /dev/null
+++ b/.metadata/.plugins/com.aptana.ruby.core/1184073882/4/argumenterror.rb
@@ -0,0 +1,11 @@
+class ArgumentError < StandardError
+
+
+
+
+ protected
+
+
+ private
+
+end
diff --git a/.metadata/.plugins/com.aptana.ruby.core/1184073882/4/constants.rb b/.metadata/.plugins/com.aptana.ruby.core/1184073882/4/constants.rb
new file mode 100644
index 000000000..7205e3807
--- /dev/null
+++ b/.metadata/.plugins/com.aptana.ruby.core/1184073882/4/constants.rb
@@ -0,0 +1,13 @@
+ARGV = []
+TRUE = true
+FALSE = false
+STDOUT = IO.new
+STDIN = IO.new
+STDERR = IO.new
+ENV = {}
+NIL = nil
+RUBY_PATCHLEVEL = 392
+RUBY_COPYRIGHT = 'ruby - Copyright (C) 1993-2013 Yukihiro Matsumoto'
+TOPLEVEL_BINDING = Binding.new
+RUBY_VERSION = '1.9.3'
+RUBY_PLATFORM = 'i386-mingw32'
diff --git a/.metadata/.plugins/com.aptana.ruby.core/1184073882/4/globals.rb b/.metadata/.plugins/com.aptana.ruby.core/1184073882/4/globals.rb
new file mode 100644
index 000000000..3e49c73b6
--- /dev/null
+++ b/.metadata/.plugins/com.aptana.ruby.core/1184073882/4/globals.rb
@@ -0,0 +1,24 @@
+$; = nil
+$-F = nil
+$@ = nil
+$! = nil
+$SAFE = 0
+$~ = nil
+$& = nil
+$` = nil
+$' = nil
+$+ = nil
+$= = false
+$KCODE = nil
+$-K = nil
+$, = nil
+$/ = "\n"
+$-0 = "\n"
+$\ = nil
+$_ = nil
+$stdin = IO.new
+$stdout = IO.new
+$stderr = IO.new
+$> = IO.new
+$< = ARGF
+$. = 0
diff --git a/.metadata/.plugins/com.aptana.ruby.ui/dialog_settings.xml b/.metadata/.plugins/com.aptana.ruby.ui/dialog_settings.xml
new file mode 100644
index 000000000..80f900fa3
--- /dev/null
+++ b/.metadata/.plugins/com.aptana.ruby.ui/dialog_settings.xml
@@ -0,0 +1,6 @@
+
+
diff --git a/.metadata/.plugins/com.aptana.syncing.core/defaultConnection.9 b/.metadata/.plugins/com.aptana.syncing.core/defaultConnection.9
new file mode 100644
index 000000000..375897785
--- /dev/null
+++ b/.metadata/.plugins/com.aptana.syncing.core/defaultConnection.9
@@ -0,0 +1,7 @@
+
+
+
+Default
+
+
+
\ No newline at end of file
diff --git a/.metadata/.plugins/com.aptana.syncing.core/sites.9 b/.metadata/.plugins/com.aptana.syncing.core/sites.9
new file mode 100644
index 000000000..d9b475695
--- /dev/null
+++ b/.metadata/.plugins/com.aptana.syncing.core/sites.9
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/.metadata/.plugins/com.aptana.webserver.core/webservers.8 b/.metadata/.plugins/com.aptana.webserver.core/webservers.8
new file mode 100644
index 000000000..5c07542b1
--- /dev/null
+++ b/.metadata/.plugins/com.aptana.webserver.core/webservers.8
@@ -0,0 +1,6 @@
+
+
+
+demo
+
+
\ No newline at end of file
diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/demo/.location b/.metadata/.plugins/org.eclipse.core.resources/.projects/demo/.location
new file mode 100644
index 000000000..6592acc5b
Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.projects/demo/.location differ
diff --git a/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version
new file mode 100644
index 000000000..25cb955ba
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index
new file mode 100644
index 000000000..fddafcbcd
Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index differ
diff --git a/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version
new file mode 100644
index 000000000..6b2aaa764
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/.metadata/.plugins/org.eclipse.core.resources/.root/2.tree b/.metadata/.plugins/org.eclipse.core.resources/.root/2.tree
new file mode 100644
index 000000000..5b2529389
Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.root/2.tree differ
diff --git a/.metadata/.plugins/org.eclipse.core.resources/.safetable/com.aptana.core.io.9 b/.metadata/.plugins/org.eclipse.core.resources/.safetable/com.aptana.core.io.9
new file mode 100644
index 000000000..0b4ef3b47
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.core.resources/.safetable/com.aptana.core.io.9
@@ -0,0 +1,3 @@
+#safe table
+#Tue Mar 11 17:27:27 CST 2014
+connections=connections.9
diff --git a/.metadata/.plugins/org.eclipse.core.resources/.safetable/com.aptana.syncing.core.9 b/.metadata/.plugins/org.eclipse.core.resources/.safetable/com.aptana.syncing.core.9
new file mode 100644
index 000000000..371e94161
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.core.resources/.safetable/com.aptana.syncing.core.9
@@ -0,0 +1,4 @@
+#safe table
+#Tue Mar 11 17:27:27 CST 2014
+defaultConnection=defaultConnection.9
+sites=sites.9
diff --git a/.metadata/.plugins/org.eclipse.core.resources/.safetable/com.aptana.webserver.core.8 b/.metadata/.plugins/org.eclipse.core.resources/.safetable/com.aptana.webserver.core.8
new file mode 100644
index 000000000..1af4b85d6
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.core.resources/.safetable/com.aptana.webserver.core.8
@@ -0,0 +1,3 @@
+#safe table
+#Tue Mar 11 17:27:27 CST 2014
+webservers=webservers.8
diff --git a/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources b/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources
new file mode 100644
index 000000000..b3b591e28
Binary files /dev/null and b/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources differ
diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.aptana.editor.common.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.aptana.editor.common.prefs
new file mode 100644
index 000000000..050277123
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.aptana.editor.common.prefs
@@ -0,0 +1,15 @@
+AbstractTextEditor.Color.Background=20,20,20
+AbstractTextEditor.Color.Background.SystemDefault=false
+AbstractTextEditor.Color.Foreground=248,248,248
+AbstractTextEditor.Color.Foreground.SystemDefault=false
+AbstractTextEditor.Color.SelectionForeground=248,248,248
+AbstractTextEditor.Color.SelectionForeground.SystemDefault=false
+CONFLICTING_COLOR=66,14,9
+INCOMING_COLOR=235,235,235
+OUTGOING_COLOR=235,235,235
+RESOLVED_COLOR=37,59,34
+additionIndicationColor=37,59,34
+changeIndicationColor=37,59,34
+currentLineColor=27,27,27
+deletionIndicationColor=66,14,9
+eclipse.preferences.version=1
diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.aptana.explorer.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.aptana.explorer.prefs
new file mode 100644
index 000000000..752d73cf4
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.aptana.explorer.prefs
@@ -0,0 +1,2 @@
+activeProject=demo
+eclipse.preferences.version=1
diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.aptana.js.core.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.aptana.js.core.prefs
new file mode 100644
index 000000000..8611f3f02
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.aptana.js.core.prefs
@@ -0,0 +1,2 @@
+JS_INDEX_VERSION=0.36
+eclipse.preferences.version=1
diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.aptana.portal.ui.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.aptana.portal.ui.prefs
new file mode 100644
index 000000000..a710d7ff4
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.aptana.portal.ui.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+last_known_studio_version=3.4.0.1358388620
diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.aptana.rcp.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.aptana.rcp.prefs
new file mode 100644
index 000000000..72b561e6a
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.aptana.rcp.prefs
@@ -0,0 +1,3 @@
+EDITOR_LINE_NUMBER_SET=true
+WORKSPACE_ENCODING_SET=true
+eclipse.preferences.version=1
diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.aptana.ruby.core.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.aptana.ruby.core.prefs
new file mode 100644
index 000000000..82f86f837
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.aptana.ruby.core.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+index_version=5
diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.aptana.theme.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.aptana.theme.prefs
new file mode 100644
index 000000000..590c84632
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.aptana.theme.prefs
@@ -0,0 +1,8 @@
+ACTIVE_HYPERLINK_COLOR=84,143,160
+ACTIVE_THEME=Aptana Studio
+HYPERLINK_COLOR=84,143,160
+THEME_CHANGED=1394527579080
+eclipse.preferences.version=1
+hyperlinkColor=84,143,160
+hyperlinkColor.SystemDefault=false
+themes/Aptana\ Studio=I1R1ZSBNYXIgMTEgMTY6MzM6MTkgQ1NUIDIwMTQNCm5hbWU9QXB0YW5hIFN0dWRpbw0Kc2VsZWN0aW9uPVwjZGRmMGZmMzMNCmxpbmVIaWdobGlnaHQ9XCNmZmZmZmYwOA0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WFya3VwLmxpc3QNCk1hcmt1cFw6XCBIZWFkaW5nPVwjY2Y2YTRjZmZebWFya3VwLmhlYWRpbmcNCkFubm90YXRpb25cIE92ZXJyaWRlXCAtXCBzZWFyY2hSZXN1bHRJbmRpY2F0aW9uPV5vdmVycmlkZS5zZWFyY2hSZXN1bHRJbmRpY2F0aW9uDQpBbm5vdGF0aW9uXCBPdmVycmlkZVwgLVwgeG1sVGFnUGFpck9jY3VycmVuY2VJbmRpY2F0aW9uPV5vdmVycmlkZS54bWxUYWdQYWlyT2NjdXJyZW5jZUluZGljYXRpb24NCkFubm90YXRpb25cIE92ZXJyaWRlXCAtXCBodG1sVGFnUGFpck9jY3VycmVuY2VJbmRpY2F0aW9uPV5vdmVycmlkZS5odG1sVGFnUGFpck9jY3VycmVuY2VJbmRpY2F0aW9uDQpBbm5vdGF0aW9uXCBPdmVycmlkZVwgLVwgcnVieUJsb2NrUGFpck9jY3VycmVuY2VJbmRpY2F0aW9uPV5vdmVycmlkZS5ydWJ5QmxvY2tQYWlyT2NjdXJyZW5jZUluZGljYXRpb24NCkFubm90YXRpb25cIE92ZXJyaWRlXCAtXCBweWRldk9jY3VycmVuY2VJbmRpY2F0aW9uPV5vdmVycmlkZS5weWRldk9jY3VycmVuY2VJbmRpY2F0aW9uDQo\=
diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.aptana.ui.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.aptana.ui.prefs
new file mode 100644
index 000000000..c7ec58f2d
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.aptana.ui.prefs
@@ -0,0 +1,3 @@
+IDEHasLaunchedBefore=true
+PerspectiveVersion=103
+eclipse.preferences.version=1
diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 000000000..f8c207078
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,4 @@
+eclipse.preferences.version=1
+encoding=UTF-8
+refresh.enabled=true
+version=1
diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs
new file mode 100644
index 000000000..455f3abba
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.debug.ui.PREF_CHANGED_VALUE_BACKGROUND=74,65,13
+org.eclipse.debug.ui.PREF_LAUNCH_PERSPECTIVES=\r\n\r\n
+org.eclipse.debug.ui.consoleBackground=20,20,20
+org.eclipse.debug.ui.errorColor=255,0,0
+org.eclipse.debug.ui.inColor=95,175,176
+org.eclipse.debug.ui.outColor=248,248,248
diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.search.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.search.prefs
new file mode 100644
index 000000000..f3bbade48
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.search.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+org.eclipse.search.potentialMatch.fgColor=94,101,105
diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.browser.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.browser.prefs
new file mode 100644
index 000000000..5fe466c23
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.browser.prefs
@@ -0,0 +1,2 @@
+browsers=\r\n\r\n\r\n\r\n
+eclipse.preferences.version=1
diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.editors.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.editors.prefs
new file mode 100644
index 000000000..dd8cefcee
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.editors.prefs
@@ -0,0 +1,40 @@
+AbstractTextEditor.Color.Background=20,20,20
+AbstractTextEditor.Color.Background.SystemDefault=false
+AbstractTextEditor.Color.Foreground=248,248,248
+AbstractTextEditor.Color.Foreground.SystemDefault=false
+AbstractTextEditor.Color.SelectionBackground=60,64,67
+AbstractTextEditor.Color.SelectionBackground.SystemDefault=false
+AbstractTextEditor.Color.SelectionForeground=248,248,248
+AbstractTextEditor.Color.SelectionForeground.SystemDefault=false
+CONFLICTING_COLOR=66,14,9
+INCOMING_COLOR=235,235,235
+OUTGOING_COLOR=235,235,235
+OccurrenceIndicationColor=94,101,105
+RESOLVED_COLOR=37,59,34
+additionIndicationColor=37,59,34
+changeIndicationColor=37,59,34
+currentIPColor=14,34,49
+currentLineColor=27,27,27
+deletionIndicationColor=66,14,9
+eclipse.preferences.version=1
+htmlTagPairOccurrenceIndication=true
+htmlTagPairOccurrenceIndicationColor=94,94,94
+htmlTagPairOccurrenceIndicationHighlighting=false
+htmlTagPairOccurrenceIndicationTextStyle=BOX
+lineNumberRuler=true
+occurrenceIndicationColor=60,64,67
+pydevOccurrenceHighlighting=false
+pydevOccurrenceIndication=true
+pydevOccurrenceIndicationColor=94,94,94
+pydevOccurrenceIndicationTextStyle=BOX
+rubyBlockPairOccurrenceIndication=true
+rubyBlockPairOccurrenceIndicationColor=94,94,94
+rubyBlockPairOccurrenceIndicationHighlighting=false
+rubyBlockPairOccurrenceIndicationTextStyle=BOX
+searchResultIndicationColor=94,101,105
+secondaryIPColor=14,34,49
+writeOccurrenceIndicationColor=60,64,67
+xmlTagPairOccurrenceIndication=true
+xmlTagPairOccurrenceIndicationColor=94,94,94
+xmlTagPairOccurrenceIndicationHighlighting=false
+xmlTagPairOccurrenceIndicationTextStyle=BOX
diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs
new file mode 100644
index 000000000..71a846af6
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs
@@ -0,0 +1,7 @@
+PROBLEMS_FILTERS_MIGRATE=true
+SHOW_COOLBAR=true
+SHOW_PERSPECTIVEBAR=true
+eclipse.preferences.version=1
+platformState=1394526372425
+quickStart=false
+tipsAndTricks=true
diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.texteditor.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.texteditor.prefs
new file mode 100644
index 000000000..e9b8648bf
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.texteditor.prefs
@@ -0,0 +1,9 @@
+AbstractTextEditor.Color.Background=20,20,20
+AbstractTextEditor.Color.Background.SystemDefault=false
+AbstractTextEditor.Color.Foreground=248,248,248
+AbstractTextEditor.Color.Foreground.SystemDefault=false
+AbstractTextEditor.Color.SelectionBackground=60,64,67
+AbstractTextEditor.Color.SelectionForeground=248,248,248
+AbstractTextEditor.Color.SelectionForeground.SystemDefault=false
+currentLineColor=27,27,27
+eclipse.preferences.version=1
diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs
new file mode 100644
index 000000000..34c35fec1
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs
@@ -0,0 +1,21 @@
+ACTIVE_HYPERLINK_COLOR=84,143,160
+HYPERLINK_COLOR=84,143,160
+com.vectrace.mercurialeclipse.ui.colorsandfonts.IgnoredBackgroundColor=20,20,20
+com.vectrace.mercurialeclipse.ui.colorsandfonts.IgnoredForegroundColor=248,248,248
+com.vectrace.mercurialeclipse.ui.colorsandfonts.addedBackgroundColor=37,59,34
+com.vectrace.mercurialeclipse.ui.colorsandfonts.addedForegroundColor=248,248,248
+com.vectrace.mercurialeclipse.ui.colorsandfonts.changedBackgroundColor=74,65,13
+com.vectrace.mercurialeclipse.ui.colorsandfonts.changedForegroundColor=248,248,248
+com.vectrace.mercurialeclipse.ui.colorsandfonts.conflictBackgroundColor=20,20,20
+com.vectrace.mercurialeclipse.ui.colorsandfonts.conflictForegroundColor=248,248,248
+com.vectrace.mercurialeclipse.ui.colorsandfonts.deletedBackgroundColor=66,14,9
+com.vectrace.mercurialeclipse.ui.colorsandfonts.deletedForegroundColor=248,248,248
+com.vectrace.mercurialeclipse.ui.colorsandfonts.removedBackgroundColor=66,14,9
+com.vectrace.mercurialeclipse.ui.colorsandfonts.removedForegroundColor=248,248,248
+com.vectrace.mercurialeclipse.ui.colorsandfonts.unknownBackgroundColor=20,20,20
+com.vectrace.mercurialeclipse.ui.colorsandfonts.unknownForegroundColor=248,248,248
+eclipse.preferences.version=1
+hyperlinkColor=84,143,160
+hyperlinkColor.SystemDefault=false
+org.eclipse.egit.ui.UncommittedChangeBackgroundColor=37,59,34
+org.eclipse.egit.ui.UncommittedChangeForegroundColor=248,248,248
diff --git a/.metadata/.plugins/org.eclipse.debug.core/.launches/Firefox - Internal Server.launch b/.metadata/.plugins/org.eclipse.debug.core/.launches/Firefox - Internal Server.launch
new file mode 100644
index 000000000..f21eed9f2
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.debug.core/.launches/Firefox - Internal Server.launch
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.metadata/.plugins/org.eclipse.debug.core/.launches/Internet Explorer - Internal Server.launch b/.metadata/.plugins/org.eclipse.debug.core/.launches/Internet Explorer - Internal Server.launch
new file mode 100644
index 000000000..2134fa92c
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.debug.core/.launches/Internet Explorer - Internal Server.launch
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml b/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml
new file mode 100644
index 000000000..2636d060e
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml b/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml
new file mode 100644
index 000000000..4868ecd96
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml
@@ -0,0 +1,14 @@
+
+
diff --git a/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml b/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml
new file mode 100644
index 000000000..f7e4d66f0
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml
@@ -0,0 +1,10 @@
+
+
diff --git a/.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml b/.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml
new file mode 100644
index 000000000..88eaacee1
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml
@@ -0,0 +1,202 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+demo
+E:\code\demo
+
+
+
+
+
+
+
+Terminal
+C:\Users\nudt
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml b/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml
new file mode 100644
index 000000000..5a9aef845
--- /dev/null
+++ b/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/.metadata/version.ini b/.metadata/version.ini
new file mode 100644
index 000000000..c51ff745b
--- /dev/null
+++ b/.metadata/version.ini
@@ -0,0 +1 @@
+org.eclipse.core.runtime=1
\ No newline at end of file
diff --git a/Gemfile b/Gemfile
index 63dd32df4..0ea40e013 100644
--- a/Gemfile
+++ b/Gemfile
@@ -6,6 +6,7 @@ unless RUBY_PLATFORM =~ /w32/
gem 'rubyzip'
gem 'zip-zip'
end
+gem 'seems_rateable', path: 'lib/seems_rateable'
gem "rails", "3.2.13"
gem "jquery-rails", "~> 2.0.2"
gem "i18n", "~> 0.6.0"
diff --git a/Gemfile.lock b/Gemfile.lock
index d60847b17..54d89f381 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,3 +1,10 @@
+PATH
+ remote: lib/seems_rateable
+ specs:
+ seems_rateable (1.0.13)
+ jquery-rails
+ rails
+
GEM
remote: https://rubygems.org/
specs:
@@ -109,3 +116,4 @@ DEPENDENCIES
rails (= 3.2.13)
rdoc (>= 2.4.2)
ruby-openid (~> 2.1.4)
+ seems_rateable!
diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb
index 6edd2a8c8..20ae191ab 100644
--- a/app/controllers/attachments_controller.rb
+++ b/app/controllers/attachments_controller.rb
@@ -21,7 +21,7 @@ class AttachmentsController < ApplicationController
before_filter :delete_authorize, :only => :destroy
before_filter :authorize_global, :only => :upload
- before_filter :require_login, only: [:download]
+ before_filter :login_without_softapplication, only: [:download]
accept_api_auth :show, :download, :upload
@@ -207,4 +207,9 @@ private
end
content_type.to_s
end
+
+ def login_without_softapplication
+ referer = request.headers['Referer']
+ require_login unless referer =~ /softapplication/
+ end
end
diff --git a/app/controllers/contests_controller.rb b/app/controllers/contests_controller.rb
index 5511b15ca..0f16a81c6 100644
--- a/app/controllers/contests_controller.rb
+++ b/app/controllers/contests_controller.rb
@@ -137,6 +137,20 @@ class ContestsController < ApplicationController
end
end
+ # Added by Longjun
+ def destroy_contest
+ @contest = Contest.find(params[:id])
+ if @contest.author_id == User.current.id
+
+ @contest.destroy
+ redirect_to action: 'index'
+ else
+ render_403 :message => :notice_not_contest_delete_authorized
+ end
+
+ end
+ # end
+
def show_contest_project
contests = Contest.where('parent_id = ?', @contest.id)
@projects = []
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 0c09fc1bd..6c8e75eeb 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -177,11 +177,18 @@ class ProjectsController < ApplicationController
def course
@project_type = params[:project_type]
+ @school_id = params[:school_id]
per_page_option = 10
-
- @projects_all = Project.active.visible.
- joins("LEFT JOIN #{ProjectStatus.table_name} ON #{Project.table_name}.id = #{ProjectStatus.table_name}.project_id").
- where("#{Project.table_name}.project_type = ? ", Project::ProjectType_course)
+ if @school_id == "0" or @school.nil?
+ @projects_all = Project.active.visible.
+ joins("LEFT JOIN #{ProjectStatus.table_name} ON #{Project.table_name}.id = #{ProjectStatus.table_name}.project_id").
+ where("#{Project.table_name}.project_type = ? ", Project::ProjectType_course)
+ else
+ @projects_all = Project.active.visible.
+ joins("LEFT JOIN #{ProjectStatus.table_name} ON #{Project.table_name}.id = #{ProjectStatus.table_name}.project_id").
+ joins(:course_extra).
+ where("#{Project.table_name}.project_type = ? AND #{Course.table_name}.school_id = ?", Project::ProjectType_course, @school_id)
+ end
@project_count = @projects_all.count
@project_pages = Paginator.new @project_count, per_page_option, params['page']
@@ -495,7 +502,8 @@ class ProjectsController < ApplicationController
# added by bai
@course.term = params[:term]
@course.time = params[:time]
- @course.school_id = params[:occupation]
+ #@course.school_id = params[:occupation]
+ @course.school_id = User.current.user_extensions.school_id
@course.setup_time = params[:setup_time]
@course.endup_time = params[:endup_time]
@course.class_period = params[:class_period]
diff --git a/app/controllers/school_controller.rb b/app/controllers/school_controller.rb
index 749491b69..a2f6a348c 100644
--- a/app/controllers/school_controller.rb
+++ b/app/controllers/school_controller.rb
@@ -1,4 +1,10 @@
class SchoolController < ApplicationController
+
+
+ def index
+
+ end
+
def get_options
@school = School.where("province = ?", params[:province])
p = params[:province]
@@ -6,10 +12,23 @@ class SchoolController < ApplicationController
options = ""
@school.each do |s|
- options << ""
+ #options << ""
+ options << "#{s.name}"
end
+
render :text => options
end
+
+ def get_schoollist
+ @school = School.where("province = ?", params[:province])
+
+ options = ""
+ @school.each do |s|
+ options << "#{s.name}"
+ end
+
+ render :text => options
+ end
end
diff --git a/app/controllers/softapplications_controller.rb b/app/controllers/softapplications_controller.rb
index 9ac62f928..9cc940bdd 100644
--- a/app/controllers/softapplications_controller.rb
+++ b/app/controllers/softapplications_controller.rb
@@ -1,4 +1,8 @@
class SoftapplicationsController < ApplicationController
+ before_filter :find_softapplication, only: [:edit, :update, :destroy]
+ before_filter :editable, only: [:edit, :update]
+ before_filter :destroyable, only: :destroy
+
# GET /softapplications
# GET /softapplications.json
def index
@@ -17,18 +21,18 @@ class SoftapplicationsController < ApplicationController
@jours = @softapplication.journals_for_messages.order('created_on DESC')
@image_results = []
@softapplication.attachments.each do |f|
- f.image? ? @image_results << f : @image_results
+ f.image? ? @image_results << f : @image_results
end
- @app_items = []
+ @app_items = []
@softapplication.attachments.each do |f|
- f.pack? ? @app_items << f : @app_items
+ f.pack? ? @app_items << f : @app_items
end
@limit = 10
@feedback_count = @jours.count
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
@offset ||= @feedback_pages.offset
@jour = @jours[@offset, @limit]
- @state = false
+ @state = false
respond_to do |format|
format.html # show.html.erb
format.json { render json: @softapplication }
@@ -71,8 +75,9 @@ class SoftapplicationsController < ApplicationController
# PUT /softapplications/1
# PUT /softapplications/1.json
def update
- @softapplication = Softapplication.find(params[:id])
-
+ # @softapplication = Softapplication.find(params[:id])
+ @softapplication.attachments.map{|attach| attach.destroy }
+ @softapplication.save_attachments(params[:attachments])
respond_to do |format|
if @softapplication.update_attributes(params[:softapplication])
format.html { redirect_to @softapplication, notice: 'Softapplication was successfully updated.' }
@@ -83,33 +88,33 @@ class SoftapplicationsController < ApplicationController
end
end
end
-
-
+
def add_attach
@softapplication = Softapplication.find(params[:id])
- @softapplication.save_attachments(params[:attachments])
+ @softapplication.save_attachments(params[:attachments])
end
# DELETE /softapplications/1
# DELETE /softapplications/1.json
def destroy
- @softapplication = Softapplication.find(params[:id])
+ # @softapplication = Softapplication.find(params[:id])
@softapplication.destroy
respond_to do |format|
- format.html { redirect_to softapplications_url }
+ format.html { redirect_to home_path }
format.json { head :no_content }
end
end
+
#应用评价涉及到的方法
def new_message
@jour = JournalsForMessage.find(params[:journal_id]) if params[:journal_id]
if @jour
- user = @jour.user
- text = @jour.notes
+ user = @jour.user
+ text = @jour.notes
else
- user = @softapplication.user
- text = @softapplication.description
+ user = @softapplication.user
+ text = @softapplication.description
end
text = text.to_s.strip.gsub(%r{((.|\s)*?)
}m, '[...]')
@content = "> #{ll(User.current.language, :text_user_wrote, user)}\n> "
@@ -117,25 +122,24 @@ class SoftapplicationsController < ApplicationController
@id = user.id
rescue ActiveRecord::RecordNotFound
render_404
- end
- #新建评价
- def create_message
-
- if params[:softapplication_message][:message].size>0
- if params[:reference_content]
- message = params[:softapplication_message][:message] + "\n" + params[:reference_content]
- else
- message = params[:softapplication_message][:message]
- end
- refer_user_id = params[:softapplication_message][:reference_user_id].to_i
- @softapplication = Softapplication.find(params[:id])
- @softapplication.add_jour(User.current, message, refer_user_id)
-
end
-
+
+ #新建评价
+ def create_message
+
+ if params[:reference_content]
+ message = params[:softapplication_message][:message] + "\n" + params[:reference_content]
+ else
+ message = params[:softapplication_message][:message]
+ end
+ refer_user_id = params[:softapplication_message][:reference_user_id].to_i
+ @softapplication = Softapplication.find(params[:id])
+ @softapplication.add_jour(User.current, message, refer_user_id)
+
+
@user = @softapplication.user
@jours = @softapplication.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
-
+
@limit = 10
@feedback_count = @jours.count
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
@@ -167,6 +171,7 @@ class SoftapplicationsController < ApplicationController
format.js
end
end
+
#
def more
@jour = @softapplication.journals_for_messages
@@ -179,6 +184,7 @@ class SoftapplicationsController < ApplicationController
#format.api { render_api_ok }
end
end
+
#
def back
@jour = @softapplication.journals_for_messages
@@ -191,4 +197,24 @@ class SoftapplicationsController < ApplicationController
#format.api { render_api_ok }
end
end
+
+ private
+ def find_softapplication
+ @softapplication = Softapplication.find_by_id(params[:id])
+ end
+
+ def editable
+ unless @softapplication.editable_by? User.current
+ render_403
+ return false
+ end
+ end
+
+ def destroyable
+ unless @softapplication.destroyable_by? User.current
+ render_403
+ return false
+ end
+ end
+
end
diff --git a/app/controllers/test_controller.rb b/app/controllers/test_controller.rb
index cb28f4e66..0623dbee2 100644
--- a/app/controllers/test_controller.rb
+++ b/app/controllers/test_controller.rb
@@ -1,4 +1,6 @@
class TestController < ApplicationController
+
+ helper :UserScore
def zip
homeworks_attach_path = []
diff --git a/app/controllers/user_score_controller.rb b/app/controllers/user_score_controller.rb
new file mode 100644
index 000000000..875229e89
--- /dev/null
+++ b/app/controllers/user_score_controller.rb
@@ -0,0 +1,6 @@
+class UserScoreController < ApplicationController
+ helper :UserScoreHelper
+
+
+
+end
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 1d639726f..9d18f81c9 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1579,9 +1579,14 @@ module ApplicationHelper
forum_link = link_to l(:label_project_module_forums), {:controller => "forums", :action => "index"}
stores_link = link_to l(:label_stores_index), {:controller => 'stores', :action=> 'index'}
+
+ school_all_school_link = link_to l(:label_school_all), {:controller => 'school', :action => 'index'}
+
+
#@nav_dispaly_project_label
nav_list = Array.new
nav_list.push(home_link) if !@nav_dispaly_home_path_label
+ nav_list.push(school_all_school_link) if @nav_dispaly_course_all_label
nav_list.push(course_all_course_link) if @nav_dispaly_course_all_label
nav_list.push(course_teacher_all_link) if @nav_dispaly_teacher_all_label
@@ -1608,4 +1613,13 @@ module ApplicationHelper
User.current
end
+ # def hadcommittedforcontest(curu)
+ # message = JournalsForMessage.find_by_sql("select * from journals_for_messages where jour_type = 'Softapplication' ")
+ # message.each do |createmessage|
+ # if createmessage.user_id == curu
+ # return true
+ # end
+ # end
+ # end
+
end
diff --git a/app/helpers/user_score_helper.rb b/app/helpers/user_score_helper.rb
new file mode 100644
index 000000000..5b455a01b
--- /dev/null
+++ b/app/helpers/user_score_helper.rb
@@ -0,0 +1,271 @@
+# encoding: utf-8
+#
+# Redmine - project management software
+# Copyright (C) 2006-2013 Jean-Philippe Lang
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+module UserScoreHelper
+ def calculate_collaboration_count(user)
+ issue_c = 0
+ issues = Issue.where('author_id = ?', user.id)
+ issues.each do |issue|
+ issue_c = issue_c + issue.journals.where("user_id <> ?", user.id).count
+ end
+ issue_c = issue_c + Journal.where("user_id = ?", user.id).count
+ ############################
+ memos = Memo.where('author_id = ? AND parent_id IS NOT NULL', user.id)
+
+ memos.each do |m|
+ if Memo.find(m.parent_id).author.id != user.id
+ issue_c = issue_c + 1
+ else
+ issue_c = issue_c - 1
+ end
+ end
+
+
+ pmemos = Memo.where('author_id = ? AND parent_id IS NULL', user.id)
+ pmemos.each do |pm|
+ issue_c = issue_c + pm.replies_count
+ end
+ ############################
+
+ issue_c = issue_c + JournalsForMessage.where('user_id = ? AND reply_id IS NOT NULL AND reply_id <> ?', user.id, user.id).count + JournalsForMessage.where('reply_id = ? AND user_id <> ?', user.id, user.id).count
+
+
+
+ return issue_c
+ end
+
+ def calculate_influence_count(user)
+ watcher_count = Watcher.where("watchable_type = 'principal' AND watchable_id = ?", user.id).count
+ end
+
+ def calculate_skill_count(user)
+
+ praise_count = 0
+ tread_count = 0
+ issues = Issue.where('author_id = ?', user.id)
+ issues.each do |i|
+ ptcs = PraiseTreadCache.where('object_id = ?', i.id)
+ ptcs.each do |p|
+ praise_count = praise_count + p.praise_num
+ tread_count = tread_count + p.tread_num
+ end
+ end
+
+ bids = Bid.where('author_id = ?', user.id)
+ bids.each do |b|
+ ptcs = PraiseTreadCache.where('object_id = ?', b.id)
+ ptcs.each do |p|
+ praise_count = praise_count + p.praise_num
+ tread_count = tread_count + p.tread_num
+ end
+ end
+
+ contests = Contest.where('author_id = ?', user.id)
+ contests.each do |c|
+ ptcs = PraiseTreadCache.where('object_id = ?', c.id)
+ ptcs.each do |p|
+ praise_count = praise_count + p.praise_num
+ tread_count = tread_count + p.tread_num
+ end
+ end
+
+
+ level = calculate_level(user)
+
+ skill_score = 0
+
+ if level == 0
+ skill_score = praise_count - 0.5 * tread_count
+ end
+ if level == 1
+ skill_score = 2 * praise_count - 1.5 * tread_count
+ end
+ if level == 2
+ skill_socre = 3 * praise_count - 2.5 * tread_count
+ end
+ if level == 3
+ skill_socre = 4 * praise_count - 3.5 * tread_count
+ end
+ if level == 4
+ skill_socre = 5 * praise_count - 4.5 * tread_count
+ end
+
+# case level
+# when 0 skill_score = praise_count - 0.5 * tread_count
+# when 1 skill_score = 2 * praise_count - 1.5 * tread_count
+# when 2 skill_socre = 3 * praise_count - 2.5 * tread_count
+# when 3 skill_socre = 4 * praise_count - 3.5 * tread_count
+# when 4 skill_socre = 5 * praise_count - 4.5 * tread_count
+# end
+
+
+
+ tread_user_count = PraiseTread.where('praise_or_tread = ? AND user_id = ?', 0, user.id).count
+
+ skill_score = skill_score - 0.5 * tread_user_count
+
+ return skill_score
+
+
+
+ end
+
+ def calculate_level(user)
+ commit_count = user.changesets.count
+ max_praise_num = 0
+
+
+ issues = Issue.where('author_id = ?', user.id)
+ issues.each do |i|
+ ptcs = PraiseTreadCache.where('object_id = ?', i.id)
+ ptcs.each do |p|
+ if p.praise_num > max_praise_num
+ max_praise_num = p.praise_num
+ end
+ end
+ end
+
+ bids = Bid.where('author_id = ?', user.id)
+ bids.each do |b|
+ ptcs = PraiseTreadCache.where('object_id = ?', b.id)
+ ptcs.each do |p|
+ if p.praise_num > max_praise_num
+ max_praise_num = p.praise_num
+ end
+ end
+ end
+
+ contests = Contest.where('author_id = ?', user.id)
+ contests.each do |c|
+ ptcs = PraiseTreadCache.where('object_id = ?', c.id)
+ ptcs.each do |p|
+ if p.praise_num > max_praise_num
+ max_praise_num = p.praise_num
+ end
+ end
+ end
+
+
+ best_answer_num = 0
+
+ isManager = 0
+ members = Member.where('user_id = ?', user.id)
+ members.each do |m|
+ roles = m.member_roles
+ roles.each do |r|
+ if r.role_id == 3
+ isManager = 1
+ end
+ end
+ end
+
+ level = 0
+
+ if max_praise_num > 4
+ level = 1
+ end
+ if commit_count > 0 and commit_count < 101
+ level = 1
+ end
+ if commit_count > 100 or isManager == 1
+ level = 2
+ end
+
+ return level
+
+ end
+
+ def calculate_activity_count(user)
+ # commit_count = user.changesets.count
+ # issue_details_count = 0
+ # issues = Issue.where('assigned_to_id = ?', user.id)
+ # issues.each do |issue|
+ # change_count = issue.journals.where("prop_key = ?", "done_ratio").count
+ # issue_details_count = change_count + issue_details_count
+ # end
+ # file_count = user.file_commit.count
+ # issue_count = Issue.where('author_id = ?', user.id).count
+ #f = user.user_score.file
+ #i = user.user_score.issue
+ #f_max = UserScore.find_max_file
+ #f_min = UserScore.find_min_file
+ #i_max = UserScore.find_max_issue
+ #i_min = UserScore.find_min_issue
+ #score = 100 * ((f - f_min)/(f_max - f_min) + (i - i_min)/(i_max - i_min))
+ end
+
+ def calculate_file(user)
+ file_count = user.file_commit.count
+ issue_count = Issue.where('author_id = ?', user.id).count
+ return (file_count + issue_count)
+ end
+
+ def calculate_issue(user)
+ commit_count = user.changesets.count
+
+ issue_details_count = 0
+ issues = Issue.where('assigned_to_id = ?', user.id)
+
+ change_count = 0
+ issues.each do |issue|
+ js = issue.journals
+ js.each do |j|
+ change_count = change_count + j.details.where("prop_key = ?", "done_ratio").count
+ end
+
+
+ issue_details_count = change_count + issue_details_count
+ end
+
+ return (commit_count + issue_details_count)
+
+ end
+
+ def calculate_user_score(user)
+ collaboration = calculate_collaboration_count(user)
+ influence = calculate_influence_count(user)
+ skill = calculate_skill_count(user)
+ activity = calculate_activity_count(user)
+ file = calculate_file(user)
+ issue = calculate_issue(user)
+ level = calculate_level(user)
+ #user.user_score << UserScore.new(:collaboration => collaboration, :influence => influence, :skill => skill,
+ # :activity => activity, :file => file, :issue => issue, :level => level)
+ UserScore.new(:collaboration => collaboration, :influence => influence, :skill => skill,
+ :activity => activity, :file => file, :issue => issue, :level => level)
+ end
+
+ def update_user_score(user)
+ collaboration = calculate_collaboration_count(user)
+ influence = calculate_influence_count(user)
+ skill = calculate_skill_count(user)
+ file = calculate_file(user)
+ issue = calculate_issue(user)
+
+ ##activity = calculate_activity_count(user)
+
+ level = calculate_level(user)
+ user.user_score.update_attributes(:collaboration => collaboration, :influence => influence, :skill => skill,
+ :activity => activity, :file => file, :issue => issue, :level => level)
+ end
+
+
+
+
+end
diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb
index 10e8a4471..b622e6818 100644
--- a/app/helpers/welcome_helper.rb
+++ b/app/helpers/welcome_helper.rb
@@ -56,12 +56,49 @@ module WelcomeHelper
# # => 前7个项目为新课程,后面三个是参与人数最多的
#
# Returns project&courses array
- def find_miracle_course(sum=10, max_rate=7)
- Project.active.visible.course_entities.
- joins(:course_extra).
- joins(:memberships).
- group('members.project_id').
- reorder("courses.time DESC, COUNT(members.project_id) DESC").take sum
+ def find_miracle_course(sum=10, max_rate=7, school_id)
+
+ if User.current.user_extensions.school.nil? and school_id.nil?
+ Project.active.visible.course_entities.
+ joins(:course_extra).
+ joins(:memberships).
+ group('members.project_id').
+ reorder("courses.time DESC, COUNT(members.project_id) DESC").take sum
+# elseif school_id.nil?
+
+ else
+ if school_id.nil?
+ Project.active.visible.course_entities.
+ joins(:course_extra).
+ joins(:memberships).
+ where("#{Course.table_name}.school_id = ?", User.current.user_extensions.school.id).
+ group('members.project_id').
+ reorder("courses.time DESC, COUNT(members.project_id) DESC").take sum
+ else
+ if school_id == "0"
+ Project.active.visible.course_entities.
+ joins(:course_extra).
+ joins(:memberships).
+ group('members.project_id').
+ reorder("courses.time DESC, COUNT(members.project_id) DESC").take sum
+ else
+ Project.active.visible.course_entities.
+ joins(:course_extra).
+ joins(:memberships).
+ where("#{Course.table_name}.school_id = ?", school_id).
+ group('members.project_id').
+ reorder("courses.time DESC, COUNT(members.project_id) DESC").take sum
+ end
+ end
+ end
+# else
+# Project.active.visible.course_entities.
+# joins(:course_extra).
+# joins(:memberships).
+# where("#{Course.table_name}.school_id = ?", school_id).
+# group('members.project_id').
+# reorder("courses.time DESC, COUNT(members.project_id) DESC").take sum
+# end
# max = sum*(max_rate.to_f/10)
# c1 = find_new_course(sum).to_a.dup
# c2 = find_all_hot_course(sum).to_a.dup
@@ -98,7 +135,14 @@ module WelcomeHelper
end
def find_all_hot_contest limit=10
- Contest.reorder("created_on DESC").all.take limit
+ # Contest.reorder("created_on DESC").all.take limit
+ mix_bid = []
+ mix_bid += Contest.reorder("created_on DESC").take(limit).to_a
+ mix_bid += Bid.visible.where('reward_type = ?', 2).reorder('bids.created_on desc').take(limit).to_a
+ mix_bid.sort do |older, newer|
+ newer.created_on - older.created_on
+ end
+ mix_bid.take limit
end
def find_all_hot_softapplication limit=10
@@ -224,6 +268,10 @@ module WelcomeHelper
def sort_contest_by_hot
sort_bid_by_hot_rails 2
end
+#new added by linchun
+ def sort_contest_by_time
+ sort_bid_by_time 2
+ end
#取得所有活动
def find_all_activities limit=6
@@ -278,6 +326,10 @@ module WelcomeHelper
Bid.visible.where('reward_type = ?', reward_type).reorder('bids.commit desc').limit(limit)
end
+ def sort_bid_by_time reward_type, limit = 10
+ Bid.visible.where('reward_type = ?', reward_type).reorder('bids.created_on desc').limit(limit)
+ end
+
def find_all_event_type event
case event.event_type
when 'news'
diff --git a/app/models/attachment.rb b/app/models/attachment.rb
index 919760ee3..73ae44b4d 100644
--- a/app/models/attachment.rb
+++ b/app/models/attachment.rb
@@ -181,7 +181,7 @@ class Attachment < ActiveRecord::Base
end
def pack?
- !!(self.filename =~ /\.(zip|rar|tar|gz)$/i)
+ !!(self.filename =~ /\.(zip|rar|tar|gz|exe|jar|7z|iso)$/i)
end
def thumbnailable?
diff --git a/app/models/bid.rb b/app/models/bid.rb
index fd389c15f..e58e640a0 100644
--- a/app/models/bid.rb
+++ b/app/models/bid.rb
@@ -29,6 +29,7 @@ class Bid < ActiveRecord::Base
has_many :courses, :through => :homework_for_courses, :source => :project
has_many :homeworks, :class_name => 'HomeworkAttach', :dependent => :destroy
has_many :join_in_contests, :dependent => :destroy
+ has_many :praise_tread, as: :praise_tread_object, dependent: :destroy
# has_many :fork_homework, :class_name => 'Bid', :conditions => "#{Bid.table_name}.parent_id = #{id}"
diff --git a/app/models/contest.rb b/app/models/contest.rb
index edc252574..c3eea7e74 100644
--- a/app/models/contest.rb
+++ b/app/models/contest.rb
@@ -12,6 +12,7 @@ class Contest < ActiveRecord::Base
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
has_many :join_in_competitions, foreign_key: 'competition_id', :dependent => :destroy
has_many :join_in_contests, class_name: 'JoinInCompetition', foreign_key: 'competition_id', :dependent => :destroy
+ has_many :praise_tread, as: :praise_tread_object, dependent: :destroy
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 43bc6537d..b69ac246c 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -45,7 +45,8 @@ class Issue < ActiveRecord::Base
# added by fq
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
- # end
+ # end
+ has_many :praise_tread, as: :praise_tread_object, dependent: :destroy
acts_as_nested_set :scope => 'root_id', :dependent => :destroy
diff --git a/app/models/praise_tread.rb b/app/models/praise_tread.rb
index 901a31660..c27e1fc9f 100644
--- a/app/models/praise_tread.rb
+++ b/app/models/praise_tread.rb
@@ -1,4 +1,6 @@
class PraiseTread < ActiveRecord::Base
attr_accessible :user_id,:praise_tread_object_id,:praise_tread_object_type,:praise_or_tread
+ belongs_to :user
+ belongs_to :praise_tread_object, polymorphic: true
end
diff --git a/app/models/softapplication.rb b/app/models/softapplication.rb
index 71caf059c..6782b2436 100644
--- a/app/models/softapplication.rb
+++ b/app/models/softapplication.rb
@@ -1,11 +1,13 @@
class Softapplication < ActiveRecord::Base
attr_accessible :android_min_version_available, :app_type_id, :app_type_name, :description, :name, :user_id, :contest_id, :application_developers
acts_as_attachable
+ seems_rateable :allow_update => true, :dimensions => :quality
+
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
has_many :contesting_softapplications, :dependent => :destroy
belongs_to :user
- belongs_to :contest
+ has_many :contests, :through => :contesting_softapplications
def add_jour(user, notes, reference_user_id = 0, options = {})
if options.count == 0
@@ -19,6 +21,13 @@ class Softapplication < ActiveRecord::Base
def set_commit(commit)
self.update_attribute(:commit, commit)
end
-
+
+ def editable_by? usr
+ usr.admin? || self.user == usr
+ end
+
+ def destroyable_by? usr
+ self.user == usr || usr.admin?
+ end
end
diff --git a/app/models/user.rb b/app/models/user.rb
index d14090c56..20624888a 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -96,6 +96,7 @@ class User < Principal
has_many :students_for_courses
has_many :courses, :through => :students_for_courses, :source => :project
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
+ has_many :file_commit, :class_name => 'Attachment', :foreign_key => 'author_id', :conditions => "container_type = 'Project' or container_type = 'Version'"
####
# added by bai
has_many :join_in_contests, :dependent => :destroy
@@ -104,6 +105,7 @@ class User < Principal
has_many :wiki_contents, :foreign_key => 'author_id'
has_many :journals
has_many :messages, :foreign_key => 'author_id'
+ has_one :user_score, :dependent => :destroy
# end
######added by nie
@@ -125,6 +127,7 @@ class User < Principal
scope :by_join_date, order("created_on DESC")
############################# added by liuping 关注
acts_as_watchable
+ seems_rateable_rater
has_one :user_extensions,:dependent => :destroy
## end
diff --git a/app/models/user_scores.rb b/app/models/user_scores.rb
new file mode 100644
index 000000000..c939a20ff
--- /dev/null
+++ b/app/models/user_scores.rb
@@ -0,0 +1,36 @@
+# Redmine - project management software
+# Copyright (C) 2006-2013 Jean-Philippe Lang
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+class UserScore < ActiveRecord::Base
+ belongs_to :user
+
+ def self.find_max_file
+ self.maximum(:file)
+ end
+
+ def self.find_min_file
+ self.minimum(:file)
+ end
+
+ def self.find_max_issue
+ self.maximum(:issue)
+ end
+
+ def self.find_min_issue
+ self.minimum(:file)
+ end
+end
diff --git a/app/views/contests/_contest_list.html.erb b/app/views/contests/_contest_list.html.erb
index 4fb2865c8..fb3ddd115 100644
--- a/app/views/contests/_contest_list.html.erb
+++ b/app/views/contests/_contest_list.html.erb
@@ -6,7 +6,7 @@
- <%= link_to(contest.author, user_path(contest.author), :class => 'bid_user') %>: <%= link_to(contest.name, show_contest_contest_path(contest), :class => 'bid_path') %> |
+ <%= link_to(contest.author, user_path(contest.author), :class => 'bid_user') %>: <%= link_to(contest.name, show_contest_contest_path(contest), :class => 'bid_path', :target => "_blank") %> |
@@ -18,8 +18,8 @@
|
- <%= l(:label_contest_project, :count => contest.contesting_projects.count) %>(<%= link_to(contest.contesting_projects.count, show_project_contest_path(contest)) %>)
- <%= l(:label_contest_softapplication, :count => contest.contesting_softapplications.count) %>(<%= link_to(contest.contesting_softapplications.count, show_softapplication_contest_path(contest)) %>)
+ | <%= l(:label_contest_project, :count => contest.contesting_projects.count) %>(<%= link_to(contest.contesting_projects.count, show_project_contest_path(contest), :target => "_blank") %>)
+ <%= l(:label_contest_softapplication, :count => contest.contesting_softapplications.count) %>(<%= link_to(contest.contesting_softapplications.count, show_softapplication_contest_path(contest), :target => "_blank") %>)
|
@@ -29,13 +29,14 @@
-
-
-
- <%= contest.description%> |
-
-
- |
+
+
|
diff --git a/app/views/contests/_list_softapplications.html.erb b/app/views/contests/_list_softapplications.html.erb
index 29c985b7e..eb179718a 100644
--- a/app/views/contests/_list_softapplications.html.erb
+++ b/app/views/contests/_list_softapplications.html.erb
@@ -6,7 +6,7 @@
应用软件: |
- <%= link_to(c_softapplication.softapplication.name, softapplication_path(c_softapplication.softapplication)) %>
+ <%= link_to(c_softapplication.softapplication.name, softapplication_path(c_softapplication.softapplication), :target => '_blank') %>
|
diff --git a/app/views/contests/index.html.erb b/app/views/contests/index.html.erb
index 3a7bde1e5..670ba27cf 100644
--- a/app/views/contests/index.html.erb
+++ b/app/views/contests/index.html.erb
@@ -7,7 +7,7 @@
<% if User.current.logged? %>
<% unless User.current.user_extensions.identity == 1 %>
- <%= link_to(l(:label_newtype_contest), {:controller => 'contests', :action => 'new_contest'}, :class => 'icon icon-add') %>
+ <%= link_to(l(:label_newtype_contest), {:controller => 'contests', :action => 'new_contest'}, :class => 'icon icon-add', :target => "_blank") %>
<% end %>
<% end %>
|
diff --git a/app/views/courses/_set_course_time.html.erb b/app/views/courses/_set_course_time.html.erb
index ab9fa6f28..d13d256c1 100644
--- a/app/views/courses/_set_course_time.html.erb
+++ b/app/views/courses/_set_course_time.html.erb
@@ -1,8 +1,9 @@
<%
- id = "finish_course_tag"
+ id = "finish_course_#{project.id}"
+ display = (project.course_extra.teacher.id == User.current.id )
%>
-<% if course_endTime_timeout?(project) #如果课程已结束%>
+<% if display && course_endTime_timeout?(project) #如果课程已结束%>
<%= link_to '重启课程', restartcourse_project_path(project), :remote => true, :method => :post, :id => id, :confirm => ('确定要重启课程?') %>
<% else %>
<%= link_to '关闭课程', finishcourse_project_path(project), :remote => true, :method => :post, :id => id, :confirm => ('确定要关闭课程?') %>
diff --git a/app/views/layouts/_base_footer.html.erb b/app/views/layouts/_base_footer.html.erb
index bba5b2166..0f2334656 100644
--- a/app/views/layouts/_base_footer.html.erb
+++ b/app/views/layouts/_base_footer.html.erb
@@ -9,6 +9,7 @@
主办单位:
+
版权@2007~2014
@@ -26,3 +27,18 @@
+
+
+ <%= debug(params) if Rails.env.development? %>
+
+
+
diff --git a/app/views/layouts/_base_softapplication_top_content.html.erb b/app/views/layouts/_base_softapplication_top_content.html.erb
new file mode 100644
index 000000000..064e84cf0
--- /dev/null
+++ b/app/views/layouts/_base_softapplication_top_content.html.erb
@@ -0,0 +1,20 @@
+
+
+
+ 创新竞赛社区 |
+ <%= l(:label_user_location) %> : |
+ |
+
+
+
+ <%=link_to request.host()+"/contests", :controller=>'contests', :action=>'index' %> |
+ <%=link_to l(:field_homepage), home_path %> >
+ <%=link_to l(:label_contest_innovate), :controller=>'contests', :action=>'index' %> >
+
+ <% contest = @softapplication.contests.first %><%= contest ? link_to(contest.name, show_contest_contest_path(contest)) : '尚未加入竞赛'%>
+
+
+ |
+
+
+
\ No newline at end of file
diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb
index fe42d00e8..92bc93c3e 100644
--- a/app/views/layouts/base.html.erb
+++ b/app/views/layouts/base.html.erb
@@ -10,6 +10,8 @@
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
+<%= javascript_include_tag "jquery.leanModal.min" %>
+<%= javascript_include_tag 'seems_rateable/jRating', 'seems_rateable/rateable'%>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
diff --git a/app/views/layouts/base_contest.html.erb b/app/views/layouts/base_contest.html.erb
index b4ba3dd4b..2bda701fe 100644
--- a/app/views/layouts/base_contest.html.erb
+++ b/app/views/layouts/base_contest.html.erb
@@ -26,23 +26,23 @@
- 创新竞赛社区 |
- <%= l(:label_user_location) %> : |
-
-
- <%= form_tag(:controller => 'bids', :action => 'contest', :method => :get) do %>
- <%= text_field_tag 'name', params[:name], :size => 20 %>
- <%= hidden_field_tag 'reward_type', @bid.reward_type %>
- <%= hidden_field_tag 'project_type', params[:project_type] %>
- <%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
- <% end %>
-
- |
+ 创新竞赛社区 |
+ <%= l(:label_user_location) %> : |
+
+
+ <%= form_tag(:controller => 'bids', :action => 'contest', :method => :get) do %>
+ <%= text_field_tag 'name', params[:name], :size => 20 %>
+ <%= hidden_field_tag 'reward_type', @bid.reward_type %>
+ <%= hidden_field_tag 'project_type', params[:project_type] %>
+ <%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
+ <% end %>
+
+ |
- <%=link_to request.host()+"/contest", :controller => 'bids', :action => 'contest' %> |
- <%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_contest_innovate), :controller => 'bids', :action => 'contest' %> >
- <%= link_to @bid.name, bid_path %> |
+ <%=link_to request.host()+"/contest", :controller => 'bids', :action => 'contest' %> |
+ <%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_contest_innovate), :controller => 'bids', :action => 'contest' %> >
+ <%= link_to @bid.name, bid_path %> |
diff --git a/app/views/layouts/base_newcontest.html.erb b/app/views/layouts/base_newcontest.html.erb
index 190209ae4..147df5245 100644
--- a/app/views/layouts/base_newcontest.html.erb
+++ b/app/views/layouts/base_newcontest.html.erb
@@ -10,6 +10,7 @@
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
+
<%= javascript_heads %>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
@@ -26,24 +27,24 @@
- 创新竞赛社区 |
- <%= l(:label_user_location) %> : |
-
-
- <%= form_tag({controller: 'contests', action: 'index'}, method: :get) do %>
- <%= text_field_tag 'name', params[:name], :size => 20 %>
- <%= hidden_field_tag 'project_type', params[:project_type] %>
- <%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
- <% end %>
-
- |
+ 创新竞赛社区 |
+ <%= l(:label_user_location) %> : |
+
+
+ <%= form_tag({controller: 'contests', action: 'index'}, method: :get) do %>
+ <%= text_field_tag 'name', params[:name], :size => 20 %>
+ <%= hidden_field_tag 'project_type', params[:project_type] %>
+ <%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
+ <% end %>
+
+ |
- <%=link_to request.host()+"/contests", :controller=>'contests', :action=>'index' %> |
- <%=link_to l(:field_homepage), home_path %> >
- <%=link_to l(:label_contest_innovate), :controller=>'contests', :action=>'index' %> >
- <%= link_to @contest.name, show_contest_contest_path %>
- |
+ <%=link_to request.host()+"/contests", :controller=>'contests', :action=>'index' %> |
+ <%=link_to l(:field_homepage), home_path %> >
+ <%=link_to l(:label_contest_innovate), :controller=>'contests', :action=>'index' %> >
+ <%= link_to @contest.name, show_contest_contest_path %>
+ |
@@ -98,11 +99,14 @@
<%=link_to "#{@contest.contesting_softapplications.count}", :controller => 'contests', :action => 'show_softapplication' %>
- |
+
+
+
<%= l(:label_participate) %> |
<%= l(:label_contest_project) %> |
- <%= l(:label_contest_application) %> |
+ <%= l(:label_contest_application) %> |
+
@@ -141,6 +145,13 @@
<%= l(:label_create_time) %>:<%= format_time(@contest.created_on) %>
+ <% if User.current.logged? %>
+ <% if @contest.author.id == User.current.id %>
+
+ <%= link_to '删除', {:controller => 'contests', :action => 'destroy_contest', :id => @contest}, data: { confirm: '你确定要删除该竞赛吗?' } %>
+
+ <% end %>
+ <% end %>
diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb
index e46b25fc4..bec07145b 100644
--- a/app/views/my/account.html.erb
+++ b/app/views/my/account.html.erb
@@ -1,3 +1,16 @@
+
+
+
+
+
+
@@ -88,12 +106,50 @@
-->
-
- <%= l(:field_occupation) %> *<%= select_tag "province", options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province), :onchange => "get_options(this.value)" %>
+
- <%= select_tag "occupation" %>
+
+ <% unless User.current.user_extensions.school.nil? %>
+ <%= l(:field_occupation) %> *<%= select_tag "province", options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province, User.current.user_extensions.school.province), :onchange => "get_options(this.value)" %>
+
+
+
+
+
+
+
+ <% else %>
+ <%= l(:field_occupation) %> *<%= select_tag "province", options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province), :onchange => "get_options(this.value)" %>
+
+
+
+ <% end %>
+
+
+
+
+
+
diff --git a/app/views/projects/_course.html.erb b/app/views/projects/_course.html.erb
index 02845137c..b698b1142 100644
--- a/app/views/projects/_course.html.erb
+++ b/app/views/projects/_course.html.erb
@@ -16,7 +16,8 @@
<%= content_tag('span', "#{l(:label_institution_name)}:", :class => "course-font")%>
<% @admin = @project.project_infos%>
<%if @admin&&@admin.first&&@admin.first.user&&@admin.first.user.user_extensions%>
- <%= @admin.first.user.user_extensions.occupation %>
+
+ <%= @project.course_extra.school.name %>
<% end %>
diff --git a/app/views/projects/_course_form.html.erb b/app/views/projects/_course_form.html.erb
index 944157a9b..017c4e6ee 100644
--- a/app/views/projects/_course_form.html.erb
+++ b/app/views/projects/_course_form.html.erb
@@ -284,13 +284,7 @@
-
-
- <%=l(:label_new_course_school)%>*
- <%= select_tag "province", options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province), :onclick => "get_options(this.value)" %>
- <%= select_tag "occupation" %>
-
diff --git a/app/views/projects/files_tags.html.erb b/app/views/projects/files_tags.html.erb
new file mode 100644
index 000000000..f451a59f5
--- /dev/null
+++ b/app/views/projects/files_tags.html.erb
@@ -0,0 +1,26 @@
+
+
+
+
+<% content_for :content do %>
+
+
<%= l(:label_tags_search_result) %>
+
+ <%= l(:label_tags_numbers) %>
+ <%= l(:label_issue_plural) %>(<%= @issues_tags_num %>) |
+ <%= l(:label_project_plural) %>(<%= @projects_tags_num %>) |
+ <%= l(:label_user_plural) %>(<%= @users_tags_num %>) |
+ <%= l(:label_tags_call)%>(<%= @bids_tags_num %>) |
+ <%= l(:field_filename)%>(<%= @attachments_tags_num %>)
+
+
+ <%# 求工厂模式重构 %>
+ <%= render :partial => "tag_search_results",:locals => {:issues_results => @issues_results,
+ :projects_results => @projects_results,:users_results => @users_results ,
+ :bids_results=>@bids_results,:forums_results => @forums_results, :attachments_results => @attachments_results, :show_flag => @obj_flag}%>
+
+
+
+
+<% end %>
\ No newline at end of file
diff --git a/app/views/projects/finishcourse.js.erb b/app/views/projects/finishcourse.js.erb
index 04f6617db..35ecac370 100644
--- a/app/views/projects/finishcourse.js.erb
+++ b/app/views/projects/finishcourse.js.erb
@@ -2,7 +2,7 @@
<% if Rails.env.development? %>
console.debug('课程修改成功:结束时间改为<%=Course.find_by_extra(@project.identifier).try(:endup_time)%>');
<% end %>
- $('#finish_course_tag').replaceWith("<%= j(render partial: 'courses/set_course_time', :locals => {:project => @project} )%>")
+ $('#finish_course_<%=@project.id%>').replaceWith("<%= j(render partial: 'courses/set_course_time', :locals => {:project => @project} )%>")
<% else %>
alert('设置失败,请在论坛提交问题,等待管理员处理。');
<% end %>
diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb
index 3ca41d072..eb66efc73 100644
--- a/app/views/projects/show.html.erb
+++ b/app/views/projects/show.html.erb
@@ -1,4 +1,4 @@
-
+<% if @events_by_day.size >0 %>
+
<% end %>
+
+
+ <% if format_date(day) == format_date(@date_to - @days) %>
+
+
+
+ <%= image_tag(url_to_avatar(@user), :class => "avatar") %> |
+
+
+
+ <%= link_to (h @user.try(:name)), user_path(@user) if @user %> <%= l(:label_user_create_project) %> <%= link_to @project.name %> ! |
+
+
+ <%= l :label_update_time %>: <%= format_time(@project.created_on) %>
+ | |
+
+
+
+ <% end %>
<% end -%>
-
-
-
-
- <%= image_tag(url_to_avatar(@user), :class => "avatar") %> |
-
-
-
- <%= link_to (h @user.try(:name)), user_path(@user) if @user %> <%= l(:label_user_create_project) %> <%= link_to @project.name %> ! |
-
-
- <%= l :label_update_time %>: <%= format_time(@project.created_on) %>
- | |
-
-
-
+
-
+<% else %>
+
+
+
+ <%= image_tag(url_to_avatar(@user), :class => "avatar") %> |
+
+
+
+ <%= link_to (h @user.try(:name)), user_path(@user) if @user %> <%= l(:label_user_create_project) %> <%= link_to @project.name %> ! |
+
+
+ <%= l :label_update_time %>: <%= format_time(@project.created_on) %>
+ | |
+
+
+
+<% end %>
diff --git a/app/views/school/index.html.erb b/app/views/school/index.html.erb
new file mode 100644
index 000000000..ad9523025
--- /dev/null
+++ b/app/views/school/index.html.erb
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+ 全部学校
+
+
+ 请选择省份:<%= select_tag "province",
+ options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province),
+ :onclick => "get_school(this.value)" %>
+
+
+
+
diff --git a/app/views/softapplications/_form.html.erb b/app/views/softapplications/_form.html.erb
index 5a046801f..b4a9c3c96 100644
--- a/app/views/softapplications/_form.html.erb
+++ b/app/views/softapplications/_form.html.erb
@@ -1,64 +1,70 @@
-<%= form_for(@softapplication) do |f| %>
+<%= form_for(softapplication) do |f| %>
- <% if @softapplication.errors.any? %>
+ <% if softapplication.errors.any? %>
-
<%= pluralize(@softapplication.errors.count, "error") %> prohibited this softapplication from being saved:
+
<%= pluralize(softapplication.errors.count, "error") %> prohibited this softapplication from being saved:
- <% @softapplication.errors.full_messages.each do |msg| %>
+ <% softapplication.errors.full_messages.each do |msg| %>
- <%= msg %>
<% end %>
<% end %>
-
-
- <%= l(:label_softapplication_name) %> |
- * | :
- <%= f.text_field :name, :required => true, :size => 60, :style => "width:400px;" %> |
- <%= l(:label_softapplication_name_condition)%> |
-
br>
+
+ <%= submit_tag l(:button_create), :onclick => "return true" %>
<% end %>
diff --git a/app/views/softapplications/edit.html.erb b/app/views/softapplications/edit.html.erb
index f93e091d2..c9e0c6f66 100644
--- a/app/views/softapplications/edit.html.erb
+++ b/app/views/softapplications/edit.html.erb
@@ -1,6 +1,8 @@
-Editing softapplication
+<%= l(:label_edit_softapplication)%>
+
+<%= render partial: 'form', locals:{softapplication: @softapplication} %>
+
+
-<%= render 'form' %>
-<%= link_to 'Show', @softapplication %> |
-<%= link_to 'Back', softapplications_path %>
diff --git a/app/views/softapplications/index.html.erb b/app/views/softapplications/index.html.erb
index be9245876..16a206508 100644
--- a/app/views/softapplications/index.html.erb
+++ b/app/views/softapplications/index.html.erb
@@ -1,4 +1,4 @@
-Listing softapplications
+参赛应用
diff --git a/app/views/softapplications/new.html.erb b/app/views/softapplications/new.html.erb
index d5ff2c9c2..1112fcfa4 100644
--- a/app/views/softapplications/new.html.erb
+++ b/app/views/softapplications/new.html.erb
@@ -1,76 +1,5 @@
<%= l(:label_release_softapplication)%>
-
+<%= render partial: 'form', locals:{softapplication: @softapplication} %>
-
- <%= form_for Softapplication.new, :url => {:controller => 'softapplications', :action => 'create'}, :update => "bidding_project_list", :complete => '$("#put-bid-form").hide();', :html => {:multipart => true, :id => 'add_homework_form'} do |f| %>
-
-
-
- <%= l(:label_softapplication_name) %>
- * : <%= f.text_field :name, :required => true, :size => 60, :style => "width:400px;" %> |
- <%= l(:label_softapplication_name_condition)%>
-
br>
-
-
-
- <%= l(:label_softapplication_version_available) %>
- * : <%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:400px;" %> |
-
-
br>
-
-
-
-
- <%= l(:label_softapplication_type) %>
-
- * : <%= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %> |
-
-
br>
-
-
-
-
- <%= l(:label_softapplication_description) %>
- * : <%= f.text_field :description, :required => true, :size => 60, :style => "width:400px;" %> |
-
-
br>
-
-
-
-
- <%= l(:label_softapplication_developers) %>
- * : <%= f.text_field :application_developers, :required => true, :size => 60, :style => "width:400px;" %> |
-
-
br>
-
-
-
-
- <%= render_flash_messages %>
-
- <%= render :partial => 'attachments/form' %>
-
- (<%=l(:label_upload_softapplication_photo_condition)%>)
-
-
-
-
<%= submit_tag l(:button_create), :onclick => "return true" %>
-
-
-
- <% end %>
-
\ No newline at end of file
diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb
index 047ecf8dc..b39ab6c61 100644
--- a/app/views/softapplications/show.html.erb
+++ b/app/views/softapplications/show.html.erb
@@ -1,3 +1,4 @@
+<%=render :partial => 'layouts/base_softapplication_top_content'%>