Changeset 1974987
- Timestamp:
- 11/15/2018 03:06:48 PM (7 years ago)
- Location:
- amilia-store/trunk
- Files:
-
- 3 edited
-
amilia-store.php (modified) (2 diffs)
-
shortcodes/amilia-store-standings.js (modified) (5 diffs)
-
shortcodes/amilia-store-standings.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
amilia-store/trunk/amilia-store.php
r1973325 r1974987 6 6 Author: Martin Drapeau <martin.drapeau@amilia.com> 7 7 Copyright: 2014-2018 Amilia 8 Version: 2.8. 48 Version: 2.8.5 9 9 Author URI: http://www.amilia.com/ 10 10 License: Apache License 2.0 … … 107 107 "standings-instructions-p2" => __("Choose the program in which you have activities representing teams (1 activity = 1 team).", 'amilia-store'), 108 108 "standings-instructions-p3" => __("You can optionally filter activities shown by tags allowing you to exclude activities which are not teams.", 'amilia-store'), 109 "standings-instructions-p4" => __("The sport you choose determines how to count and display score and standings.", 'amilia-store'), 109 110 "select-program" => __("Select a program", 'amilia-store'), 110 111 "show-hidden-activities" => __("Show hidden activities", 'amilia-store'), 112 "select-sport" => __("Select a sport", 'amilia-store'), 113 "soccer" => __("Soccer", 'amilia-store'), 114 "football" => __("Football", 'amilia-store'), 111 115 112 116 "button-title" => __("Insert a styled button link your Amilia Store", 'amilia-store'), -
amilia-store/trunk/shortcodes/amilia-store-standings.js
r1968084 r1974987 10 10 ' <input type="text" name="store-url" />', 11 11 ' <div class="input-helper store-url"></div>', 12 '</div>', 13 '<div class="form-group">', 14 ' <label>{select-sport} <a class="amilia-help" href="#">(?)</a></label>', 15 ' <select name="sport">', 16 ' <option value="soccer">{soccer}</option>', 17 ' <option value="football">{football}</option>', 18 ' </select>', 12 19 '</div>', 13 20 '<div class="form-group">', … … 47 54 ' <p>{standings-instructions-p2}</p>', 48 55 ' <p>{standings-instructions-p3}</p>', 56 ' <p>{standings-instructions-p4}</p>', 49 57 '</div>' 50 58 ].join('\n'); … … 69 77 var storeUrl = modal.querySelector('input[name=store-url]'), 70 78 storeUrlError = modal.querySelector('div.store-url'), 79 sportSelect = modal.querySelector('select[name="sport"]'), 71 80 programSelect = modal.querySelector('select[name="program"]'), 72 81 programSelectError = modal.querySelector('div.input-helper.program'), … … 184 193 var program = getSelectedProgram(); 185 194 var tags = getSelectedTags(); 186 return '[' + SHORTCODE + " url='{url}' program='{program}' tags='{tags}' showhidden='{show-hidden}' show='{show}' api='{api}']"195 return '[' + SHORTCODE + " url='{url}' sport='{sport}' program='{program}' tags='{tags}' showhidden='{show-hidden}' show='{show}' api='{api}']" 187 196 .replace('{url}', storeUrl.value) 197 .replace('{sport}', sportSelect.value) 188 198 .replace('{program}', program) 189 199 .replace('{tags}', tags.join(',')) … … 232 242 storeUrl.value = activeShortcode.shortcode.attrs.named.url; 233 243 Amilia.validateStoreUrl(storeUrl, storeUrlError); 244 sportSelect.value = activeShortcode.shortcode.attrs.named.sport || 'soccer'; 234 245 235 246 var program = activeShortcode.shortcode.attrs.named.program; -
amilia-store/trunk/shortcodes/amilia-store-standings.php
r1970350 r1974987 3 3 function amilia_store_standings_shortcode_handler($atts, $content = null) { 4 4 $a = shortcode_atts(array( 5 'sport' => 'soccer', 5 6 'program' => '', 6 7 'tags' => '', … … 13 14 $uid = rand(); 14 15 $api = $a['api']; 16 $sport = $a['sport']; 15 17 $program = $a['program']; 16 18 if (!is_numeric($program)) $program = 'null'; … … 67 69 } 68 70 var api = '$api'; 71 var sport = '$sport'; 69 72 var tagIds = [$tags]; 70 73 var eventsUrl = api + 'Events'; … … 193 196 team1.L += 1; 194 197 team2.W += 1; 195 team2.Pts += 3;198 team2.Pts += sport == 'football' ? 2 : 3; 196 199 } else if (goals1 > goals2) { 197 200 team2.L += 1; 198 201 team1.W += 1; 199 team1.Pts += 3;202 team1.Pts += sport == 'football' ? 2 : 3; 200 203 } 201 204 team1.F += goals1;
Note: See TracChangeset
for help on using the changeset viewer.