From 40b28e4a84834e91cb4c459ccac3fcbbfa860863 Mon Sep 17 00:00:00 2001 From: Alexey Nayden Date: Fri, 11 Mar 2011 19:13:24 +0300 Subject: [PATCH] Trying to add repositories to my hierarchy (step 2) --- app/views/platforms/show.html.haml | 11 ++++++----- app/views/projects/show.html.haml | 4 ++-- app/views/repositories/new.html.haml | 0 app/views/repositories/show.html.haml | 0 config/routes.rb | 6 ++++-- 5 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 app/views/repositories/new.html.haml create mode 100644 app/views/repositories/show.html.haml diff --git a/app/views/platforms/show.html.haml b/app/views/platforms/show.html.haml index dfdfb8aa7..fa70e4649 100644 --- a/app/views/platforms/show.html.haml +++ b/app/views/platforms/show.html.haml @@ -7,10 +7,11 @@ = @platform.path -%h2= t('layout.platforms.projects') -- @projects.each do |project| - = div_for project do - = link_to project.name, [@platform, project] -= link_to t('layout.projects.new'), new_platform_project_path(@platform) +%h2= t('layout.platforms.repositories') +- @repositories.each do |repository| + = div_for repository do + = link_to repository.name, [@platform, repository] += link_to t('layout.repositories.new'), new_platform_repository_path(@platform) %h2= t('layout.platforms.products') +TBD diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index b15b586d5..43a24d1cf 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -7,6 +7,6 @@ = t('layout.projects.git_repo_location') = @project.git_repo_path -= link_to t('layout.projects.back_to_the_list'), platform_path(@platform) += link_to t('layout.projects.back_to_the_list'), platform_repository_path(@repository, @platform) %br/ -= link_to "git-repo", platform_project_repo_path(@platform, @project) += link_to "git-repo", platform_repository_project_repo_path(@platform, @repository, @project) diff --git a/app/views/repositories/new.html.haml b/app/views/repositories/new.html.haml new file mode 100644 index 000000000..e69de29bb diff --git a/app/views/repositories/show.html.haml b/app/views/repositories/show.html.haml new file mode 100644 index 000000000..e69de29bb diff --git a/config/routes.rb b/config/routes.rb index 4bab0e2fe..c18cfc28f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2,8 +2,10 @@ Rosa::Application.routes.draw do devise_for :users resources :platforms do - resources :projects do - resource :repo, :controller => "git/repositories", :only => [:show] + resources :repositories do + resources :projects do + resource :repo, :controller => "git/repositories", :only => [:show] + end end end