forked from pinballmap/pbm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show OPDB backglass images in machine details
- Loading branch information
Showing
4 changed files
with
47 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- if (!lmx.machine.opdb_img.blank?) | ||
%div{:class => 'backglass_container'} | ||
=image_tag( "#{lmx.machine.opdb_img}", :alt => "#{lmx.machine.name} backglass image",:class => 'backglass_img') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
- if lmx.ic_enabled? | ||
- has_text = "Has" | ||
- else | ||
- has_text = "No" | ||
- if !user_signed_in? | ||
= button_to new_user_session_path, :class => ["bold pointer ic_button", (lmx.ic_enabled == nil ? "ic_button_unknown_#{lmx.id} ic_unknown" : lmx.ic_enabled ? "ic_yes ic_button_#{lmx.id}" : "ic_no ic_button_#{lmx.id}")] do | ||
Insider Connected | ||
- else | ||
= button_to ic_toggle_location_machine_xref_path(lmx), method: :patch, remote: :true, :class => ["bold pointer ic_button", (lmx.ic_enabled == nil ? "ic_button_unknown_#{lmx.id} ic_unknown" : lmx.ic_enabled ? "ic_yes ic_button_#{lmx.id}" : "ic_no ic_button_#{lmx.id}")] do | ||
Insider Connected | ||
- if lmx.machine.ic_eligible | ||
- if lmx.ic_enabled? | ||
- has_text = "Has" | ||
- else | ||
- has_text = "No" | ||
- if !user_signed_in? | ||
= button_to new_user_session_path, :class => ["bold pointer ic_button", (lmx.ic_enabled == nil ? "ic_button_unknown_#{lmx.id} ic_unknown" : lmx.ic_enabled ? "ic_yes ic_button_#{lmx.id}" : "ic_no ic_button_#{lmx.id}")] do | ||
Insider Connected | ||
- else | ||
= button_to ic_toggle_location_machine_xref_path(lmx), method: :patch, remote: :true, :class => ["bold pointer ic_button", (lmx.ic_enabled == nil ? "ic_button_unknown_#{lmx.id} ic_unknown" : lmx.ic_enabled ? "ic_yes ic_button_#{lmx.id}" : "ic_no ic_button_#{lmx.id}")] do | ||
Insider Connected | ||
|
||
:javascript | ||
$(".ic_button_unknown_#{lmx.id}").click(function(event){ | ||
if (event.target.classList.contains('ic_unknown')) { | ||
$(this).removeClass("ic_unknown").addClass("ic_yes"); | ||
} else { | ||
$(this).toggleClass("ic_no ic_yes"); | ||
} | ||
}) | ||
$(".ic_button_#{lmx.id}").click(function(){ | ||
$(".ic_button_#{lmx.id}").toggleClass('ic_yes ic_no'); | ||
}); | ||
:javascript | ||
$(".ic_button_unknown_#{lmx.id}").click(function(event){ | ||
if (event.target.classList.contains('ic_unknown')) { | ||
$(this).removeClass("ic_unknown").addClass("ic_yes"); | ||
} else { | ||
$(this).toggleClass("ic_no ic_yes"); | ||
} | ||
}) | ||
$(".ic_button_#{lmx.id}").click(function(){ | ||
$(".ic_button_#{lmx.id}").toggleClass('ic_yes ic_no'); | ||
}); |
4 changes: 2 additions & 2 deletions
4
app/views/location_machine_xrefs/_render_machine_tools.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters