← Alla rollguiderAll role guides
Hitta Ditt Sverige · AnvändarresedokumentationHitta Ditt Sverige · User Journey Documentation

ByadministratörenThe Village Administrator

Hur en byrepresentant håller sin orts profil aktuell och synlig på plattformenHow a village representative keeps their location's profile current and visible on the platform

Roll: village_adminRole: village_admin Plattform: pitea.hittadittsverige.sePlatform: pitea.hittadittsverige.se Uppdaterad: 2026-09-08Updated: 2026-09-08

Vem är det här?Who is this?

  • En lokal representant, ofta vald av bybornaA local representative, often elected by the village
  • Ansvarar för sin orts profil på plattformenResponsible for their village's profile on the platform
  • Frivilliguppdrag, ingen kommunanställning krävsVoluntary role, no municipal employment required
  • Kommunens direktkanal till lokalsamhälletThe commune's direct channel to the local community

Vad kan de göra?What can they do?

  • Redigera byns profilsidaEdit the village profile page
  • Lägga till beskrivning, bilder och fakta om ortenAdd description, images, and facts about the village
  • Se vilka entiteter som är kopplade till bynView entities linked to the village
  • Hålla kontaktuppgifter uppdateradeKeep contact information up to date
Steg 1Step 1

InloggningLogin

Byadministratören loggar in på samma sida som alla andra roller, med sin e-post och sitt lösenord.

Inloggningssidan
Inloggningssidan
Login page

The village administrator logs in on the same page as all other roles, with their email and password.

Login page
Inloggningssidan
Login page
Steg 2Step 2

DashboardenThe dashboard

Efter inloggning hamnar byadministratören på /dashboard/, precis som andra kommunroller. Fliken «Översikt» visar kommunens övergripande siffror (antal entiteter, hävdade profiler, kommande evenemang) — samma vy som en fältagent eller landsbygdsutvecklare ser, inte bara data om den egna byn.

/dashboard/  ·  byadministratörens översiktsflik med kommunens siffror
/dashboard/ · byadministratörens översiktsflik med kommunens siffror
/dashboard/ · the village admin’s overview tab with commune-wide figures

After logging in, the village administrator lands on /dashboard/, just like other commune roles. The «Översikt» (Overview) tab shows commune-wide numbers (entity count, claimed profiles, upcoming events) — the same view a field agent or rural development officer sees, not just data about their own village.

/dashboard/  ·  the village admin’s overview tab with commune-wide figures
/dashboard/ · byadministratörens översiktsflik med kommunens siffror
/dashboard/ · the village admin’s overview tab with commune-wide figures
Steg 3Step 3

«Min by», den egna orten«Min by», the assigned village

Fliken «Min by» är filtrerad till byadministratörens egen ort — i det här kontot Arnemark. Länken «Visa» ska ta administratören till byns publika sida, och «Visa på karta» öppnar kartan.

/dashboard/  ·  fliken Min by, filtrerad till Arnemark
/dashboard/ · fliken Min by, filtrerad till Arnemark
/dashboard/ · the Min by tab, filtered to Arnemark
✓

Fixat (2026-09-08): «Visa» länkade tidigare till /by/?id=arnemark, en död adress (404). Länken pekar nu på den riktiga publika bysidan, /plats/arnemark/. «Visa på karta» fungerar som väntat.

The «Min by» (My village) tab is filtered to the village administrator’s own location — in this account, Arnemark. The «Visa» (View) link is meant to take the administrator to the village’s public page, and «Visa på karta» opens the map.

/dashboard/  ·  the Min by tab, filtered to Arnemark
/dashboard/ · fliken Min by, filtrerad till Arnemark
/dashboard/ · the Min by tab, filtered to Arnemark
✓

Fixed (2026-09-08): «Visa» used to link to /by/?id=arnemark, a dead address (404). The link now points to the real public village page, /plats/arnemark/. «Visa på karta» works as expected.

Steg 4Step 4

Byns publika sidaThe village’s public page

Den riktiga adressen till byns publika sida är /plats/arnemark/ (nås via menyn BYAR, inte via den trasiga «Visa»-länken). Sidan visar beskrivning, karta, aktörer och en galleriflik — men inte i skrivande stund någon «Redigera»-knapp för den inloggade byadministratören.

/plats/arnemark/  ·  byns publika sida
/plats/arnemark/ · byns publika sida
/plats/arnemark/ · the village’s public page

The real address for the village’s public page is /plats/arnemark/ (reached via the BYAR menu, not the broken «Visa» link). The page shows a description, map, local actors, and a gallery tab — but as of this writing, no «Redigera» (Edit) button for the logged-in village administrator.

/plats/arnemark/  ·  the village’s public page
/plats/arnemark/ · byns publika sida
/plats/arnemark/ · the village’s public page
Steg 5Step 5

«Min profil» – inte byns profil«Min profil» – not the village profile

Fliken «Min profil» på dashboarden visar ett formulär med fälten Namn, Tagline, Beskrivning, Kontakt-e-post, Telefon, Webbplats och Öppettider. Formuläret hämtar och sparar data mot /data/entities.json med kontots entitets-id (arnemark) — men Arnemark finns bara som en by i villages.json, inte som en entitet i entities.json. Formuläret laddas därför tomt, och det är oklart vad ett sparat ändringsförsök egentligen skulle påverka. Detta är inte rätt verktyg för att redigera byns profil.

