From 311210962d6f212d17f1149da843d0afab0c6d74 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Johan=20S=C3=B8rensen?=
Date: Sun, 27 Apr 2008 23:12:41 +0200
Subject: [PATCH] Simplify a few repository pages, and use a custom theme for
the graphs in the sidebar
---
TODO.txt | 1 -
app/views/comments/commit.html.erb | 4 ++++
app/views/comments/index.html.erb | 9 +++------
app/views/committers/new.html.erb | 4 ++++
app/views/logs/show.html.erb | 3 +--
app/views/merge_requests/index.html.erb | 10 ++++------
app/views/merge_requests/new.html.erb | 6 +++++-
app/views/merge_requests/show.html.erb | 6 +++++-
app/views/repositories/new.html.erb | 4 ++++
lib/gitorious/graphs/builder.rb | 17 +++++++++++++++++
.../graphs/commits_by_author_builder.rb | 2 +-
public/stylesheets/base.css | 4 ++--
tmp/graph_generator/.gitignore | 1 +
13 files changed, 51 insertions(+), 20 deletions(-)
create mode 100644 tmp/graph_generator/.gitignore
diff --git a/TODO.txt b/TODO.txt
index aa7669cf..eafc3984 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -1,5 +1,4 @@
new-ui:
-* create hooks symlinks on GitBackend.create+clone
* Make the project tabs active styled depending on context
* Fix menu bottom spacing issue in safari
* Clone stats graph on repositories#index
diff --git a/app/views/comments/commit.html.erb b/app/views/comments/commit.html.erb
index fa15f02d..0192e9e9 100644
--- a/app/views/comments/commit.html.erb
+++ b/app/views/comments/commit.html.erb
@@ -13,3 +13,7 @@
<%= render :partial => @comments -%>
<%= render :partial => "form", :locals => {:sha1 => @commit.id} -%>
+
+<% content_for :submenu do -%>
+ <%= render :partial => "repositories/context_menu" -%>
+<% end -%>
diff --git a/app/views/comments/index.html.erb b/app/views/comments/index.html.erb
index 3c935f06..ada6013f 100644
--- a/app/views/comments/index.html.erb
+++ b/app/views/comments/index.html.erb
@@ -3,12 +3,9 @@
Comments for "<%= h(@repository.name) -%>" repository in <%= h(@repository.project.title) -%>
+<%= render :partial => @comments -%>
+<%= render :partial => "form" -%>
+
<% content_for :submenu do -%>
<%= render :partial => "repositories/context_menu" -%>
<% end -%>
-
-<%= render :partial => "repositories/infobox" -%>
-
-Comments
-<%= render :partial => @comments -%>
-<%= render :partial => "form" -%>
\ No newline at end of file
diff --git a/app/views/committers/new.html.erb b/app/views/committers/new.html.erb
index 0053b450..1a60eb5f 100644
--- a/app/views/committers/new.html.erb
+++ b/app/views/committers/new.html.erb
@@ -34,3 +34,7 @@
<%= f.submit "Add as committer" -%> or <%= link_to "cancel", [@repository.project, @repository] -%>
<% end -%>
+
+<% content_for :submenu do -%>
+ <%= render :partial => "repositories/context_menu" -%>
+<% end -%>
diff --git a/app/views/logs/show.html.erb b/app/views/logs/show.html.erb
index 981369cf..cabcd17a 100644
--- a/app/views/logs/show.html.erb
+++ b/app/views/logs/show.html.erb
@@ -34,7 +34,6 @@
<% end -%>
<% end -%>
-
+
<%= commit_graph_by_author_tag(@repository, params[:id]) %>
-
<% end -%>
diff --git a/app/views/merge_requests/index.html.erb b/app/views/merge_requests/index.html.erb
index a8517dac..80745c84 100644
--- a/app/views/merge_requests/index.html.erb
+++ b/app/views/merge_requests/index.html.erb
@@ -3,12 +3,6 @@
Merge requests in <%=h @repository.name -%>
-<% content_for :submenu do -%>
- <%= render :partial => "repositories/context_menu" -%>
-<% end -%>
-
-<%= render :partial => "repositories/infobox" -%>
-
A "merge request" is a notification from one repository to another that
would like their changes to be merged upstream.
@@ -21,3 +15,7 @@
<% else -%>
<%= render :partial => @merge_requests -%>
<% end -%>
+
+<% content_for :submenu do -%>
+ <%= render :partial => "repositories/context_menu" -%>
+<% end -%>
diff --git a/app/views/merge_requests/new.html.erb b/app/views/merge_requests/new.html.erb
index 726d48f7..50eff297 100644
--- a/app/views/merge_requests/new.html.erb
+++ b/app/views/merge_requests/new.html.erb
@@ -6,4 +6,8 @@
<%= render :partial => "form", :locals => {:form => f} -%>
<%= f.submit "Create merge request" -%>
-<% end -%>
\ No newline at end of file
+<% end -%>
+
+<% content_for :submenu do -%>
+ <%= render :partial => "repositories/context_menu" -%>
+<% end -%>
diff --git a/app/views/merge_requests/show.html.erb b/app/views/merge_requests/show.html.erb
index bfaafe84..0b1ee0e3 100644
--- a/app/views/merge_requests/show.html.erb
+++ b/app/views/merge_requests/show.html.erb
@@ -32,4 +32,8 @@
<%= simple_format(h(commit.message)) -%>
<% end -%>
-<% end -%>
\ No newline at end of file
+<% end -%>
+
+<% content_for :submenu do -%>
+ <%= render :partial => "repositories/context_menu" -%>
+<% end -%>
diff --git a/app/views/repositories/new.html.erb b/app/views/repositories/new.html.erb
index 6bc65a75..f8ed3cf7 100644
--- a/app/views/repositories/new.html.erb
+++ b/app/views/repositories/new.html.erb
@@ -19,3 +19,7 @@
with lots of empty repositories), so it's a good idea to wait with creating
the clone here until there's something to push.
+
+<% content_for :submenu do -%>
+ <%= link_to "Back to repository", [@project, @repository_to_clone] -%>
+<% end -%>
diff --git a/lib/gitorious/graphs/builder.rb b/lib/gitorious/graphs/builder.rb
index 3b52f263..c9cd9805 100644
--- a/lib/gitorious/graphs/builder.rb
+++ b/lib/gitorious/graphs/builder.rb
@@ -42,6 +42,23 @@ def self.default_theme
}
end
+ def self.sidebar_pastel_theme
+ {
+ :colors => [
+ '#a9dada', # blue
+ '#aedaa9', # green
+ '#daaea9', # peach
+ '#dadaa9', # yellow
+ '#a9a9da', # dk purple
+ '#daaeda', # purple
+ '#dadada' # grey
+ ],
+ :marker_color => '#aea9a9', # Grey
+ :font_color => 'black',
+ :background_colors => '#EEF2F5'
+ }
+ end
+
def write
dest = File.join(self.class.graph_dir, construct_filename)
@graph.write(dest)
diff --git a/lib/gitorious/graphs/commits_by_author_builder.rb b/lib/gitorious/graphs/commits_by_author_builder.rb
index 54f34a87..bc27d368 100644
--- a/lib/gitorious/graphs/commits_by_author_builder.rb
+++ b/lib/gitorious/graphs/commits_by_author_builder.rb
@@ -20,7 +20,7 @@ def initialize(repository, branch)
@repository = repository
@branch = branch
@graph = Gruff::Mini::Pie.new(250)
- @graph.theme_pastel
+ @graph.theme = self.class.sidebar_pastel_theme
@graph.marker_font_size = 32
@graph.legend_font_size = 32
@graph.top_margin = 1
diff --git a/public/stylesheets/base.css b/public/stylesheets/base.css
index 5efb83f7..5416a2f5 100644
--- a/public/stylesheets/base.css
+++ b/public/stylesheets/base.css
@@ -1068,9 +1068,9 @@ ul.diff_stats small.deletions { color: #DC0000; }
margin-bottom: 20px;
}
-.commits_by_author_graph img {
+.commits_by_author_graph {
float: right;
- margin: 0 0 10px 10px;
+ margin: 40px 0 10px 10px;
}
.commit_graph {
diff --git a/tmp/graph_generator/.gitignore b/tmp/graph_generator/.gitignore
new file mode 100644
index 00000000..32bc2c04
--- /dev/null
+++ b/tmp/graph_generator/.gitignore
@@ -0,0 +1 @@
+*.status