2012-02-17 11:13:54 +00:00
|
|
|
= form_tag compare_path(@project, @name), :name => "compare-versions", :id => "version-form" do
|
|
|
|
%table.wiki{:cellpadding => "0", :cellspacing => "0"}
|
|
|
|
- @versions.each do |v|
|
|
|
|
%tr.history
|
|
|
|
%td.td1
|
|
|
|
%span#niceCheckbox1.niceCheck-main{:onclick => "changeCheck(this)"}
|
2012-02-24 21:37:22 +00:00
|
|
|
/ = check_box_tag "versions[]", v.id, :html => {:class => 'history_cbx'}
|
2012-02-21 12:42:09 +00:00
|
|
|
%input{:type => 'checkbox', :id => 'versions_', :name => 'versions[]', :value => v.id, :class => 'history_cbx'}
|
2012-02-17 11:13:54 +00:00
|
|
|
%td.td2
|
|
|
|
- user = User.where(:email => v.author.email).first
|
|
|
|
.avatar
|
|
|
|
%a{:href => "#"}
|
|
|
|
= link_to user_path_by_user(user) do
|
2012-02-24 21:37:22 +00:00
|
|
|
%img.mini-gravatar{:src => gravatar_url(v.author.email), :alt => "avatar: #{v.author.name.encode_to_default}"}
|
2012-02-17 11:13:54 +00:00
|
|
|
%span.username= user.present? ? user.uname : v.author.name.encode_to_default
|
|
|
|
.name
|
|
|
|
.both
|
|
|
|
%td.td3
|
|
|
|
%span.wiki-gray= "#{l v.committed_date.to_date, :format => :long}:"
|
|
|
|
= v.message.encode_to_default
|
|
|
|
- if @name
|
2012-02-24 21:37:22 +00:00
|
|
|
= raw "[#{link_to v.id[0..6], versioned_project_wiki_path(@project, escaped_name, v.id), :title => t("wiki.view_commit")}]"
|
2012-02-17 11:13:54 +00:00
|
|
|
- else
|
|
|
|
= "[#{v.id[0..6]}]"
|
2012-01-17 23:30:54 +00:00
|
|
|
|
2012-02-24 21:37:22 +00:00
|
|
|
:javascript
|
|
|
|
$('.niceCheck-main').click(function() {
|
|
|
|
var count = 0;
|
|
|
|
$('input.history_cbx').each(function(i,el) {
|
|
|
|
if ($(el).attr('checked')) {
|
|
|
|
count = count + 1;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
if (count > 2) {
|
|
|
|
var cbx = $( $(this).find('input.history_cbx')[0] );
|
|
|
|
if ( cbx.attr('checked') ) {
|
|
|
|
$(this).css('background-position', '0pt 0px');
|
|
|
|
cbx.removeAttr('checked');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|