Drop some not required brakets

This commit is contained in:
Alexander Meindl 2020-08-08 18:44:40 +02:00
parent 98d8a148de
commit 39ee9e4805
17 changed files with 31 additions and 29 deletions

View File

@ -23,7 +23,7 @@ class AdditionalsAssignToMeController < ApplicationController
return redirect_to(issue_path(@issue)) if last_journal.nil?
last_journal = @issue.journals.visible.order(:created_on).last
redirect_to "#{issue_path(@issue)}#change-#{last_journal.id}"
redirect_to "#{issue_path @issue}#change-#{last_journal.id}"
end
private

View File

@ -27,7 +27,7 @@ class AdditionalsChangeStatusController < ApplicationController
return redirect_to(issue_path(@issue)) if last_journal.nil?
last_journal = @issue.journals.visible.order(:created_on).last
redirect_to "#{issue_path(@issue)}#change-#{last_journal.id}"
redirect_to "#{issue_path @issue}#change-#{last_journal.id}"
end
private

View File

@ -15,7 +15,7 @@ module AdditionalsIssuesHelper
s = []
return s unless authors.any?
s << tag.option("<< #{l(:label_me)} >>", value: User.current.id) if authors.include?(User.current)
s << tag.option("<< #{l :label_me} >>", value: User.current.id) if authors.include?(User.current)
if entity.nil?
s << options_from_collection_for_select(authors, 'id', 'name')

View File

