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:

show_repository_url.patch

Lukas Pirl, 13 Jan 2015 18:19

Download (1.83 KB)

View differences:

app/views/scm/_view_repositories_show_contextual.html.erb
1
<div class="contextual" style="padding-left: 5px;">
2

  
3
  <% repository_url = repository.root_url %>
4

  
5
  <% begin %>
6
    <% interface = Object.const_get("#{repository.class.name.demodulize}Creator") %>
7
    <% rescue NameError %>
8
  <% end %>
9

  
10
  <% if (interface && (interface < SCMCreator) && interface.enabled? && interface.options['url'].present? && repository.created_with_scm) %>
11
    <% repository_url = interface.external_url(repository) if repository %>
12
  <% end %>
13

  
14
  <% if repository_url %>
15
    <%= javascript_tag("$(document).ready(function() {
16
                          $('#repository_url').click(function(){
17
                             $(this).select();;
18
                          });
19
                        });") %>
20
    | URL: <%= text_field_tag 'repository_url', repository_url, :size => 24, :read_only => true, :style => 'color: inherit;' %>
21
  <% end %>
22
</div>
init.rb
14 14

  
15 15
require_dependency 'scm_config'
16 16
require_dependency 'scm_hook'
17
require_dependency 'scm_repository_hook'
17 18

  
18 19
require_dependency File.expand_path(File.join(File.dirname(__FILE__), 'app/models/repository_observer'))
19 20

  
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