Actualiza el plugin Additionals a 3.0.2-master

This commit is contained in:
Manuel Cillero 2021-03-20 11:12:56 +01:00
parent 3b6a41320c
commit cfa0d58b18
164 changed files with 2027 additions and 58190 deletions

View file

@ -1,2 +0,0 @@
- if Additionals.setting?(:invisible_captcha)
= f.invisible_captcha :url, autocomplete: 'off'

View file

@ -1,7 +1,7 @@
- footer = Additionals.setting(:global_footer)
- footer = Additionals.setting :global_footer
- if footer.present?
.additionals-footer
= textilizable(footer)
= textilizable footer
- if @additionals_help_items.present?
javascript:
@ -9,7 +9,7 @@
$('a.help').parent().append("<ul class=\"menu-children\">#{escape_javascript @additionals_help_items}</ul>");
});
- if Additionals.setting?(:open_external_urls)
- if Additionals.setting? :open_external_urls
javascript:
$(function() {
$('a.external').attr({ 'target': '_blank',

View file

@ -1,2 +1,2 @@
- if Additionals.setting?(:add_go_to_top)
- if Additionals.setting? :add_go_to_top
a#gototop

View file

@ -7,8 +7,7 @@ table.list.issue-report.table-of-values
tbody
- options = { set_filter: 1 }
- @chart[:filters].each do |line|
- if line[:filter]
- options.merge! line[:filter]
- options.merge! line[:filter] if line[:filter]
tr class="#{cycle 'odd', 'even'}"
td.name class="#{line[:id].to_s == '0' ? 'summary' : ''}"
- if line[:filter].nil?

View file

@ -1,11 +1,13 @@
= render(partial: 'additionals/live_search_ajax_call.js', layout: false, formats: [:js])
- unless defined? classes
- classes = 'title'
- classes = 'title' unless defined? classes
h2 class="#{classes}"
= @query.new_record? ? l(title) : h(@query.name)
span.additionals-live-search
= text_field_tag(:search,
= text_field_tag :search,
q,
autocomplete: 'off',
class: 'live-search-field',
placeholder: l(:label_query_name_search))
placeholder: defined?(placeholder) ? placeholder : l(:label_query_name_search)
javascript:
observeLiveSearchField('search',
'query-result-list')

View file

@ -2,5 +2,4 @@
= additionals_library_load :font_awesome
= stylesheet_link_tag 'additionals', plugin: 'additionals'
= javascript_include_tag 'additionals', plugin: 'additionals'
- unless Redmine::Plugin.installed? 'redmine_hrm'
- render_custom_top_menu_item
- render_custom_top_menu_item unless Redmine::Plugin.installed? 'redmine_hrm'

View file

@ -1,18 +0,0 @@
javascript:
$(function() {
// when the #search field changes
$('#search').live_observe_field(2, function() {
var form = $('#query_form'); // grab the form wrapping the search bar.
var url = form.attr('action');
form.find('[name="c[]"] option').each(function(i, elem) {
$(elem).attr('selected', true)
})
var formData = form.serialize();
form.find('[name="c[]"] option').each(function(i, elem) {
$(elem).attr('selected', false)
})
$.get(url, formData, function(data) { // perform an AJAX get, the trailing function is what happens on successful get.
$("#query-result-list").html(data); // replace the "results" div with the result of action taken
});
});
});

View file

@ -21,7 +21,7 @@ javascript:
placeholder: "#{options[:placeholder].presence}",
allowClear: #{options[:allow_clear].present? && options[:allow_clear] ? 'true' : 'false'},
minimumInputLength: 0,
width: "#{options[:width].presence || '60%'}",
width: "#{options[:width].presence || '90%'}",
templateResult: #{options[:template_result].presence || 'formatNameWithIcon'},
#{options[:template_selection].present? ? ('templateSelection: ' + options[:template_selection]) : nil}
})

View file

@ -16,8 +16,8 @@ fieldset.box
- columns.each do |s|
label.inline
- value = @settings[setting_name_totals.to_sym].present? ? @settings[setting_name_totals.to_sym].include?(s.name.to_s) : false
= check_box_tag("settings[#{setting_name_totals}][]",
= check_box_tag "settings[#{setting_name_totals}][]",
s.name,
value,
id: nil)
id: nil
= s.caption

View file

@ -1,30 +0,0 @@
- if defined?(show_always) && show_always || entry.tag_list.present?
.tags.attribute
- unless defined? hide_label
span.label
= l(:field_tag_list)
' :
- if defined?(editable) && editable
#tags-data
= additionals_tag_links(entry.tags,
project: @project,
tags_without_color: defined?(tags_without_color) ? tags_without_color : false)
'
span.contextual
= link_to l(:label_edit_tags),
{},
onclick: "$('#edit_tags_form').show(); $('#tags-data').hide(); return false;",
id: 'edit_tags_link'
#edit_tags_form style="display: none;"
= form_tag(update_url, method: :put, multipart: true) do
= render partial: 'tags_form'
'
= submit_tag l(:button_save), class: 'button-small'
'
= link_to l(:button_cancel), {}, onclick: "$('#edit_tags_form').hide(); $('#tags-data').show(); return false;"
- else
= additionals_tag_links(entry.tags,
project: @project,
tags_without_color: defined?(tags_without_color) ? tags_without_color : false)

View file

@ -1,7 +1,3 @@
' Need Help? :
= link_to(l(:label_additionals_doc),
'https://additionals.readthedocs.io/en/latest/',
class: 'external',
target: '_blank',
rel: 'noopener')
= link_to_external l(:label_additionals_doc), 'https://additionals.readthedocs.io/en/latest/'
= render_tabs additionals_settings_tabs

View file

@ -1,5 +0,0 @@
p
= additionals_settings_checkbox :invisible_captcha,
disabled: (true unless Setting.self_registration?)
em.info
= t(:invisible_captcha_info_html)

View file

@ -1,6 +1,6 @@
h2 = l(:label_settings_macros) + " (#{@available_macros.count})"
.info = t(:label_top_macros_help_html)
.info = t :label_top_macros_help_html
br
.box
- @available_macros.each do |macro, options|

View file

@ -1,13 +1,6 @@
table.list
tr
td.name
= l :label_system_info
| :
td.name
= system_info
tr
td.name
= l :label_uptime
| :
td.name
= system_uptime
- AdditionalsInfo.system_infos.each_value do |system_info|
tr
td.name
= "#{system_info[:label]}:"
td.name = system_info[:value]

View file

@ -1 +0,0 @@
== @tags.collect { |tag| { 'id' => tag.name, 'text' => tag.name } }.to_json

View file

@ -9,10 +9,7 @@
.splitcontent
.splitcontentleft
- if @dashboard.new_record?
= hidden_field_tag 'dashboard[dashboard_type]', @dashboard.dashboard_type
= hidden_field_tag 'dashboard[dashboard_type]', @dashboard.dashboard_type if @dashboard.new_record?
- if @project && @allowed_projects.present? && @allowed_projects.count > 1
p
= f.select :project_id,

View file

@ -6,6 +6,6 @@
- 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)
from: events_by_day.keys.first)
= render partial: 'activities/activities', locals: { events_by_day: events_by_day }

