diff options
author | Valery Sizov <valery@gitlab.com> | 2014-10-07 12:54:00 +0400 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2014-10-07 12:54:00 +0400 |
commit | fd8d1d9b62066766c96610b7d42b20fa0e84b0ac (patch) | |
tree | 3844f60a3ceb8bd2e11275cdd86d45b3103608a8 /app | |
parent | 70004f4ef6160e788e6a600b9da06608c8559aa2 (diff) |
Snippets: rename public to internal
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/snippets_controller.rb | 8 | ||||
-rw-r--r-- | app/models/snippet.rb | 2 | ||||
-rw-r--r-- | app/views/shared/snippets/_form.html.haml | 2 | ||||
-rw-r--r-- | app/views/snippets/current_user_index.html.haml | 8 |
4 files changed, 10 insertions, 10 deletions
diff --git a/app/controllers/snippets_controller.rb b/app/controllers/snippets_controller.rb index 3927584235e..5904dbbceda 100644 --- a/app/controllers/snippets_controller.rb +++ b/app/controllers/snippets_controller.rb @@ -14,7 +14,7 @@ class SnippetsController < ApplicationController layout 'navless' def index - @snippets = Snippet.are_public.fresh.non_expired.page(params[:page]).per(20) + @snippets = Snippet.are_internal.fresh.non_expired.page(params[:page]).per(20) end def user_index @@ -26,15 +26,15 @@ class SnippetsController < ApplicationController if @user == current_user @snippets = case params[:scope] - when 'are_public' then - @snippets.are_public + when 'are_internal' then + @snippets.are_internal when 'are_private' then @snippets.are_private else @snippets end else - @snippets = @snippets.are_public + @snippets = @snippets.are_internal end @snippets = @snippets.page(params[:page]).per(20) diff --git a/app/models/snippet.rb b/app/models/snippet.rb index 80c1af8f337..addde2d106a 100644 --- a/app/models/snippet.rb +++ b/app/models/snippet.rb @@ -32,7 +32,7 @@ class Snippet < ActiveRecord::Base validates :content, presence: true # Scopes - scope :are_public, -> { where(private: false) } + scope :are_internal, -> { where(private: false) } scope :are_private, -> { where(private: true) } scope :fresh, -> { order("created_at DESC") } scope :expired, -> { where(["expires_at IS NOT NULL AND expires_at < ?", Time.current]) } diff --git a/app/views/shared/snippets/_form.html.haml b/app/views/shared/snippets/_form.html.haml index 49ea8460e7d..f4d74045f77 100644 --- a/app/views/shared/snippets/_form.html.haml +++ b/app/views/shared/snippets/_form.html.haml @@ -23,7 +23,7 @@ = f.label :private_false, class: 'radio-label' do = f.radio_button :private, false %span - %strong Public + %strong Internal (GitLab users can see this snippet) .form-group diff --git a/app/views/snippets/current_user_index.html.haml b/app/views/snippets/current_user_index.html.haml index e3edd856983..14b5b072ec2 100644 --- a/app/views/snippets/current_user_index.html.haml +++ b/app/views/snippets/current_user_index.html.haml @@ -23,11 +23,11 @@ Private %span.pull-right = @user.snippets.are_private.count - = nav_tab :scope, 'are_public' do - = link_to user_snippets_path(@user, scope: 'are_public') do - Public + = nav_tab :scope, 'are_internal' do + = link_to user_snippets_path(@user, scope: 'are_internal') do + Internal %span.pull-right - = @user.snippets.are_public.count + = @user.snippets.are_internal.count .col-md-9.my-snippets = render 'snippets' |