Modul:Music ratings
Bu moduldan koʻplab sahifada foydalanilgan. Tajriba oʻtkazish uchun modulning /qumloq yoki /test ostsahifalaridan foydalaning. Oʻzgarishlar kiritishdan avval boshqa foydalanuvchilar bilan muhokama qilish haqida oʻylab koʻring. |
Bu andoza quyidagi Luadan foydalanadi: |
Review scores | |
---|---|
Manba | Reyting |
Instructions
[manbasini tahrirlash]This template provides a brief summary and overview of the critical consensus of song and album reviews. It is used to display only brief and objectively-verifiable ratings, such as "", "B+", or "7/10". It cannot capture the general sense of a review that does not include any kind of scale, so do not include language like "Very favorable" or "(mixed)" in the template, as this would be original research.
The template is not to be a substitute for a section in paragraph form, since a review can not be accurately boiled down to a simple rating out of five stars or other numeric score. If an article is lacking a reception section in prose, but the information is presented in table format, the |noprose=yes
parameter can be used to tag the article as needing a reception section in prose.
This template is generally the first element after the heading for the section on Reception, Critical reception, Reviews, or something similar. If one of those sections is not present, the template should be placed immediately after the infobox, and can then be moved once a Reception section is present.
The reviews should be listed alphabetically in the Reviews field. The information in the reviewer field should be the name of the source (most commonly an online music service like AllMusic, or a music magazine like Rolling Stone—note that magazines are italicized). Don't forget to wikilink to the relevant article.
The information in the score field should be the rating given in the review (e.g. 4/5). The rating should use the same format as in the review, to portray the score of the review accurately. For star ratings you should use the star rating template; for example, entering {{Rating|4.5|5}}
, will render: .
For reviews at AllMusic it is convenient to use the {{AllMusic}} template.
For review aggregators AnyDecentMusic? and Metacritic it is convenient to use the fields ADM
and MC
in the template, respectively.
For reviews from Robert Christgau's Consumer Guide you may use the Christgau rating template. For example, entering {{Rating-Christgau|dud}}
will render: Andoza:Rating-Christgau.
Note that the minus sign character (−) is not the same thing as a hyphen (-), so "B–", not "B-". They appear similar but you can use the proper character by inputting −
or using the Insert
menu that is available in the editing window on Wikipedia; it is located near other such arithmetic operators like <×> and <÷>.
After the rating should be the citation of the source of the review. Per Wikipedia:Citing sources do not add reviews without a citation. This means a properly formatted footnote, in most cases providing the author, date, and source, along with an external link if available. Do not use an embedded link with no information (e.g. link) as this promotes link rot and is inconsistent with Wikipedia's policy on embedded links. If you must use an embedded link, be sure to manually provide a full citation in the article's References section per Wikipedia:Citing sources.
Usage
[manbasini tahrirlash]{{Music ratings
| title =
| subtitle =
<!-- Aggregate scores -->
| ADM =
| MC =
| aggregate1 =
| aggregate1score =
| aggregate2 =
| aggregate2score =
| aggregate3 =
| aggregate3score =
<!-- ... -->
<!-- Reviewers -->
| rev1 =
| rev1score =
| rev2 =
| rev2score =
| rev3 =
| rev3score =
<!-- ... -->
<!-- Article needs reviews expanded into prose -->
| noprose = <!--yes-->
}}
Parameters
[manbasini tahrirlash]Required fields:
- rev#
- The name of the reviewer. It is recommended to include no more than 10 reviews , but you can add more in exceptional circumstances. For instance, a particularly popular song or album which has been re-released and has several prominent reviews over decades' time.
- rev#score
- The rating given by the reviewer.
All of the following fields are optional:
- title
- Can be used to provide a custom title for the table, otherwise, it will default to "Professional ratings".
- subtitle
- Used to add additional text before the collapsible section. This is necessary to add if want a longer title, as long titles via the "title" parameter will not center correctly.
- width
- Sets the width of the table; default is 24.2em, to match the width of the song and album infoboxes in most browsers and skins.
- ADM
- AnyDecentMusic? score.
- MC
- Metacritic score.
- aggregate#
- Name of a review aggregator.
- aggregate#score
- The rating given by the review aggregator.
- noprose
- Should only be used for articles that do not have a Reception section summarizing the reviews. If set to yes, will categorize articles into Category:Articles with music ratings that need to be turned into prose.
Example
[manbasini tahrirlash]For example, entering
{{Music ratings
| MC = 69/100<ref name="Meta">{{cite web|url=http://www.metacritic.com/music/black-gives-way-to-blue/alice-in-chains|title=Black Gives Way To Blue|publisher=Metacritic|access-date=2 September 2012}}</ref>
| rev1 = [[AllMusic]]
| rev1score = {{Rating|4.5|5}}<ref name="AM">{{Allmusic |class=album |id=r70661 |tab=review |label=Alice in Chains: ''Dirt'' > Review |first=Steve |last=Huey |accessdate=31 January 2010}}</ref>
| rev2 = ''[[Q (magazine)|Q]]''
| rev2score = {{Rating|4|5}}<ref name="Q">{{cite magazine |last=Doe |first=Jane |title=Review: ''Dirt'' |magazine=[[Q (magazine)|Q]] |issue=65 |date=February 2002 |page=120}}</ref>
| rev3 = [[Robert Christgau]]
| rev3score = B<ref name="RC">{{cite web |first=Robert |last=Christgau |title=Review: ''Dirt'' |url=http://www.robertchristgau.com/get_artist.php?name=Alice+in+Chains |publisher=[[Robert Christgau]] |access-date=31 January 2010}}</ref>
}}
will render
and generate the following footnotes with the sources:
Tracking categories
[manbasini tahrirlash]- Category:Pages using music ratings with unknown parameters (0)
- Category:Articles with music ratings that need to be turned into prose (0)
- Category:Pages using music ratings with duplicate score parameters (0)
Template data
[manbasini tahrirlash]Music ratings uchun TemplateData
This template creates a table with reviews for songs and albums. Only add a rating if you cite it with a reference. The template is not to be a substitute for a section in paragraph form.
Parametr | Tavsif | Turi | Status | |
---|---|---|---|---|
1st reviewer | rev1 | The name of the first reviewer. | String | required |
1st reviewer's rating | rev1score rev1Score | The rating given by the first reviewer. | String | required |
2nd reviewer | rev2 | The name of the second reviewer. More reviewers can be added with parameters in the format rev[#] (the next one would be rev3). It is recommended to include no more than 10 reviews, but more can be added in exceptional circumstances. | String | ixtiyoriy |
2nd reviewer's rating | rev2score rev2Score | The rating given by the second reviewer. More ratings can be added with parameters in the format rev[#]score (the next one would be rev3score). It is recommended to include no more than 10 reviews, but more can be added in exceptional circumstances. | String | ixtiyoriy |
3rd reviewer | rev3 | tavsif yoʻq | String | ixtiyoriy |
3rd reviewer's rating | rev3score rev3Score | tavsif yoʻq | String | ixtiyoriy |
4th reviewer | rev4 | tavsif yoʻq | String | ixtiyoriy |
4th reviewer's rating | rev4score rev4Score | tavsif yoʻq | String | ixtiyoriy |
5th reviewer | rev5 | tavsif yoʻq | String | ixtiyoriy |
5th reviewer's rating | rev5score rev5Score | tavsif yoʻq | String | ixtiyoriy |
6th reviewer | rev6 | tavsif yoʻq | String | ixtiyoriy |
6th reviewer's rating | rev6score rev6Score | tavsif yoʻq | String | ixtiyoriy |
7th reviewer | rev7 | tavsif yoʻq | String | ixtiyoriy |
7th reviewer's rating | rev7score rev7Score | tavsif yoʻq | String | ixtiyoriy |
8th reviewer | rev8 | tavsif yoʻq | String | ixtiyoriy |
8th reviewer's rating | rev8score rev8Score | tavsif yoʻq | String | ixtiyoriy |
9th reviewer | rev9 | tavsif yoʻq | String | ixtiyoriy |
9th reviewer's rating | rev9score rev9Score | tavsif yoʻq | String | ixtiyoriy |
10th reviewer | rev10 | tavsif yoʻq | String | ixtiyoriy |
10th reviewer's rating | rev10score rev10Score | tavsif yoʻq | String | ixtiyoriy |
AnyDecentMusic score | ADM | The AnyDecentMusic? score. Appears under the "Aggregate scores" header. | String | ixtiyoriy |
Metacritic score | MC | The Metacritic score. Appears under the "Aggregate scores" header. | String | ixtiyoriy |
1st review aggregator | aggregate1 | The name of the first review aggregator. | String | ixtiyoriy |
1st review aggregator's rating | aggregate1score | The rating given by the first review aggregator. | String | ixtiyoriy |
2nd review aggregator | aggregate2 | The name of the second review aggregator. | String | ixtiyoriy |
2nd review aggregator's rating | aggregate2score | The rating given by the second review aggregator. | String | ixtiyoriy |
Table title | title | A custom title for the table, replacing "professional ratings". | String | ixtiyoriy |
Table subtitle | subtitle | Additional text before the collapsible section. This is necessary to add if you want a longer title, as long titles in the "title" parameter will not work right. | String | ixtiyoriy |
Table width | width | The width of the table. | String | ixtiyoriy |
Table align | align | The value is "left" if you want to place the table on the left.
| Qator | ixtiyoriy |
Article lacks prose section | noprose | Set to yes if there is just a single ratings template in the reception section and prose text is missing
| Qator | ixtiyoriy |
Table state (collapse) | state | Automatically collapses the template and adds a "show" button.
| Qator | deprecated |
See also
[manbasini tahrirlash]-- This module implements [[Template:Album ratings]].
local mTableTools = require('Module:TableTools')
local yesno = require('Module:Yesno')
local p = {}
local function makeCell(html, s)
html
:tag('td')
:css('text-align', 'center')
:css('vertical-align', 'middle')
:wikitext(s)
end
local function makeRow(review, score)
local row = mw.html.create('tr')
makeCell(row, review)
makeCell(row, score)
return row
end
local function makeHeaderRow(header, background, scope)
local row = mw.html.create('tr')
row
:tag('th')
:attr('scope', scope ~= false and 'col' or nil)
:attr('colspan', 2)
:css('text-align', 'center')
:css('background', background ~= false and '#d1dbdf' or nil)
:css('font-size', '100%')
:wikitext(header)
return row
end
local function makeRatingHeaderRow()
local row = mw.html.create('tr')
row
:tag('th')
:attr('scope', 'col')
:wikitext('Manba')
:done()
:tag('th')
:attr('scope', 'col')
:wikitext('Reyting')
return row
end
local function getScore(scoreArgs, length)
for i = 1, length do
local arg = scoreArgs[i]
if arg then
return arg
end
end
return nil
end
local function hasDuplicateScores(scoreArgs, length)
local count = 0
for i = 1, length do
local arg = scoreArgs[i]
if arg then
count = count + 1
end
end
return count > 1
end
local function ucfirst(s)
local first = s:sub(1, 1)
local others = s:sub(2, -1)
return first:upper() .. others
end
local function getArgPermutations(args, prefix, num, suffix)
local prefixUpper = ucfirst(prefix)
local suffixUpper = ucfirst(suffix)
return {
args[prefix .. num .. suffix],
args[prefixUpper .. num .. suffix],
args[prefix .. num .. suffixUpper],
args[prefixUpper .. num .. suffixUpper],
}, 4 -- The 4 is the length of the array; this is needed as the args may be nil
end
local function makeWikilink(page, display)
if not page and not display then
error('no arguments provided to makeWikilink', 2)
elseif display and not page then
return display
elseif page and not display or page == display then
return string.format('[[%s]]', page)
else
return string.format('[[%s|%s]]', page, display)
end
end
local function findSortText(wikitext)
-- Simplified wikitext parser that returns a value that can be used for
-- sorting.
wikitext = mw.text.killMarkers(wikitext)
-- Replace piped links with their display values
wikitext = wikitext:gsub('%[%[[^%]]*|([^%]]-)%]%]', '%1')
-- Replace non-piped links with their display values
wikitext = wikitext:gsub('%[%[([^%]]-)%]%]', '%1')
-- Strip punctuation
wikitext = wikitext:gsub('%p', '')
-- Trim whitespace
wikitext = wikitext:gsub('^%s*', ''):gsub('%s*$', '')
return wikitext
end
function p._main(args)
local root = mw.html.create()
local tableRoot = root:tag('table')
-- Table base
tableRoot
:addClass('wikitable')
:addClass( (args.align == 'left') and 'floatleft' or 'floatright' )
:css('float', (args.align == 'left') and 'left' or 'right')
:css('clear', (args.align == 'left') and 'left' or 'right')
:css('width', args.width or '24.2em')
:css('font-size', '88%')
:css('text-align', 'center')
:css('margin', (args.align == 'left') and '0.5em 1em 0.5em 0' or '0.5em 0 0.5em 1em')
:css('padding', 0)
:css('border-spacing', 0)
:tag('caption')
:attr('scope', 'col')
:attr('colspan', 2)
:css('font-size', '115%')
:wikitext(args.title or 'Professional Reytinglar')
-- Subtitle
if args.subtitle then
tableRoot:node(makeHeaderRow(args.subtitle, false, false))
end
-- Aggregate rows
local aggregateNums = mTableTools.affixNums(args, 'aggregate')
if args.MC or args.ADM or #aggregateNums > 0 then
tableRoot:node(makeHeaderRow('Aggregate scores', true, true))
tableRoot:node(makeRatingHeaderRow())
-- Assemble all of the aggregate scores
local aggregates = {}
if args.MC then
table.insert(aggregates, {
name = '[[Metacritic]]',
sort = 'Metacritic',
score = args.MC,
})
end
if args.ADM then
table.insert(aggregates, {
name = '[[AnyDecentMusic?]]',
sort = 'AnyDecentMusic?',
score = args.ADM,
})
end
for i, num in ipairs(aggregateNums) do
local name = args['aggregate' .. num]
local sort = findSortText(name)
local score = args['aggregate' .. num .. 'score']
table.insert(aggregates, {
name = name,
sort = sort,
score = score,
})
end
-- Sort the aggregates
if not args.aggregatenosort then
table.sort(aggregates, function (t1, t2)
return t1.sort < t2.sort
end)
end
-- Add the aggregates to the HTML
for i, t in ipairs(aggregates) do
tableRoot:node(makeRow(t.name, t.score))
end
end
-- Review rows
local reviewNums = mTableTools.affixNums(args, 'rev')
local duplicateScores = false
tableRoot:node(makeHeaderRow('Review scores', true, true))
tableRoot:node(makeRatingHeaderRow())
for i, num in ipairs(reviewNums) do
local scoreArgs, nScoreArgs = getArgPermutations(args, 'rev', num, 'score')
tableRoot:node(makeRow(
args['rev' .. num],
getScore(scoreArgs, nScoreArgs)
))
if not duplicateScores and hasDuplicateScores(scoreArgs, nScoreArgs) then
duplicateScores = true
end
end
-- Tracking category
if mw.title.getCurrentTitle().namespace == 0 and yesno(args.noprose) then
root:wikitext('[[Category:Articles with music ratings that need to be turned into prose]]')
end
if duplicateScores then
root:wikitext('[[Category:Pages using music ratings with duplicate score parameters]]')
end
return tostring(root)
end
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:Music ratings'
})
return p._main(args)
end
return p