Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/SdazaP/ruTournament/llms.txt

Use this file to discover all available pages before exploring further.

Every tournament in ruTournament has a lifecycle that governs what organizers can and cannot do at any given moment. The three-state model exists to prevent accidental data modifications once competition is underway or concluded: you can freely set everything up while the tournament is upcoming, record results live during the active phase, and then lock the record permanently once the event is over. Understanding which state your tournament is in is the key to knowing why a button might be disabled or a form read-only.

Status states at a glance

StateIdentifierCan EditCan Upload ResultsDescription
UpcomingproximamentePre-competition preparation phase. All general fields are editable but the results entry interface is disabled.
ActiveactivoCompetition is in progress. All features are fully enabled including result entry, competitor management, and category configuration.
FinalizedfinalizadoRead-only archive. All writes are blocked — no edits, no result uploads, no deletions.

The useTournamentStatus hook

The permission system is centralised in a single React hook that every page uses to derive its current capabilities. The hook loads the tournament’s status from IndexedDB once on mount and exposes computed boolean flags:
// src/hooks/useTournamentStatus.ts
export type TournamentStatus = 'activo' | 'proximamente' | 'finalizado';

export const useTournamentStatus = (id: string | undefined) => {
  // Fetches tournament from db.tournaments.get(id)
  // returns:
  // status:             'activo' | 'proximamente' | 'finalizado'
  // canEdit:            boolean  — true when activo OR proximamente
  // canUploadResults:   boolean  — true only when activo
  // isFinalized:        boolean  — true only when finalizado
  // loading:            boolean  — true while the DB read is in-flight
};
The derivation logic is straightforward:
const canEdit          = status === 'activo' || status === 'proximamente';
const canUploadResults = status === 'activo';
const isFinalized      = status === 'finalizado';
  • canEdit is true for both activo and proximamente. It guards updates to tournament metadata, competitor lists, categories, and round configuration.
  • canUploadResults is true exclusively for activo. Result entry buttons are disabled and show a lock icon in any other state.
  • isFinalized being true causes every section in the tournament to render a read-only banner informing the organiser that the tournament has been closed.

Changing tournament state

1

Open the tournament panel

Navigate to the tournament’s home panel (Inicio) from the left sidebar.
2

Activate Edit Mode

Click the blue Editar button in the top-right corner of the panel. The UI switches to edit mode, revealing all configurable fields.
3

Change the Status dropdown

Locate the Estado (Status) field and select the desired state: Próximamente, Activo, or Finalizado.
4

Save the change

Click Guardar to persist the new status to IndexedDB. All pages in the tournament will immediately reflect the new permissions.
To un-finalize a tournament — for example if you need to correct a result after closing — repeat the same steps and change the status back to Activo. There is no grace-period or confirmation required for un-finalization.
The finalizado state is designed for archiving completed competitions. Once finalized, every section of the tournament displays a read-only banner and all edit controls are hidden or disabled. This makes it safe to leave a finalized tournament accessible for viewing without risk of accidental modification.

Deleting a tournament

Tournament deletion is available only while Edit Mode is active on the tournament panel. A red Eliminar Torneo button appears at the bottom of the edit form. Clicking it opens a confirmation dialog that requires you to type the exact tournament name before the deletion can proceed.
Deleting a tournament is irreversible. Because ruTournament has no backend and no sync service, all tournament data — categories, competitors, rounds, results, scrambles, and groups — lives exclusively in your browser’s IndexedDB. Once deleted, there is no recovery path. Make absolutely sure you have selected the correct tournament before typing the confirmation name.

Build docs developers (and LLMs) love