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

41 lines
1.7 KiB
Plaintext
Raw Normal View History

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)"}
/ = check_box_tag "versions[]", v.id, :html => {:class => 'history_cbx'}
%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
2012-03-06 20:54:02 +00:00
= link_to user_path_by_user(user) do
= image_tag avatar_url_by_email(v.author.email), :alt => "avatar: #{v.author.name}", :class => 'mini-gravatar'
2012-02-17 11:13:54 +00:00
.name
= link_to user_path_by_user(user) do
%span.username= user.present? ? "#{user.uname} (#{user.name})" : v.author.name
2012-02-17 11:13:54 +00:00
.both
%td.td3
%span.wiki-gray= "#{l v.committed_date.to_date, :format => :long}:"
= v.message
2012-02-17 11:13:54 +00:00
- if @name
= 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
: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');
}
}
});