Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ozfortress branch changes #522

Open
wants to merge 35 commits into
base: ozfortress
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
853ed09
Small spacing/padding fix
coreobs Mar 18, 2024
77bd84a
Medal Distribution tool added to league pages
coreobs Mar 18, 2024
1874516
Merge pull request #1 from coreobs/master
coreobs Mar 18, 2024
8862224
Update league edit page to include tips & a little cleaner UI
coreobs Mar 18, 2024
efec949
Update user edit page to remove content guidelines & clean UI up a li…
coreobs Mar 18, 2024
9d72024
Signup/new account page improvement
coreobs Mar 18, 2024
9ecbdc8
Removed match comms content guidelines
coreobs Mar 18, 2024
bbbf524
Match settings page improvements
coreobs Mar 18, 2024
3bdd2e0
Roster settings page updates
coreobs Mar 18, 2024
64591d7
Team settings page updates
coreobs Mar 18, 2024
326ba32
Bolded remaining headings in match settings
coreobs Mar 18, 2024
016d01e
Added Match ID to match settings title
coreobs Mar 18, 2024
bf0e183
Bolded headings on meta page settings
coreobs Mar 18, 2024
481e32c
Made bracket lines show only on hover & styled with OZF blue
coreobs Mar 22, 2024
9592fa0
Changed Captain badge colour to secondary
coreobs Mar 22, 2024
4550999
Updated user profiles with new links
coreobs Mar 22, 2024
c32be14
Consistency with production
coreobs Mar 22, 2024
6f85cc3
Added notice to home page when news topic/news feed is not working
coreobs Mar 22, 2024
11f4dc0
Change team listing avatar's to rounded corners
coreobs Mar 22, 2024
9a702bf
Updated roster settings page to say "roster" rather than "team"
coreobs Mar 22, 2024
ff104a9
Show league penalties on individual rosters
coreobs Mar 22, 2024
f92b9f2
Move notice field in team settings to the bottom
coreobs Mar 22, 2024
b0acc85
Update disclaimer for notice section in user settings to reflect that…
coreobs Mar 22, 2024
085de79
Updated Admin Only section with a new heading
coreobs Mar 22, 2024
44b4df1
Moved notice section in rosters to new Admin Only card
coreobs Mar 22, 2024
edf294a
Changed user link in trello script to link to ozfortress instead of S…
coreobs Mar 22, 2024
74d9144
Merge pull request #2 from ozfortress/ozfortress
coreobs Apr 5, 2024
0dfddf6
Merge branch 'ozfortress:ozfortress' into ozfortress
coreobs Aug 18, 2024
3a01d89
"Fix" mobile navmenu having large gaps
coreobs Aug 18, 2024
a3d2694
Add callouts.tf to sidebar
coreobs Aug 18, 2024
9df38cc
Forgot styles for mobile navmenu fix
coreobs Aug 18, 2024
a1e4ef4
Update socials logo
coreobs Aug 18, 2024
868f588
Added new user links
coreobs Oct 1, 2024
99f86ab
Merge branch 'ozfortress:ozfortress' into ozfortress
coreobs Nov 19, 2024
3f8e15b
Update user page to include more.tf
coreobs Nov 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified app/assets/images/discord-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/facebook-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/patreon-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/steam/steam-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/assets/images/twitter-logo.png
Binary file not shown.
3 changes: 3 additions & 0 deletions app/assets/images/twitter-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/youtube-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 12 additions & 5 deletions app/assets/javascripts/brackets.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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() {
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
30 changes: 30 additions & 0 deletions app/assets/stylesheets/navbar.sass
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 18 additions & 2 deletions app/controllers/leagues_controller.rb
Original file line number Diff line number Diff line change
@@ -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]

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/presenters/user_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
37 changes: 20 additions & 17 deletions app/views/application/_navbar.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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')

25 changes: 22 additions & 3 deletions app/views/application/_sidebar.html.haml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
40 changes: 32 additions & 8 deletions app/views/leagues/_league_form.html.haml
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
.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'
.form-group
= 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'
Expand All @@ -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
Expand All @@ -41,7 +56,7 @@
.card.mb-3
.card-header
.row.no-gutters.flex-nowrap.align-items-center
.mr-2 Tiebreaking
%b Tiebreaking

.spacer

Expand All @@ -59,7 +74,7 @@
.card.mb-3
.card-header
.row.no-gutters.flex-nowrap.align-items-center
.mr-2 Divisions
%b Divisions

.spacer

Expand All @@ -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

Expand All @@ -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] })
Expand Down
2 changes: 1 addition & 1 deletion app/views/leagues/edit.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
.row.no-gutters.align-items-start
.col-auto.mr-2
%h1
Editing
= league_p.link
Editing League


.alert.alert-warning
Expand Down
23 changes: 2 additions & 21 deletions app/views/leagues/matches/_match_comms.html.haml
Original file line number Diff line number Diff line change
@@ -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|
Expand All @@ -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).
= f.primary 'Post'
Loading