diff --git a/app/assets/images/discord-logo.png b/app/assets/images/discord-logo.png index de92c58ae..e9dc50d7f 100644 Binary files a/app/assets/images/discord-logo.png and b/app/assets/images/discord-logo.png differ diff --git a/app/assets/images/facebook-logo.png b/app/assets/images/facebook-logo.png index d2b7f08a4..03056266f 100644 Binary files a/app/assets/images/facebook-logo.png and b/app/assets/images/facebook-logo.png differ diff --git a/app/assets/images/patreon-logo.png b/app/assets/images/patreon-logo.png index c05441637..35ca076ea 100644 Binary files a/app/assets/images/patreon-logo.png and b/app/assets/images/patreon-logo.png differ diff --git a/app/assets/images/steam/steam-logo.png b/app/assets/images/steam/steam-logo.png index 76e802df0..7cc1861b4 100644 Binary files a/app/assets/images/steam/steam-logo.png and b/app/assets/images/steam/steam-logo.png differ diff --git a/app/assets/images/twitter-logo.png b/app/assets/images/twitter-logo.png deleted file mode 100644 index b4b6650d8..000000000 Binary files a/app/assets/images/twitter-logo.png and /dev/null differ diff --git a/app/assets/images/twitter-logo.svg b/app/assets/images/twitter-logo.svg new file mode 100644 index 000000000..56368dd4b --- /dev/null +++ b/app/assets/images/twitter-logo.svg @@ -0,0 +1,3 @@ + + + diff --git a/app/assets/images/youtube-logo.png b/app/assets/images/youtube-logo.png index d8e9ed0fc..b2fda92bf 100644 Binary files a/app/assets/images/youtube-logo.png and b/app/assets/images/youtube-logo.png differ diff --git a/app/assets/javascripts/brackets.js b/app/assets/javascripts/brackets.js index 599303ed8..3edaabb82 100644 --- a/app/assets/javascripts/brackets.js +++ b/app/assets/javascripts/brackets.js @@ -76,7 +76,7 @@ }; } - function render(containerj, canvas) { + function render(containerj, canvas, target) { // Use twice the scale for better resolution on high dpi displays var container = containerj[0]; var width = container.scrollWidth; @@ -91,7 +91,8 @@ var context = canvas.getContext('2d'); context.clearRect(0, 0, canvas.width, canvas.height); context.scale(2, 2); - context.lineWidth = 2; + context.lineWidth = 4; + context.strokeStyle = '#00abba'; var canvasj = $(canvas); containerj.find('.bracket-round').each(function() { @@ -102,7 +103,7 @@ round.find('.bracket-match').each(function() { var match = $(this); - match.find('.bracket-team').each(function() { + match.find('.bracket-team[data-team-id="'+target+'"]').each(function() { var team = $(this); var teamId = team.data('team-id'); var rightPos = rightPosition(canvasj, team); @@ -138,8 +139,14 @@ buildRound(rounds[index], roundMatches, teams).appendTo(container); }); - $(window).on('resize', function() { render(container, canvas); }); - render(container, canvas); + $('.bracket-team').each(function() { + $(this).on("mouseover", function(){ + render(container, canvas, $(this).data("team-id")) + }); + }); + + //$(window).on('resize', function() { render(container, canvas); }); + //render(container, canvas); // Scroll to the right of the bracket container.scrollLeft(canvas.scrollWidth); diff --git a/app/assets/stylesheets/navbar.sass b/app/assets/stylesheets/navbar.sass index 84cdd3bc4..ecef4e21c 100644 --- a/app/assets/stylesheets/navbar.sass +++ b/app/assets/stylesheets/navbar.sass @@ -59,6 +59,36 @@ $notification-hover-background-color: #eeeeee &:hover background-color: $notification-hover-background-color +//Nav dropdown button / menu -------------------- // + +@media screen and (max-width: 991px) + .nav-dropdown-menu + background: #343a40 + border: none + + .dropdown-item + color: #83878b + + .dropdown-header + display: none + + .dropdown-divider + display: none + +@media screen and (min-width: 992px) + .nav-dropdown-menu + margin-top: 1rem + display: block + visibility: hidden + opacity: 0 + transform: translateY(-0.5rem) + transition: 0.3s ease all + + &.show + visibility: visible + opacity: 1 + transform: translateY(0) + // Misc -------------------- // .dropdown-menu-animated diff --git a/app/controllers/leagues_controller.rb b/app/controllers/leagues_controller.rb index 36c1a6081..ce94232d8 100644 --- a/app/controllers/leagues_controller.rb +++ b/app/controllers/leagues_controller.rb @@ -1,12 +1,16 @@ class LeaguesController < ApplicationController include LeaguePermissions - before_action except: [:index, :new, :create] do + before_action except: [:index, :new, :create, :medals] do @league = League.includes(:tiebreakers).find(params[:id]) end + before_action only: [:medals] do + @league = League.includes(:tiebreakers).find(params[:league_id]) + end + before_action :require_user_leagues_permission, only: [:new, :create, :destroy] - before_action :require_user_league_permission, only: [:edit, :update, :modify] + before_action :require_user_league_permission, only: [:edit, :update, :modify, :medals] before_action :require_league_not_hidden_or_permission, only: [:show] before_action :require_hidden, only: [:destroy] @@ -49,6 +53,18 @@ def show .group_by(&:division) end + def medals + @rosters = @league.rosters.includes(:division) + @ordered_rosters = @league.ordered_rosters_by_division + @divisions = @ordered_rosters.map(&:first) + @roster = @league.roster_for(current_user) if user_signed_in? + @personal_matches = @roster.matches.pending.ordered.reverse_order.includes(:home_team, :away_team) if @roster + @top_div_matches = @divisions.first.matches.pending.ordered + .includes(:home_team, :away_team).last(5) + @matches = @league.matches.ordered.includes(:rounds, :home_team, :away_team) + .group_by(&:division) + end + def edit @weekly_scheduler = @league.weekly_scheduler || League::Schedulers::Weekly.new end diff --git a/app/presenters/user_presenter.rb b/app/presenters/user_presenter.rb index f00b6ea70..1a0aaf901 100644 --- a/app/presenters/user_presenter.rb +++ b/app/presenters/user_presenter.rb @@ -45,7 +45,7 @@ def titles(options = {}) has_captain_label = team && user.can?(:edit, team) && user.can?(:use, :teams) titles = [] - titles << content_tag(:span, 'Captain', class: 'badge badge-danger') if has_captain_label + titles << content_tag(:span, 'Captain', class: 'badge badge-secondary') if has_captain_label titles << badge if user.badge? safe_join(titles, ' ') end diff --git a/app/views/application/_navbar.html.haml b/app/views/application/_navbar.html.haml index 318726ac1..e49e5ebe4 100644 --- a/app/views/application/_navbar.html.haml +++ b/app/views/application/_navbar.html.haml @@ -18,21 +18,22 @@ Rules %span.caret - .dropdown-menu.dropdown-menu-animated#rules-dropdown-menu + %ul.dropdown-menu.nav-dropdown-menu#rules-dropdown-menu .dropdown-header Competitive Rulesets - = link_to('Global Ruleset', 'https://docs.ozfortress.com/rules/global/index', class: 'dropdown-item') - = link_to('Sixes Ruleset', 'https://docs.ozfortress.com/rules/sixes/index', class: 'dropdown-item') - = link_to('Highlander Ruleset', 'https://docs.ozfortress.com/rules/highlander/index', class: 'dropdown-item') + %li= link_to('Global Ruleset', 'https://docs.ozfortress.com/rules/global', class: 'dropdown-item') + %li= link_to('Sixes Ruleset', 'https://docs.ozfortress.com/rules/sixes', class: 'dropdown-item') + %li= link_to('Highlander Ruleset', 'https://docs.ozfortress.com/rules/highlander', class: 'dropdown-item') .dropdown-divider .dropdown-header - Community + Behaviour - = link_to('Community Guidelines', 'https://docs.ozfortress.com/rules/community_guidelines/index', class: 'dropdown-item') - = link_to('Infractions', 'https://docs.ozfortress.com/rules/infractions/index', class: 'dropdown-item') + %li= link_to('Community Guidelines', 'https://docs.ozfortress.com/rules/community_guidelines', class: 'dropdown-item') + %li= link_to('Player Behaviour Infractions', 'https://docs.ozfortress.com/rules/infractions', class: 'dropdown-item') + %li= link_to('League Penalties', 'https://docs.ozfortress.com/rules/penalties', class: 'dropdown-item') :javascript // Prevent inside clicks from dismissing dropdown @@ -46,29 +47,30 @@ Help %span.caret - .dropdown-menu.dropdown-menu-animated#help-dropdown-menu + %ul.dropdown-menu.nav-dropdown-menu#help-dropdown-menu .dropdown-header General Info - = link_to('Staff', 'https://docs.ozfortress.com/info/staff/index', class: 'dropdown-item') - = link_to('Map History', 'https://docs.ozfortress.com/info/map_history/index', class: 'dropdown-item') - = link_to('Anti-Cheat and You', 'https://docs.ozfortress.com/info/anticheat_and_you/index', class: 'dropdown-item') + %li= link_to('Staff', 'https://docs.ozfortress.com/info/staff', class: 'dropdown-item') + %li= link_to('Map History', 'https://docs.ozfortress.com/info/map_history', class: 'dropdown-item') + %li= link_to('Anti-Cheat and You', 'https://docs.ozfortress.com/info/anticheat_and_you', class: 'dropdown-item') + %li= link_to('Ban Appeals', 'https://forms.gle/WmkpBvb4AFEc1cxaA', class: 'dropdown-item') .dropdown-divider .dropdown-header Guides - = link_to('Book a Server', 'https://docs.ozfortress.com/guides/book_a_server/index', class: 'dropdown-item') - = link_to('Newbie Guide', 'https://docs.ozfortress.com/guides/newbie_guide/index', class: 'dropdown-item') + %li= link_to('Book a Server', 'https://docs.ozfortress.com/guides/book_a_server', class: 'dropdown-item') + %li= link_to('Newbie Guide', 'https://docs.ozfortress.com/guides/newbie_guide', class: 'dropdown-item') .dropdown-divider .dropdown-header Other - = link_to('Verify Rosters tool', 'https://verify.ozfortress.com', target: :_blank, rel: :noopener, class: 'dropdown-item') - = link_to('STV Demos', 'https://demos.tf/uploads/76561198049618390', target: :_blank, rel: :noopener, class: 'dropdown-item') + %li= link_to('Verify Rosters tool', 'https://verify.ozfortress.com', target: :_blank, rel: :noopener, class: 'dropdown-item') + %li= link_to('Support & Reporting', 'https://docs.ozfortress.com/support/landing/', target: :_blank, rel: :noopener, class: 'dropdown-item') :javascript // Prevent inside clicks from dismissing dropdown @@ -77,11 +79,12 @@ }) %li.nav-item - = link_to('Support & Reporting', 'https://docs.ozfortress.com/support/landing/index', target: :_blank, rel: :noopener, class: 'nav-link') + = link_to('Server Booking', 'https://au.serveme.tf', target: :_blank, rel: :noopener, class: 'nav-link') %li.nav-item - = link_to('Docs', 'https://docs.ozfortress.com/index', target: :_blank, rel: :noopener, class: 'nav-link') + = link_to('Docs', 'https://docs.ozfortress.com', target: :_blank, rel: :noopener, class: 'nav-link') - if user_signed_in? && current_user.admin? %li.nav-item{ class: navbar_class(:admin) } = link_to('Admin', :admin, class: 'nav-link') + diff --git a/app/views/application/_sidebar.html.haml b/app/views/application/_sidebar.html.haml index d0871aaa3..69be17a91 100644 --- a/app/views/application/_sidebar.html.haml +++ b/app/views/application/_sidebar.html.haml @@ -1,3 +1,22 @@ + +.card + .card-header League Partners + %ul.list-group.list-group-flush + %li.list-group-item + = link_to 'https://au.serveme.tf', target: 'blank', rel: :noopener do + serveme + %li.list-group-item + = link_to 'https://twitch.tv/kritzkast', target: 'blank', rel: :noopener do + KritzKast + %li.list-group-item + = link_to 'https://twitch.tv/CappingTV', target: 'blank', rel: :noopener do + CappingTV + %li.list-group-item + = link_to 'https://callouts.tf', target: 'blank', rel: :noopener do + callouts.tf + +%br + .card .card-header Socials %ul.list-group.list-group-flush @@ -7,11 +26,11 @@ Join our Discord %li.list-group-item = link_to 'http://twitter.com/ozfortress', target: '_blank', rel: :noopener do - = image_tag 'twitter-logo.png', width: 32 - Follow us on Twitter + = image_tag 'twitter-logo.svg', width: 32 + Follow us on X %li.list-group-item = link_to 'https://www.patreon.com/ozfortress/', target: '_blank', rel: :noopener do - = image_tag 'patreon-logo.png', width: 32 + = image_tag 'patreon-logo.png', height: 32 Support us on Patreon %li.list-group-item = link_to 'https://www.youtube.com/channel/UCKnMgeTAHzdttd8TXE9UOgw', target: '_blank', rel: :noopener do diff --git a/app/views/leagues/_league_form.html.haml b/app/views/leagues/_league_form.html.haml index 585504165..8d8b95f1f 100644 --- a/app/views/leagues/_league_form.html.haml +++ b/app/views/leagues/_league_form.html.haml @@ -1,13 +1,22 @@ .card.mb-3 - .card-header Info + .card-header + %b Info .card-body = f.select :format_id, format_options + = inline_svg_tag 'open_iconic/pencil.svg', class: 'icon mr-2' + %small Tip: Can't find the format you are looking for here? Reach out to us in our Discord. + %hr = f.text_field :name + %hr = f.markdown_editor :description, rows: 10, no_escape: true + %hr = f.text_field :category + = inline_svg_tag 'open_iconic/pencil.svg', class: 'icon mr-2' + %small Tip: The category is shown in the dropdown on the Leagues page, allowing you to display only leagues with this category set. .card.mb-3 - .card-header Players + .card-header + %b Players .card-body .form-group = f.number_field :min_players, min: 1, label: 'Minimum' @@ -15,7 +24,8 @@ = f.number_field :max_players, min: 0, label: 'Maximum (0 for unlimited)' .card.mb-3 - .card-header State + .card-header + %b State .card-body = f.check_box :signuppable, label_class: 'pl-1' = f.check_box :hide_rosters, label_class: 'pl-1' @@ -25,8 +35,13 @@ = f.check_box :allow_disbanding, label_class: 'pl-1' = f.check_box :forfeit_all_matches_when_roster_disbands, label_class: 'pl-1' + .card-footer + = inline_svg_tag 'open_iconic/pencil.svg', class: 'icon mr-2' + %small Tip: Check the state options above prior to releasing the league, during the signups period and when the competition is live. + .card.mb-3 - .card-header Points + .card-header + %b Points .card-body = f.number_field :points_per_round_win, label: 'Points per set won', step: :any = f.number_field :points_per_round_draw, label: 'Points per set drawn', step: :any @@ -41,7 +56,7 @@ .card.mb-3 .card-header .row.no-gutters.flex-nowrap.align-items-center - .mr-2 Tiebreaking + %b Tiebreaking .spacer @@ -59,7 +74,7 @@ .card.mb-3 .card-header .row.no-gutters.flex-nowrap.align-items-center - .mr-2 Divisions + %b Divisions .spacer @@ -74,10 +89,14 @@ #divisions + .card-footer + = inline_svg_tag 'open_iconic/pencil.svg', class: 'icon mr-2' + %small Tip: Don't delete a division with signups/teams in it still. Move the signups/teams to another division before deleting the division. + .card.mb-3 .card-header .row.no-gutters.flex-nowrap.align-items-center - .mr-2 Map Pool (Leave empty for all maps) + %b Map Pool (Leave empty for all maps) .spacer @@ -92,8 +111,13 @@ #pooled-maps + .card-footer + = inline_svg_tag 'open_iconic/pencil.svg', class: 'icon mr-2' + %small Tip: Need a map added? Reach out to us in our Discord. + .card.mb-3 - .card-header Scheduling + .card-header + %b Scheduling .card-body = f.check_box :schedule_locked = f.select(:schedule, League.schedules.map { |name, _| [name.humanize, name] }) diff --git a/app/views/leagues/edit.html.haml b/app/views/leagues/edit.html.haml index 0edd734f4..7b8046836 100644 --- a/app/views/leagues/edit.html.haml +++ b/app/views/leagues/edit.html.haml @@ -5,8 +5,8 @@ .row.no-gutters.align-items-start .col-auto.mr-2 %h1 + Editing = league_p.link - Editing League .alert.alert-warning diff --git a/app/views/leagues/matches/_match_comms.html.haml b/app/views/leagues/matches/_match_comms.html.haml index 85993a6f9..c5da56c26 100644 --- a/app/views/leagues/matches/_match_comms.html.haml +++ b/app/views/leagues/matches/_match_comms.html.haml @@ -1,6 +1,6 @@ .card.mb-3#match-comms .card-header - Match Communications (Match Comms) + %b Match Communications (aka Match Comms) .card-body.p-0 - comms.each do |comm| @@ -15,23 +15,4 @@ = render 'leagues/matches/comms/form', f: f .d-flex.justify-content-end - = f.primary 'Post' - - .card-header Post Guidelines - .card-body - %p - Please ensure your posts in Match Communications - %b does not - contain the following: - %ul - %li Anything unrelated to the match. This is an infractable offence. - %li Anything that violates our Community Guidelines. - - .card-header Expected Match Details - .card-body - %p Your Match Communications should (by the end of that round) contain: - %ul - %li The agreed upon, scheduled match day and time. - %li Indication as to which team won what map. - %li logs.tf links for each map, which you can find easily via your ozfortress.com profile. - %li Any mercenaries used within the match (it is expected that each team declares their approved mercenaries here). \ No newline at end of file + = f.primary 'Post' \ No newline at end of file diff --git a/app/views/leagues/matches/_match_form.html.haml b/app/views/leagues/matches/_match_form.html.haml index d9e2a5747..c92ec876f 100644 --- a/app/views/leagues/matches/_match_form.html.haml +++ b/app/views/leagues/matches/_match_form.html.haml @@ -1,7 +1,8 @@ - no_team_fields = false if local_assigns[:no_team_fields].nil? .card.mb-3 - .card-header Match Settings + .card-header + %b Match Settings .card-body - unless no_team_fields / TODO: Properly handle errors here. @@ -27,7 +28,7 @@ .card.mb-3 .card-header .row.no-gutters.flex-nowrap.align-items-center - .mr-2 Picks & Bans + %b Picks & Bans .spacer @@ -48,7 +49,7 @@ .card.mb-3 .card-header .row.no-gutters.flex-nowrap.align-items-center - .mr-2 Sets + %b Sets .spacer diff --git a/app/views/leagues/matches/_matches_table.html.haml b/app/views/leagues/matches/_matches_table.html.haml index 592fbd13b..5ed45f0d5 100644 --- a/app/views/leagues/matches/_matches_table.html.haml +++ b/app/views/leagues/matches/_matches_table.html.haml @@ -1,6 +1,6 @@ - if matches.empty? - .py-2.text-muted + %li.list-group-item No matches scheduled - else diff --git a/app/views/leagues/matches/_schedule.html.haml b/app/views/leagues/matches/_schedule.html.haml index ee73df563..1c7715c87 100644 --- a/app/views/leagues/matches/_schedule.html.haml +++ b/app/views/leagues/matches/_schedule.html.haml @@ -1,6 +1,7 @@ - if league.schedule == 'weeklies' .card.mb-3 - .card-header Shared Availability + .card-header + %b Shared Availability .card-body Schedule suggestions (based on both team's shared availability): %b= league.scheduler.common_schedule(match.home_team, match.away_team).join(', ') diff --git a/app/views/leagues/matches/edit.html.haml b/app/views/leagues/matches/edit.html.haml index 1d0206511..47607f1a6 100644 --- a/app/views/leagues/matches/edit.html.haml +++ b/app/views/leagues/matches/edit.html.haml @@ -2,7 +2,9 @@ - content_for(:title) { "Edit: #{match_p} | #{@league.name}" } -%h1 Edit Match +%h1 + Editing Match ID: + %code= match_p.id %h2= match_p.link .mb-5 diff --git a/app/views/leagues/matches/show.html.haml b/app/views/leagues/matches/show.html.haml index 9465775a5..03d247f88 100644 --- a/app/views/leagues/matches/show.html.haml +++ b/app/views/leagues/matches/show.html.haml @@ -52,7 +52,8 @@ .card.mb-3 - .card-header Picks/Bans #{match_p.status} + .card-header + %b Picks/Bans #{match_p.status} - can_view_scores = !@match.confirmed? && user_can_either_teams? && @league.matches_submittable? - if can_view_scores || user_can_edit_league? @@ -63,7 +64,8 @@ - if @match.notice.present? && (user_on_either_teams? || user_can_edit_league?) .card.mb-3 - .card-header Match Notice + .card-header + %b Match Notice .card-body.markdown= match_p.notice - if @match.home_team.schedule_data && @match.away_team.schedule_data diff --git a/app/views/leagues/medals.html.haml b/app/views/leagues/medals.html.haml new file mode 100644 index 000000000..9407ca537 --- /dev/null +++ b/app/views/leagues/medals.html.haml @@ -0,0 +1,65 @@ +- content_for(:title) { "Medal Distribution for #{@league.name}" } + +%h1 Medal Distribution for #{@league.name} + +%p.alert.alert-warning Please Note: We do not provide a way of distributing your promotional items/medals, only a way of downloading lists of SteamID64 IDs for individual teams or divisions. For distribution, we recommend PGrant, or whatever Valve provides when receiving the promotional item IDs for your medals. + +%hr + +.row + .col-md-12 + .panel.panel-container + .panel-body.table-responsive + - @ordered_rosters.each do |div, rosters| + %h3= div.name + %table.table + %tr + %th # + %th Team + %th Points + %th Add to the list + - present_collection(@league.tiebreakers).each do |tiebreaker| + %th= tiebreaker.name_with_tooltip + + - rosters.each_with_index do |roster, rank| + %tr + %th{ scope: 'row' }= rank + 1 + %td + = present(roster).listing + %ul{:class => "steamids", style: "display: none"} + - roster.users.each do |player| + %li + =player.steam_id + %td= roster.points + - @league.tiebreakers.each do |tiebreaker| + %th= tiebreaker.value_for(roster) + %td + %input{:name => "list", :type => "checkbox"} + %button.btn.btn-primary.btn-lg.btn-block{:type => "button", :id => "download"} Download + %br + +:javascript + $(function() { + function download(filename, text) { + var element = document.createElement('a'); + element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)); + element.setAttribute('download', filename); + element.style.display = 'none'; + document.body.appendChild(element); + element.click(); + document.body.removeChild(element); + } + + $("#download").click(function () { + var ids = []; + $("input:checked").each(function () { + list = $(this).parent().parent().find(".steamids > li"); + list.each(function () { + var temp = $(this).html().replace(/(\r\n\t|\n|\r\t)/gm,""); + ids.push(temp); + }); + }); + console.log(ids); + download("MedalSteam64IDs" + Date.now() + ".txt", ids.join("\n")); + }); + }); \ No newline at end of file diff --git a/app/views/leagues/rosters/_form.html.haml b/app/views/leagues/rosters/_form.html.haml index 15e792f83..29b275c85 100644 --- a/app/views/leagues/rosters/_form.html.haml +++ b/app/views/leagues/rosters/_form.html.haml @@ -1,4 +1,4 @@ -= f.markdown_editor :description, label: 'About your team', rows: 10 += f.markdown_editor :description, label: 'About your roster', rows: 10 - if f.object.league.schedule == 'weeklies' = render 'leagues/schedulers/weekly_roster_form', f: f diff --git a/app/views/leagues/rosters/edit.html.haml b/app/views/leagues/rosters/edit.html.haml index 517aae395..2edcd2a07 100644 --- a/app/views/leagues/rosters/edit.html.haml +++ b/app/views/leagues/rosters/edit.html.haml @@ -29,7 +29,8 @@ .card.mb-3 - .card-header Info + .card-header + %b Roster Info .card-body = bootstrap_form_for @roster, as: :roster, url: roster_path(@roster) do |f| - if user_can_edit_league? @@ -37,7 +38,6 @@ = f.select :division_id, divisions_select(@league), label: 'Division' = f.number_field :seeding = f.number_field :ranking - = f.markdown_editor :notice, rows: 3, label: 'Notice (Public)' = render 'form', f: f @@ -53,22 +53,17 @@ = link_to 'Cancel', team_path(@roster.team), class: 'btn btn-link mr-2' = f.primary 'Update' - .card-header Roster Content Guidelines - .card-body - %p - Your roster name - %b can not - contain the following: - %ul - %li Emojis or special characters. - %li Blank characters or characters to otherwise break the name field. - %li Links/URLs. - %li Anything that violates our Community Guidelines. - = render 'leagues/rosters/transfers/index', league: @league, roster: @roster, new_transfer_request: @transfer_request, users_on_roster: @users_on_roster, users_off_roster: @users_off_roster +- if user_can_edit_league? + .card.border-danger.mb-3 + .card-header.text-white.bg-danger + %b Admin Only + .card-body + = bootstrap_form_for @roster, as: :roster, url: roster_path(@roster) do |f| + = f.markdown_editor :notice, rows: 3, label: 'Notice (only visible for Captains & Admins)' - if user_can_disband_roster? || user_can_destroy_roster? .alert.alert-danger.mb-3 diff --git a/app/views/leagues/rosters/transfers/_index.html.haml b/app/views/leagues/rosters/transfers/_index.html.haml index a18107c62..60d8375ab 100644 --- a/app/views/leagues/rosters/transfers/_index.html.haml +++ b/app/views/leagues/rosters/transfers/_index.html.haml @@ -1,7 +1,8 @@ .row .col-lg-6 .card.mb-3 - .card-header Players on Roster + .card-header + %b Players on Roster - if users_on_roster.empty? .card-body.text-muted @@ -42,7 +43,8 @@ .col-lg-6 .card.mb-3 - .card-header Players off Roster + .card-header + %b Players off Roster - if users_off_roster.empty? .card-body.text-muted diff --git a/app/views/leagues/show.html.haml b/app/views/leagues/show.html.haml index e4a566835..09cb4e817 100644 --- a/app/views/leagues/show.html.haml +++ b/app/views/leagues/show.html.haml @@ -30,6 +30,10 @@ = inline_svg_tag 'open_iconic/people.svg', class: 'icon mr-2' Signups + = link_to league_medals_path(@league), class: 'btn btn-admin' do + = inline_svg_tag 'open_iconic/badge.svg', class: 'icon mr-2' + Medals + .spacer.d-none.d-md-block = link_to edit_league_path(@league), class: 'btn btn-admin', type: 'button' do diff --git a/app/views/meta/formats/edit.html.haml b/app/views/meta/formats/edit.html.haml index 322d50c93..6883d484d 100644 --- a/app/views/meta/formats/edit.html.haml +++ b/app/views/meta/formats/edit.html.haml @@ -1,5 +1,6 @@ .card.mb-3 - .card-header Information + .card-header + %b Information .card-body = bootstrap_form_for @format, as: :format_, url: meta_format_path(@format) do |f| = render 'format_form', f: f diff --git a/app/views/meta/games/edit.html.haml b/app/views/meta/games/edit.html.haml index 1ba509a8b..7b791aa52 100644 --- a/app/views/meta/games/edit.html.haml +++ b/app/views/meta/games/edit.html.haml @@ -1,5 +1,6 @@ .card.mb-3 - .card-header Information + .card-header + %b Information .card-body = bootstrap_form_for @game, url: meta_game_path(@game) do |f| = render 'game_form', f: f diff --git a/app/views/meta/maps/edit.html.haml b/app/views/meta/maps/edit.html.haml index a06bea6f4..4e592eed1 100644 --- a/app/views/meta/maps/edit.html.haml +++ b/app/views/meta/maps/edit.html.haml @@ -1,5 +1,6 @@ .card.mb-3 - .card-header Information + .card-header + %b Information .card-body = bootstrap_form_for @map, url: meta_map_path(@map) do |f| = render 'map_form', f: f diff --git a/app/views/pages/home.html.haml b/app/views/pages/home.html.haml index 6de813a0d..9d8830edb 100644 --- a/app/views/pages/home.html.haml +++ b/app/views/pages/home.html.haml @@ -16,6 +16,6 @@ .jumbotron %h1 Welcome to Citadel - %p.lead ESports League Framework + %p.lead Esports League Framework %hr - %p View the source on #{link_to 'Github', 'https://github.com/ozfortress/citadel'} + %p You shouldn't be seeing this! Report it in our #{link_to 'Discord', 'https://discord.gg/7E6kC2H'} diff --git a/app/views/teams/_listing.html.haml b/app/views/teams/_listing.html.haml index d9cc72d58..c050dc298 100644 --- a/app/views/teams/_listing.html.haml +++ b/app/views/teams/_listing.html.haml @@ -1,7 +1,7 @@ - team = present(team) .row.ml-0 - = team.avatar_tag width: 40, height: 40, class: 'text-center' + = team.avatar_tag width: 40, height: 40, class: 'text-center rounded' .ml-2.d-flex.flex-column %span.p-0 diff --git a/app/views/teams/_show_leagues.html.haml b/app/views/teams/_show_leagues.html.haml index 64df55ae4..17c16d040 100644 --- a/app/views/teams/_show_leagues.html.haml +++ b/app/views/teams/_show_leagues.html.haml @@ -4,10 +4,12 @@ - roster_p = present(roster) - matches = active_roster_matches[roster] || [] - - if roster_p.notice != '' - .alert.alert-warning.mb-3 - .alert-heading Notice - .markdown= roster_p.notice + - if user_can_manage_transfers?(roster) && roster_p.notice != '' + .card.mb-3 + .card-header.bg-warning League Penalties + .card-body.markdown= roster_p.notice + .card-footer + %small You can find more information regarding League Penalties #{link_to 'here', 'https://docs.ozfortress.com/rules/penalties/'}. = render 'teams/show_roster', team: team, roster: roster, roster_p: roster_p, users: users, matches: matches @@ -18,4 +20,13 @@ - roster_p = present(roster) - matches = past_roster_matches[roster] || [] + - if user_can_manage_transfers?(roster) && roster_p.notice != '' + .card.mb-3 + .card-header.bg-warning League Penalties + .card-body.markdown= roster_p.notice + .alert.alert-info.mb-3 + .alert-heading + You can find more information regarding League Penalties #{link_to 'here', 'https://docs.ozfortress.com/rules/penalties/'}. + + = render 'teams/show_roster', team: team, roster: roster, roster_p: roster_p, users: users, matches: matches diff --git a/app/views/teams/_team_form.html.haml b/app/views/teams/_team_form.html.haml index 81b297afa..399937bb1 100644 --- a/app/views/teams/_team_form.html.haml +++ b/app/views/teams/_team_form.html.haml @@ -2,9 +2,6 @@ = f.text_field :name -- if user_can_edit_teams? - = f.markdown_editor :notice, rows: 3, label: 'Notice (Public)' - = f.file_field :avatar, accept: 'image/png,image/jpeg' = f.hidden_field :avatar_cache - if team.avatar.file @@ -12,3 +9,6 @@ = f.check_box :remove_avatar, label_class: 'ml-1' = f.markdown_editor :description, rows: 10 + +- if user_can_edit_teams? + = f.markdown_editor :notice, rows: 3, label: 'Notice (Public)' \ No newline at end of file diff --git a/app/views/teams/edit.html.haml b/app/views/teams/edit.html.haml index 217a9d5a1..598303ba1 100644 --- a/app/views/teams/edit.html.haml +++ b/app/views/teams/edit.html.haml @@ -1,10 +1,11 @@ - content_for(:title) { "Edit: #{@team.name}" } %h1 - Edit #{link_to @team.name, team_path(@team)} + Editing #{link_to @team.name, team_path(@team)} .card.mb-3 - .card-header Info + .card-header + %b Team Info .card-body = bootstrap_form_for @team, method: :patch do |f| = render 'team_form', f: f @@ -19,21 +20,6 @@ = f.primary 'Save' - .card-header Team Content Guidelines - .card-body - %p - Your team page (name, avatar/logo and description) - %b can not - contain the following: - %ul - %li Emojis or special characters. (Name only) - %li Blank characters or characters to otherwise break the name/description fields. - %li Links/URLs. (Name only) - %li Nudity or Sexual Content. - %li Inappropriate or Not Safe for Work memes. - %li Blank characters or characters to otherwise break the description field. - %li Anything that violates our Community Guidelines. - - unless @team.rosters.exists? .alert.alert-danger.mb-3 %label.font-weight-bold.alert-heading Danger Zone diff --git a/app/views/users/_admin_form.html.haml b/app/views/users/_admin_form.html.haml index abdf152fd..dd60eaccf 100644 --- a/app/views/users/_admin_form.html.haml +++ b/app/views/users/_admin_form.html.haml @@ -1,4 +1,4 @@ = f.text_field :badge_name = f.select :badge_color, UserPresenter::BADGE_COLORS.each_with_index.to_a -= f.markdown_editor :notice, row: 3, label: 'Notice (Only visible for user)' += f.markdown_editor :notice, row: 3, label: 'Notice (only visible for the user)' diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 0a5ae0c0e..3554b26f0 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -7,7 +7,8 @@ %hr .card.mb-3 - .card-header Change your ozfortress.com name + .card-header + %b Change your ozfortress.com name .card-body = bootstrap_form_for @name_change, url: name_user_path(@user), method: :post, as: :name_change do |f| @@ -15,29 +16,13 @@ = f.primary 'Request Name Change' - .card-header Name Change Request Guidelines - .card-body - %p - Your name - %b can not - contain the following: - %ul - %li Emojis or special characters. - %li Blank characters or characters to otherwise break the name field. - %li Links/URLs. - %li Anything that violates our Community Guidelines. - %br/ - %p - The following - %b may - result in your Name Change Request being denied: - %ul - %li Inappropriate or Not Safe for Work memes/meme names. - %li Non-emoji faces without a name next to them. - %li Obscured or otherwise "sneaky" references to anything that breaks our Community Guidelines. + .card-footer + = inline_svg_tag 'open_iconic/document.svg', class: 'icon mr-2' + %small We do not process name change requests until there are no current active seasonal leagues. .card.mb-3 - .card-header General + .card-header + %b Account Info .card-body = bootstrap_form_for @user, method: :patch do |f| = render 'form', f: f, user: @user, user_p: user_p @@ -46,22 +31,19 @@ = link_to 'Cancel', user_path(@user), class: 'btn btn-link mr-2' = f.primary 'Save' - .card-header Profile Content Guidelines - .card-body - %p - Your profile (avatar and description) - %b can not - contain the following: - %ul - %li Nudity or Sexual Content. - %li Inappropriate or Not Safe for Work memes. - %li Blank characters or characters to otherwise break the description field. - %li Anything that violates our Community Guidelines. + .card-footer + = inline_svg_tag 'open_iconic/document.svg', class: 'icon mr-2' + %small See our + = link_to 'https://docs.ozfortress.com/rules/user_policy/', target: '_blank', rel: :noopener do + %small User Policy + %small for email privacy information. Your email is only used for website notifications, not for marketing/promotions. - if user_can_edit_users? .card.border-danger.mb-3 - .card-header.text-white.bg-danger Admin Only + .card-header.text-white.bg-danger + %b Admin Only .card-body + %h5 User Management = bootstrap_form_for @user, method: :patch do |f| = render 'admin_form', f: f, user: @user, user_p: user_p @@ -71,8 +53,10 @@ = link_to 'Cancel', user_path(@user), class: 'btn btn-link mr-2' = f.primary 'Save' + %hr + .card-body - %h5 Send Notification + %h5 Send notification to #{@user.name} - notification = @user.notifications.new = bootstrap_form_for notification, url: user_notifications_path(user_id: @user.id), as: :notification, method: :post do |f| diff --git a/app/views/users/new.html.haml b/app/views/users/new.html.haml index 945463176..402e7708a 100644 --- a/app/views/users/new.html.haml +++ b/app/views/users/new.html.haml @@ -4,12 +4,25 @@ %h1 Register with [#{@user.steam_id3}] -= bootstrap_form_for @user, method: :new do |f| - = f.text_field :name - = render 'form', f: f, user: @user, user_p: user_p +.card.mb-3 + .card-header + %b= link_to "Create account with your Steam account", 'https://steamcommunity.com/profiles/' + @user.steam_id.to_s, class: 'steam_link' + + .card-body + = bootstrap_form_for @user, method: :new do |f| + = f.text_field :name + = render 'form', f: f, user: @user, user_p: user_p - .d-flex.justify-content-end - = link_to 'Cancel', :back, class: 'btn btn-link mr-2' - = f.submit 'Register' + .d-flex.justify-content-end + = link_to 'Cancel', :back, class: 'btn btn-link mr-2' + = f.submit 'Register' -%p By signing up, you are agreeing to our Community Guidelines & User Policy. +%hr + +%h5 Signup Agreement +%span By signing up, you are agreeing to our += link_to 'https://docs.ozfortress.com/rules/community_guidelines/', target: '_blank', rel: :noopener do + Community Guidelines +%span & += link_to 'https://docs.ozfortress.com/rules/user_policy/', target: '_blank', rel: :noopener do + User Policy \ No newline at end of file diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index c4e6336ec..240437c3a 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -31,19 +31,23 @@ %span= @user.steam_id .row.align-items-center.steam-link.mt-2 - = link_to "LEGACY HL (RSL)", 'https://rsl.tf/users/steam_id/' + @user.steam_id.to_s, class: 'steam_link' + = link_to "STEAMREP", 'https://steamrep.com/search?q=' + @user.steam_id.to_s, class: 'steam_link' %span.mx-2='|' - = link_to "LOGS.TF", 'http://logs.tf/profile/' + @user.steam_id.to_s, class: 'steam_link' + = link_to "LOGS.TF", 'https://logs.tf/profile/' + @user.steam_id.to_s, class: 'steam_link' %span.mx-2='·' - = link_to "DEMOS.TF", 'https://demos.tf/profiles/' + @user.steam_id.to_s, class: 'steam_link' + = link_to "MORE.TF", 'https://more.tf/profile/' + @user.steam_id.to_s, class: 'steam_link' + %span.mx-2='·' + = link_to "TRENDS.TF", 'https://trends.tf/player/' + @user.steam_id.to_s, class: 'steam_link' %span.mx-2='·' - = link_to "ETF2L", 'http://etf2l.org/search/' + @user.steam_id.to_s, class: 'steam_link' + = link_to "DEMOS.TF", 'https://demos.tf/profiles/' + @user.steam_id.to_s, class: 'steam_link' %span.mx-2='·' = link_to "RGL", 'https://rgl.gg/public/PlayerProfile.aspx?p=' + @user.steam_id.to_s, class: 'steam_link' %span.mx-2='·' - = link_to "UGC", 'http://www.ugcleague.com/players_page.cfm?player_id=' + @user.steam_id.to_s, class: 'steam_link' + = link_to "ETF2L", 'https://etf2l.org/search/' + @user.steam_id.to_s, class: 'steam_link' %span.mx-2='·' - = link_to "MATCH.TF", 'https://match.tf/users/steam_id/' + @user.steam_id.to_s, class: 'steam_link' + = link_to "UGC", 'https://www.ugcleague.com/players_page.cfm?player_id=' + @user.steam_id.to_s, class: 'steam_link' + %span.mx-2='·' + = link_to "CLTF2", 'https://cltf2.com/users/steam_id/' + @user.steam_id.to_s, class: 'steam_link' .row.mb-3 != present_collection(@titles).map(&:icon).join(' ') @@ -68,8 +72,10 @@ - if user_p.notice != '' && (user_can_edit_users? || (current_user? && current_user == @user)) .card.mb-3 - .card-header.bg-warning Notice + .card-header.bg-warning Player Behaviour Infractions & League Penalties .card-body.markdown= user_p.notice + .card-footer + %small You can find more information regarding Player Behaviour Infractions #{link_to 'here', 'https://docs.ozfortress.com/rules/infractions/'}, and League Penalties #{link_to 'here', 'https://docs.ozfortress.com/rules/penalties/'}. .nav.nav-tabs{ role: 'tablist' } %a.nav-item.nav-link.active#info-tab{ href: '#info', role: 'tab', data: { toggle: 'tab' }, @@ -93,7 +99,6 @@ .tab-pane#forums{ role: 'tabpanel', aria: { labelledby: 'forums-tab' } } = render 'users/show_forums', user: @user, forums_posts: @forums_posts - - if user_can_edit_users? %hr = render 'users/show_admin_comments', user: @user, comments: @comments, comment: @comment diff --git a/config/routes.rb b/config/routes.rb index febadeee5..f0eecf730 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -31,6 +31,7 @@ end resources :leagues do + get 'medals', to: 'leagues#medals' patch 'modify', on: :member resources :transfers, controller: 'leagues/transfers', only: [:index, :destroy, :update] diff --git a/script/auto_seed_trello.rb b/script/auto_seed_trello.rb index e803ac3b8..2a65ee5da 100644 --- a/script/auto_seed_trello.rb +++ b/script/auto_seed_trello.rb @@ -58,7 +58,7 @@ def deliver_team body << 'Roster:' roster.users.each do |user| user_p = UserPresenter.new(user, nil) - body << "\t#{user.name}\t[[#{user.steam_id3}](#{user_p.steam_profile_url})]" + body << "\t#{user.name}\t[[#{user.steam_id3}](https://ozfortress.com/users/steam_id/#{user.steam_id})]" end p body