Fixing coding standards
This commit is contained in:
parent
748e0fdcf4
commit
f33d58f4bb
@ -3,16 +3,16 @@ module Additionals
|
||||
module WikiMacros
|
||||
Redmine::WikiFormatting::Macros.register do
|
||||
desc <<-DESCRIPTION
|
||||
Display calendar (only works on wiki pages)
|
||||
Examples:
|
||||
Display calendar (only works on wiki pages)
|
||||
|
||||
{{calendar}} show calendar for current date
|
||||
{{calendar(year=2014,month=6)}} show calendar for Juni in year 2014
|
||||
{{calendar(show_weeks=true)}} show calendar with week numbers
|
||||
{{calendar(select=2015-07-12 2015-07-31, show_weeks=true)}} preselect dates and show week numbers
|
||||
{{calendar(select=2016-03-13:2016-03-27)}} preselect dates between 2016/3/13 and 2016/3/27
|
||||
Examples:
|
||||
|
||||
DESCRIPTION
|
||||
{{calendar}} show calendar for current date
|
||||
{{calendar(year=2014,month=6)}} show calendar for Juni in year 2014
|
||||
{{calendar(show_weeks=true)}} show calendar with week numbers
|
||||
{{calendar(select=2015-07-12 2015-07-31, show_weeks=true)}} preselect dates and show week numbers
|
||||
{{calendar(select=2016-03-13:2016-03-27)}} preselect dates between 2016/3/13 and 2016/3/27
|
||||
DESCRIPTION
|
||||
|
||||
macro :calendar do |_obj, args|
|
||||
raise 'Only works on wiki page' unless controller_name == 'wiki' && action_name == 'show'
|
||||
|
@ -6,8 +6,9 @@ module Additionals
|
||||
desc <<-DESCRIPTION
|
||||
Create CryptoCompare information.
|
||||
{{cryptocompare(options)}}
|
||||
see https://additionals.readthedocs.io/en/latest/macros/#cryptocompare
|
||||
DESCRIPTION
|
||||
see https://additionals.readthedocs.io/en/latest/macros/#cryptocompare
|
||||
DESCRIPTION
|
||||
|
||||
macro :cryptocompare do |_obj, args|
|
||||
raise 'The correct usage is {{cryptocompare(options)}}' if args.empty?
|
||||
_args, options = extract_macro_options(args, :fsym, :fsyms, :tsym, :tsyms, :period, :type)
|
||||
|
@ -3,17 +3,19 @@ module Additionals
|
||||
module WikiMacros
|
||||
Redmine::WikiFormatting::Macros.register do
|
||||
desc <<-DESCRIPTION
|
||||
Display current dates. Examples:
|
||||
Display current dates.
|
||||
|
||||
{{current_year}} current year
|
||||
{{current_month}} current month
|
||||
{{current_day}} current day
|
||||
{{current_day}} current day
|
||||
{{current_hour}} current hour
|
||||
{{current_minute}} current minute
|
||||
{{current_weekday}} current weekday
|
||||
{{current_weeknumber}} current week number (1 - 52) The week starts with Monday
|
||||
DESCRIPTION
|
||||
Examples:
|
||||
|
||||
{{current_year}} current year
|
||||
{{current_month}} current month
|
||||
{{current_day}} current day
|
||||
{{current_day}} current day
|
||||
{{current_hour}} current hour
|
||||
{{current_minute}} current minute
|
||||
{{current_weekday}} current weekday
|
||||
{{current_weeknumber}} current week number (1 - 52) The week starts with Monday
|
||||
DESCRIPTION
|
||||
|
||||
macro :current_year do |_obj, _args|
|
||||
content_tag(:span, Additionals.now_with_user_time_zone.year, class: 'current-date')
|
||||
|
@ -3,18 +3,18 @@ module Additionals
|
||||
module WikiMacros
|
||||
Redmine::WikiFormatting::Macros.register do
|
||||
desc <<-DESCRIPTION
|
||||
Display a google map. Examples:
|
||||
Display a google map. Examples:
|
||||
|
||||
Syntax:
|
||||
Syntax:
|
||||
|
||||
{{gmap([q=QUERY, mode=MODE, width=216, height=368])}}
|
||||
{{gmap([q=QUERY, mode=MODE, width=216, height=368])}}
|
||||
|
||||
Examples:
|
||||
Examples:
|
||||
|
||||
{{gmap(Munich)}} Google maps with Munich
|
||||
{{gmap(Munich)}} Google maps with Munich
|
||||
|
||||
{{gmap(mode=directions, origin=Munich+Rosenheimerstr, destination=Arco)}} Direction from Munich to Arco
|
||||
DESCRIPTION
|
||||
{{gmap(mode=directions, origin=Munich+Rosenheimerstr, destination=Arco)}} Direction from Munich to Arco
|
||||
DESCRIPTION
|
||||
|
||||
macro :gmap do |_obj, args|
|
||||
src_options = %i[attribution_ios_deep_link_id
|
||||
|
@ -3,18 +3,17 @@ module Additionals
|
||||
module WikiMacros
|
||||
Redmine::WikiFormatting::Macros.register do
|
||||
desc <<-DESCRIPTION
|
||||
Display users of group.
|
||||
Display users of group.
|
||||
|
||||
Syntax:
|
||||
Syntax:
|
||||
|
||||
{{group_users(GROUP_NAME}}
|
||||
{{group_users(GROUP_NAME}}
|
||||
|
||||
Examples:
|
||||
Examples:
|
||||
|
||||
{{group_users(Team)}}
|
||||
...List all users in user group "Team" (with the current user permission)
|
||||
|
||||
DESCRIPTION
|
||||
{{group_users(Team)}}
|
||||
...List all users in user group "Team" (with the current user permission)
|
||||
DESCRIPTION
|
||||
|
||||
macro :group_users do |_obj, args|
|
||||
raise 'The correct usage is {{group_users(<group_name>)}}' if args.empty?
|
||||
|
@ -3,20 +3,20 @@ module Additionals
|
||||
module WikiMacros
|
||||
Redmine::WikiFormatting::Macros.register do
|
||||
desc <<-DESCRIPTION
|
||||
Include iframe
|
||||
Include iframe
|
||||
|
||||
Syntax:
|
||||
Syntax:
|
||||
|
||||
{{iframe(<url> [, width=100%, height=485)}}
|
||||
{{iframe(<url> [, width=100%, height=485)}}
|
||||
|
||||
Examples:
|
||||
Examples:
|
||||
|
||||
show iframe of URL https://www.google.com/
|
||||
{{iframe(https://www.google.com/)}}
|
||||
show iframe of URL https://www.google.com/
|
||||
{{iframe(https://www.google.com/)}}
|
||||
|
||||
show iframe of URL https://www.google.com/ and show link to it
|
||||
{{iframe(https://www.google.com/, with_link: true)}}
|
||||
DESCRIPTION
|
||||
show iframe of URL https://www.google.com/ and show link to it
|
||||
{{iframe(https://www.google.com/, with_link: true)}}
|
||||
DESCRIPTION
|
||||
|
||||
macro :iframe do |_obj, args|
|
||||
args, options = extract_macro_options(args, :width, :height, :slide, :with_link)
|
||||
|
@ -2,35 +2,36 @@
|
||||
module Additionals
|
||||
module WikiMacros
|
||||
Redmine::WikiFormatting::Macros.register do
|
||||
desc <<-DESCRIPTION
|
||||
Create a link to issue with the subject of this issue.
|
||||
Syntax:
|
||||
desc <<-DESCRIPTION
|
||||
Create a link to issue with the subject of this issue.
|
||||
|
||||
{{issue(URL [, format=USER_FORMAT, id=ID, note_id=NOTE_ID)}}
|
||||
URL is URL to issue
|
||||
USER_FORMATS
|
||||
- text
|
||||
- short
|
||||
- link (default)
|
||||
- full
|
||||
ID is issue
|
||||
NOTE_ID is note id, if you want to display it
|
||||
Syntax:
|
||||
|
||||
Examples:
|
||||
{{issue(URL [, format=USER_FORMAT, id=ID, note_id=NOTE_ID)}}
|
||||
URL is URL to issue
|
||||
USER_FORMATS
|
||||
- text
|
||||
- short
|
||||
- link (default)
|
||||
- full
|
||||
ID is issue
|
||||
NOTE_ID is note id, if you want to display it
|
||||
|
||||
{{issue(1)}}
|
||||
...Link to issue with id and subject
|
||||
{{issue(http://myredmine.url/issues/1)}}
|
||||
...Link to issue with id and subject
|
||||
{{issue(http://myredmine.url/issues/1#note-3)}}
|
||||
...Link to issue with id and subject and display comment 3
|
||||
{{issue(1, format=short)}}
|
||||
...Link to issue with subject (without id)
|
||||
{{issue(1, format=text)}}
|
||||
...Display subject name
|
||||
{{issue(1, format=full)}}
|
||||
...Link to issue with track, issue id and subject
|
||||
DESCRIPTION
|
||||
Examples:
|
||||
|
||||
{{issue(1)}}
|
||||
...Link to issue with id and subject
|
||||
{{issue(http://myredmine.url/issues/1)}}
|
||||
...Link to issue with id and subject
|
||||
{{issue(http://myredmine.url/issues/1#note-3)}}
|
||||
...Link to issue with id and subject and display comment 3
|
||||
{{issue(1, format=short)}}
|
||||
...Link to issue with subject (without id)
|
||||
{{issue(1, format=text)}}
|
||||
...Display subject name
|
||||
{{issue(1, format=full)}}
|
||||
...Link to issue with track, issue id and subject
|
||||
DESCRIPTION
|
||||
|
||||
macro :issue do |_obj, args|
|
||||
args, options = extract_macro_options(args, :id, :note_id, :format)
|
||||
|
@ -3,31 +3,30 @@ module Additionals
|
||||
module WikiMacros
|
||||
Redmine::WikiFormatting::Macros.register do
|
||||
desc <<-DESCRIPTION
|
||||
Display members.
|
||||
Display members.
|
||||
|
||||
Syntax:
|
||||
Syntax:
|
||||
|
||||
{{members([PROJECT_NAME, title=My members list, role=ROLE)]}}
|
||||
{{members([PROJECT_NAME, title=My members list, role=ROLE)]}}
|
||||
|
||||
PROJECT_NAME can be project identifier, project name or project id
|
||||
PROJECT_NAME can be project identifier, project name or project id
|
||||
|
||||
Examples:
|
||||
Examples:
|
||||
|
||||
{{members}}
|
||||
...List all members for all projects (with the current user permission)
|
||||
{{members}}
|
||||
...List all members for all projects (with the current user permission)
|
||||
|
||||
{{members(the-identifier)}}
|
||||
...A box showing all members for the project with the identifier of 'the-identifier'
|
||||
{{members(the-identifier)}}
|
||||
...A box showing all members for the project with the identifier of 'the-identifier'
|
||||
|
||||
{{members(the-identifier, role=Manager)}}
|
||||
...A box showing all members for the project with the identifier of 'the-identifier', which
|
||||
have the role "Manager"
|
||||
{{members(the-identifier, role=Manager)}}
|
||||
...A box showing all members for the project with the identifier of 'the-identifier', which
|
||||
have the role "Manager"
|
||||
|
||||
{{members(the-identifier, title=My user list)}}
|
||||
...A box showing all members for the project with the identifier of 'the-identifier' and with
|
||||
box title "My user list"
|
||||
|
||||
DESCRIPTION
|
||||
{{members(the-identifier, title=My user list)}}
|
||||
...A box showing all members for the project with the identifier of 'the-identifier' and with
|
||||
box title "My user list"
|
||||
DESCRIPTION
|
||||
|
||||
macro :members do |_obj, args|
|
||||
args, options = extract_macro_options(args, :role, :title)
|
||||
|
@ -3,18 +3,18 @@ module Additionals
|
||||
module WikiMacros
|
||||
Redmine::WikiFormatting::Macros.register do
|
||||
desc <<-DESCRIPTION
|
||||
Display current weather from meteoblue service. Examples:
|
||||
Display current weather from meteoblue service. Examples:
|
||||
|
||||
Syntax:
|
||||
Syntax:
|
||||
|
||||
{{meteoblue(<location> [, days=INT, width=216, height=368, color=BOOL])}}
|
||||
{{meteoblue(<location> [, days=INT, width=216, height=368, color=BOOL])}}
|
||||
|
||||
Examples:
|
||||
Examples:
|
||||
|
||||
{{meteoblue(münchen_deutschland_2867714)}} weather for Munich
|
||||
{{meteoblue(münchen_deutschland_2867714)}} weather for Munich
|
||||
|
||||
{{meteoblue(münchen_deutschland_2867714, days=6, color=false)}} weather for Munich of the next 6 days without color
|
||||
DESCRIPTION
|
||||
{{meteoblue(münchen_deutschland_2867714, days=6, color=false)}} weather for Munich of the next 6 days without color
|
||||
DESCRIPTION
|
||||
|
||||
macro :meteoblue do |_obj, args|
|
||||
args, options = extract_macro_options(args,
|
||||
|
@ -3,24 +3,23 @@ module Additionals
|
||||
module WikiMacros
|
||||
Redmine::WikiFormatting::Macros.register do
|
||||
desc <<-DESCRIPTION
|
||||
Display projects.
|
||||
Display projects.
|
||||
|
||||
Syntax:
|
||||
Syntax:
|
||||
|
||||
{{projects([title=My project list, with_create_issue=BOOL])}}
|
||||
{{projects([title=My project list, with_create_issue=BOOL])}}
|
||||
|
||||
Examples:
|
||||
Examples:
|
||||
|
||||
{{projects}}
|
||||
...List all project, which I am member of
|
||||
{{projects}}
|
||||
...List all project, which I am member of
|
||||
|
||||
{{projects(title=My project list)}}
|
||||
...List all project with title "My project list", which I am member of
|
||||
{{projects(title=My project list)}}
|
||||
...List all project with title "My project list", which I am member of
|
||||
|
||||
{{projects(with_create_issue=true)}}
|
||||
...List all project with link to create new issue, which I am member of
|
||||
|
||||
DESCRIPTION
|
||||
{{projects(with_create_issue=true)}}
|
||||
...List all project with link to create new issue, which I am member of
|
||||
DESCRIPTION
|
||||
|
||||
macro :projects do |_obj, args|
|
||||
_args, options = extract_macro_options(args, :title, :with_create_issue)
|
||||
|
@ -7,14 +7,13 @@ module Additionals
|
||||
{{recently_updated}}
|
||||
{{recently_updated([days])}}
|
||||
|
||||
Examples:
|
||||
Examples:
|
||||
|
||||
{{recently_updated}}
|
||||
...List last updated pages (of the last 5 days)
|
||||
|
||||
{{recently_updated(15)}}
|
||||
...List last updated pages of the last 15 days
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
macro :recently_updated do |obj, args|
|
||||
|
@ -5,7 +5,8 @@ module Additionals
|
||||
desc <<-DESCRIPTION
|
||||
Creates link to reddit.
|
||||
{{reddit(name)}}
|
||||
DESCRIPTION
|
||||
DESCRIPTION
|
||||
|
||||
macro :reddit do |_obj, args|
|
||||
raise 'The correct usage is {{reddit(<name>)}}' if args.empty?
|
||||
name = args[0].strip
|
||||
|
@ -3,18 +3,18 @@ module Additionals
|
||||
module WikiMacros
|
||||
Redmine::WikiFormatting::Macros.register do
|
||||
desc <<-DESCRIPTION
|
||||
Slideshare macro to include Slideshare slide.
|
||||
Slideshare macro to include Slideshare slide.
|
||||
|
||||
Syntax:
|
||||
Syntax:
|
||||
|
||||
{{slideshare(<key> [, width=595, height=485, slide=SLIDE])}}
|
||||
{{slideshare(<key> [, width=595, height=485, slide=SLIDE])}}
|
||||
|
||||
Examples:
|
||||
Examples:
|
||||
|
||||
{{slideshare(57941706)}} show slideshare slide with default size 595x485
|
||||
{{slideshare(57941706, width=514, height=422)}} show slide with user defined size
|
||||
{{slideshare(57941706, slide=5)}} start with slide (page) 5
|
||||
DESCRIPTION
|
||||
{{slideshare(57941706)}} show slideshare slide with default size 595x485
|
||||
{{slideshare(57941706, width=514, height=422)}} show slide with user defined size
|
||||
{{slideshare(57941706, slide=5)}} start with slide (page) 5
|
||||
DESCRIPTION
|
||||
|
||||
macro :slideshare do |_obj, args|
|
||||
args, options = extract_macro_options(args, :width, :height, :slide)
|
||||
|
@ -7,7 +7,8 @@ module Additionals
|
||||
Creates Tradingview chart
|
||||
{{tradingview(options)}}
|
||||
see https://additionals.readthedocs.io/en/latest/macros/#tradingview
|
||||
DESCRIPTION
|
||||
DESCRIPTION
|
||||
|
||||
macro :tradingview do |_obj, args|
|
||||
raise 'The correct usage is {{tradingview(options)}}' if args.empty?
|
||||
_args, options = extract_macro_options(args, :width, :height, :symbol, :interval, :timezone,
|
||||
|
@ -5,7 +5,8 @@ module Additionals
|
||||
desc <<-DESCRIPTION
|
||||
Creates link to twitter account page or topic.
|
||||
{{twitter(name)}}
|
||||
DESCRIPTION
|
||||
DESCRIPTION
|
||||
|
||||
macro :twitter do |_obj, args|
|
||||
raise 'The correct usage is {{twitter(<name>)}}' if args.empty?
|
||||
name = args[0].strip
|
||||
|
@ -3,18 +3,18 @@ module Additionals
|
||||
module WikiMacros
|
||||
Redmine::WikiFormatting::Macros.register do
|
||||
desc <<-DESCRIPTION
|
||||
Vimeo macro to include vimeo video.
|
||||
Vimeo macro to include vimeo video.
|
||||
|
||||
Syntax:
|
||||
Syntax:
|
||||
|
||||
{{vimeo(<video key> [, width=640, height=360, autoplay=BOOL])}}
|
||||
{{vimeo(<video key> [, width=640, height=360, autoplay=BOOL])}}
|
||||
|
||||
Examples:
|
||||
Examples:
|
||||
|
||||
{{vimeo(142849533)}} show video with default size 640x360
|
||||
{{vimeo(142849533, width=853, height=480)}} show video with user defined size
|
||||
{{vimeo(142849533, autoplay=true)}} autoplay video
|
||||
DESCRIPTION
|
||||
{{vimeo(142849533)}} show video with default size 640x360
|
||||
{{vimeo(142849533, width=853, height=480)}} show video with user defined size
|
||||
{{vimeo(142849533, autoplay=true)}} autoplay video
|
||||
DESCRIPTION
|
||||
|
||||
macro :vimeo do |_obj, args|
|
||||
args, options = extract_macro_options(args, :width, :height, :autoplay)
|
||||
|
@ -3,18 +3,18 @@ module Additionals
|
||||
module WikiMacros
|
||||
Redmine::WikiFormatting::Macros.register do
|
||||
desc <<-DESCRIPTION
|
||||
Youtube macro to include youtube video.
|
||||
Youtube macro to include youtube video.
|
||||
|
||||
Syntax:
|
||||
Syntax:
|
||||
|
||||
{{youtube(<video key> [, width=640, height=360, autoplay=BOOL])}}
|
||||
{{youtube(<video key> [, width=640, height=360, autoplay=BOOL])}}
|
||||
|
||||
Examples:
|
||||
Examples:
|
||||
|
||||
{{youtube(KMU0tzLwhbE)}} show video with default size 640x360
|
||||
{{youtube(KMU0tzLwhbE, width=853, height=480)}} show video with user defined size
|
||||
{{youtube(KMU0tzLwhbE, autoplay=true)}} autoplay video
|
||||
DESCRIPTION
|
||||
{{youtube(KMU0tzLwhbE)}} show video with default size 640x360
|
||||
{{youtube(KMU0tzLwhbE, width=853, height=480)}} show video with user defined size
|
||||
{{youtube(KMU0tzLwhbE, autoplay=true)}} autoplay video
|
||||
DESCRIPTION
|
||||
|
||||
macro :youtube do |_obj, args|
|
||||
args, options = extract_macro_options(args, :width, :height, :autoplay)
|
||||
|
@ -47,14 +47,14 @@ module ApiTest
|
||||
)
|
||||
|
||||
payload = <<-XML
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<issue>
|
||||
<project_id>1</project_id>
|
||||
<tracker_id>2</tracker_id>
|
||||
<status_id>3</status_id>
|
||||
<subject>API test</subject>
|
||||
</issue>
|
||||
XML
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<issue>
|
||||
<project_id>1</project_id>
|
||||
<tracker_id>2</tracker_id>
|
||||
<status_id>3</status_id>
|
||||
<subject>API test</subject>
|
||||
</issue>
|
||||
XML
|
||||
|
||||
assert_difference('Issue.count') do
|
||||
post '/issues.xml',
|
||||
@ -80,12 +80,12 @@ module ApiTest
|
||||
)
|
||||
|
||||
payload = <<-XML
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<issue>
|
||||
<project_id>1</project_id>
|
||||
<subject>API test</subject>
|
||||
</issue>
|
||||
XML
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<issue>
|
||||
<project_id>1</project_id>
|
||||
<subject>API test</subject>
|
||||
</issue>
|
||||
XML
|
||||
|
||||
assert_difference('Issue.count') do
|
||||
post '/issues.xml',
|
||||
|
Loading…
x
Reference in New Issue
Block a user