diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-03-25 12:12:15 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-03-25 12:12:15 +0000 |
commit | 16f9f50f50dbac49b1f791c7c2892420a354bc43 (patch) | |
tree | efaebfb9dd13bde6d45afa36b39063772d9116de /app/views | |
parent | 6f1dcdc08f401923ac77254ca22fd520582bcf6f (diff) | |
download | redmine-16f9f50f50dbac49b1f791c7c2892420a354bc43.tar.gz redmine-16f9f50f50dbac49b1f791c7c2892420a354bc43.zip |
SVN commits are now stored in the database, and added to the activity view and the search engine.
New commits are automatically retrieved and stored when consulting the repository in the app. This behaviour can be disabled by unchecking 'Autofecth commits' in configuration settings.
Commits can be fetched offline by running (recommanded at least for the initial import of past commits):
ruby script/runner "Repository.fetch_changesets"
It will load commits for all of the repositories.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@377 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/projects/_form.rhtml | 2 | ||||
-rw-r--r-- | app/views/projects/activity.rhtml | 4 | ||||
-rw-r--r-- | app/views/projects/search.rhtml | 7 | ||||
-rw-r--r-- | app/views/repositories/_revisions.rhtml | 20 | ||||
-rw-r--r-- | app/views/repositories/revision.rhtml | 16 | ||||
-rw-r--r-- | app/views/repositories/revisions.rhtml | 27 | ||||
-rw-r--r-- | app/views/repositories/show.rhtml | 15 | ||||
-rw-r--r-- | app/views/settings/edit.rhtml | 3 |
8 files changed, 53 insertions, 41 deletions
diff --git a/app/views/projects/_form.rhtml b/app/views/projects/_form.rhtml index 85f3f2966..ded227197 100644 --- a/app/views/projects/_form.rhtml +++ b/app/views/projects/_form.rhtml @@ -30,7 +30,7 @@ <%= hidden_field_tag "repository_enabled", 0 %> <div id="repository"> <% fields_for :repository, @project.repository, { :builder => TabularFormBuilder, :lang => current_language} do |repository| %> -<p><%= repository.text_field :url, :size => 60, :required => true %><br />(http://, https://, svn://, file:///)</p> +<p><%= repository.text_field :url, :size => 60, :required => true, :disabled => (@project.repository && !@project.repository.root_url.blank?) %><br />(http://, https://, svn://, file:///)</p> <p><%= repository.text_field :login, :size => 30 %></p> <p><%= repository.password_field :password, :size => 30 %></p> <% end %> diff --git a/app/views/projects/activity.rhtml b/app/views/projects/activity.rhtml index b1d131aa9..69bfa6028 100644 --- a/app/views/projects/activity.rhtml +++ b/app/views/projects/activity.rhtml @@ -7,6 +7,7 @@ <%= select_year(@year, :prefix => "year", :discard_type => true) %></p> <p> <%= check_box_tag 'show_issues', 1, @show_issues %><%= hidden_field_tag 'show_issues', 0, :id => nil %> <%=l(:label_issue_plural)%><br /> + <% if @project.repository %><%= check_box_tag 'show_changesets', 1, @show_changesets %><%= hidden_field_tag 'show_changesets', 0, :id => nil %> <%=l(:label_revision_plural)%><br /><% end %> <%= check_box_tag 'show_news', 1, @show_news %><%= hidden_field_tag 'show_news', 0, :id => nil %> <%=l(:label_news_plural)%><br /> <%= check_box_tag 'show_files', 1, @show_files %><%= hidden_field_tag 'show_files', 0, :id => nil %> <%=l(:label_attachment_plural)%><br /> <%= check_box_tag 'show_documents', 1, @show_documents %><%= hidden_field_tag 'show_documents', 0, :id => nil %> <%=l(:label_document_plural)%><br /> @@ -39,6 +40,9 @@ <% elsif e.is_a? WikiContent.versioned_class %> <%= e.created_on.strftime("%H:%M") %> <%=l(:label_wiki_edit)%>: <%= link_to h(WikiPage.pretty_title(e.title)), :controller => 'wiki', :page => e.title %> (<%= link_to '#' + e.version.to_s, :controller => 'wiki', :page => e.title, :version => e.version %>)<br /> <% unless e.comment.blank? %><em><%=h e.comment %></em><% end %> + <% elsif e.is_a? Changeset %> + <%= e.created_on.strftime("%H:%M") %> <%=l(:label_revision)%> <%= link_to h(e.revision), :controller => 'repositories', :action => 'revision', :id => @project, :rev => e.revision %><br /> + <em><%=h e.committer %><%= h(": #{e.comment}") unless e.comment.blank? %></em> <% end %> </p></li> diff --git a/app/views/projects/search.rhtml b/app/views/projects/search.rhtml index 056effd47..8b35dce3b 100644 --- a/app/views/projects/search.rhtml +++ b/app/views/projects/search.rhtml @@ -4,6 +4,9 @@ <% form_tag({:action => 'search', :id => @project}, :method => :get) do %> <p><%= text_field_tag 'q', @question, :size => 30 %> <%= check_box_tag 'scope[]', 'issues', (@scope.include? 'issues') %> <label><%= l(:label_issue_plural) %></label> +<% if @project.repository %> +<%= check_box_tag 'scope[]', 'changesets', (@scope.include? 'changesets') %> <label><%= l(:label_revision_plural) %></label> +<% end %> <%= check_box_tag 'scope[]', 'news', (@scope.include? 'news') %> <label><%= l(:label_news_plural) %></label> <%= check_box_tag 'scope[]', 'documents', (@scope.include? 'documents') %> <label><%= l(:label_document_plural) %></label> <% if @project.wiki %> @@ -36,6 +39,10 @@ <%=l(:label_wiki)%>: <%= link_to highlight_tokens(h(e.pretty_title), @tokens), :controller => 'wiki', :action => 'index', :id => @project, :page => e.title %><br /> <%= highlight_tokens(e.content.text, @tokens) %><br /> <i><%= e.content.author ? e.content.author.name : "Anonymous" %>, <%= format_time(e.content.updated_on) %></i> + <% elsif e.is_a? Changeset %> + <%=l(:label_revision)%> <%= link_to h(e.revision), :controller => 'repositories', :action => 'revision', :id => @project, :rev => e.revision %><br /> + <%= highlight_tokens(e.comment, @tokens) %><br /> + <em><%= e.committer.blank? ? e.committer : "Anonymous" %>, <%= format_time(e.committed_on) %></em> <% end %> </p></li> <% end %> diff --git a/app/views/repositories/_revisions.rhtml b/app/views/repositories/_revisions.rhtml new file mode 100644 index 000000000..d9bf7cc7c --- /dev/null +++ b/app/views/repositories/_revisions.rhtml @@ -0,0 +1,20 @@ +<table class="list"> +<thead><tr> +<th>#</th> +<th><%= l(:field_author) %></th> +<th><%= l(:label_date) %></th> +<th><%= l(:field_comment) %></th> +<th></th> +</tr></thead> +<tbody> +<% changesets.each do |changeset| %> +<tr class="<%= cycle 'odd', 'even' %>"> +<th align="center"><%= link_to changeset.revision, :action => 'revision', :id => project, :rev => changeset.revision %></th> +<td align="center"><em><%=h changeset.committer %></em></td> +<td align="center"><%= format_time(changeset.committed_on) %></td> +<td style="width:70%"><%= textilizable(changeset.comment) %></td> +<td align="center"><%= link_to 'Diff', :action => 'diff', :id => project, :path => path, :rev => changeset.revision if entry && entry.is_file? && changeset != changesets.last %></td> +</tr> +<% end %> +</tbody> +</table>
\ No newline at end of file diff --git a/app/views/repositories/revision.rhtml b/app/views/repositories/revision.rhtml index 22e965090..3f28f3a9c 100644 --- a/app/views/repositories/revision.rhtml +++ b/app/views/repositories/revision.rhtml @@ -5,10 +5,10 @@ <% end %> </div> -<h2><%= l(:label_revision) %> <%= @revision.identifier %></h2> +<h2><%= l(:label_revision) %> <%= @changeset.revision %></h2> -<p><em><%= @revision.author %>, <%= format_time(@revision.time) %></em></p> -<%= textilizable @revision.message %> +<p><em><%= @changeset.committer %>, <%= format_time(@changeset.committed_on) %></em></p> +<%= textilizable @changeset.comment %> <div style="float:right;"> <div class="square action_A"></div> <div style="float:left;"><%= l(:label_added) %> </div> @@ -19,19 +19,19 @@ <h3><%= l(:label_attachment_plural) %></h3> <table class="list"> <tbody> -<% @revision.paths.each do |path| %> +<% @changeset.changes.each do |change| %> <tr class="<%= cycle 'odd', 'even' %>"> -<td><div class="square action_<%= path[:action] %>"></div> <%= path[:path] %></td> +<td><div class="square action_<%= change.action %>"></div> <%= change.path %></td> <td> -<% if path[:action] == "M" %> -<%= link_to 'View diff', :action => 'diff', :id => @project, :path => path[:path], :rev => @revision.identifier %> +<% if change.action == "M" %> +<%= link_to 'View diff', :action => 'diff', :id => @project, :path => change.path, :rev => @changeset.revision %> <% end %> </td> </tr> <% end %> </tbody> </table> -<p><%= lwr(:label_modification, @revision.paths.length) %></p> +<p><%= lwr(:label_modification, @changeset.changes.length) %></p> <% content_for :header_tags do %> <%= stylesheet_link_tag "scm" %> diff --git a/app/views/repositories/revisions.rhtml b/app/views/repositories/revisions.rhtml index 8e300a9da..52564472d 100644 --- a/app/views/repositories/revisions.rhtml +++ b/app/views/repositories/revisions.rhtml @@ -5,36 +5,17 @@ <% end %> </div> -<h2><%= render :partial => 'navigation', :locals => { :path => @path, :kind => @entry.kind, :revision => @rev } %></h2> +<h2><%= render :partial => 'navigation', :locals => { :path => @path, :kind => (@entry ? @entry.kind : nil), :revision => @rev } %></h2> -<% if @entry.is_file? %> +<% if @entry && @entry.is_file? %> <h3><%=h @entry.name %></h3> <p><%= link_to 'Download', {:action => 'entry', :id => @project, :path => @path, :rev => @rev, :format => 'raw' }, :class => "icon file" %> (<%= number_to_human_size @entry.size %>)</p> <% end %> <h3>Revisions</h3> -<table class="list"> -<thead><tr> -<th>#</th> -<th><%= l(:field_author) %></th> -<th><%= l(:label_date) %></th> -<th><%= l(:field_description) %></th> -<th></th> -</tr></thead> -<tbody> -<% @revisions.each do |revision| %> -<tr class="<%= cycle 'odd', 'even' %>"> -<th align="center"><%= link_to revision.identifier, :action => 'revision', :id => @project, :rev => revision.identifier %></th> -<td align="center"><em><%=h revision.author %></em></td> -<td align="center"><%= format_time(revision.time) %></td> -<td style="width:70%"><%= textilizable(revision.message) %></td> -<td align="center"><%= link_to 'Diff', :action => 'diff', :id => @project, :path => @path, :rev => revision.identifier if @entry.is_file? && revision != @revisions.last %></td> -</tr> -<% end %> -</tbody> -</table> -<p><%= lwr(:label_modification, @revisions.length) %></p> +<%= render :partial => 'revisions', :locals => {:project => @project, :path => @path, :changesets => @changesets, :entry => @entry }%> +<p><%= lwr(:label_modification, @changesets.length) %></p> <% content_for :header_tags do %> <%= stylesheet_link_tag "scm" %> diff --git a/app/views/repositories/show.rhtml b/app/views/repositories/show.rhtml index 9c2adc929..e7d71cb79 100644 --- a/app/views/repositories/show.rhtml +++ b/app/views/repositories/show.rhtml @@ -1,17 +1,14 @@ <h2><%= l(:label_repository) %></h2> -<h3><%= l(:label_revision_plural) %></h3> -<% if @latest_revision %> - <p><%= l(:label_latest_revision) %>: - <%= link_to @latest_revision.identifier, :action => 'revision', :id => @project, :rev => @latest_revision.identifier %><br /> - <em><%= @latest_revision.author %>, <%= format_time(@latest_revision.time) %></em></p> -<% end %> -<p><%= link_to l(:label_view_revisions), :action => 'revisions', :id => @project %></p> - - <h3><%= l(:label_browse) %></h3> <%= render :partial => 'dir_list' %> +<% unless @changesets.empty? %> +<h3><%= l(:label_latest_revision_plural) %></h3> +<%= render :partial => 'revisions', :locals => {:project => @project, :path => '', :changesets => @changesets, :entry => nil }%> +<p><%= link_to l(:label_view_revisions), :action => 'revisions', :id => @project %></p> +<% end %> + <% content_for :header_tags do %> <%= stylesheet_link_tag "scm" %> <% end %>
\ No newline at end of file diff --git a/app/views/settings/edit.rhtml b/app/views/settings/edit.rhtml index 4bdea07b9..223df7a9d 100644 --- a/app/views/settings/edit.rhtml +++ b/app/views/settings/edit.rhtml @@ -45,6 +45,9 @@ <p><label><%= l(:setting_feeds_limit) %></label> <%= text_field_tag 'settings[feeds_limit]', Setting.feeds_limit, :size => 6 %></p> +<p><label><%= l(:setting_autofetch_changesets) %></label> +<%= check_box_tag 'settings[autofetch_changesets]', 1, Setting.autofetch_changesets? %><%= hidden_field_tag 'settings[autofetch_changesets]', 0 %></p> + </div> <%= submit_tag l(:button_save) %> </div> |