Actualizar plugin Additionals a 3.0.0

This commit is contained in:
Manuel Cillero 2020-11-22 21:30:25 +01:00
parent 3d976f1b3b
commit a26f5567af
399 changed files with 70374 additions and 4093 deletions

View file

@ -0,0 +1,11 @@
- cache render_async_cache_key(_dashboard_async_blocks_path(@project,
dashboard.async_params(block, async, settings))),
expires_in: async[:cache_expires_in] || DashboardContent::RENDER_ASYNC_CACHE_EXPIRES_IN,
skip_digest: true do
- events_by_day = activity_dashboard_data settings, dashboard
- title = Additionals.true?(settings[:me_only]) ? l(:label_my_activity) : l(:label_activity)
h3 = link_to title, activity_path(user_id: User.current,
from: events_by_day.keys.first)
= render partial: 'activities/activities', locals: { events_by_day: events_by_day }

View file

@ -0,0 +1,21 @@
- max_entries = settings[:max_entries].presence || DashboardContent::DEFAULT_MAX_ENTRIES
div id="#{block}-settings" style="#{'display: none;' if hide}"
= form_tag(_update_layout_setting_dashboard_path(@project, @dashboard), remote: true) do
= hidden_field_tag "settings[#{block}][me_only]", '0'
.box
p
label
= l(:label_max_entries)
' :
= number_field_tag "settings[#{block}][max_entries]", max_entries, min: 1, max: 1000, required: true
p
label
= l(:label_only_my_activities)
' :
= check_box_tag "settings[#{block}][me_only]", '1', Additionals.true?(settings[:me_only])
p
= submit_tag l(:button_save)
'
= link_to_function l(:button_cancel), "$('##{block}-settings').toggle();"

View file

@ -0,0 +1,31 @@
- with_async = dashboard_async_required_settings? settings, async
- unless with_async
h3 = settings[:title].presence || block_definition[:label]
- if @can_edit && \
block_definition[:no_settings].blank? && \
(!block_definition.key?(:with_settings_if) || block_definition[:with_settings_if].call(@project))
= render partial: block_definition[:settings_partial].presence || "#{async[:partial]}_settings",
locals: build_dashboard_partial_locals(block,
block_definition,
settings,
dashboard).merge({ hide: with_async })
- if with_async
= render_async_cache _dashboard_async_blocks_path(@project,
dashboard.async_params(block, async, settings)) do
.clear-both
p
i.fas.fa-sync.fa-spin
'
= l(:label_loading)
= content_for :render_async
javascript:
$(function() {
$('#ajax-indicator').hide();
})
- else
p.nodata = l :label_no_data

View file

@ -0,0 +1,27 @@
h3.icon.icon-document = l :label_document_plural
- if @can_edit
div id="#{block}-settings" style='display: none;'
= form_tag(_update_layout_setting_dashboard_path(@project, @dashboard), remote: true) do
.box
p
label
= l(:label_max_entries)
' :
= number_field_tag "settings[#{block}][max_entries]", max_entries, min: 1, max: 1000, required: true
p
= submit_tag l(:button_save)
'
= link_to_function l(:button_cancel), "$('##{block}-settings').toggle();"
- if documents.any?
= render partial: 'documents/document', collection: documents
p
- if @project
= link_to l(:label_document_view_all), project_documents_path(@project)
/- else
/ no route available
/= link_to l(:label_news_view_all), documents_path
- else
p.nodata = l :label_no_data

View file

@ -0,0 +1,23 @@
- cache render_async_cache_key(_dashboard_async_blocks_path(@project,
dashboard.async_params(block, async, settings))),
expires_in: async[:cache_expires_in],
skip_digest: true do
- feed = dashboard_feed_catcher settings[:url], settings[:max_entries]
h3
= dashboard_feed_title settings[:title], block_definition
- if feed[:valid]
- if feed[:items].count.positive?
ul.reporting-list.feed
- feed[:items].each do |item|
li
= link_to item[:title],
item[:link],
class: 'external', rel: 'noopener noreferrer', target: '_blank'
- else
p.nodata = l :label_no_data
- elsif settings[:url].blank?
p.nodata = l :label_no_data
- else
p.nodata = l(:label_invalid_feed_data)

View file

