diff --git a/assets/css/forum-styles.css b/assets/css/forum-styles.css index cd98b38..556064b 100644 --- a/assets/css/forum-styles.css +++ b/assets/css/forum-styles.css @@ -437,6 +437,14 @@ cursor: pointer; } +#scrollToTopButton:hover { + background-color: white; + color: black; + border: 2px solid black; + box-shadow: 0 0 15px rgba(255,255,255,0.8); + transform: scale(1.1); /* Slight enlarge effect on hover */ +} + /* this is the text from the quill editor, hopefully these settings will prevent the page styles from affecting the formatted html from editor posts. */ .message-text { diff --git a/assets/js/AdminBoard.js b/assets/js/AdminBoard.js index 03c2d26..8e50bf4 100644 --- a/assets/js/AdminBoard.js +++ b/assets/js/AdminBoard.js @@ -99,11 +99,10 @@ const loadAdminBoardPage = async () => { document.getElementById("publish-card-form").addEventListener("submit", async (event) => { event.preventDefault() const isTopicChecked = document.getElementById("topic-checkbox").checked - // Pass that boolean to publishEncryptedCard await publishEncryptedCard(isTopicChecked) }) - + createScrollToTopButton() // await fetchAndValidateAllAdminCards() await fetchAllEncryptedCards() await updateOrSaveAdminGroupsDataLocally() diff --git a/assets/js/MinterBoard.js b/assets/js/MinterBoard.js index 91224c7..5b036fc 100644 --- a/assets/js/MinterBoard.js +++ b/assets/js/MinterBoard.js @@ -4,6 +4,9 @@ const cardIdentifierPrefix = "Minter-board-card" let isExistingCard = false let existingCardData = {} let existingCardIdentifier = {} +const MIN_ADMIN_YES_VOTES = 9; +const MINTER_INVITE_BLOCK_HEIGHT = 9999999; // Example height, update later +let isApproved = false const loadMinterBoardPage = async () => { // Clear existing content on the page @@ -28,7 +31,7 @@ const loadMinterBoardPage = async () => {
` document.body.appendChild(mainContent) + createScrollToTopButton() document.getElementById("publish-card-button").addEventListener("click", async () => { try { @@ -331,7 +335,7 @@ const fetchExistingCard = async () => { return null } else if (response.length === 1) { // we don't need to go through all of the rest of the checks and filtering nonsense if there's only a single result, just return it. const mostRecentCard = response[0] - + isExistingCard = true const cardDataResponse = await qortalRequest({ action: "FETCH_QDN_RESOURCE", name: userState.accountName, // User's account name @@ -341,6 +345,7 @@ const fetchExistingCard = async () => { existingCardIdentifier = mostRecentCard.identifier existingCardData = cardDataResponse + isExistingCard = true return cardDataResponse } @@ -367,6 +372,7 @@ const fetchExistingCard = async () => { existingCardIdentifier = mostRecentCard.identifier existingCardData = cardDataResponse + isExistingCard = true console.log("Full card data fetched successfully:", cardDataResponse) @@ -472,6 +478,7 @@ const publishCard = async () => { if (isExistingCard){ alert("Card Updated Successfully! (No poll updates are possible at this time...)") + isExistingCard = false } document.getElementById("publish-card-form").reset() @@ -575,29 +582,6 @@ const processPollData= async (pollData, minterGroupMembers, minterAdmins, creato blocksMinted } }) - //TODO verify this new voterPromises async function works better. - // const voterPromises = pollData.votes.map(async (vote) => { - // const voterPublicKey = vote.voterPublicKey; - // const voterAddress = await getAddressFromPublicKey(voterPublicKey); - - // const [nameInfo, addressInfo] = await Promise.all([ - // getNameFromAddress(voterAddress).catch(() => ""), - // getAddressInfo(voterAddress).catch(() => ({})), - // ]); - - // const voterName = nameInfo || (nameInfo === voterAddress ? "" : voterAddress); - // const blocksMinted = addressInfo?.blocksMinted || 0; - - // return { - // optionIndex: vote.optionIndex, - // voterPublicKey, - // voterAddress, - // voterName, - // isAdmin: adminAddresses.includes(voterAddress), - // isMinter: memberAddresses.includes(voterAddress), - // blocksMinted, - // }; - // }); const allVoters = await Promise.all(voterPromises) const yesVoters = [] @@ -774,35 +758,6 @@ const fetchCommentsForCard = async (cardIdentifier) => { } } -// display the comments on the card, with passed cardIdentifier to identify the card -------------- -// const displayComments = async (cardIdentifier) => { -// try { -// const comments = await fetchCommentsForCard(cardIdentifier); -// const commentsContainer = document.getElementById(`comments-container-${cardIdentifier}`) - -// for (const comment of comments) { -// const commentDataResponse = await qortalRequest({ -// action: "FETCH_QDN_RESOURCE", -// name: comment.name, -// service: "BLOG_POST", -// identifier: comment.identifier, -// }) -// const timestamp = await timestampToHumanReadableDate(commentDataResponse.timestamp) -// const commentHTML = ` -// + ` +} + +const checkAndDisplayInviteButton = async (adminYes, creator, cardIdentifier) => { + const latestBlockInfo = await getLatestBlockInfo() + const isBlockPassed = latestBlockInfo.height > MINTER_INVITE_BLOCK_HEIGHT + + if (adminYes >= 9 && userState.isMinterAdmin) { + const inviteButtonHtml = createInviteButtonHtml(creator, cardIdentifier) + console.log(`admin votes over 9, creating invite button...`, adminYes) + return inviteButtonHtml + } + + return null +} + + // Create the overall Minter Card HTML ----------------------------------------------- const createCardHTML = async (cardData, pollResults, cardIdentifier, commentCount, cardUpdatedTime, BgColor) => { const { header, content, links, creator, timestamp, poll } = cardData @@ -1056,6 +1075,9 @@ const createCardHTML = async (cardData, pollResults, cardIdentifier, commentCoun createModal('links') createModal('poll-details') + const inviteButtonHtml = await checkAndDisplayInviteButton(adminYes, creator, cardIdentifier) + const inviteHtmlAdd = (inviteButtonHtml) ? inviteButtonHtml : '' + return `${header}
(click COMMENTS button to open/close card comments)
Learn more about the Mintership concept, and why it was needed. The days of 'sponsorship' are a thing of the past on the Qortal Network. No more will there be the ability to self-sponsor. A new era of Qortal begins! Join the conversation with the other minters and admins here!
@@ -168,10 +140,10 @@- Are you one of the initially selected Minter Admins? We have the tools here you need to create and approve GROUP_APPROVAL transactions, and communicate securely with your fellow admins. There is a private forum, and Minter Admin Tools section available for you!
- + Make decisions together with the other admins on the Admin Board. The admin board is a FULLY ENCRYPTED decision-making board for the Mintership Admins. This board allows publishing 'cards' just like the Minter Board, but with two types of cards. Check out the Admin Board Here! ++ NEW Feature- 'INVITE MINTER' - This is a button that will come up on the Minter Board and allow existing Minters (non-admins) to create the INVITE transaction that will then be approved by the Minter Admins. The concept of the 'Minter Admin Tools' section is changing, and the tools for creation and approval of transactions are being implemented into the Minter Board instead. Just as the Votes are now displayed, in the future the approval transactions will be displayed. Making it a one-stop location for all new (and existing) Minter details and actions. More details will be published in the FORUM
+NEW Feature - 'ScrollToTop button' - The 'ScrollToTop' button was a requested feature to allow users to easily scroll back to the top of the page. It will come up on any page after you scroll down over 100px, and allow you to get back to the top of the page with a single click. Applied to Forum and Boards.
+Fixes - Admin Room image embeds - The image embed feature on the Forum, in the Admin Room (encrypted) has been fixed, attached images will now display in the preview pane as they would with unencrypted images.
+Various additional fixes and cleanup. More account detail features and the modification of the Minter Admin Tools section into an 'account details explorer' will be taking place over time.
++ A few update patches have been made, so this is a patch update to fix various issues.
+Q-Mintership v0.69beta
+Q-Mintership v0.71beta
${commentDataResponse.creator}:
-//${commentDataResponse.content}
-//${timestamp}
-//