I'm looking for a part-time remote job.

Hire me


I'm the author of:

Mastering Redmine is a comprehensive guide with tips, tricks and best practices, and an easy-to-learn structure.

Check the book's project or

Buy the book

Social pages of the book:

By buying this book you also donate to Redmine (see this page).


Follow me:

repository-view-_2122.patch

Yukinari Toyota, 30 Jul 2013 16:47

Download (2.16 KB)

View differences:

app/views/scm/_view_repositories_show_contextual.html.erb
1
<div class="contextual" style="padding-left: 5px;">
2
  <% repository_url = repository.root_url %>
3
  <% begin %>
4
    <% interface = Object.const_get("#{repository.scm_name}Creator") %>
5
    <% rescue NameError %>
6
  <% end %>
7
  <% if (interface && (interface < SCMCreator) && interface.enabled? && interface.options['url'].present? && repository.created_with_scm) %>
8
    <% name = interface.repository_name(repository.root_url) %>
9
    <% repository_url = interface.external_url(name) if name %>
10
  <% end %>
11
  <% if repository_url %>
12
    <%= javascript_tag(" $(document).ready(function() {
13
                           $('#repository_url').focus(function(){
14
                             var self = $(this);
15
                             setTimeout(function() { self.select(); }, 10);
16
                           });
17
                         });") %>
18
    | <%= text_field_tag 'repository_url', repository_url, :size => 24, :read_only => true, :style => 'color: rgb(153, 153, 153); padding: 3px 5px 2px;' %>
19
  <% end %>
20

  
21
  <% if User.current.allowed_to?(:manage_repository, @project) %>
22
    | <%= link_to l(:label_repository_new), new_project_repository_path(@project), :class => 'icon icon-add' %>
23
  <% end %>
24
</div>
init.rb
8 8

  
9 9
require_dependency 'scm_config'
10 10
require_dependency 'scm_hook'
11
require_dependency 'scm_repository_hook'
11 12

  
12 13
require_dependency File.expand_path(File.join(File.dirname(__FILE__), 'app/models/repository_observer'))
13 14

  
lib/scm_repository_hook.rb
1
class ScmRepositoryHook < Redmine::Hook::ViewListener
2
    render_on :view_repositories_show_contextual, :partial => 'scm/view_repositories_show_contextual'
3
end
Terms of use | Privacy policy