Add template for default query settings
This commit is contained in:
parent
0f5d020a9b
commit
307c8b9819
@ -12,13 +12,6 @@ module AdditionalsQueriesHelper
|
||||
params[:set_filter] ||
|
||||
session[session_key].nil? ||
|
||||
session[session_key][:project_id] != (@project ? @project.id : nil)
|
||||
|
||||
if options[:with_default_query] && !api_request? && %i[op f fields].all? { |k| !params.key?(k) }
|
||||
d_query = query_class.default_query
|
||||
if d_query.present? && query_class.where(id: d_query.id).exists?
|
||||
return additionals_load_query_id(query_class, session_key, d_query.id, options, object_type)
|
||||
end
|
||||
end
|
||||
# Give it a name, required to be valid
|
||||
@query = query_class.new(name: '_')
|
||||
@query.project = @project
|
||||
|
25
app/views/additionals/_settings_list_defaults.html.slim
Normal file
25
app/views/additionals/_settings_list_defaults.html.slim
Normal file
@ -0,0 +1,25 @@
|
||||
fieldset.box
|
||||
legend
|
||||
= l(:additionals_query_list_defaults)
|
||||
- setting_name_columns = "#{query_type}_list_defaults"
|
||||
- query = query_class.new(@settings[setting_name_columns.to_sym])
|
||||
.default-query-settings-label
|
||||
= render_query_columns_selection(query, name: "settings[#{setting_name_columns}][column_names]")
|
||||
|
||||
- columns = query_class.new.available_totalable_columns
|
||||
- if columns.count > 0
|
||||
fieldset.box
|
||||
legend
|
||||
= l(:additionals_query_list_default_totals)
|
||||
|
||||
.default-query-settings-totals
|
||||
- setting_name_totals = "#{query_type}_list_default_totals"
|
||||
= hidden_field_tag("settings[#{setting_name_totals}][]", '')
|
||||
- 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}][]",
|
||||
s.name,
|
||||
value,
|
||||
id: nil)
|
||||
= s.caption
|
@ -317,3 +317,8 @@ div.additionals-projects li.project.odd {
|
||||
.additionals-projects ul {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
/* drop it with Redmine4 */
|
||||
.default-query-settings-label label {
|
||||
margin-left: -100px !important;
|
||||
}
|
||||
|
@ -167,3 +167,5 @@ de:
|
||||
wiki_pdf_remove_title_info: Wenn aktiv, wird der Wiki Titel nicht in der PDF Ansicht angezeigt.
|
||||
label_rule_issue_freezed_with_close: Bearbeitung geschlossener Tickets verbieten (Freeze)
|
||||
rule_issue_freezed_with_close_info: Wird diese Option aktiviert können bereits geschlossene Tickets nicht mehr bearbeitet und kommentiert werden. Auch nicht via Mail oder API. Für Benutzerrollen mit dem Recht "Geschlossene Tickets bearbeiten" gilt diese Einschränkung nicht.
|
||||
additionals_query_list_defaults: Standard-Spalten Listenansicht
|
||||
additionals_query_list_default_totals: Standard-Summen in der Listenansicht
|
||||
|
@ -167,3 +167,5 @@ en:
|
||||
wiki_pdf_remove_title_info: When active the Wiki title info will not be displayed in PDF view.
|
||||
label_rule_issue_freezed_with_close: Disallow editing of closed issues (Freeze)
|
||||
rule_issue_freezed_with_close_info: If this option is activated, already closed issues can no longer be edited and commented. Not even via mail or API. This restriction does not apply to user roles with the "Edit closed issues" permission.
|
||||
additionals_query_list_defaults: Default columns for list view
|
||||
additionals_query_list_default_totals: Default sums for list view
|
||||
|
@ -167,3 +167,5 @@ fr:
|
||||
wiki_pdf_remove_title_info: "Lorsqu'elle est active, l'information sur le titre du wiki ne sera pas affichée dans la vue PDF."
|
||||
label_rule_issue_freezed_with_close: "Interdire l'édition des questions fermées (freeze)"
|
||||
rule_issue_freezed_with_close_info: "Si cette option est activée, les numéros déjà fermés ne peuvent plus être édités et commentés. Pas même par courrier ou API. Cette restriction ne s'applique pas aux rôles utilisateurs avec l'autorisation \"Modifier les problèmes fermés\"."
|
||||
additionals_query_list_defaults: Default columns for list view
|
||||
additionals_query_list_default_totals: Default sums for list view
|
||||
|
@ -167,3 +167,5 @@ it:
|
||||
wiki_pdf_remove_title_info: "Quando è attivo, le informazioni sul titolo del Wiki non verranno visualizzate nella vista PDF."
|
||||
label_rule_issue_freezed_with_close: "Impedire la modifica dei problemi chiusi (Freeze)"
|
||||
rule_issue_freezed_with_close_info: "Se questa opzione è attivata, i numeri già chiusi non possono più essere modificati e commentati. Nemmeno via mail o API. Questa restrizione non si applica ai ruoli utente con il permesso \"Modifica problemi chiusi\"."
|
||||
additionals_query_list_defaults: Default columns for list view
|
||||
additionals_query_list_default_totals: Default sums for list view
|
||||
|
@ -167,3 +167,5 @@ ja:
|
||||
wiki_pdf_remove_title_info: When active the Wiki title info will not be displayed in PDF view.
|
||||
label_rule_issue_freezed_with_close: Disallow editing of closed issues (Freeze)
|
||||
rule_issue_freezed_with_close_info: If this option is activated, already closed issues can no longer be edited and commented. Not even via mail or API. This restriction does not apply to user roles with the "Edit closed issues" permission.
|
||||
additionals_query_list_defaults: Default columns for list view
|
||||
additionals_query_list_default_totals: Default sums for list view
|
||||
|
@ -167,3 +167,5 @@
|
||||
wiki_pdf_remove_title_info: "當啟用時,Wiki標題訊息不會顯示在PDF中"
|
||||
label_rule_issue_freezed_with_close: Disallow editing of closed issues (Freeze)
|
||||
rule_issue_freezed_with_close_info: If this option is activated, already closed issues can no longer be edited and commented. Not even via mail or API. This restriction does not apply to user roles with the "Edit closed issues" permission.
|
||||
additionals_query_list_defaults: Default columns for list view
|
||||
additionals_query_list_default_totals: Default sums for list view
|
||||
|
@ -167,3 +167,5 @@ zh:
|
||||
wiki_pdf_remove_title_info: 当启用时,WIKI 标题信息将不会显示在PDF视图中。
|
||||
label_rule_issue_freezed_with_close: Disallow editing of closed issues (Freeze)
|
||||
rule_issue_freezed_with_close_info: If this option is activated, already closed issues can no longer be edited and commented. Not even via mail or API. This restriction does not apply to user roles with the "Edit closed issues" permission.
|
||||
additionals_query_list_defaults: Default columns for list view
|
||||
additionals_query_list_default_totals: Default sums for list view
|
||||
|
Loading…
Reference in New Issue
Block a user