Dont set @project variable in list. Remove a bit of duplication in dash and group

This commit is contained in:
Dmitriy Zaporozhets 2013-01-14 10:09:01 +02:00
parent f716c0a1dd
commit 23e338852c
6 changed files with 21 additions and 32 deletions

View file

@ -12,9 +12,9 @@
- if @issues.any?
- @issues.group_by(&:project).each do |group|
%div.ui-box
- @project = group[0]
- project = group[0]
%h5.title
= link_to_project @project
= link_to_project project
%ul.well-list.issues_table
- group[1].each do |issue|
= render(partial: 'issues/show', locals: {issue: issue})

View file

@ -8,17 +8,4 @@
.span3
= render 'filter', entity: 'merge_request'
.span9
- if @merge_requests.any?
- @merge_requests.group_by(&:project).each do |group|
.ui-box
- @project = group[0]
%h5.title
= link_to_project @project
%ul.well-list
- group[1].each do |merge_request|
= render(partial: 'merge_requests/merge_request', locals: {merge_request: merge_request})
%hr
= paginate @merge_requests, theme: "gitlab"
- else
%h3.nothing_here_message Nothing to show here
= render 'shared/merge_requests'

View file

@ -11,9 +11,9 @@
- if @issues.any?
- @issues.group_by(&:project).each do |group|
%div.ui-box
- @project = group[0]
- project = group[0]
%h5.title
= link_to_project @project
= link_to_project project
%ul.well-list.issues_table
- group[1].each do |issue|
= render(partial: 'issues/show', locals: {issue: issue})

View file

@ -8,17 +8,4 @@
.span3
= render 'filter', entity: 'merge_request'
.span9
- if @merge_requests.any?
- @merge_requests.group_by(&:project).each do |group|
.ui-box
- @project = group[0]
%h5.title
= link_to_project @project
%ul.well-list
- group[1].each do |merge_request|
= render(partial: 'merge_requests/merge_request', locals: {merge_request: merge_request})
%hr
= paginate @merge_requests, theme: "gitlab"
- else
%h3.nothing_here_message Nothing to show here
= render 'shared/merge_requests'

View file

@ -1,4 +1,5 @@
.input-prepend.project_clone_holder
%button{class: "btn active", :"data-clone" => @project.ssh_url_to_repo} SSH
%button{class: "btn", :"data-clone" => @project.http_url_to_repo}= Gitlab.config.gitlab.protocol.upcase
= text_field_tag :project_clone, @project.url_to_repo, class: "one_click_select input-xxlarge"

View file

@ -0,0 +1,14 @@
- if @merge_requests.any?
- @merge_requests.group_by(&:project).each do |group|
.ui-box
- project = group[0]
%h5.title
= link_to_project project
%ul.well-list
- group[1].each do |merge_request|
= render(partial: 'merge_requests/merge_request', locals: {merge_request: merge_request})
%hr
= paginate @merge_requests, theme: "gitlab"
- else
%h3.nothing_here_message Nothing to show here