rosa-build/app/views/wiki/_git_access.html.haml

24 lines
828 B
Plaintext
Raw Normal View History

2012-01-20 15:01:59 +00:00
.url-box
%ul.clone-urls
%li.http-clone-url.selected
= link_to t("layout.wiki.clones.http"), git_repo_url(@project.wiki_repo_name),
2012-02-02 18:30:46 +00:00
:'data-permissions' => (can? :write, @project) ? 'Read+Write' : 'Read'
2012-01-20 15:01:59 +00:00
%input.url-field{:type => 'text', :spellcheck => 'false'}
%p.url-description
%strong
access
:javascript
$(document).ready(function() {
var link = $('li.http-clone-url a').first();
$('.url-box input.url-field').attr('value', link.attr('href'));
$('.url-box p.url-description strong').text(link.attr('data-permissions'));
$('li.http-clone-url a').live('click', function(e) {
e.preventDefault();
$('.url-box input.url-field').attr('value', $(this).attr('href'));
$('.url-box p.url-description strong').text($(this).attr('data-permissions'));
});
});