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

41 lines
1.6 KiB
Plaintext
Raw Normal View History

2014-01-21 04:51:49 +00:00
= form_tag compare_path(@project, @name), name: "compare-versions", id: "version-form" do
%table.wiki{cellpadding: "0", cellspacing: "0"}
2012-02-17 11:13:54 +00:00
- @versions.each do |v|
%tr.history
%td.td1
2014-01-21 04:51:49 +00:00
%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
2014-01-21 04:51:49 +00:00
- user = User.where(email: v.author.email).first
2012-02-17 11:13:54 +00:00
.avatar
2012-03-06 20:54:02 +00:00
= link_to user_path_by_user(user) do
2014-01-21 04:51:49 +00:00
= 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
2012-05-28 11:08:51 +01:00
%span.username= user.present? ? user.fullname : v.author.name
2012-02-17 11:13:54 +00:00
.both
%td.td3
2014-01-21 04:51:49 +00:00
= datetime_moment v.committed_date, tag: :span, class: 'wiki-gray'
= v.message
2012-02-17 11:13:54 +00:00
- if @name
2014-01-21 04:51:49 +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
: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');
}
}
});