BigW Consortium Gitlab

Commit b7cf72f6 by Dmitriy Zaporozhets

Merge branch 'master' of github.com:gitlabhq/gitlabhq

parents c4c80899 71ebf3aa
...@@ -221,7 +221,7 @@ group :development, :test do ...@@ -221,7 +221,7 @@ group :development, :test do
gem 'spinach-rails' gem 'spinach-rails'
gem "rspec-rails" gem "rspec-rails"
gem "capybara", '~> 2.2.1' gem "capybara", '~> 2.2.1'
gem "pry" gem "pry-rails"
gem "awesome_print" gem "awesome_print"
gem "database_cleaner" gem "database_cleaner"
gem "launchy" gem "launchy"
...@@ -254,7 +254,7 @@ end ...@@ -254,7 +254,7 @@ end
group :test do group :test do
gem "simplecov", require: false gem "simplecov", require: false
gem "shoulda-matchers", "~> 2.1.0" gem "shoulda-matchers", "~> 2.7.0"
gem 'email_spec' gem 'email_spec'
gem "webmock" gem "webmock"
gem 'test_after_commit' gem 'test_after_commit'
......
...@@ -260,7 +260,7 @@ GEM ...@@ -260,7 +260,7 @@ GEM
multi_xml (>= 0.5.2) multi_xml (>= 0.5.2)
httpauth (0.2.1) httpauth (0.2.1)
httpclient (2.5.3.3) httpclient (2.5.3.3)
i18n (0.6.11) i18n (0.7.0)
ice_nine (0.10.0) ice_nine (0.10.0)
jasmine (2.0.2) jasmine (2.0.2)
jasmine-core (~> 2.0.0) jasmine-core (~> 2.0.0)
...@@ -279,7 +279,7 @@ GEM ...@@ -279,7 +279,7 @@ GEM
turbolinks turbolinks
jquery-ui-rails (4.2.1) jquery-ui-rails (4.2.1)
railties (>= 3.2.16) railties (>= 3.2.16)
json (1.8.1) json (1.8.2)
jwt (0.1.13) jwt (0.1.13)
multi_json (>= 1.5) multi_json (>= 1.5)
kaminari (0.15.1) kaminari (0.15.1)
...@@ -366,6 +366,8 @@ GEM ...@@ -366,6 +366,8 @@ GEM
coderay (~> 1.0) coderay (~> 1.0)
method_source (~> 0.8) method_source (~> 0.8)
slop (~> 3.4) slop (~> 3.4)
pry-rails (0.3.2)
pry (>= 0.9.10)
pyu-ruby-sasl (0.0.3.3) pyu-ruby-sasl (0.0.3.3)
quiet_assets (1.0.2) quiet_assets (1.0.2)
railties (>= 3.1, < 5.0) railties (>= 3.1, < 5.0)
...@@ -495,7 +497,7 @@ GEM ...@@ -495,7 +497,7 @@ GEM
sass (~> 3.2) sass (~> 3.2)
settingslogic (2.0.9) settingslogic (2.0.9)
sexp_processor (4.4.0) sexp_processor (4.4.0)
shoulda-matchers (2.1.0) shoulda-matchers (2.7.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
sidekiq (3.3.0) sidekiq (3.3.0)
celluloid (>= 0.16.0) celluloid (>= 0.16.0)
...@@ -694,7 +696,7 @@ DEPENDENCIES ...@@ -694,7 +696,7 @@ DEPENDENCIES
org-ruby (= 0.9.12) org-ruby (= 0.9.12)
pg pg
poltergeist (~> 1.5.1) poltergeist (~> 1.5.1)
pry pry-rails
quiet_assets (~> 1.0.1) quiet_assets (~> 1.0.1)
rack-attack rack-attack
rack-cors rack-cors
...@@ -719,7 +721,7 @@ DEPENDENCIES ...@@ -719,7 +721,7 @@ DEPENDENCIES
select2-rails select2-rails
semantic-ui-sass (~> 1.8.0) semantic-ui-sass (~> 1.8.0)
settingslogic settingslogic
shoulda-matchers (~> 2.1.0) shoulda-matchers (~> 2.7.0)
sidekiq (~> 3.3) sidekiq (~> 3.3)
simplecov simplecov
sinatra sinatra
......
...@@ -247,15 +247,6 @@ module ApplicationHelper ...@@ -247,15 +247,6 @@ module ApplicationHelper
Gitlab::MarkdownHelper.gitlab_markdown?(filename) Gitlab::MarkdownHelper.gitlab_markdown?(filename)
end end
def spinner(text = nil, visible = false)
css_class = 'loading'
css_class << ' hide' unless visible
content_tag :div, class: css_class do
content_tag(:i, nil, class: 'fa fa-spinner fa-spin') + text
end
end
def link_to(name = nil, options = nil, html_options = nil, &block) def link_to(name = nil, options = nil, html_options = nil, &block)
begin begin
uri = URI(options) uri = URI(options)
......
...@@ -65,8 +65,7 @@ module CommitsHelper ...@@ -65,8 +65,7 @@ module CommitsHelper
branches.sort.map do |branch| branches.sort.map do |branch|
link_to(project_tree_path(project, branch)) do link_to(project_tree_path(project, branch)) do
content_tag :span, class: 'label label-gray' do content_tag :span, class: 'label label-gray' do
content_tag(:i, nil, class: 'fa fa-code-fork') + ' ' + icon('code-fork') + ' ' + branch
branch
end end
end end
end.join(" ").html_safe end.join(" ").html_safe
...@@ -78,8 +77,7 @@ module CommitsHelper ...@@ -78,8 +77,7 @@ module CommitsHelper
sorted.map do |tag| sorted.map do |tag|
link_to(project_commits_path(project, project.repository.find_tag(tag).name)) do link_to(project_commits_path(project, project.repository.find_tag(tag).name)) do
content_tag :span, class: 'label label-gray' do content_tag :span, class: 'label label-gray' do
content_tag(:i, nil, class: 'fa fa-tag') + ' ' + icon('tag') + ' ' + tag
tag
end end
end end
end.join(" ").html_safe end.join(" ").html_safe
......
...@@ -27,18 +27,17 @@ module EventsHelper ...@@ -27,18 +27,17 @@ module EventsHelper
content_tag :li, class: "filter_icon #{active}" do content_tag :li, class: "filter_icon #{active}" do
link_to request.path, class: 'has_tooltip event_filter_link', id: "#{key}_event_filter", 'data-original-title' => tooltip do link_to request.path, class: 'has_tooltip event_filter_link', id: "#{key}_event_filter", 'data-original-title' => tooltip do
content_tag(:i, nil, class: icon_for_event[key]) + icon(icon_for_event[key]) + content_tag(:span, ' ' + tooltip)
content_tag(:span, ' ' + tooltip)
end end
end end
end end
def icon_for_event def icon_for_event
{ {
EventFilter.push => 'fa fa-upload', EventFilter.push => 'upload',
EventFilter.merged => 'fa fa-check-square-o', EventFilter.merged => 'check-square-o',
EventFilter.comments => 'fa fa-comments', EventFilter.comments => 'comments',
EventFilter.team => 'fa fa-user', EventFilter.team => 'user',
} }
end end
......
module IconsHelper module IconsHelper
# Creates an icon tag given icon name(s) and possible icon modifiers.
#
# Right now this method simply delegates directly to `fa_icon` from the
# font-awesome-rails gem, but should we ever use a different icon pack in the
# future we won't have to change hundreds of method calls.
def icon(names, options = {})
fa_icon(names, options)
end
def spinner(text = nil, visible = false)
css_class = 'loading'
css_class << ' hide' unless visible
content_tag :div, class: css_class do
icon('spinner spin') + text
end
end
def boolean_to_icon(value) def boolean_to_icon(value)
if value.to_s == "true" if value.to_s == "true"
content_tag :i, nil, class: 'fa fa-circle cgreen' icon('circle', class: 'cgreen')
else else
content_tag :i, nil, class: 'fa fa-power-off clgray' icon('power-off', class: 'clgray')
end end
end end
def public_icon def public_icon
content_tag :i, nil, class: 'fa fa-globe' icon('globe')
end end
def internal_icon def internal_icon
content_tag :i, nil, class: 'fa fa-shield' icon('shield')
end end
def private_icon def private_icon
content_tag :i, nil, class: 'fa fa-lock' icon('lock')
end end
end end
...@@ -49,7 +49,7 @@ module IssuesHelper ...@@ -49,7 +49,7 @@ module IssuesHelper
ts << capture_haml do ts << capture_haml do
haml_tag :span do haml_tag :span do
haml_concat '&middot;' haml_concat '&middot;'
haml_concat '<i class="fa fa-edit" title="edited"></i> ' haml_concat icon('edit', title: 'edited')
haml_concat time_ago_with_tooltip(issue.updated_at, 'bottom', 'issue_edited_ago') haml_concat time_ago_with_tooltip(issue.updated_at, 'bottom', 'issue_edited_ago')
end end
end end
......
...@@ -22,7 +22,7 @@ module NotesHelper ...@@ -22,7 +22,7 @@ module NotesHelper
ts << capture_haml do ts << capture_haml do
haml_tag :span do haml_tag :span do
haml_concat '&middot;' haml_concat '&middot;'
haml_concat '<i class="fa fa-edit" title="edited"></i> ' haml_concat icon('edit', title: 'edited')
haml_concat time_ago_with_tooltip(note.updated_at, 'bottom', 'note_edited_ago') haml_concat time_ago_with_tooltip(note.updated_at, 'bottom', 'note_edited_ago')
end end
end end
...@@ -57,7 +57,7 @@ module NotesHelper ...@@ -57,7 +57,7 @@ module NotesHelper
button_tag(class: 'btn add-diff-note js-add-diff-note-button', button_tag(class: 'btn add-diff-note js-add-diff-note-button',
data: data, data: data,
title: 'Add a comment to this line') do title: 'Add a comment to this line') do
content_tag :i, nil, class: 'fa fa-comment-o' icon('comment-o')
end end
end end
...@@ -74,7 +74,7 @@ module NotesHelper ...@@ -74,7 +74,7 @@ module NotesHelper
button_tag class: 'btn reply-btn js-discussion-reply-button', button_tag class: 'btn reply-btn js-discussion-reply-button',
data: data, title: 'Add a reply' do data: data, title: 'Add a reply' do
link_text = content_tag(:i, nil, class: 'fa fa-comment') link_text = icon('comment')
link_text << ' Reply' link_text << ' Reply'
end end
end end
......
module NotificationsHelper module NotificationsHelper
def notification_icon(notification) def notification_icon(notification)
if notification.disabled? if notification.disabled?
content_tag :i, nil, class: 'fa fa-volume-off ns-mute' icon('volume-off', class: 'ns-mute')
elsif notification.participating? elsif notification.participating?
content_tag :i, nil, class: 'fa fa-volume-down ns-part' icon('volume-down', class: 'ns-part')
elsif notification.watch? elsif notification.watch?
content_tag :i, nil, class: 'fa fa-volume-up ns-watch' icon('volume-up', class: 'ns-watch')
else else
content_tag :i, nil, class: 'fa fa-circle-o ns-default' icon('circle-o', class: 'ns-default')
end end
end end
end end
...@@ -83,7 +83,7 @@ module ProjectsHelper ...@@ -83,7 +83,7 @@ module ProjectsHelper
' Star' ' Star'
end end
content_tag('i', ' ', class: 'fa fa-star') + toggle_text icon('star') + toggle_text
end end
count_html = content_tag('span', class: 'count') do count_html = content_tag('span', class: 'count') do
...@@ -107,7 +107,7 @@ module ProjectsHelper ...@@ -107,7 +107,7 @@ module ProjectsHelper
end end
def link_to_toggle_fork def link_to_toggle_fork
out = content_tag(:i, '', class: 'fa fa-code-fork') out = icon('code-fork')
out << ' Fork' out << ' Fork'
out << content_tag(:span, class: 'count') do out << content_tag(:span, class: 'count') do
@project.forks_count.to_s @project.forks_count.to_s
......
...@@ -38,13 +38,8 @@ module TreeHelper ...@@ -38,13 +38,8 @@ module TreeHelper
# #
# type - String type of the tree item; either 'folder' or 'file' # type - String type of the tree item; either 'folder' or 'file'
def tree_icon(type) def tree_icon(type)
icon_class = if type == 'folder' icon_class = type == 'folder' ? 'folder' : 'file-o'
'fa fa-folder' icon(icon_class)
else
'fa fa-file-o'
end
content_tag :i, nil, class: icon_class
end end
def tree_hex_class(content) def tree_hex_class(content)
......
...@@ -161,8 +161,8 @@ describe Issue, 'Votes' do ...@@ -161,8 +161,8 @@ describe Issue, 'Votes' do
add_note '+1 I still like this' add_note '+1 I still like this'
add_note '+1 I really like this' add_note '+1 I really like this'
add_note '+1 Give me this now!!!!' add_note '+1 Give me this now!!!!'
p issue.downvotes.should == 0 issue.downvotes.should == 0
p issue.upvotes.should == 1 issue.upvotes.should == 1
end end
it 'should count a users vote only once without caring about comments' do it 'should count a users vote only once without caring about comments' do
...@@ -171,8 +171,8 @@ describe Issue, 'Votes' do ...@@ -171,8 +171,8 @@ describe Issue, 'Votes' do
add_note 'Another comment' add_note 'Another comment'
add_note '+1 vote' add_note '+1 vote'
add_note 'final comment' add_note 'final comment'
p issue.downvotes.should == 0 issue.downvotes.should == 0
p issue.upvotes.should == 1 issue.upvotes.should == 1
end end
end end
......
...@@ -10,7 +10,7 @@ describe Member do ...@@ -10,7 +10,7 @@ describe Member do
it { should validate_presence_of(:user) } it { should validate_presence_of(:user) }
it { should validate_presence_of(:source) } it { should validate_presence_of(:source) }
it { should ensure_inclusion_of(:access_level).in_array(Gitlab::Access.values) } it { should validate_inclusion_of(:access_level).in_array(Gitlab::Access.values) }
end end
describe "Delegate methods" do describe "Delegate methods" do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment