Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2016-12-05 07:19:51 +0300
committerTimothy Andrew <mail@timothyandrew.net>2016-12-16 13:59:32 +0300
commitf706a973c26f9de9a1f1599d532b33e9e66a80bb (patch)
treeec89ae65e503bf24b9e32b01715c0b7efd0111d6 /app/views/shared/tokens/_scopes_form.html.haml
parentf14d423dc7c9ec2d97c83f0c8893661922df4360 (diff)
View-related (and other minor) changes to !5951 based on @rymai's review.
- The `scopes_form` partial can be used in the `admin/applications` view as well - Don't allow partials to access instance variables directly. Instead, pass in the instance variables as local variables, and use `local_assigns.fetch` to assert that the variables are passed in as expected. - Change a few instances of `render :partial` to `render` - Remove an instance of `required: false` in a view, since this is the default - Inline many instances of a local variable (`ip = 'ip'`) in `auth_spec`
Diffstat (limited to 'app/views/shared/tokens/_scopes_form.html.haml')
-rw-r--r--app/views/shared/tokens/_scopes_form.html.haml6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/views/shared/tokens/_scopes_form.html.haml b/app/views/shared/tokens/_scopes_form.html.haml
index 5dbbd9e4808..5074afb63a1 100644
--- a/app/views/shared/tokens/_scopes_form.html.haml
+++ b/app/views/shared/tokens/_scopes_form.html.haml
@@ -1,4 +1,8 @@
-- @scopes.each do |scope|
+- scopes = local_assigns.fetch(:scopes)
+- prefix = local_assigns.fetch(:prefix)
+- token = local_assigns.fetch(:token)
+
+- scopes.each do |scope|
%fieldset
= check_box_tag "#{prefix}[scopes][]", scope, token.scopes.include?(scope), id: "#{prefix}_scopes_#{scope}"
= label_tag "#{prefix}_scopes_#{scope}", scope