We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi
I'd find it really useful to have the option to include news articles on a dashboard for the current project and all sub-projects.
I might have a go at doing this myself - would this be a useful feature worth including ?
Cheers
The text was updated successfully, but these errors were encountered:
Not sure if this is nice or optimal as I don't know the Redmine code very well and obviously this should be configurable -
diff --git a/app/helpers/dashboards_helper.rb b/app/helpers/dashboards_helper.rb index d2cf89a6..63e17b36 100644 --- a/app/helpers/dashboards_helper.rb +++ b/app/helpers/dashboards_helper.rb @@ -344,8 +344,10 @@ module DashboardsHelper news = if dashboard.content_project.nil? News.latest User.current, max_entries else - dashboard.content_project - .news + project_ids = [dashboard.content_project.id] + + dashboard.content_project.descendants.where.not(status: Project::STATUS_ARCHIVED).ids + @subproject_ids = project_ids & User.current.memberships.collect(&:project_id) + News.where(project_id: @subproject_ids) .limit(max_entries) .includes(:author, :project) .reorder(created_on: :desc) diff --git a/app/views/dashboards/blocks/_news.html.slim b/app/views/dashboards/blocks/_news.html.slim index 93d87f85..8f942876 100644 --- a/app/views/dashboards/blocks/_news.html.slim +++ b/app/views/dashboards/blocks/_news.html.slim @@ -15,7 +15,10 @@ h3.icon.icon-news = l :label_news_latest = link_to_function l(:button_cancel), "$('##{block}-settings').toggle()" - if news.any? + - saved_project = @project + - @project = nil if @subproject_ids && @subproject_ids.size > 1 = render partial: 'news/news', collection: news + - @project = saved_project p - if @project = link_to l(:label_news_view_all), project_news_index_path(@project)
Sorry, something went wrong.
No branches or pull requests
Hi
I'd find it really useful to have the option to include news articles on a dashboard for the current project and all sub-projects.
I might have a go at doing this myself - would this be a useful feature worth including ?
Cheers
The text was updated successfully, but these errors were encountered: