diff --git a/core/modules/user/user.admin.inc b/core/modules/user/user.admin.inc
index ed8508a..af954b1 100644
--- a/core/modules/user/user.admin.inc
+++ b/core/modules/user/user.admin.inc
@@ -980,6 +980,44 @@ function theme_user_admin_roles($variables) {
 }
 
 /**
+ * Preprocess variables for theme('user_admin_roles').
+ *
+ * @see user-admin-roles.html.twig
+ */
+function template_preprocess_user_admin_roles(&$variables) {
+  $form = $variables['form'];
+
+  $header = array(t('Name'), t('Weight'), array('data' => t('Operations'), 'colspan' => 2));
+  foreach (element_children($form['roles']) as $rid) {
+    $row = array();
+    foreach (element_children($form['roles'][$rid]) as $column) {
+      $row[] = drupal_render($form['roles'][$rid][$column]);
+    }
+    $rows[] = array('data' => $row, 'attributes' => array('class' => array('draggable')));
+  }
+
+  // Distribute the role add form into table columns.
+  $form['role']['name']['#title_display'] = 'invisible';
+  unset($form['role']['name']['#description']);
+  unset($form['role']['rid']['#description']);
+
+  $actions = $form['role']['actions'];
+  unset($form['role']['actions']);
+  unset($form['role']['weight']);
+  $row = array();
+  $row[] = drupal_render($form['role']);
+  // Empty placeholder for the weight column.
+  $row[] = '';
+  $row[] = array('data' => drupal_render($actions), 'colspan' => 2);
+  $rows[] = array('data' => $row);
+
+  drupal_add_tabledrag('user-roles', 'order', 'sibling', 'role-weight');
+
+  $variables['table'] = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'user-roles')));
+  $variables['form'] = drupal_render_children($form);
+}
+
+/**
  * Form to configure a single role.
  *
  * @ingroup forms