@ -118,7 +118,7 @@ module AdditionalsMenuHelper
def addtionals_help_plugin_items
user_items = [{ title: 'Redmine Guide', url: Redmine::Info.help_url },
{ title: "Redmine #{l(:label_macro_plural)}", url: additionals_macros_path }]
{ title: "Redmine #{l :label_macro_plural}", url: additionals_macros_path }]
admin_items = [{ title: 'Additionals',
url: 'https://additionals.readthedocs.io/en/latest/manual/', manual: true },
@ -149,7 +149,7 @@ module AdditionalsMenuHelper
plugin_item.each do |temp_item|
u_items = if !temp_item[:manual].nil? && temp_item[:manual]
{ title: "#{temp_item[:title]} #{l(:label_help_manual)}", url: temp_item[:url] }
{ title: "#{temp_item[:title]} #{l :label_help_manual}", url: temp_item[:url] }
else
{ title: temp_item[:title], url: temp_item[:url] }
end

View File

@ -3,7 +3,7 @@ module AdditionalsSelect2Helper
s = select_tag(name, option_tags, options)
s << hidden_field_tag("#{name}[]", '') if options[:multiple] && options.fetch(:include_hidden, true)
s + javascript_tag("select2Tag('#{sanitize_to_id(name)}', #{options.to_json});")
s + javascript_tag("select2Tag('#{sanitize_to_id name}', #{options.to_json});")
end
# Transforms select filters of +type+ fields into select2

View File

@ -48,7 +48,7 @@ module DashboardsHelper
out = []
dashboards.each do |dashboard|
css_class = base_css
dashboard_name = "#{l(:label_dashboard)}: #{dashboard.name}"
dashboard_name = "#{l :label_dashboard}: #{dashboard.name}"
out << if dashboard.id == active_dashboard.id
link_to dashboard_name, '#',
onclick: 'return false;',
@ -84,10 +84,10 @@ module DashboardsHelper
tag.div class: 'active-dashboards' do
out = [tag.h3(l(:label_active_dashboard)),
tag.ul do
concat tag.ul "#{l(:field_name)}: #{h dashboard.name}"
concat tag.ul "#{l :field_name}: #{h dashboard.name}"
concat tag.ul safe_join([l(:field_author), link_to_user(dashboard.author)], ': ')
concat tag.ul "#{l(:field_created_on)}: #{format_time dashboard.created_at}"
concat tag.ul "#{l(:field_updated_on)}: #{format_time dashboard.updated_at}"
concat tag.ul "#{l :field_created_on}: #{format_time dashboard.created_at}"
concat tag.ul "#{l :field_updated_on}: #{format_time dashboard.updated_at}"
end]
out << tag.div(textilizable(dashboard, :description), class: 'dashboard-description') if dashboard.description.present?
@ -166,7 +166,7 @@ module DashboardsHelper
# Returns the select tag used to add or remove a block
def dashboard_block_select_tag(dashboard)
blocks_in_use = dashboard.layout.values.flatten
options = tag.option "<< #{l(:label_add_dashboard_block)} >>", value: ''
options = tag.option "<< #{l :label_add_dashboard_block} >>", value: ''
dashboard.content.block_options(blocks_in_use).each do |label, block|
options << tag.option(label, value: block, disabled: block.blank?)
end

View File

@ -35,7 +35,7 @@ module AdditionalsQuery
# accepts a comma separated list of ids
ids = value.first.to_s.scan(/\d+/).map(&:to_i)
if ids.present?
"#{queried_table_name}.id IN (#{ids.join(',')})"
"#{queried_table_name}.id IN (#{ids.join ','})"
else
'1=0'
end
@ -132,14 +132,14 @@ module AdditionalsQuery
# issue independend values. Use assigned_to_values from Redmine, if you want it only for issues
def assigned_to_all_values
assigned_to_values = []
assigned_to_values << ["<< #{l(:label_me)} >>", 'me'] if User.current.logged?
assigned_to_values << ["<< #{l :label_me} >>", 'me'] if User.current.logged?
assigned_to_values += principals.sort_by(&:status).collect { |s| [s.name, s.id.to_s, l("status_#{User::LABEL_BY_STATUS[s.status]}")] }
assigned_to_values
end
def watcher_values
watcher_values = [["<< #{l(:label_me)} >>", 'me']]
watcher_values = [["<< #{l :label_me} >>", 'me']]
watcher_values += users.collect { |s| [s.name, s.id.to_s] } if User.current.allowed_to?(:manage_public_queries, project, global: true)
watcher_values
end

View File

@ -55,7 +55,7 @@ class AdditionalsTag
end
if projects_allowed.present?
"#{PROJECT_TABLE_NAME}.id IN (#{projects_allowed.join(',')})" unless projects_allowed.empty?
"#{PROJECT_TABLE_NAME}.id IN (#{projects_allowed.join ','})" unless projects_allowed.empty?
else
'1=0'
end

View File

@ -6,7 +6,7 @@
- if @additionals_help_items.present?
javascript:
$(function() {
$('a.help').parent().append("<ul class=\"menu-children\">#{escape_javascript(@additionals_help_items)}</ul>");
$('a.help').parent().append("<ul class=\"menu-children\">#{escape_javascript @additionals_help_items}</ul>");
});
- if Additionals.setting?(:open_external_urls)

View File

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

View File

@ -5,7 +5,7 @@ h3 = l :label_custom_menu_items
- 5.times do |i|
fieldset
legend
b = "#{l(:label_menu_entry)} ##{i + 1}"
b = "#{l :label_menu_entry} ##{i + 1}"
div
p
= additionals_settings_textfield "custom_menu#{i}_name".to_sym, label: l(:field_name), size: 40

View File

@ -1,11 +1,13 @@
table.list
tr
td.name
= "#{l(:label_system_info)}:"
= l :label_system_info
| :
td.name
= system_info
tr
td.name
= "#{l(:label_uptime)}:"
= l :label_uptime
| :
td.name
= system_uptime

View File

@ -9,5 +9,5 @@ tr.group.open
span.badge.badge-count.count = group_count
'
span.totals = group_totals
= link_to_function("#{l(:button_collapse_all)}/#{l(:button_expand_all)}",
= link_to_function("#{l :button_collapse_all}/#{l :button_expand_all}",
'toggleAllRowGroups(this)', class: 'toggle-all')

View File

@ -46,10 +46,10 @@ h2 = welcome_overview_name @dashboard
action: 'index',
key: User.current.rss_key,
format: 'atom' },
title: "#{Setting.app_title}: #{l(:label_news_latest)}"
title: "#{Setting.app_title}: #{l :label_news_latest}"
= auto_discovery_link_tag :atom,
{ controller: 'activities',
action: 'index',
key: User.current.rss_key,
format: 'atom' },
title: "#{Setting.app_title}: #{l(:label_activity)}"
title: "#{Setting.app_title}: #{l :label_activity}"

View File

@ -4,7 +4,7 @@
table.list.projects
- project_tree(@projects, init_level: false) do |project, level|
tr id="project-#{project.id}" class="#{project_list_css_classes(project, level)}"
tr id="project-#{project.id}" class="#{project_list_css_classes project, level}"
td.name
span[style='font-weight: bold;']
- if Redmine::Plugin.installed? 'redmine_reporting'

View File

@ -2,7 +2,7 @@
- if list_title
h3 = list_title
- users.each do |user|
.user.box class="#{cycle('odd', 'even')}"
.user.box class="#{cycle 'odd', 'even'}"
div[style="float: left; display: block; margin-right: 5px;"]
= avatar(user, size: 50)
.user.line[style="font-weight: bold;"]

View File

@ -4,12 +4,12 @@ if ENV['JENKINS']
require 'simplecov'
SimpleCov.start :rails do
add_filter 'init.rb'
root File.expand_path "#{File.dirname(__FILE__)}/.."
root File.expand_path "#{File.dirname __FILE__}/.."
end
end
require File.expand_path "#{File.dirname(__FILE__)}/../../../test/test_helper"
require File.expand_path "#{File.dirname(__FILE__)}/global_test_helper"
require File.expand_path "#{File.dirname __FILE__}/../../../test/test_helper"
require File.expand_path "#{File.dirname __FILE__}/global_test_helper"
module Additionals
module TestHelper
@ -35,7 +35,7 @@ module Additionals
module PluginFixturesLoader
def fixtures(*table_names)
dir = "#{File.dirname(__FILE__)}/fixtures/"
dir = "#{File.dirname __FILE__}/fixtures/"
table_names.each do |x|
ActiveRecord::FixtureSet.create_fixtures(dir, x) if File.exist?("#{dir}/#{x}.yml")
end