Skip to content

Commit

Permalink
Display project's language
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew committed Nov 22, 2023
1 parent 4e262e6 commit dd713d1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions app/models/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,11 @@ def fetch_issue_stats
puts "Error fetching issues for #{url}"
end

def language
return unless repository.present?
repository['language']
end

def issue_stats
i = read_attribute(:issues_stats) || {}
JSON.parse(i.to_json, object_class: OpenStruct)
Expand Down
6 changes: 5 additions & 1 deletion app/views/issues/_issue.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
</h5>

<p class="card-subtitle mb-2 text-muted"><small>
Project: <%= link_to issue.project.to_s, project_url(issue.project) %><br/>
Project: <%= link_to issue.project.to_s, project_url(issue.project) %>
<% if issue.project.language%>
<span class='text-muted'><i>(<%= issue.project.language %>)</i></span>
<% end %>
<br/>
Opened by <%= issue.user %> <%= time_ago_in_words(issue.created_at) %> ago
- <%= pluralize issue.comments_count, 'comment' %>
<br />
Expand Down

0 comments on commit dd713d1

Please sign in to comment.