Skip to content

Commit

Permalink
minor changes to formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Sanderson committed Oct 23, 2024
1 parent 6ee28c4 commit 9714692
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
5 changes: 3 additions & 2 deletions public/scripts/clublist.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ const auth = getAuth();
const db = getFirestore(app);

function appendElement (elemNode,textNode,href) {
var container = document.getElementById("body");
var container = document.getElementById("listOfClubs");
var element = document.createElement(elemNode);
element.setAttribute("href","clubhomepage.html?id=" + href)
var text = document.createTextNode(textNode);
var text = document.createTextNode("\t" +textNode + "\n");
element.appendChild(text);
container.appendChild(element);
}
Expand All @@ -41,6 +41,7 @@ firebase.auth().onAuthStateChanged(function(user){
{

appendElement("a",doc.data()["BookClubName"], doc.id);
appendElement("p", "\n", "none")
// output+="\n<a href=\"clubhomepage?" + doc.data()["BookClubName"] +"\" >";
// output+= doc.data()["BookClubName"];
// output+= "</a>\n"
Expand Down
8 changes: 6 additions & 2 deletions public/scripts/manageclub.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,17 @@ from "https://www.gstatic.com/firebasejs/10.13.2/firebase-auth.js";

clubEditForm.addEventListener('submit', async function(e){
e.preventDefault();
const clubName = clubEditForm["club-name"].value;
let clubName = clubEditForm["club-name"].value;
let desc = clubEditForm["club-description"].value;

if (desc == "")
{
desc = docRef.data()["clubDescription"];
}
if (clubName == "")
{
clubName = docRef.data()["BookClubName"];
}



Expand All @@ -65,7 +69,7 @@ from "https://www.gstatic.com/firebasejs/10.13.2/firebase-auth.js";



if (qsnap.empty || clubName == docRef.docs[0].data()["BookClubName"]){
if (qsnap.empty || clubName == docRef.data()["BookClubName"]){
await updateDoc(doc(db,"BookClubs", docRef.id), {
BookClubName: clubName,
clubDescription: desc
Expand Down
3 changes: 3 additions & 0 deletions public/webpages/html/MyClubs.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<title>Document</title>
</head>
<body id="body">
<ul id="listOfClubs">

</ul>
<script src="https://www.gstatic.com/firebasejs/8.10.0/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.10.0/firebase-auth.js"></script>
<script defer type="module" src="../../scripts/clublist.js"> </script>
Expand Down
4 changes: 2 additions & 2 deletions public/webpages/html/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
<nav class="nav-container">
<ul class="nav-list">
<li><a href="dashboard.html">Home</a></li>
<li class="dropdown">
<!-- <li class="dropdown">
<a href="MyClubs.html">My Clubs</a>
<ul class="dropdownmenu" id="userdropdownmenu">
<li><a href="overview.html">My Club Creation</a></li>
<li><a href="club.html">Create my Club</a></li>
</ul>
</li>
</li> -->

<li>
<a href="MyClubs.html"><button class="loginbutton">My Clubs</button></button></a>
Expand Down

0 comments on commit 9714692

Please sign in to comment.