@ -0,0 +1,25 @@
- max_entries = settings[:max_entries].presence || DashboardContent::DEFAULT_MAX_ENTRIES
div id="#{block}-settings" style="#{'display: none;' if hide}"
= form_tag(_update_layout_setting_dashboard_path(@project, @dashboard), remote: true) do
.box
p
label
= l :field_title
' :
= text_field_tag "settings[#{block}][title]", dashboard_feed_title(settings[:title], block_definition)
p
label
= l :field_url
' :
= url_field_tag "settings[#{block}][url]", settings[:url], required: true
p
label
= l(:label_max_entries)
' :
= number_field_tag "settings[#{block}][max_entries]", max_entries, min: 1, max: 100, required: true
p
= submit_tag l(:button_save)
'
= link_to_function l(:button_cancel), "$('##{block}-settings').toggle();"

View file

@ -0,0 +1,35 @@
h3 = block_definition[:label]
- if @can_edit
div id="#{block}-settings" style='display: none;'
= form_tag(_update_layout_setting_dashboard_path(@project, @dashboard), remote: true) do
.box
p
label
= l :button_show
' :
= number_field_tag "settings[#{block}][days]", days, min: 1, max: 1000, required: true
'
= l :label_day_plural
p
= submit_tag l(:button_save)
'
= link_to_function l(:button_cancel), "$('#my_spent_time-settings').toggle();"
ul.reporting-list
li.today
= l :label_today
' :
= l_hours_short entries_today.sum(&:hours)
li.days
= l :label_last_n_days, days
' :
= l_hours_short entries_days.sum(&:hours)
= link_to l(:label_spent_time), _time_entries_path(@project, nil, user_id: 'me')
'
= link_to l(:button_log_time),
_new_time_entry_path(@project, nil),
class: 'icon-only icon-add',
title: l(:button_log_time)

View file

@ -0,0 +1,25 @@
h3.icon.icon-news = l :label_news_latest
- if @can_edit
div id="#{block}-settings" style='display: none;'
= form_tag(_update_layout_setting_dashboard_path(@project, @dashboard), remote: true) do
.box
p
label
= l(:label_max_entries)
' :
= number_field_tag "settings[#{block}][max_entries]", max_entries, min: 1, max: 1000, required: true
p
= submit_tag l(:button_save)
'
= link_to_function l(:button_cancel), "$('##{block}-settings').toggle();"
- if news.any?
= render partial: 'news/news', collection: news
p
- if @project
= link_to l(:label_news_view_all), project_news_index_path(@project)
- else
= link_to l(:label_news_view_all), news_index_path
- else
p.nodata = l :label_no_data

View file

@ -0,0 +1,21 @@
h3 = block_definition[:label]
- if @project.description.present?
.wiki.project-description
= textilizable @project.description
- if @project.homepage.present? || @project.visible_custom_field_values.any? { |o| o.value.present? }
ul.reporting-list
- if @project.homepage.present?
li
span.label
= l :field_homepage
' :
= link_to_if uri_with_safe_scheme?(@project.homepage), @project.homepage, @project.homepage, class: 'external'
- render_custom_field_values(@project) do |custom_field, formatted|
li class="#{custom_field.css_classes}"
span.label
= custom_field.name
' :
= formatted
= call_hook :view_projects_show_dashboard_info_block, project: @project, dashboard: dashboard

View file

@ -0,0 +1,42 @@
h3.icon.icon-issue
= l :label_issue_tracking
'
= link_to l(:label_details),
project_issues_report_details_path(@project, detail: 'tracker'),
class: 'icon-only icon-zoom-in',
title: l(:label_details)
- if @trackers.present?
table.list.issue-report
thead
tr
th
th
= l :label_open_issues_plural
th
= l :label_closed_issues_plural
th
= l :label_total
tbody
- @trackers.each do |tracker|
tr
td.name
= link_to tracker.name, project_issues_path(@project, set_filter: 1, tracker_id: tracker.id), title: tracker.description
td
= link_to @open_issues_by_tracker[tracker].to_i, project_issues_path(@project, set_filter: 1, tracker_id: tracker.id)
td
= link_to (@total_issues_by_tracker[tracker].to_i - @open_issues_by_tracker[tracker].to_i),
project_issues_path(@project, set_filter: 1, tracker_id: tracker.id, status_id: 'c')
td.total
= link_to @total_issues_by_tracker[tracker].to_i,
project_issues_path(@project, set_filter: 1, tracker_id: tracker.id, status_id: '*')
p
= link_to l(:label_issue_view_all), project_issues_path(@project, set_filter: 1)
' |
= link_to l(:field_summary), project_issues_report_path(@project)
- if User.current.allowed_to? :view_calendar, @project, global: true
' |
= link_to l(:label_calendar), project_calendar_path(@project)
- if User.current.allowed_to? :view_gantt, @project, global: true
' |
= link_to l(:label_gantt), project_gantt_path(@project)

