Commit a5cbb4cb82a6911b5c1de117ae6ed4cbf667a679

Authored by Dmitriy Zaporozhets
2 parents 92ccc687 afe47e26

Merge branch 'autolink-in-project-description' into 'master'

Autolink in project/group description

Group:

![Screenshot 2014-06-12 22.58.07](https://dev.gitlab.org/uploads/dzaporozhets/gitlabhq/b5a95eff8a/Screenshot_2014-06-12_22.58.07.png)

Project:

![Screenshot 2014-06-12 22.58.36](https://dev.gitlab.org/uploads/dzaporozhets/gitlabhq/51e516fb41/Screenshot_2014-06-12_22.58.36.png)

- - -

Fixes http://feedback.gitlab.com/forums/176466-general/suggestions/4110570-group-description-should-support-markdown
@@ -13,6 +13,9 @@ gem "rails", "~> 4.1.0" @@ -13,6 +13,9 @@ gem "rails", "~> 4.1.0"
13 gem "protected_attributes" 13 gem "protected_attributes"
14 gem 'rails-observers' 14 gem 'rails-observers'
15 15
  16 +# Make links from text
  17 +gem 'rails_autolink', '~> 1.1'
  18 +
16 # Default values for AR models 19 # Default values for AR models
17 gem "default_value_for", "~> 3.0.0" 20 gem "default_value_for", "~> 3.0.0"
18 21
@@ -367,6 +367,8 @@ GEM @@ -367,6 +367,8 @@ GEM
367 sprockets-rails (~> 2.0) 367 sprockets-rails (~> 2.0)
368 rails-observers (0.1.2) 368 rails-observers (0.1.2)
369 activemodel (~> 4.0) 369 activemodel (~> 4.0)
  370 + rails_autolink (1.1.6)
  371 + rails (> 3.1)
370 rails_best_practices (1.14.4) 372 rails_best_practices (1.14.4)
371 activesupport 373 activesupport
372 awesome_print 374 awesome_print
@@ -641,6 +643,7 @@ DEPENDENCIES @@ -641,6 +643,7 @@ DEPENDENCIES
641 rack-mini-profiler 643 rack-mini-profiler
642 rails (~> 4.1.0) 644 rails (~> 4.1.0)
643 rails-observers 645 rails-observers
  646 + rails_autolink (~> 1.1)
644 rails_best_practices 647 rails_best_practices
645 raphael-rails (~> 2.1.2) 648 raphael-rails (~> 2.1.2)
646 rb-fsevent 649 rb-fsevent
app/views/groups/show.html.haml
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 = link_to dashboard_path, class: 'btn btn-tiny' do 5 = link_to dashboard_path, class: 'btn btn-tiny' do
6 ← To dashboard 6 ← To dashboard
7   7  
8 - %span.cgray 8 + %span.cgray
9 Currently you are only seeing events from the 9 Currently you are only seeing events from the
10 = @group.name 10 = @group.name
11 group 11 group
@@ -23,7 +23,8 @@ @@ -23,7 +23,8 @@
23 %h3.page-title 23 %h3.page-title
24 = @group.name 24 = @group.name
25 - if @group.description.present? 25 - if @group.description.present?
26 - %p= @group.description 26 + %p
  27 + = auto_link @group.description, link: :urls
27 = render "projects", projects: @projects 28 = render "projects", projects: @projects
28 - if current_user 29 - if current_user
29 .prepend-top-20 30 .prepend-top-20
app/views/projects/_home_panel.html.haml
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 .col-md-8 17 .col-md-8
18 .project-home-desc 18 .project-home-desc
19 - if @project.description.present? 19 - if @project.description.present?
20 - = @project.description 20 + = auto_link @project.description, link: :urls
21 - if can?(current_user, :admin_project, @project) 21 - if can?(current_user, :admin_project, @project)
22 – 22 –
23 %strong= link_to 'Edit', edit_project_path 23 %strong= link_to 'Edit', edit_project_path