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