Revision 804:548e23d4cd71 app

View differences:

app/controllers/application_controller.rb
177 177
  def find_project
178 178
    @project = Project.find(params[:id])
179 179
  rescue ActiveRecord::RecordNotFound
180
    render_404
180
    User.current.logged? ? render_404 : require_login
181 181
  end
182 182

  
183 183
  # Find project of id params[:project_id]
184 184
  def find_project_by_project_id
185 185
    @project = Project.find(params[:project_id])
186 186
  rescue ActiveRecord::RecordNotFound
187
    render_404
187
    User.current.logged? ? render_404 : require_login
188 188
  end
189 189

  
190 190
  # Find a project based on params[:project_id]
app/helpers/projects_helper.rb
150 150

  
151 151
    if s != ''
152 152
      a = ''
153
      a << "<h2>"
154
      a <<  l("label_my_project_plural")
155
      a << "</h2>"
156 153
      a << "<ul class='projects root'>\n"
157 154
      a << s
158 155
      a << "</ul>\n"
app/helpers/repositories_helper.rb
281 281
                        ) +
282 282
                     '<br />' + l(:text_scm_path_encoding_note))
283 283
  end
284

  
285
  # Generates a link to a downloadable archive for a revision
286
  # Options:
287
  # * :text - Link text (default to the formatted revision)
288
  def link_to_revision_archive(repository, revision, project, options={})
289
    method = repository.class.name.demodulize.underscore + "_link_to_revision_archive"
290
    if repository.is_a?(Repository) &&
291
        respond_to?(method) && method != 'link_to_revision_archive'
292
      send(method, repository, revision, project, options)
293
    end
294
  end
295

  
296
  def mercurial_link_to_revision_archive(repository, revision, project, options={})
297
    text = options.delete(:text) || format_revision(revision)
298
    rev = revision.respond_to?(:identifier) ? revision.identifier : revision
299
    if rev.blank? then rev = 'tip' end
300
    content_tag('a', h(text),
301
        { :href => "/hg/#{project.identifier}/archive/#{rev}.zip" }.merge(options));
302
  end
303

  
284 304
end
app/views/account/register.rhtml
29 29
<p><label for="user_mail"><%=l(:field_mail)%> <span class="required">*</span></label>
30 30
<%= text_field 'user', 'mail'  %></p>
31 31

  
32
<!-- We only support English in this site 
32 33
<p><label for="user_language"><%=l(:field_language)%></label>
33 34
<%= select("user", "language", lang_options_for_select) %></p>
34

  
35
-->
35 36

  
36 37
<h3><%=l(:label_ssamr_details)%></h3>
37 38
	
app/views/repositories/_navigation.rhtml
2 2
  <%= javascript_include_tag 'repository_navigation' %>
3 3
<% end %>
4 4

  
5
<%= link_to l(:label_statistics), {:action => 'stats', :id => @project}, :class => 'icon icon-stats' %>
5
<%= link_to_revision_archive(@repository, @changeset, @project, { :text => l(:label_download_revision), :class => 'icon icon-package' }) %>
6 6

  
7 7
<% form_tag({:action => controller.action_name, :id => @project, :path => to_path_param(@path), :rev => ''}, {:method => :get, :id => 'revision_selector'}) do -%>
8 8
  <!-- Branches Dropdown -->
......
19 19
  | <%= l(:label_revision) %>: 
20 20
  <%= text_field_tag 'rev', @rev, :size => 8 %>
21 21
<% end -%>
22

  
23

  
app/views/repositories/revision.rhtml
1 1
<div class="contextual">
2

  
3
  <%= link_to_revision_archive(@repository, @changeset, @project, { :text => l(:label_download_revision), :class => 'icon icon-package' }) %>
4
  &nbsp;&nbsp;
5

  
2 6
  &#171;
3 7
  <% unless @changeset.previous.nil? -%>
4 8
    <%= link_to_revision(@changeset.previous, @project, :text => l(:label_previous)) %>
5 9
  <% else -%>
6 10
    <%= l(:label_previous) %>
7 11
  <% end -%>
8
|
12

  
9 13
  <% unless @changeset.next.nil? -%>
10 14
    <%= link_to_revision(@changeset.next, @project, :text => l(:label_next)) %>
11 15
  <% else -%>
......
21 25
    <%= text_field_tag 'rev', @rev, :size => 8 %>
22 26
    <%= submit_tag 'OK', :name => nil %>
23 27
  <% end %>
28

  
24 29
</div>
25 30

  
26 31
<h2><%= l(:label_revision) %> <%= format_revision(@changeset) %></h2>
app/views/repositories/show.rhtml
51 51
                       :id => @project, :page => nil, :key => User.current.rss_key})) %>
52 52
<%     end %>
53 53

  
54
<p class="statistics">
55
<%= link_to l(:label_statistics), {:action => 'stats', :id => @project}, :class => 'icon icon-stats' %>
56
</p>
57

  
54 58
<%     other_formats_links do |f| %>
55 59
  <%= f.link_to 'Atom', :url => {:action => 'revisions', :id => @project, :key => User.current.rss_key} %>
56 60
<%     end %>
61

  
57 62
<%   end %>
58 63
<% end %>
59 64

  

Also available in: Unified diff