View file

@ -0,0 +1,7 @@
- if @subprojects.any?
h3.icon.icon-projects
= l(:label_subproject_plural)
ul.subprojects
- @subprojects.each do |project|
li
= link_to(project.name, project_path(project), class: project.css_classes).html_safe

View file

@ -0,0 +1,20 @@
h3.icon.icon-time
= block_definition[:label]
ul
- if @total_estimated_hours.present?
li
= l :field_estimated_hours
' :
= l_hours @total_estimated_hours
- if @total_hours.present?
li
= l :label_spent_time
' :
= l_hours @total_hours
p
- if User.current.allowed_to? :log_time, @project
= link_to l(:button_log_time), new_project_time_entry_path(@project)
' |
= link_to l(:label_details), project_time_entries_path(@project)
' |
= link_to l(:label_report), report_project_time_entries_path(@project)

View file

@ -0,0 +1,34 @@
- cache render_async_cache_key(_dashboard_async_blocks_path(@project, dashboard.async_params(block, async, settings))),
expires_in: DashboardContent::RENDER_ASYNC_CACHE_EXPIRES_IN,
skip_digest: true do
- query = klass.visible.find_by(id: settings[:query_id])
- if query
ruby:
query.project = @project if query_block[:with_project]
count = query.send query_block[:count_method]
query.column_names = settings[:columns].split(',').map(&:to_sym) if settings[:columns].present?
query.sort_criteria = params[:sort] if params[:sort].present?
h3.query-list-block
= dashboard_query_list_block_title query, query_block, @project
= " (#{count})"
= dashboard_query_list_block_alerts dashboard, query, block_definition
- if query.respond_to?(:description) && query.description.present?
.query-description
= textilizable query, :description
- if count.positive?
/ required by some helpers of other plugins
- @query = query
= render partial: query_block[:list_partial],
locals: { query_block[:entities_var] => query.send(query_block[:entries_method],
limit: settings[:max_entries] || DashboardContent::DEFAULT_MAX_ENTRIES),
query: query,
query_options: { sort_param: 'sort',
sort_link_options: { method: :post, remote: true } } }
- else
p.nodata = l :label_no_data
- else
p.nodata = l :label_no_data

View file

@ -0,0 +1,27 @@
- query = klass.find_by id: settings[:query_id]
- query.column_names = settings[:columns].map(&:to_sym) if query && settings[:columns].present?
div id="#{block}-settings" style="#{'display: none;' if hide}"
= form_tag(_update_layout_setting_dashboard_path(@project, dashboard), remote: true) do
.box
- if query
= render_query_columns_selection query, name: "settings[#{block}][columns]"
- else
p
label
= block_definition[:label]
'
= select_tag "settings[#{block}][query_id]",
options_for_query_select(klass, @project),
required: true
p
label
= l :label_max_entries
' :
= number_field_tag "settings[#{block}][max_entries]",
settings[:max_entries].presence || DashboardContent::DEFAULT_MAX_ENTRIES,
min: 1, max: 100, required: true
p
= submit_tag l(:button_save)
'
= link_to_function l(:button_cancel), "$('##{block}-settings').toggle();"

View file

@ -0,0 +1,26 @@
ruby:
title = settings[:title] || l(:label_text)
text = settings[:text]
- if title.present?
h3 = title
- if @can_edit
div id="#{block}-settings" style='display: none;'
= form_tag(_update_layout_setting_dashboard_path(@project, @dashboard), remote: true) do
.box
p
label
= l :field_title
' :
= text_field_tag "settings[#{block}][title]", title
p
= text_area_tag "settings[#{block}][text]", text, rows: addtionals_textarea_cols(text), class: 'wiki-edit'
= wikitoolbar_for "settings_#{block}_text"
p
= submit_tag l(:button_save)
'
= link_to_function l(:button_cancel), "$('##{block}-settings').toggle();"
.wiki
= textilizable text

View file

@ -0,0 +1,2 @@
.wiki
= textilizable Setting.welcome_text