View file

@ -1,17 +1,17 @@
- 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)
= l :label_max_entries
' :
= number_field_tag "settings[#{block}][max_entries]", max_entries, min: 1, max: 1000, required: true
= number_field_tag "settings[#{block}][max_entries]",
settings[:max_entries].presence || DashboardContent::DEFAULT_MAX_ENTRIES,
min: 1, max: 1000, required: true
p
label
= l(:label_only_my_activities)
= l :label_only_my_activities
' :
= check_box_tag "settings[#{block}][me_only]", '1', Additionals.true?(settings[:me_only])

View file

@ -11,10 +11,7 @@
- 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'
li = link_to_external item[:title], item[:link]
- else
p.nodata = l :label_no_data
- elsif settings[:url].blank?

View file

@ -6,7 +6,7 @@ h3.icon.icon-news = l :label_news_latest
.box
p
label
= l(:label_max_entries)
= l :label_max_entries
' :
= number_field_tag "settings[#{block}][max_entries]", max_entries, min: 1, max: 1000, required: true
p

View file

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

View file

@ -22,6 +22,7 @@
- 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),

View file

@ -1,26 +1,12 @@
ruby:
title = settings[:title] || l(:label_text)
text = settings[:text]
- if title.present?
h3 = title
- if settings[:text].nil?
h3
= l :label_text_sync
- elsif settings[:title].present?
h3
= settings[: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();"
= render partial: 'dashboards/blocks/text_async_settings', locals: { block: block, settings: settings }
.wiki
= textilizable text
= textilizable settings[:text]

View file

@ -0,0 +1,10 @@
- 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
- if settings[:title].present?
h3 = settings[:title]
.wiki
= textilizable settings[:text]

View file

@ -0,0 +1,15 @@
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]", (settings[:title] || l(:label_text_sync))
p
= text_area_tag "settings[#{block}][text]", settings[:text], rows: addtionals_textarea_cols(settings[:text]), class: 'wiki-edit'
= wikitoolbar_for "settings_#{block}_text"
p
= submit_tag l :button_save
'
= link_to_function l(:button_cancel), "$('##{block}-settings').toggle();"

View file

