lillianchou94/csua169

View on GitHub
app/views/elections/show_main.html.erb

Summary

Maintainability
Test Coverage
<!-- main dashboard -->
<% if current_user != nil %>
    <script>
    
  function open_organization_modal() {
    $(function() {
          $("#hiddenFrameID").empty();
          $("#organizationmodal").dialog({autoOpen: false, modal:true});
          $("#organizationmodal").dialog("open");
      });
  };
    
    function open_election_modal() {
        $(function() {
            $("#hiddenFrameID").empty();
            $("#electionmodal").dialog({autoOpen: false, modal:true});
            $("#electionmodal").dialog("open");
        });
    };
    
    function open_position_modal(button_id) {
        $(function() {
          $("#button_id").val(button_id);
            $("#hiddenFrameID").empty();
            $("#positionmodal").prepend('<input id="button_election_id" style="display:none;" value='+button_id+'>')
            $("#positionmodal").dialog({autoOpen: false, modal:true});
            $("#positionmodal").dialog("open");
        });
    };
    </script>
    <% if current_user.has_non_zero_prime? == false %>
    <p>You are not a registered member. Please make sure your organization leader has added your name and email to the system before trying to log in.</p>
    <% end %>
    <% if current_user.has_non_zero_prime? == true %>
    <p> Click on an election to see election status. </p>
    <% end %>
    
<% end %>