/dashboard/  ·  fliken Min profil, tom eftersom Arnemark inte är en entitet
/dashboard/ · fliken Min profil, tom eftersom Arnemark inte är en entitet
/dashboard/ · the Min profil tab, empty because Arnemark is not an entity

The «Min profil» tab on the dashboard shows a form with fields for Name, Tagline, Description, Contact email, Phone, Website, and Opening hours. The form fetches and saves data against /data/entities.json using the account’s entity ID (arnemark) — but Arnemark only exists as a village in villages.json, not as an entity in entities.json. The form therefore loads empty, and it is unclear what a saved change would actually affect. This is not the right tool for editing the village profile.

/dashboard/  ·  the Min profil tab, empty because Arnemark is not an entity
/dashboard/ · fliken Min profil, tom eftersom Arnemark inte är en entitet
/dashboard/ · the Min profil tab, empty because Arnemark is not an entity
Steg 6Step 6

/konto/ – den avsedda byredigeraren är trasig/konto/ – the intended village editor is broken

/konto/ är den sida som är byggd för att låta byadministratören redigera sin orts profiltext, fakta och kopplade entiteter (se rollkortet ovan). Vysväljaren visar korrekt «Byadministration» som vald vy, men innehållsytan visar istället felmeddelandet «Byn hittades inte pa ditt konto. Logga ut och in igen, eller kontakta admin.» Det här är inte ett tillfälligt fel — det inträffar varje gång och beror på hur kontots by-koppling sparas i sessionen (se rutan nedan). Byadministratören har i praktiken ingen fungerande väg att redigera byns profil just nu.

/konto/  ·  Byadministration-vyn visar «Byn hittades inte pa ditt konto»
/konto/ · Byadministration-vyn visar «Byn hittades inte pa ditt konto»
/konto/ · the Byadministration view shows «Village not found on your account»

/konto/ is the page built to let the village administrator edit their location’s profile text, facts, and linked entities (see the role card above). The view selector correctly shows «Byadministration» as the selected view, but the content area instead shows the error message «Byn hittades inte pa ditt konto. Logga ut och in igen, eller kontakta admin.» («The village was not found on your account. Log out and back in, or contact admin.») This is not an intermittent glitch — it happens every time, and stems from how the account’s village link is stored in the session (see the box below). The village administrator currently has no working way to edit the village profile.

/konto/  ·  the Byadministration view shows «Village not found on your account»
/konto/ · Byadministration-vyn visar «Byn hittades inte pa ditt konto»
/konto/ · the Byadministration view shows «Village not found on your account»
Steg 7Step 7

/konto/ – «Mina sidor»-vyn/konto/ – the «Mina sidor» view

Vysväljaren på /konto/ erbjuder bara två alternativ: «Mina sidor» (personlig vy för medlemskap, bokningar och annonser) och «Byadministration» (den trasiga vyn ovan). «Mina sidor» fungerar och visar att kontot inte är medlem i någon förening ännu.

/konto/  ·  Mina sidor-vyn, fungerar som väntat
/konto/ · Mina sidor-vyn, fungerar som väntat
/konto/ · the Mina sidor view, working as expected

The view selector on /konto/ offers only two options: «Mina sidor» (a personal view for memberships, bookings, and listings) and «Byadministration» (the broken view above). «Mina sidor» works and shows that the account is not yet a member of any association.

/konto/  ·  the Mina sidor view, working as expected
/konto/ · Mina sidor-vyn, fungerar som väntat
/konto/ · the Mina sidor view, working as expected
i

Fixat (2026-09-08): Vid inloggning sattes sessionens villageId tidigare enbart från kolumnen village_id i konto-tabellen, som är NULL för det här testkontot. Den by-slug som faktiskt stämmer med villages.json (arnemark) ligger istället i kolumnen entity_id. Åtgärdat i api/auth/login.php (samt api/auth/google-callback.php) genom att falla tillbaka på entity_id när village_id är NULL för roller village/village_admin — samma fallback som dashboardens «Min by»-flik redan använde. api/_helpers.phps hds_require_village_access() uppdaterades att känna igen rollen village_admin (tidigare kollade den bara village), och api/accounts/create.phps bykonto-flöde skapar nu konton med rollen village_admin och by-sluggen i entity_id, i linje med hur resten av koden fungerar. /konto/-editorn laddar och sparar nu byns profil korrekt (verifierat mot detta testkonto).Fixed (2026-09-08): At login, the session’s villageId used to be set purely from the village_id column in the accounts table, which is NULL for this test account. The village slug that actually matches villages.json (arnemark) instead lives in the entity_id column. Fixed in api/auth/login.php (and api/auth/google-callback.php) by falling back to entity_id when village_id is NULL for the village/village_admin roles — the same fallback the dashboard’s «Min by» tab already used. api/_helpers.php’s hds_require_village_access() was updated to recognize the village_admin role (it previously only checked village), and api/accounts/create.php’s village-account flow now creates accounts with the village_admin role and the village slug in entity_id, matching how the rest of the code works. The /konto/ editor now loads and saves the village profile correctly (verified against this test account).