@ -1,7 +1,6 @@
h2 = l(:button_dashboard_edit)
= labelled_form_for :dashboard,
@dashboard,
url: { action: 'update', id: @dashboard.id },
html: { multipart: true, method: :put, id: 'dashboard-form' } do |f|
html: { multipart: true, id: 'dashboard-form' } do |f|
= render partial: 'form', locals: { f: f }
= submit_tag l(:button_save)

View file

@ -0,0 +1 @@
= call_hook :view_wiki_form_bottom, content: @content, page: @page

View file

@ -0,0 +1 @@
= call_hook :view_wiki_show_bottom, content: @content, page: @page

View file

@ -1,5 +1,9 @@
- if User.current.logged? && @issue.editable? && Additionals.setting?(:issue_assign_to_me) && \
@issue.assigned_to_id != User.current.id && @project.assignable_users.detect { |u| u.id == User.current.id }
- if User.current.logged? && \
Additionals.setting?(:issue_assign_to_me) && \
@issue.editable? && \
@issue.safe_attribute?('assigned_to_id') && \
@issue.assigned_to_id != User.current.id && \
@project.assignable_users.detect { |u| u.id == User.current.id }
= link_to font_awesome_icon('far_user-circle', post_text: l(:button_assign_to_me)),
issue_assign_to_me_path(@issue), method: :put,
class: 'assign-to-me'

View file

@ -1,19 +1,19 @@
- if Additionals.setting?(:issue_change_status_in_sidebar) && \
@issue && \
User.current.allowed_to?(:edit_issues, @project) && \
(!@issue.closed? || User.current.allowed_to?(:edit_closed_issues, @project))
- statuses = @issue.sidbar_change_status_allowed_to(User.current)
@issue && \
User.current.allowed_to?(:edit_issues, @project) && \
(!@issue.closed? || User.current.allowed_to?(:edit_closed_issues, @project))
- statuses = @issue.sidbar_change_status_allowed_to User.current
- if statuses.present?
h3 = l(:label_issue_change_status)
h3 = l :label_issue_change_status
ul.issue-status-change-sidebar
- statuses.each do |s|
- if s != @issue.status
- unless s == @issue.status
li
- if s.is_closed?
= link_to(font_awesome_icon('fas_caret-square-left', post_text: s.name),
= link_to font_awesome_icon('fas_caret-square-left', post_text: s.name),
issue_change_status_path(@issue, new_status_id: s.id),
method: :put, class: "status-switch status-#{s.id}")
method: :put, class: "status-switch status-#{s.id}"
- else
= link_to(font_awesome_icon('far_caret-square-left', post_text: s.name),
= link_to font_awesome_icon('far_caret-square-left', post_text: s.name),
issue_change_status_path(@issue, new_status_id: s.id),
method: :put, class: "status-switch status-#{s.id}")
method: :put, class: "status-switch status-#{s.id}"

View file

@ -6,8 +6,7 @@
edit_project_dashboard_path(@project, @dashboard),
class: 'icon icon-edit'
- unless Redmine::Plugin.installed? 'redmine_reporting'
= bookmark_link @project
= bookmark_link @project unless Redmine::Plugin.installed? 'redmine_reporting'
= call_hook :view_project_contextual_links, project: @project
- if @dashboard&.editable?
@ -49,9 +48,7 @@
class: 'icon icon-del'
= sidebar_action_toggle @dashboard_sidebar, @dashboard, @project
- unless @dashboard_sidebar
= render_dashboard_actionlist @dashboard, @project
= render_dashboard_actionlist @dashboard, @project unless @dashboard_sidebar
= call_hook :view_project_actions_dropdown, project: @project
- if User.current.allowed_to?(:edit_project, @project)

View file

@ -1,4 +1,3 @@
- if Additionals.setting?(:new_issue_on_profile) && @memberships.present?
- project_url = memberships_new_issue_project_url(user, @memberships)
- if project_url.present?
= link_to(l(:label_issue_new), project_url, class: 'user-new-issue icon icon-add')
- project_url = memberships_new_issue_project_url user, @memberships
= link_to l(:label_issue_new), project_url, class: 'user-new-issue icon icon-add' if project_url.present?

View file

@ -21,8 +21,7 @@
= delete_dashboard_link dashboard_path(@dashboard),
class: 'icon icon-del'
= sidebar_action_toggle @dashboard_sidebar, @dashboard
- unless @dashboard_sidebar
= render_dashboard_actionlist @dashboard
= render_dashboard_actionlist @dashboard unless @dashboard_sidebar
= call_hook :view_welcome_show_actions_dropdown

View file

@ -7,6 +7,7 @@
= avatar(user, size: 50)
.user.line[style="font-weight: bold;"]
= link_to_user user
- if !user_roles.nil? && user_roles[user.id]
.user.line
= l :field_role
@ -16,6 +17,7 @@
= l :field_login
' :
= link_to user.login, "/users/#{user.id}"
- unless user.pref.hide_mail
.user.line
= l :field_mail