Restream/redmine_undev_git

View on GitHub
app/views/remote_committers/index.html.erb

Summary

Maintainability
Test Coverage
<h1><%= link_to remote_repo_site.uri, remote_repo_site.uri, target: '_blank' %></h1>

<h2><%= l(:label_remote_user_mappings) %></h2>

<%= simple_format(l(:text_remote_user_mappings)) %>

<% if committers.empty? %>
  <p class="nodata"><%= l(:label_no_data) %></p>
<% else %>

  <%= form_tag({}) do %>
    <table class="list">
      <thead>
      <tr>
        <th><%= l(:field_committer) %></th>
        <th><%= l(:label_user) %></th>
      </tr>
      </thead>
      <tbody>
      <% i = 0 -%>
      <% committers.each do |committer, user_id| -%>
        <tr class="<%= cycle 'odd', 'even' %>">
          <td><%= h committer %></td>
          <td>
            <%= hidden_field_tag "committers[#{i}][]", committer %>
            <%= select_tag "committers[#{i}][]",
                content_tag(
                    'option',
                    "-- #{l :actionview_instancetag_blank_option} --",
                    value: ''
                ) +
                    options_from_collection_for_select(
                        users, 'id', 'name', user_id.to_i
                    ) %>
          </td>
        </tr>
        <% i += 1 -%>
      <% end -%>
      </tbody>
    </table>
    <p><%= submit_tag(l(:button_update)) %></p>
  <% end %>

<% end %>