ashirahattia/cs169-pgm

View on GitHub
app/views/google/settings.erb

Summary

Maintainability
Test Coverage
<%= render 'layouts/sidebar.html.erb' %>

<% current_settings %>

<div class="content-container">
  <div class="content">
    <h1> Google Sheet Settings </h1>
    <p>
      Update the URL of the sheet you would like the algorithm to pull data from, or change the column number individual attributes should be pulled from.
      <br>
      <b>Note that column numbers are 0-indexed</b>
    </p>
    <%= form_tag(google_settings_path, method: 'PUT') do %>
      <h1>Google Spreadsheet ID:</h1>
      <p>
        This should be the string right after the /d/ in the URL
        <br><input class="full-width" type="text" name="spreadsheet_id" id="spreadsheet_id" value="<%= session[:spreadsheet_id] %>">
      </p>
      <br>
      <h1>Group Data</h1>
      <p>
        <strong>Groups Tab Name</strong>
        <br>This refers to the tab of the sheet containing the group data
        <br></b><input type="text" name="group_tab" id="group_tab" value="<%= session[:group_tab] %>">
        <br>
        <br><strong>Group Username Column:</strong>
        <br><input type="text" name="group_username_col" id="group_username_col" value="<%= session[:group_username_col] %>">
        <br>
        <br><strong>Group ID Column: </strong>
        <br><input type="text" name="group_id_col" id="group_id_col" value="<%= session[:group_id_col] %>">
        <br>
        <br><strong>Group Preference 1 Column: </strong>
        <br><input type="text" name="group_preference_1" id="group_preference_1" value="<%= session[:group_preference_1] %>">
        <br>
        <br><strong>Group Preference 2 Column:</strong>
        <br><input type="text" name="group_preference_2" id="group_preference_2" value="<%= session[:group_preference_2] %>">
        <br>
        <br><strong> Group Preference 3 Column:</strong>
        <br><input type="text" name="group_preference_3" id="group_preference_3" value="<%= session[:group_preference_3] %>">
        <br>
        <br><strong>Group Preference 4 Column:</strong>
        <br><input type="text" name="group_preference_4" id="group_preference_4" value="<%= session[:group_preference_4] %>">
        <br>
        <br><strong>Group Preference 5 Column:</strong>
        <br> <input type="text" name="group_preference_5" id="group_preference_5" value="<%= session[:group_preference_5] %>">
        <br>
        <br><strong>Group Preference 6 Column:</strong>
        <br> <input type="text" name="group_preference_6" id="group_preference_6" value="<%= session[:group_preference_6] %>">
        <br>
        <br><strong>Group Preference 7 Column:</strong>
        <br><input type="text" name="group_preference_7" id="group_preference_7" value="<%= session[:group_preference_7] %>">
      </p>
      <br>
      <h1>Projects Data</h1>
      <p>
        <strong>Projects Tab Name</strong>
        <br>This refers to the tab of the sheet containing project data
        <br><input type="text" name="project_tab" id="project_tab" value="<%= session[:project_tab] %>">
        <br>
        <br><strong> Project ID Column:</strong>
        <br> <input type="text" name="project_id_col" id="project_id_col" value="<%= session[:project_id_col] %>">
        <br>
        <br><strong> Project Name Column:</strong>
        <br> <input type="text" name="project_name_col" id="project_name_col" value="<%= session[:project_name_col] %>">
      </p>
      <br>
      <h1>Match Data</h1>
      <p>
        <strong>Match Tab Name</strong>
        <br>This refers to the tab of the sheet that should contain match data
        <br><input type="text" name="matches_tab" id="matches_tab" value="<%= session[:matches_tab] %>">
      </p>
      <div class="action-container">
        <input id="fetch_matches" class="button" type="submit" value="Save Settings"/>
      </div>
    <% end %>
  </div>
</div>