diff app/controllers/sys_controller.rb @ 318:f7c525dc7585 luisf

Merge from branch "live"
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Mon, 28 Mar 2011 18:17:06 +0100
parents 6c282df74a30
children 102056ec2de9
line wrap: on
line diff
--- a/app/controllers/sys_controller.rb	Thu Mar 24 13:59:03 2011 +0000
+++ b/app/controllers/sys_controller.rb	Mon Mar 28 18:17:06 2011 +0100
@@ -55,6 +55,20 @@
     render :nothing => true, :status => 404
   end
 
+  def get_external_repo_url
+    project = Project.find(params[:id])
+    if project.repository
+      repo = project.repository
+      if repo.is_external?
+        render :text => repo.external_url, :status => 200
+      else
+        render :nothing => true, :status => 200
+      end
+    end
+  rescue ActiveRecord::RecordNotFound
+    render :nothing => true, :status => 404
+  end
+
   def set_embedded_active
     project = Project.find(params[:id])
     mods = project.enabled_modules