Used with
MetaDataPlugin to rate pottery pieces
| Name: |
Type: |
Size: |
Values: |
Description: |
Attributes: |
Default: |
| Reference |
topic |
40 |
|
The reference pottery piece |
h |
Applications/LocalApps.PotteryRating |
| Who |
user |
40 |
|
Who made the rating |
d h |
Main.WikiGuest |
| Form |
slider |
1 |
min="1" max="5" |
Refinement of the form |
d |
3 |
| Trimming |
slider |
1 |
min="1" max="5" |
Quality of trimming |
d |
3 |
| Glazing |
slider |
1 |
min="1" max="5" |
Glaze choice and application |
d |
3 |
| Surface |
slider |
1 |
min="1" max="5" |
Quality of surface design |
d |
3 |
| Execution |
slider |
1 |
min="1" max="5" |
Overall execution of piece |
d |
3 |
| Concept |
slider |
1 |
min="1" max="5" |
Boldness of concept for piece |
d |
3 |
| Comment |
textarea |
30x4 |
|
|
|
|
- TARGET - optional - specify target topic to rate. Defaults to
BASEWEB.BASETOPIC.
- MINI - set to true to only display icon (no button title) for compact use.
%STARTSECTION{"rate"}%%NEWMETADATA{"PotteryRating"
topic="%TARGET{default="%BASEWEB%.%BASETOPIC%"}%"
title="Rate %QUERY{"'%TARGET{default="%BASEWEB%.%BASETOPIC%"}%'/TopicTitle"}%"
buttontitle="%IF{"defined MINI" else="Rate This Piece"}%"
icon="fa-dashboard"
}%%ENDSECTION{"rate"}%
Rating refresh javascript
Forces pages refresh after submitting rating. To use, insert into topic:
%INCLUDE{"Applications.LocalApps.PotteryRating" section="refreshjs" TARGET="%WEB%.%TOPIC%"}%
Not working yet.
%STARTSECTION{"refreshjs"}%%ADDTOZONE{"script"
requires="JQUERYPLUGIN"
text="<literal><script type='text/javascript'>
jQuery(function($) {
$('div.metaDataEditDialog form').livequery(function() {
$(this).bind('submit', function() {
event.preventDefault();
$.ajax({
type: $(this).prop('method'),
url : $(this).prop('action'),
data: $(this).serialize()
}).done(function() {
location.reload();
});
});
});
});
</script>"
}%%ENDSECTION{"refreshjs"}%
Render Rating Table
%STARTSECTION{"rating_table"}%%SET{"RATINGS"
value="%RENDERMETADATA{"PotteryRating"
mode="view"
separator="#"
header=""
footer=""
format="Reference:$Reference~Who:$Who~Form:$Form~Trimming:$Trimming~Glazing:$Glazing~Surface:$Surface~Execution:$Execution~Concept:$Concept"
}%"
}%%SET{"HEADINGS"
value="%FORMATLIST{"%RATINGS%"
split="#"
pattern="Reference:.*?~Who:.*?~(.*?):[^~]*~(.*?):[^~]*~(.*?):[^~]*~(.*?):[^~]*~(.*?):[^~]*~(.*?):.*"
format="$1#$2#$3#$4#$5#$6"
limit="1"
}%"
}%
%FORMATLIST{"%RATINGS%"
split="#"
pattern="Reference:.*?~Who:(.*?)~(.*)"
header="$percntFORMATLIST{\"%HEADINGS%\" split=\"#\" format=\" *$1* \" header=\"| *Item* |\" separator=\" |\" footer=\" | *Overall Rating* | *Comment* |$n\"}$percnt"
format="| $1 | $percntFORMATLIST{\"$2\" "
+"split=\"~\" "
+"pattern=\"(.*?):(.*)\" "
+"format=\"$dollarpercntCALC{\\"$SET(this_$dollar1,$dollar2)$SET(all_$1, $GET(all_$1),$GET(this_$dollar1))"
+"$SET(all_$dollar1,$GET(all_$dollar1),$GET(this_$dollar1))$GET(this_$dollar1)\\" "
+"}$dollarpercnt\" "
+"separator=\"|\" "
+"}$percnt | $percntCALC{\"$FORMAT(NUMBER, 1, $AVERAGE($GET(all_$1)))\"}$percnt | $Comment |"
separator="$n"
footer="$n| Rating Avgs | $percntCALC{\"$FORMAT(NUMBER, 1, $AVERAGE($ABOVE()))\"}$percnt | $percntCALC{\"$FORMAT(NUMBER, 1, $AVERAGE($ABOVE()))\"}$percnt "
+"| $percntCALC{\"$FORMAT(NUMBER, 1, $AVERAGE($ABOVE()))\"}$percnt | $percntCALC{\"$FORMAT(NUMBER, 1, $AVERAGE($ABOVE()))\"}$percnt "
+"| $percntCALC{\"$FORMAT(NUMBER, 1, $AVERAGE($ABOVE()))\"}$percnt | $percntCALC{\"$FORMAT(NUMBER, 1, $AVERAGE($ABOVE()))\"}$percnt "
+"| $percntCALC{\"$FORMAT(NUMBER, 1, $AVERAGE($ABOVE()))\"}$percnt | |"
}%%ENDSECTION{"rating_table"}%
Render Overall Rating
Parameters:
- TARGET - target record for rating. Defaults to
BASETOPIC
- WHO - optional Filter by who made rating
%STARTSECTION{"rating"}%%CALCULATE{"$FORMAT(NUMBER, 1, $AVERAGE(%RENDERMETADATA{"PotteryRating"
mode="view" %IF{"defined TARGET" then="topic=\"%TARGET%\""}% %IF{"defined WHO" then="filter=\"Who='%WHO%'\""}%
separator=","
header=""
footer=""
format="$Form,$Trimming,$Glazing,$Surface,$Execution,$Concept"
}%))"}%%ENDSECTION{"rating"}%