diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-06-23 19:47:22 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-06-23 19:47:22 +0300 |
commit | 2ed7cbfba4ff3c6a4cf3e72515a0375544998de0 (patch) | |
tree | ae6d7530745c80633cd993c99f7820e1452f3e1b /app/views/projects/repositories | |
parent | 95791316f4037273af7b747ce1851d5f4e46933f (diff) | |
download | gitlab-ce-2ed7cbfba4ff3c6a4cf3e72515a0375544998de0.tar.gz |
Move projects controllers/views in Projects module
Diffstat (limited to 'app/views/projects/repositories')
-rw-r--r-- | app/views/projects/repositories/_branch.html.haml | 26 | ||||
-rw-r--r-- | app/views/projects/repositories/_feed.html.haml | 19 | ||||
-rw-r--r-- | app/views/projects/repositories/_filter.html.haml | 9 | ||||
-rw-r--r-- | app/views/projects/repositories/branches.html.haml | 15 | ||||
-rw-r--r-- | app/views/projects/repositories/show.html.haml | 14 | ||||
-rw-r--r-- | app/views/projects/repositories/stats.html.haml | 33 | ||||
-rw-r--r-- | app/views/projects/repositories/tags.html.haml | 36 |
7 files changed, 152 insertions, 0 deletions
diff --git a/app/views/projects/repositories/_branch.html.haml b/app/views/projects/repositories/_branch.html.haml new file mode 100644 index 00000000000..dd91e14b66b --- /dev/null +++ b/app/views/projects/repositories/_branch.html.haml @@ -0,0 +1,26 @@ +- commit = Commit.new(Gitlab::Git::Commit.new(branch.commit)) +%tr + %td + = link_to project_commits_path(@project, branch.name) do + - if @project.protected_branch? branch.name + %i.icon-lock + - else + %i.icon-unlock + %strong= truncate(branch.name, length: 60) + - if branch.name == @repository.root_ref + %span.label default + %td + = link_to project_commit_path(@project, commit.id), class: 'commit_short_id' do + = commit.short_id + = image_tag gravatar_icon(commit.author_email), class: "avatar s16" + %span.light + = gfm escape_once(truncate(commit.title, length: 40)) + %span + = time_ago_in_words(commit.committed_date) + ago + %td + - if can? current_user, :download_code, @project + = link_to archive_project_repository_path(@project, ref: branch.name) do + %i.icon-download-alt + Download + diff --git a/app/views/projects/repositories/_feed.html.haml b/app/views/projects/repositories/_feed.html.haml new file mode 100644 index 00000000000..6bb75265ffb --- /dev/null +++ b/app/views/projects/repositories/_feed.html.haml @@ -0,0 +1,19 @@ +- commit = update +%tr + %td + = link_to project_commits_path(@project, commit.head.name) do + %strong + = commit.head.name + - if @project.root_ref?(commit.head.name) + %span.label default + + %td + %div + = link_to project_commits_path(@project, commit.id) do + %code= commit.short_id + = image_tag gravatar_icon(commit.author_email), class: "", width: 16 + = gfm escape_once(truncate(commit.title, length: 40)) + %td + %span.pull-right.cgray + = time_ago_in_words(commit.committed_date) + ago diff --git a/app/views/projects/repositories/_filter.html.haml b/app/views/projects/repositories/_filter.html.haml new file mode 100644 index 00000000000..e718d48190a --- /dev/null +++ b/app/views/projects/repositories/_filter.html.haml @@ -0,0 +1,9 @@ +%ul.nav.nav-pills.nav-stacked + = nav_link(path: 'repositories#show') do + = link_to 'Recent', project_repository_path(@project) + = nav_link(path: 'protected_branches#index') do + = link_to project_protected_branches_path(@project) do + Protected + %i.icon-lock + = nav_link(path: 'repositories#branches') do + = link_to 'All branches', branches_project_repository_path(@project) diff --git a/app/views/projects/repositories/branches.html.haml b/app/views/projects/repositories/branches.html.haml new file mode 100644 index 00000000000..2bdd304cdac --- /dev/null +++ b/app/views/projects/repositories/branches.html.haml @@ -0,0 +1,15 @@ += render "projects/commits/head" +.row + .span3 + = render "filter" + .span9 + - unless @branches.empty? + %table + %thead + %tr + %th Name + %th Last commit + %th + %tbody + - @branches.each do |branch| + = render "projects/repositories/branch", branch: branch diff --git a/app/views/projects/repositories/show.html.haml b/app/views/projects/repositories/show.html.haml new file mode 100644 index 00000000000..84a32e62426 --- /dev/null +++ b/app/views/projects/repositories/show.html.haml @@ -0,0 +1,14 @@ += render "projects/commits/head" +.row + .span3 + = render "filter" + .span9 + %table + %thead + %tr + %th Name + %th Last commit + %th + - @activities.each do |update| + = render "branch", branch: update.head + diff --git a/app/views/projects/repositories/stats.html.haml b/app/views/projects/repositories/stats.html.haml new file mode 100644 index 00000000000..dfdbc898912 --- /dev/null +++ b/app/views/projects/repositories/stats.html.haml @@ -0,0 +1,33 @@ += render "projects/commits/head" +.row + .span6 + %div#activity-chart.chart + %hr + %p + %b Total commits: + %span= @stats.commits_count + %p + %b Total files in #{@repository.root_ref}: + %span= @stats.files_count + %p + %b Authors: + %span= @stats.authors_count + + + .span6 + %h4 Top 50 Committers: + %ol.styled + - @stats.authors[0...50].each do |author| + %li + = image_tag gravatar_icon(author.email, 16), class: 'avatar s16' + = author.name + %small.light= author.email + .pull-right + = author.commits + + +:javascript + var labels = [#{@graph.labels.to_json}]; + var commits = [#{@graph.commits.join(', ')}]; + var title = "Commit activity for last #{@graph.weeks} weeks"; + Chart.init(labels, commits, title); diff --git a/app/views/projects/repositories/tags.html.haml b/app/views/projects/repositories/tags.html.haml new file mode 100644 index 00000000000..5972ea6c531 --- /dev/null +++ b/app/views/projects/repositories/tags.html.haml @@ -0,0 +1,36 @@ += render "projects/commits/head" +- unless @tags.empty? + %ul.bordered-list + - @tags.each do |tag| + - commit = Commit.new(Gitlab::Git::Commit.new(tag.commit)) + %li + %h5 + = link_to project_commits_path(@project, tag.name), class: "" do + %i.icon-tag + = tag.name + %small + = truncate(tag.message || '', length: 70) + .pull-right + %span.light + = time_ago_in_words(commit.committed_date) + ago + %div.prepend-left-20 + = link_to commit.short_id(8), project_commit_path(@project, commit), class: "monospace" + – + = link_to_gfm truncate(commit.title, length: 70), project_commit_path(@project, commit.id), class: "cdark" + + - if can? current_user, :download_code, @project + .pull-right + = link_to archive_project_repository_path(@project, ref: tag.name) do + %i.icon-download-alt + Download + + +- else + %h3.nothing_here_message + Repository has no tags yet. + %br + %small + Use git tag command to add a new one: + %br + %span.monospace git tag -a v1.4 -m 'version 1.4' |