Loading app/assets/javascripts/event_ratings.js 0 → 100644 +39 −0 Original line number Diff line number Diff line $(document).ready(function() { $("#my_rating").raty({ path: "", starOn: '#{raty_icon_path("on")}', starHalf: '#{raty_icon_path("half")}', starOff: '#{raty_icon_path("off")}', half: true, start: $("#event_rating_rating").val(), target: "#event_rating_rating", targetType: "number", targetKeep: true }); $("#total_rating").raty({ readOnly: true, path: "", starOn: '#{raty_icon_path("on")}', starHalf: '#{raty_icon_path("half")}', starOff: '#{raty_icon_path("off")}', half: true, start: $("#total_rating").data("rating") }); $("td .rating").each(function(index) { $(this).raty({ readOnly: true, path: "", starOn: '#{raty_icon_path("on")}', starHalf: '#{raty_icon_path("half")}', starOff: '#{raty_icon_path("off")}', half: true, start: $(this).data('rating') }); }); $('[data-function="toggle-description"]').click(function() { $('#full_description').toggle(); return false }); }); app/inputs/rating_input.rb +0 −2 Original line number Diff line number Diff line class RatingInput < FormtasticBootstrap::Inputs::HiddenInput def to_html generic_input_wrapping do builder.hidden_field(method, input_html_options) + "<div id=\"my_rating\"></div>".html_safe end end end app/views/event_ratings/show.html.haml +2 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ %li= link_to "Feedback", event_event_feedbacks_path(@event) .row .span16 %small= link_to_function "Toggle Description >>", "$('#full_description').toggle();" %small= link_to "Toggle Description >>", "#", data: { function: 'notification-defaults' } #full_description{:style => "display:none;"} .row .span16 Loading Loading @@ -146,3 +146,4 @@ }); }); }); Loading
app/assets/javascripts/event_ratings.js 0 → 100644 +39 −0 Original line number Diff line number Diff line $(document).ready(function() { $("#my_rating").raty({ path: "", starOn: '#{raty_icon_path("on")}', starHalf: '#{raty_icon_path("half")}', starOff: '#{raty_icon_path("off")}', half: true, start: $("#event_rating_rating").val(), target: "#event_rating_rating", targetType: "number", targetKeep: true }); $("#total_rating").raty({ readOnly: true, path: "", starOn: '#{raty_icon_path("on")}', starHalf: '#{raty_icon_path("half")}', starOff: '#{raty_icon_path("off")}', half: true, start: $("#total_rating").data("rating") }); $("td .rating").each(function(index) { $(this).raty({ readOnly: true, path: "", starOn: '#{raty_icon_path("on")}', starHalf: '#{raty_icon_path("half")}', starOff: '#{raty_icon_path("off")}', half: true, start: $(this).data('rating') }); }); $('[data-function="toggle-description"]').click(function() { $('#full_description').toggle(); return false }); });
app/inputs/rating_input.rb +0 −2 Original line number Diff line number Diff line class RatingInput < FormtasticBootstrap::Inputs::HiddenInput def to_html generic_input_wrapping do builder.hidden_field(method, input_html_options) + "<div id=\"my_rating\"></div>".html_safe end end end
app/views/event_ratings/show.html.haml +2 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ %li= link_to "Feedback", event_event_feedbacks_path(@event) .row .span16 %small= link_to_function "Toggle Description >>", "$('#full_description').toggle();" %small= link_to "Toggle Description >>", "#", data: { function: 'notification-defaults' } #full_description{:style => "display:none;"} .row .span16 Loading Loading @@ -146,3 +146,4 @@ }); }); });