Skip to content

Commit

Permalink
Link to tree pages
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew committed Oct 6, 2016
1 parent aeaa28c commit 921aba7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/views/projects/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,13 @@
</tr>
<% end %>
</table>
<% kind_param = kind == 'normal' ? nil : kind %>
<% link = @version ? version_tree_path(@version.to_param.merge(kind: kind_param)) : tree_path(@project.to_param.merge(kind: kind_param)) %>
<%= link_to link, class: 'btn btn-success' do %>
<%= fa_icon 'code-fork' %>
Explore the resolved <%= kind.downcase unless kind == 'normal' %> dependency tree for <%= @project %> <%= @version_number %>
<% end %>
<hr>
<% end %>
<% end %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
get '/:platform/:name/dependent-repositories/yours', to: 'projects#your_dependent_repos', as: :your_project_dependent_repos, constraints: { :name => /.*/ }
get '/:platform/:name/:number.about', to: 'projects#about', as: :about_version, constraints: { :number => /.*/, :name => /.*/ }
get '/:platform/:name/:number.ABOUT', to: 'projects#about', constraints: { :number => /.*/, :name => /.*/ }
get '/:platform/:name/:number/tree', to: 'tree#show', constraints: { :number => /[\w\.\-\_\%]+/, :name => /[\w\.\-\_\%]+/ }
get '/:platform/:name/:number/tree', to: 'tree#show', constraints: { :number => /[\w\.\-\_\%]+/, :name => /[\w\.\-\_\%]+/ }, as: :version_tree
get '/:platform/:name/:number', to: 'projects#show', as: :version, constraints: { :number => /.*/, :name => /.*/ }
get '/:platform/:name.about', to: 'projects#about', as: :about_project, constraints: { :name => /.*/ }
get '/:platform/:name.ABOUT', to: 'projects#about', constraints: { :name => /.*/ }
Expand Down

0 comments on commit 921aba7

Please sign in to comment.