Commit a5cbb4cb82a6911b5c1de117ae6ed4cbf667a679
Exists in
spb-stable
and in
2 other branches
Merge branch 'autolink-in-project-description' into 'master'
Autolink in project/group description Group:  Project:  - - - Fixes http://feedback.gitlab.com/forums/176466-general/suggestions/4110570-group-description-should-support-markdown
Showing
4 changed files
with
10 additions
and
3 deletions
Show diff stats
Gemfile
@@ -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 |
Gemfile.lock
@@ -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 |