diff --git a/client/agora/public/assets/img/buttons/invite-friend.png b/client/agora/public/assets/img/buttons/invite-friend.png new file mode 100644 index 00000000..b04dd622 Binary files /dev/null and b/client/agora/public/assets/img/buttons/invite-friend.png differ diff --git a/client/agora/public/css/agora-theme.css b/client/agora/public/css/agora-theme.css index 4a329746..e7757bca 100644 --- a/client/agora/public/css/agora-theme.css +++ b/client/agora/public/css/agora-theme.css @@ -81,42 +81,55 @@ Tetradic: #414d53, #4d4153, #535041 .primary { color: #F39845; } + .complementary { color: #2C8895; } + .complementary-light { color: #78C0CA; } + .harmony { color: #6d4f40; } + .analogous { color: #534c41; } + .analogous2 { color: #534341; } + .split-complementary { color: #444153; } + .split-complementary2 { color: #415347; } + .triadic { color: #4d4153; } + .triadic2 { color: #475341; } + .tetradic { color: #414d53; } + .tetradic2 { color: #4d4153; } + .tetradic3 { color: #535041; } + .agoraColor { color: #f39945; } @@ -136,7 +149,7 @@ Tetradic: #414d53, #4d4153, #535041 .cherry-red-color { color: rgba(99, 19, 18) !important; } - + .cherry-red-bg-color { background-color: rgba(99, 19, 18) !important; } @@ -147,35 +160,41 @@ Tetradic: #414d53, #4d4153, #535041 font-family: 'Luxurious Roman', cursive !important; color: #171717; } + .agora-font-light { font-family: 'Luxurious Roman', cursive !important; color: #F6F6F6; } + .agora-font-1em { font-family: 'Luxurious Roman', cursive !important; - font-size:1em !important + font-size: 1em !important } + .agora-font-1p5em { font-family: 'Luxurious Roman', cursive !important; - font-size:1.5em !important + font-size: 1.5em !important } + .agora-font-2em { font-family: 'Luxurious Roman', cursive !important; - font-size:2em !important + font-size: 2em !important } + .agora-font-3em { font-family: 'Luxurious Roman', cursive !important; - font-size:3em !important + font-size: 3em !important } - + .agora-font-large { font-family: 'Luxurious Roman', cursive !important; - font-size:4em !important + font-size: 4em !important } + @media (min-width: 992px) { .agora-font-large { - font-family: 'Luxurious Roman', cursive !important; - font-size:5em !important + font-family: 'Luxurious Roman', cursive !important; + font-size: 5em !important } } @@ -184,7 +203,8 @@ Tetradic: #414d53, #4d4153, #535041 color: #AE7A0B !important; } -a.text-primary:hover, a.text-primary:focus { +a.text-primary:hover, +a.text-primary:focus { color: #085F6B !important; } @@ -193,7 +213,8 @@ a.text-primary:hover, a.text-primary:focus { padding-left: 25px !important; } -a.text-secondary:hover, a.text-secondary:focus { +a.text-secondary:hover, +a.text-secondary:focus { color: #11181f !important; } @@ -203,68 +224,91 @@ a.text-secondary:hover, a.text-secondary:focus { background-color: #826131; border-color: #826131; } + .btn-primary:hover { color: #fff; background-color: #d8a348; border-color: #d8a348; } + .btn-primary:active { color: #fff; background-color: #d8a348; border-color: #826131; } -.btn-primary:focus, .btn-primary.focus { + +.btn-primary:focus, +.btn-primary.focus { color: #fff; background-color: #d8a348; border-color: #826131; box-shadow: 0 0 0 0.2rem rgba(60, 198, 171, 0.5); } -.btn-primary.disabled, .btn-primary:disabled { + +.btn-primary.disabled, +.btn-primary:disabled { color: #fff; background-color: #826131; border-color: #826131; } -.btn-primary:not(:disabled):not(.disabled):active, .btn-primary:not(:disabled):not(.disabled).active, .show > .btn-primary.dropdown-toggle { + +.btn-primary:not(:disabled):not(.disabled):active, +.btn-primary:not(:disabled):not(.disabled).active, +.show>.btn-primary.dropdown-toggle { color: #fff; background-color: #d8a348; border-color: #826131; } -.btn-primary:not(:disabled):not(.disabled):active:focus, .btn-primary:not(:disabled):not(.disabled).active:focus, .show > .btn-primary.dropdown-toggle:focus { + +.btn-primary:not(:disabled):not(.disabled):active:focus, +.btn-primary:not(:disabled):not(.disabled).active:focus, +.show>.btn-primary.dropdown-toggle:focus { box-shadow: 0 0 0 0.2rem rgba(60, 198, 171, 0.5); } - + .btn-secondary { color: #fff; background-color: #494949; border-color: #494949; } + .btn-secondary:hover { color: #fff; background-color: #383d3f; border-color: #383d3f; } -.btn-secondary:focus, .btn-secondary.focus { + +.btn-secondary:focus, +.btn-secondary.focus { color: #fff; background-color: #383d3f; border-color: #383d3f; box-shadow: 0 0 0 0.2rem rgba(76, 91, 106, 0.5); } -.btn-secondary.disabled, .btn-secondary:disabled { + +.btn-secondary.disabled, +.btn-secondary:disabled { color: #fff; background-color: #222222; border-color: #222222; } -.btn-secondary:not(:disabled):not(.disabled):active, .btn-secondary:not(:disabled):not(.disabled).active, .show > .btn-secondary.dropdown-toggle { + +.btn-secondary:not(:disabled):not(.disabled):active, +.btn-secondary:not(:disabled):not(.disabled).active, +.show>.btn-secondary.dropdown-toggle { color: #fff; background-color: #17191a; border-color: #17191a; } -.btn-secondary:not(:disabled):not(.disabled):active:focus, .btn-secondary:not(:disabled):not(.disabled).active:focus, .show > .btn-secondary.dropdown-toggle:focus { + +.btn-secondary:not(:disabled):not(.disabled):active:focus, +.btn-secondary:not(:disabled):not(.disabled).active:focus, +.show>.btn-secondary.dropdown-toggle:focus { box-shadow: 0 0 0 0.2rem rgba(76, 91, 106, 0.5); } .centered { - display:block; + display: block; margin: auto; } @@ -297,7 +341,7 @@ a.text-secondary:hover, a.text-secondary:focus { /* website topmenu responsive */ .ml-auto, .mx-auto { - margin-left: auto !important; + margin-left: auto !important; } .container, @@ -314,7 +358,12 @@ a.text-secondary:hover, a.text-secondary:focus { } @media (min-width: 1200px) { - .container-xl, .container-lg, .container-md, .container-sm, .container { + + .container-xl, + .container-lg, + .container-md, + .container-sm, + .container { max-width: 98%; } } @@ -346,10 +395,12 @@ a.text-secondary:hover, a.text-secondary:focus { z-index: 2; font-size: 2.75rem; } + .masthead .masthead-subheading { z-index: 2; font-size: 1.25rem; } + .masthead .masthead-avatar { z-index: 2; width: 15rem; @@ -358,30 +409,33 @@ a.text-secondary:hover, a.text-secondary:focus { @media (min-width: 576px) { .masthead { - background-position-x:5em; - background-size: cover; - height: 750px; + background-position-x: 5em; + background-size: cover; + height: 750px; } } + @media (min-width: 768px) { .masthead { - background-position-x:10rem; - background-size: cover; - height: 750px; + background-position-x: 10rem; + background-size: cover; + height: 750px; } } + @media (min-width: 992px) { .masthead { - background-position-x:13rem; - background-size: cover; - height: 750px; + background-position-x: 13rem; + background-size: cover; + height: 750px; } - } +} + @media (min-width: 1200px) { .masthead { - background-position-x:20rem; - background-size: cover; - height: 750px; + background-position-x: 20rem; + background-size: cover; + height: 750px; } } @@ -401,77 +455,83 @@ a.text-secondary:hover, a.text-secondary:focus { .footer-interior { z-index: 2; } - + .nuge-forward { - z-index:2; + z-index: 2; } - + .yt-sub { width: 20%; } - + .yt-sub-sm { width: 15%; } - + /* make containers content centered */ .center { - display: inline-block; + display: inline-block; text-align: center; } - + /*CSS for right click sub menu*/ -#ctxMenu{ - display:none; - z-index:100; +#ctxMenu { + display: none; + z-index: 100; } -#notepad{ - position:absolute; - width:100vw; - height:100vh; + +#notepad { + position: absolute; + width: 100vw; + height: 100vh; } + menu { - position:absolute; - display:block; - height:20px; - width:20px; + position: absolute; + display: block; + height: 20px; + width: 20px; margin-bottom: 10px; - padding:0; - margin:0; - border:1px solid; - border-color:rgba(0, 0, 0, 0.125); - border-radius:20px; - background-color:white; - font-weight:normal; - white-space:nowrap; -} -menu:hover{ - background-color:#eef; - font-weight:bold; -} -menu:hover > menu{ - display:block; -} -menu > menu{ - display:none; - position:relative; - top:-20px; - left:100%; - width:75px; - height:25px; - border-radius:2px; + padding: 0; + margin: 0; + border: 1px solid; + border-color: rgba(0, 0, 0, 0.125); + border-radius: 20px; + background-color: white; + font-weight: normal; + white-space: nowrap; } -menu[title]:before{ - content:attr(title); + +menu:hover { + background-color: #eef; + font-weight: bold; +} + +menu:hover>menu { + display: block; } - + +menu>menu { + display: none; + position: relative; + top: -20px; + left: 100%; + width: 75px; + height: 25px; + border-radius: 2px; +} + +menu[title]:before { + content: attr(title); +} + /* Header background image */ @@ -481,6 +541,7 @@ a { text-decoration: none; background-color: transparent; } + a:hover { color: #142C76; text-decoration: none; @@ -490,98 +551,114 @@ a:hover { color: #FFF !important; text-decoration: none !important; background-color: transparent !important; -} +} + .a-light:hover { color: #AE590B !important; text-decoration: none !important; } - + /* navigation */ #mainNav { padding-top: 1.5rem; padding-bottom: 1.5rem; font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-weight: 700; - background: rgb(255,255,255); + background: rgb(255, 255, 255); background: linear-gradient(180deg, #171717 94%, #f39945 100%); } #mainNav .navbar-nav { margin-top: 1rem; } + #mainNav .navbar-nav li.nav-item a.nav-link { color: rgb(209, 209, 209); } + #mainNav .navbar-nav li.nav-item a.nav-link:hover { color: #534741; } -#mainNav .navbar-nav li.nav-item a.nav-link:active, #mainNav .navbar-nav li.nav-item a.nav-link:focus { + +#mainNav .navbar-nav li.nav-item a.nav-link:active, +#mainNav .navbar-nav li.nav-item a.nav-link:focus { color: #a9c6d4; } + #mainNav .navbar-nav li.nav-item a.nav-link.active { color: #534741; } + #mainNav .navbar-toggler { font-size: 80%; padding: 0.8rem; } + @media (min-width: 992px) { #mainNav { - padding-top: 1.5rem; - padding-bottom: 1.5rem; - padding-left:2rem; - transition: padding-top 0.3s, padding-bottom 0.3s; + padding-top: 1.5rem; + padding-bottom: 1.5rem; + padding-left: 2rem; + transition: padding-top 0.3s, padding-bottom 0.3s; } + #mainNav .navbar-brand { - font-size: 1.75em; - transition: font-size 0.3s; + font-size: 1.75em; + transition: font-size 0.3s; } + #mainNav .navbar-nav { - margin-top: 0; + margin-top: 0; } - #mainNav .navbar-nav > li.nav-item > a.nav-link.active { - color: #fff; - background: #534741; + + #mainNav .navbar-nav>li.nav-item>a.nav-link.active { + color: #fff; + background: #534741; } - #mainNav .navbar-nav > li.nav-item > a.nav-link.active:active, #mainNav .navbar-nav > li.nav-item > a.nav-link.active:focus, #mainNav .navbar-nav > li.nav-item > a.nav-link.active:hover { - color: #fff; - background: #a9c6d4; + + #mainNav .navbar-nav>li.nav-item>a.nav-link.active:active, + #mainNav .navbar-nav>li.nav-item>a.nav-link.active:focus, + #mainNav .navbar-nav>li.nav-item>a.nav-link.active:hover { + color: #fff; + background: #a9c6d4; } - + #mainNav.navbar-shrink { - padding-top: 0.5rem; - padding-bottom: 0.5rem; + padding-top: 0.5rem; + padding-bottom: 0.5rem; } + #mainNav.navbar-shrink .navbar-brand { - font-size: 1.5em; + font-size: 1.5em; } } -.homepageButton{ + +.homepageButton { color: white; font-family: 'Arial Black', 'Arial Bold', Gadget, sans-serif; - /* background-color: #a4b072; */ + /* background-color: #a4b072; */ border-style: solid; border-width: 5px; border-color: white; - border-radius:10px; - padding:30px; + border-radius: 10px; + padding: 30px; padding-top: 10px; padding-bottom: 10px; } -.homepageButton:hover{ +.homepageButton:hover { color: #142C76; border-color: #142C76; } /* Header background image */ .navbar { - background-position-x:10rem; + background-position-x: 10rem; background-size: cover; } - + .navbar::before { content: ""; position: absolute; @@ -590,7 +667,7 @@ a:hover { height: 100%; width: 100%; } - + .navbar-interior { z-index: 2; } @@ -604,7 +681,9 @@ a:hover { line-height: inherit; white-space: nowrap; } -.navbar-brand:hover, .navbar-brand:focus { + +.navbar-brand:hover, +.navbar-brand:focus { text-decoration: none; } @@ -614,7 +693,7 @@ a:hover { .page-section-top-padded { padding-top: 8rem; } - + /* Dashboard side menu */ /* SIDE MENu */ @@ -640,7 +719,7 @@ a:hover { color: #818181; display: block; transition: 0.3s; - + } .sidebar a:hover { @@ -656,11 +735,11 @@ a:hover { } .side-menu-home { - padding-left:3.5em; + padding-left: 3.5em; } .side-menu-icon { - padding-left:2em; + padding-left: 2em; } .material-icons, @@ -682,6 +761,10 @@ a:hover { transition: margin-left .5s; } +/* .friends-content { + transition: margin-left .5s; +} */ + .sidenav a, .dropdown-btn { padding: 6px 8px 6px 16px; @@ -834,6 +917,7 @@ a:hover { height: 40px; margin-left: -5px; } + .logo { position: absolute; top: 5px; @@ -920,6 +1004,7 @@ a:hover { .sidebar { padding-top: 15px; } + .sidebar a { font-size: 18px; } @@ -935,6 +1020,7 @@ a:hover { justify-content: center; align-items: center; } + .divider-custom .divider-custom-line { width: 100%; max-width: 7rem; @@ -943,19 +1029,24 @@ a:hover { border-radius: 1rem; border-color: #414d53 !important; } + .divider-custom .divider-custom-line:first-child { margin-right: 1rem; } + .divider-custom .divider-custom-line:last-child { margin-left: 1rem; } + .divider-custom .divider-custom-icon { color: #414d53 !important; font-size: 2rem; } + .divider-custom .divider-light .divider-custom-line { background-color: #fff; } + .divider-custom .divider-light .divider-custom-icon { color: #fff !important; } @@ -963,6 +1054,7 @@ a:hover { .divider-color { color: #414d53 } + .divider-bg-color { color: #414d53 } @@ -970,6 +1062,7 @@ a:hover { .divider-color-light { color: #FFF } + .divider-bg-color-light { color: #FFF } @@ -981,97 +1074,96 @@ a:hover { .tag-line-you { text-decoration: underline; font-size: x-large; - font-weight:bold; + font-weight: bold; } /* style for messages */ -.alert-message -{ +.alert-message { margin: 20px 0; padding: 20px; border-left: 3px solid #eee; } -.alert-message h4 -{ + +.alert-message h4 { margin-top: 0; margin-bottom: 5px; } -.alert-message p:last-child -{ + +.alert-message p:last-child { margin-bottom: 0; } -.alert-message code -{ + +.alert-message code { background-color: #fff; border-radius: 3px; } -.alert-message-success -{ + +.alert-message-success { background-color: #F4FDF0; border-color: #3C763D; } -.alert-message-success h4 -{ + +.alert-message-success h4 { color: #3C763D; } -.alert-message-danger -{ + +.alert-message-danger { background-color: #fdf7f7; border-color: #d9534f; } -.alert-message-danger h4 -{ + +.alert-message-danger h4 { color: #d9534f; } -.alert-message-warning -{ + +.alert-message-warning { background-color: #fcf8f2; border-color: #f0ad4e; } -.alert-message-warning h4 -{ + +.alert-message-warning h4 { color: #f0ad4e; } -.alert-message-info -{ + +.alert-message-info { background-color: #f4f8fa; border-color: #5bc0de; } -.alert-message-info h4 -{ + +.alert-message-info h4 { color: #5bc0de; } -.alert-message-default -{ + +.alert-message-default { background-color: #EEE; border-color: #B4B4B4; } -.alert-message-default h4 -{ + +.alert-message-default h4 { color: #000; } -.alert-message-notice -{ + +.alert-message-notice { background-color: #FCFCDD; border-color: #BDBD89; } -.alert-message-notice h4 -{ + +.alert-message-notice h4 { color: #444; -} - +} + /* Password */ /* The message box is shown when the user clicks on the password field */ #passwordRequirementsMessage { - display:none; + display: none; position: relative; } - - /* Add a green text color and a checkmark when the requirements are right */ + +/* Add a green text color and a checkmark when the requirements are right */ .valid { color: green; -} +} @@ -1092,9 +1184,11 @@ a:hover { box-sizing: border-box; margin-left: 2rem; } + .profile-picture:hover { color: red; } + .profile-top-image { width: 3rem; height: 3rem; @@ -1113,7 +1207,7 @@ a:hover { /* badge image */ .badge-image { position: relative; - clear:left; + clear: left; left: 1px; width: 6rem; height: 6rem; @@ -1127,7 +1221,7 @@ a:hover { z-index: 2; justify-content: left; align-items: left; - } +} .product-img-overlay { position: absolute; @@ -1137,8 +1231,8 @@ a:hover { left: 0; padding: 1.25rem; border-radius: 0.375rem; - width:100%; - height:95%; + width: 100%; + height: 95%; overflow: hidden; opacity: 18%; z-index: 1; @@ -1146,16 +1240,18 @@ a:hover { .product-image-large { - display:block; + display: block; margin-left: auto; margin-right: auto; width: 70%; } + /* product cards */ .product-card { width: 100%; padding: 1rem; } + .card-body-low-padding { opacity: 1; display: block; @@ -1171,7 +1267,7 @@ div.product-card a { .product-card-text-raised { z-index: 5; - padding:2rem; + padding: 2rem; } .card-text { @@ -1180,17 +1276,17 @@ div.product-card a { .product-card-med-image { width: 20%; - float:left; + float: left; } -.card{ - border-radius:5px; - text-decoration: none !important; +.card { + border-radius: 5px; + text-decoration: none !important; cursor: pointer; } .card-body { - border-radius:5px; + border-radius: 5px; opacity: 1; display: block; width: 100%; @@ -1198,6 +1294,7 @@ div.product-card a { transition: .5s ease; backface-visibility: hidden; } + .card-hover { transition: .5s ease; opacity: 0; @@ -1208,6 +1305,7 @@ div.product-card a { -ms-transform: translate(-50%, -50%); text-align: center; } + .card-hover-text { background-color: #04AA6D; color: white; @@ -1218,7 +1316,7 @@ div.product-card a { .card:hover .card-body { opacity: 0.6; } - + .card:hover .card-hover { opacity: 1; } @@ -1231,7 +1329,7 @@ div.product-card a { width: 5rem; } - /* Welcome text */ +/* Welcome text */ .welcome-text { text-align: right; padding-top: 1.5rem; @@ -1263,7 +1361,8 @@ div.product-card a { color: #3c5b6d; padding: 150px 0 20px; } -.file-button { + +.file-button { display: block; width: 240px; height: 50px; @@ -1280,7 +1379,7 @@ div.product-card a { /* website image (static pages) */ .website-image { - padding-top:1rem; + padding-top: 1rem; display: inline-flex; font-size: .75rem; justify-content: center; @@ -1291,57 +1390,64 @@ div.product-card a { .website-image-95 { width: 95%; - + } /* Workspace progress */ .pb-line { stroke: #2c3e50; - stroke-width:2; + stroke-width: 2; } + .pb-line-enroll { - stroke:#534741; - stroke-width:5; + stroke: #534741; + stroke-width: 5; } + .pb-line-complete { - stroke:#5de239; - stroke-width:5; + stroke: #5de239; + stroke-width: 5; } + .pb-line-in-progress { - stroke:#5de239; - stroke-width:5; + stroke: #5de239; + stroke-width: 5; } + .pb-circle { - fill: #2c3e50; - stroke-width:0; + fill: #2c3e50; + stroke-width: 0; } + .pb-circle-in-progress { /*fill: #238d76; */ fill: #534741; - stroke-width:0; + stroke-width: 0; } + .pb-circle-complete { - fill: #5de239; - stroke-width:1; + fill: #5de239; + stroke-width: 1; } + .pb-circle-enroll { - fill: #534741; - stroke-width:0; + fill: #534741; + stroke-width: 0; } .pb-container { - float:left; - width:5%; + float: left; + width: 5%; } .pb-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; - float:left; - width:95%; + float: left; + width: 95%; padding-top: 3rem; } @@ -1354,14 +1460,16 @@ div.product-card a { .pb-item-icon { position: relative; - left:-4.65rem; - top:0rem; + left: -4.65rem; + top: 0rem; } + .pb-item { position: relative; left: 2.7rem; padding-bottom: 2rem; } + .pb-item-in-progress { position: relative; left: 2.5rem; @@ -1378,21 +1486,21 @@ div.product-card a { padding-left: .7rem; } - /* The switch */ +/* The switch */ .switch { position: relative; display: inline-block; width: 60px; height: 34px; } - + /* Hide default HTML checkbox */ .switch input { opacity: 0; width: 0; height: 0; } - + /* The slider */ .switch { position: relative; @@ -1400,9 +1508,11 @@ div.product-card a { width: 90px; height: 34px; } - -.switch input {display:none;} - + +.switch input { + display: none; +} + .slider { position: absolute; cursor: pointer; @@ -1413,9 +1523,9 @@ div.product-card a { background-color: #2c3e50; -webkit-transition: .4s; transition: .4s; - border-radius: 34px; + border-radius: 34px; } - + .slider:before { position: absolute; content: ""; @@ -1428,51 +1538,52 @@ div.product-card a { transition: .4s; border-radius: 50%; } - -input:checked + .slider { + +input:checked+.slider { background-color: #534741; } - -input:focus + .slider { + +input:focus+.slider { box-shadow: 0 0 1px #2196F3; } - -input:checked + .slider:before { + +input:checked+.slider:before { -webkit-transform: translateX(26px); -ms-transform: translateX(26px); transform: translateX(55px); } - + .slider:after { - content:'To Do'; - color: white; - display: block; - position: absolute; - transform: translate(-50%,-50%); - top: 50%; - left: 60%; - font-size: 10px; - font-family: Verdana, sans-serif; -} - -input:checked + .slider:after { - content:'Done'; + content: 'To Do'; + color: white; + display: block; + position: absolute; + transform: translate(-50%, -50%); + top: 50%; + left: 60%; + font-size: 10px; + font-family: Verdana, sans-serif; +} + +input:checked+.slider:after { + content: 'Done'; top: 50%; left: 40%; } - - /*--------- END the switch --------*/ + +/*--------- END the switch --------*/ .grouping { position: relative; - width:100%; - height:4rem; + width: 100%; + height: 4rem; padding-top: 1rem; padding-left: 1rem; } + .grouping a { - color: rgba(99, 19, 18, 0.85); + color: rgba(99, 19, 18, 0.85); } .grouping-background { @@ -1483,37 +1594,39 @@ input:checked + .slider:after { float: left; width: 26%; } + .float-right { - float:left; - width:70%; + float: left; + width: 70%; } .codingcoach-red { - color: rgba(99, 19, 18, 0.85); + color: rgba(99, 19, 18, 0.85); } + .codingcoach-red-45-opacity { color: rgba(99, 19, 18, 0.45); } - + .txt-white { - color:#FFF !important; - text-decoration:none; + color: #FFF !important; + text-decoration: none; } /* Iframe size */ .iframe-size-control { - position: relative; - width: 100%; + position: relative; + width: 100%; } - /* New Card stuff */ +/* New Card stuff */ .card { position: relative; display: flex; @@ -1523,46 +1636,49 @@ input:checked + .slider:after { background-clip: border-box; border: 1px solid rgba(0, 0, 0, 0.125); } -.card > hr { + +.card>hr { margin-right: 0; - margin-left: 0; + margin-left: 0; } -.card > .list-group:first-child .list-group-item:first-child { + +.card>.list-group:first-child .list-group-item:first-child { border-top-left-radius: 0.25rem; - border-top-right-radius: 0.25rem; + border-top-right-radius: 0.25rem; } -.card > .list-group:last-child .list-group-item:last-child { + +.card>.list-group:last-child .list-group-item:last-child { border-bottom-right-radius: 0.25rem; - border-bottom-left-radius: 0.25rem; + border-bottom-left-radius: 0.25rem; } .card-body { - border-radius:5px; + border-radius: 5px; flex: 1 1 auto; - padding: 1.25rem; + padding: 1.25rem; } .card-title { - margin-bottom: 0.75rem; + margin-bottom: 0.75rem; } - + .card-subtitle { margin-top: -0.375rem; - margin-bottom: 0; + margin-bottom: 0; } - + .card-text:last-child { - margin-bottom: 0; + margin-bottom: 0; } .card-link:hover { - text-decoration: none; + text-decoration: none; } -.card-link + .card-link { - margin-left: 1.25rem; +.card-link+.card-link { + margin-left: 1.25rem; } - + .card-header { padding: 0.5rem .5rem; margin-bottom: 0; @@ -1570,32 +1686,33 @@ input:checked + .slider:after { } .card-header:first-child { - border-radius: calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0; + border-radius: calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0; } -.card-header + .list-group .list-group-item:first-child { - border-top: 0; + +.card-header+.list-group .list-group-item:first-child { + border-top: 0; } .card-footer { padding: 0.75rem 1.25rem; background-color: #17191a; - border-top: 1px solid rgba(0, 0, 0, 0.125); + border-top: 1px solid rgba(0, 0, 0, 0.125); } .card-footer:last-child { - border-radius: 0 0 calc(0.25rem - 1px) calc(0.25rem - 1px); + border-radius: 0 0 calc(0.25rem - 1px) calc(0.25rem - 1px); } .card-header-tabs { margin-right: -0.625rem; margin-bottom: -0.75rem; margin-left: -0.625rem; - border-bottom: 0; + border-bottom: 0; } .card-header-pills { margin-right: -0.625rem; - margin-left: -0.625rem; + margin-left: -0.625rem; } .card-img-overlay { @@ -1604,129 +1721,151 @@ input:checked + .slider:after { right: 0; bottom: 0; left: 0; - padding: 1.25rem; + padding: 1.25rem; } .card-img { width: 100%; - border-radius: calc(0.25rem - 1px); + border-radius: calc(0.25rem - 1px); } .card-img-top { width: 100%; border-top-left-radius: calc(0.25rem - 1px); - border-top-right-radius: calc(0.25rem - 1px); + border-top-right-radius: calc(0.25rem - 1px); } .card-img-bottom { width: 100%; border-bottom-right-radius: calc(0.25rem - 1px); - border-bottom-left-radius: calc(0.25rem - 1px); + border-bottom-left-radius: calc(0.25rem - 1px); } - - .card-deck { + +.card-deck { display: flex; - flex-direction: column; } - .card-deck .card { - margin-bottom: 15px; } - @media (min-width: 576px) { - .card-deck { + flex-direction: column; +} + +.card-deck .card { + margin-bottom: 15px; +} + +@media (min-width: 576px) { + .card-deck { flex-flow: row wrap; margin-right: -15px; - margin-left: -15px; } - .card-deck .card { - display: flex; - flex: 1 0 0%; - flex-direction: column; - margin-right: 15px; - margin-bottom: 0; - margin-left: 15px; } } - + margin-left: -15px; + } + + .card-deck .card { + display: flex; + flex: 1 0 0%; + flex-direction: column; + margin-right: 15px; + margin-bottom: 0; + margin-left: 15px; + } +} + .card-group { display: flex; - flex-direction: column; + flex-direction: column; } -.card-group > .card { - margin-bottom: 15px; + +.card-group>.card { + margin-bottom: 15px; } @media (min-width: 576px) { .card-group { - flex-flow: row wrap; + flex-flow: row wrap; } - .card-group > .card { + + .card-group>.card { flex: 1 0 0%; - margin-bottom: 0; + margin-bottom: 0; } - .card-group > .card + .card { + + .card-group>.card+.card { margin-left: 0; - border-left: 0; + border-left: 0; } - .card-group > .card:not(:last-child) { + + .card-group>.card:not(:last-child) { border-top-right-radius: 0; - border-bottom-right-radius: 0; + border-bottom-right-radius: 0; } - .card-group > .card:not(:last-child) .card-img-top, - .card-group > .card:not(:last-child) .card-header { - border-top-right-radius: 0; + + .card-group>.card:not(:last-child) .card-img-top, + .card-group>.card:not(:last-child) .card-header { + border-top-right-radius: 0; } - .card-group > .card:not(:last-child) .card-img-bottom, - .card-group > .card:not(:last-child) .card-footer { - border-bottom-right-radius: 0; + + .card-group>.card:not(:last-child) .card-img-bottom, + .card-group>.card:not(:last-child) .card-footer { + border-bottom-right-radius: 0; } - .card-group > .card:not(:first-child) { + + .card-group>.card:not(:first-child) { border-top-left-radius: 0; - border-bottom-left-radius: 0; + border-bottom-left-radius: 0; } - .card-group > .card:not(:first-child) .card-img-top, - .card-group > .card:not(:first-child) .card-header { - border-top-left-radius: 0; + + .card-group>.card:not(:first-child) .card-img-top, + .card-group>.card:not(:first-child) .card-header { + border-top-left-radius: 0; } - .card-group > .card:not(:first-child) .card-img-bottom, - .card-group > .card:not(:first-child) .card-footer { - border-bottom-left-radius: 0; + + .card-group>.card:not(:first-child) .card-img-bottom, + .card-group>.card:not(:first-child) .card-footer { + border-bottom-left-radius: 0; } } - + .card-columns .card { - margin-bottom: 0.75rem; + margin-bottom: 0.75rem; } - + @media (min-width: 576px) { .card-columns { column-count: 3; column-gap: 1.25rem; orphans: 1; - widows: 1; + widows: 1; } + .card-columns .card { display: inline-block; - width: 100%; - } + width: 100%; + } } - -.accordion > .card { - overflow: hidden; + +.accordion>.card { + overflow: hidden; } -.accordion > .card:not(:first-of-type) .card-header:first-child { - border-radius: 0; + +.accordion>.card:not(:first-of-type) .card-header:first-child { + border-radius: 0; } -.accordion > .card:not(:first-of-type):not(:last-of-type) { + +.accordion>.card:not(:first-of-type):not(:last-of-type) { border-bottom: 0; - border-radius: 0; + border-radius: 0; } -.accordion > .card:first-of-type { +.accordion>.card:first-of-type { border-bottom: 0; border-bottom-right-radius: 0; - border-bottom-left-radius: 0; + border-bottom-left-radius: 0; } -.accordion > .card:last-of-type { + +.accordion>.card:last-of-type { border-top-left-radius: 0; - border-top-right-radius: 0; + border-top-right-radius: 0; } -.accordion > .card .card-header { - margin-bottom: -1px; + +.accordion>.card .card-header { + margin-bottom: -1px; } .resource-complete { @@ -1737,11 +1876,11 @@ input:checked + .slider:after { } .resource-complete-checkbox { - width: 30px; + width: 30px; height: 30px; - position:relative; + position: relative; float: left; - padding-left:2rem; + padding-left: 2rem; } .resource-complete-text { @@ -1749,12 +1888,13 @@ input:checked + .slider:after { color: #2c3e50; float: left; padding-right: 2rem; - padding-left:2rem; + padding-left: 2rem; } .fs-large { font-size: large; } + .fs-xlarge { font-size: x-large; } @@ -1774,6 +1914,7 @@ input:checked + .slider:after { padding-right: 2rem; padding-bottom: 3rem; } + .chosen-container { width: 50%; float: left; @@ -1782,12 +1923,13 @@ input:checked + .slider:after { } .available-items { - + display: grid; /*grid-template-rows: repeat(5, 1fr); */ gap: 10px; min-height: 3rem; } + .chosen-items { display: grid; /*grid-template-rows: repeat(5, 1fr); */ @@ -1816,6 +1958,7 @@ input:checked + .slider:after { border-radius: .5em; padding: 10px; } + .option-border { border: 3px solid #aaa; background-color: #eee; @@ -1828,10 +1971,11 @@ input:checked + .slider:after { width: 48%; padding-right: 1rem; } + .results-right { float: left; width: 48%; - + } /* accordion */ @@ -1876,9 +2020,9 @@ input:checked + .slider:after { font-size: 30px; transform: translateY(-50%); } - + /* Hides the content (height: 0), decreases font size, justifies text and adds transition */ - + .accordion .content { position: relative; height: 0; @@ -1910,16 +2054,16 @@ input:checked + .slider:after { font-size: 30px; } - /* END accordion */ +/* END accordion */ - .button-right { - float:right; - } +.button-right { + float: right; +} - /* EVENT founder */ - .founder-event-card { +/* EVENT founder */ +.founder-event-card { background-color: #04AA6D; color: white; font-size: 1.4rem; @@ -1934,17 +2078,23 @@ input:checked + .slider:after { .material-icons { padding-bottom: 3px; } -.material-icons.md-48 { + +.material-icons.md-48 { font-size: 192px; padding-left: 25%; - } +} -.dashboard-content{ +.dashboard-content { transition: margin-left .5s; } -.sidenav a, .dropdown-btn { +/* .friends-content { + transition: margin-left .5s; +} */ + +.sidenav a, +.dropdown-btn { padding: 6px 8px 6px 16px; text-decoration: none; font-size: 20px; @@ -1952,16 +2102,18 @@ input:checked + .slider:after { display: block; border: none; background: none; - width:100%; + width: 100%; text-align: left; cursor: pointer; outline: none; } /* On mouse-over */ -.sidenav a:hover, .dropdown-btn:hover { +.sidenav a:hover, +.dropdown-btn:hover { color: #f1f1f1; } + /* Dropdown container (hidden by default). Optional: add a lighter background color and some left padding to change the design of the dropdown content */ .dropdown-container { display: none; @@ -1974,6 +2126,7 @@ input:checked + .slider:after { float: right; padding-right: 8px; } + /* On smaller screens, where height is less than 450px, change the style of the sidenav (less padding and a smaller font size) */ @@ -1982,7 +2135,7 @@ input:checked + .slider:after { border: none; border-radius: 5%; cursor: pointer; - + } .item-list:hover { @@ -1993,7 +2146,7 @@ input:checked + .slider:after { margin-left: 2%; } -.list-grid{ +.list-grid { display: grid; grid-template-columns: repeat(2, 1fr); } diff --git a/client/agora/public/css/topic.css b/client/agora/public/css/topic.css index b88b4037..64d4f0f4 100644 --- a/client/agora/public/css/topic.css +++ b/client/agora/public/css/topic.css @@ -586,7 +586,7 @@ .profile-status { margin-top: 36px; - margin-left: 230px; + margin-left: 225px; font-weight: 500px; } @@ -619,16 +619,22 @@ width: 100%; } + .profile-status-container { + display: flex; + align-items: center; +} + .arrow { cursor: pointer; border: solid black; border-width: 0 3px 3px 0; display: inline-block; - padding: 3px; - height: 15px; - width: 15px; + padding: 1px; + height: 10px; + width: 10px; background-color: transparent; - margin-right: 20px; + margin-top: 36px; + margin-left: 20px; } .arrow:focus { diff --git a/client/agora/public/js/dashboard.js b/client/agora/public/js/dashboard.js index 64f373c6..9fdf5942 100644 --- a/client/agora/public/js/dashboard.js +++ b/client/agora/public/js/dashboard.js @@ -1187,6 +1187,50 @@ function getOffset( el ) { }; } +const friendsContainer = document.querySelectorAll( '#friend-card' ); + +function filterFriends( searchTerm ){ + + for ( const friend of friendsContainer ){ + + const friendCard = friend.outerText.toLowerCase(); + + if ( friendCard.includes( searchTerm.toLowerCase() ) ){ + friend.style.display = 'block'; + } else { + friend.style.display = 'none'; + } + } +} + +function deleteFriend( friendshipId ) { + if (confirm( "Are you sure you want to remove this friend?") == true){ + fetch( "/api/v1/auth/friends/deleteFriend", { + method: "DELETE", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify( { + "friendshipId": friendshipId, + }) + }) + .then( (response) => { + if ( response.status == 200 ) { + const message = 'Friend deleted successfully'; + console.log( message ); + alert( message ); + location.reload(); + } + else{ + const errorMessage = 'Failed to delete friend.'; + console.error( errorMessage ); + alert( errorMessage ); + } + }) + .catch( ( error ) => { + console.error( 'Error deleting friend:', error); + alert( 'Error deleting friend: ' + error ); + }); + } +}; // manage highlighting of control bar buttons if( document.getElementById( "controlbar-buttons-group-1" ) ) { diff --git a/client/agora/public/js/friends.js b/client/agora/public/js/friends.js new file mode 100644 index 00000000..3ab7ebca --- /dev/null +++ b/client/agora/public/js/friends.js @@ -0,0 +1,116 @@ +// Takes you to the adding friends page +const addFriendPage = () => { + window.location.href = "/friends/add-friends"; +}; + +var displayedUsers = new Set(); +const userSearch = document.getElementById( 'user-search' ); +const searchButton = document.getElementById( 'btn-search' ); +const friendsDashboard = document.getElementById( 'friends-dashboard' ); +const redCircle = document.getElementById( 'requestCount' ); +var authUser = [ ]; +var friends = [ ]; +var requests = [ ]; + +// gets the authenticated user, their friends and sent friend requests +window.onload = getResources = () => { + + fetch( "/api/v1/auth/friends/getResources", { + method: "GET", + headers: { "Content-Type": "application/json" }, + } ) + .then( ( response ) => response.json() ) + .then( ( response ) => { + authUser.push( response[0]); + friends.push( response[1] ); + requests.push( response[2] ); + let requestCount = response[3][0].count; + if ( requestCount > 0){ + let span = document.createElement("span"); + span.textContent = requestCount; + redCircle.appendChild(span); + redCircle.style.display = "flex"; + } + } ); +}; + + +// queries the users by username +searchButton.addEventListener( 'click', queryUsers = () => { + fetch( "/api/v1/auth/user/username/" + userSearch.value, { + method: "GET", + headers: { "Content-Type": "application/json" }, + } ) + .then( ( response ) => response.json() ) + .then( ( response ) => { + + for ( i = 0; i < response.length; i++ ) { + var data = response[i]; + var isFriend = false; + var isSentRequest = false; + for( j = 0; j < friends[0].length; j++ ){ + if ( ( data.username == friends[0][j].friend_username ) ){ + isFriend = true; + } + } + for( k = 0; k < requests[0].length; k++ ){ + if( ( data.userId == requests[0][k].initiatedby_id ) || + ( data.userId == requests[0][k].recipient_id ) ){ + isSentRequest = true; + } + } + if ( !( displayedUsers.has( data.username ) ) && + !( data.username == authUser[0].username ) && !( isFriend ) && !( isSentRequest ) ) { + createUserCard( data ); + displayedUsers.add( data.username ); + } + } + } ); +} ); + +// creates a user card for each user +function createUserCard( userData ){ + var rowDiv = document.createElement( "div" ); + rowDiv.className = "row row-cols-1 row-cols-md-3 g-4"; + var columnDiv = document.createElement( "div" ); + columnDiv.className = "col mb-3 gallery-col align-items-stretch gallery-col"; + var cardDiv = document.createElement( "div" ); + cardDiv.className = "card h-100"; + var cardBodyDiv = document.createElement( "div" ); + cardBodyDiv.className = "card-body d-flex flex-column"; + var username = document.createElement( "h5" ); + username.id = userData.userId; + username.innerText = userData.username; + var userProfile = document.createElement( "img" ); + userProfile.width = 225; + userProfile.src = "/assets/uploads/profile/" + userData.profileFilename; + userProfile.alt = "user's profile"; + var userContainer = document.createElement( "div" ); + userContainer.id = "user-container-" + userData.userId; + userContainer.style.display = "flex"; + userContainer.style.marginRight = "5px"; + + cardBodyDiv.appendChild( username ); + cardBodyDiv.appendChild( userProfile ); + cardDiv.appendChild( cardBodyDiv ); + columnDiv.appendChild( cardDiv ); + rowDiv.append( columnDiv ); + userContainer.appendChild( rowDiv ); + friendsDashboard.appendChild( userContainer ); + + + userContainer.addEventListener( 'click', sendFriendRequest = () => { + if( confirm("Are you sure you want to send a friend request to " + userData.username + "?") == true){ + userContainer.style.display = "none"; + fetch( "/api/v1/auth/friends/sendFriendRequest", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify ( { + "username": userData.username, + "userId": userData.userId + } ) + } ); + } + } ); + +} diff --git a/client/agora/public/js/scripts.js b/client/agora/public/js/scripts.js index eb1c6387..7abe2447 100644 --- a/client/agora/public/js/scripts.js +++ b/client/agora/public/js/scripts.js @@ -18,39 +18,41 @@ let sideBarStatus = true; /** * Triggered when the page is loaded. */ -window.addEventListener( "load", () => { +window.addEventListener("load", () => { // Determines whether the user is on a page that contains the sidebar - if ( document.querySelector( "#agoraSideBar" ) ) { + if (document.querySelector("#agoraSideBar")) { loadClientSettings(); // Only add the hover events if the sidebar is not in the docked position - if ( !clientSettings.sideBarLocked ) { + if (!clientSettings.sideBarLocked) { // add events for toggle sidebar - if( document.getElementById( "agoraSideBar" ) ) { + if (document.getElementById("agoraSideBar")) { toggleSidebar(); - document.getElementById( "agoraSideBar" ).addEventListener( "mouseenter", toggleSidebar ); - document.getElementById( "agoraSideBar" ).addEventListener( "mouseleave", toggleSidebar ); + document.getElementById("agoraSideBar").addEventListener("mouseenter", toggleSidebar); + document.getElementById("agoraSideBar").addEventListener("mouseleave", toggleSidebar); } } - - if ( document.getElementById( "pin-menu" ) ) { - document.getElementById( "pin-menu" ).addEventListener( "click", lockSidebar ); + + if (document.getElementById("pin-menu")) { + document.getElementById("pin-menu").addEventListener("click", lockSidebar); } } -} ); +}); /** * Toggles the sidebar. */ function toggleSidebar() { - if ( !sideBarStatus ) { - document.getElementById( "agoraSideBar" ).style.width = "250px"; - document.querySelector( ".dashboard-content" ).style.marginLeft = "250px"; + if (!sideBarStatus) { + document.getElementById("agoraSideBar").style.width = "250px"; + document.querySelector(".dashboard-content").style.marginLeft = "250px"; + // document.querySelector(".friends-content").style.marginLeft = "250px"; } else { - document.getElementById( "agoraSideBar" ).style.width = "85px"; - if( window.innerWidth > 992 ) { - document.querySelector( ".dashboard-content" ).style.marginLeft = "85px"; + document.getElementById("agoraSideBar").style.width = "85px"; + if (window.innerWidth > 992) { + document.querySelector(".dashboard-content").style.marginLeft = "85px"; + // document.querySelector(".friends-content").style.marginLeft = "85px"; } } sideBarStatus = !sideBarStatus; @@ -60,23 +62,24 @@ function toggleSidebar() { * Locks the sidebar into position. */ function lockSidebar() { - if ( !clientSettings.sideBarLocked ) { - document.querySelector( ".dashboard-content" ).style.marginLeft = "250px"; + if (!clientSettings.sideBarLocked) { + document.querySelector(".dashboard-content").style.marginLeft = "250px"; + // document.querySelector(".friends-content").style.marginLeft = "250px"; - document.getElementById( "agoraSideBar" ).removeEventListener( "mouseenter", toggleSidebar ); - document.getElementById( "agoraSideBar" ).removeEventListener( "mouseleave", toggleSidebar ); + document.getElementById("agoraSideBar").removeEventListener("mouseenter", toggleSidebar); + document.getElementById("agoraSideBar").removeEventListener("mouseleave", toggleSidebar); - document.getElementById( "agoraSideBar" ).style.width = "250px"; + document.getElementById("agoraSideBar").style.width = "250px"; - document.getElementById( "tack-icon" ).style.rotate = "45deg"; + document.getElementById("tack-icon").style.rotate = "45deg"; sideBarStatus = true; // important to prevent glitching when enabling/disabling the menu } else { - document.getElementById( "tack-icon" ).style.rotate = "0deg"; + document.getElementById("tack-icon").style.rotate = "0deg"; - document.getElementById( "agoraSideBar" ).addEventListener( "mouseenter", toggleSidebar ); - document.getElementById( "agoraSideBar" ).addEventListener( "mouseleave", toggleSidebar ); + document.getElementById("agoraSideBar").addEventListener("mouseenter", toggleSidebar); + document.getElementById("agoraSideBar").addEventListener("mouseleave", toggleSidebar); } clientSettings.sideBarLocked = !clientSettings.sideBarLocked; @@ -88,21 +91,22 @@ function lockSidebar() { * Loads the client settings from local storage and sets the properties associated with them. */ function loadClientSettings() { - if ( !localStorage.getItem( 'client-settings' ) ) { + if (!localStorage.getItem('client-settings')) { saveClientSettings(); } else { - clientSettings = JSON.parse( localStorage.getItem( 'client-settings' ) ); + clientSettings = JSON.parse(localStorage.getItem('client-settings')); - if ( clientSettings.sideBarLocked ) { - document.querySelector( ".dashboard-content" ).style.marginLeft = "250px"; + if (clientSettings.sideBarLocked) { + document.querySelector(".dashboard-content").style.marginLeft = "250px"; + // document.querySelector(".friends-content").style.marginLeft = "250px"; - document.getElementById( "agoraSideBar" ).removeEventListener( "mouseenter", toggleSidebar ); - document.getElementById( "agoraSideBar" ).removeEventListener( "mouseleave", toggleSidebar ); + document.getElementById("agoraSideBar").removeEventListener("mouseenter", toggleSidebar); + document.getElementById("agoraSideBar").removeEventListener("mouseleave", toggleSidebar); - document.getElementById( "agoraSideBar" ).style.width = "250px"; + document.getElementById("agoraSideBar").style.width = "250px"; - document.getElementById( "tack-icon" ).style.rotate = "45deg"; + document.getElementById("tack-icon").style.rotate = "45deg"; sideBarStatus = true; // important to prevent glitching when enabling/disabling the menu } @@ -113,5 +117,5 @@ function loadClientSettings() { * Saves the client settings to local storage. */ function saveClientSettings() { - localStorage.setItem( 'client-settings', JSON.stringify( clientSettings ) ); + localStorage.setItem('client-settings', JSON.stringify(clientSettings)); } diff --git a/client/agora/public/js/topic-view.js b/client/agora/public/js/topic-view.js index 73010e4b..ef8866c8 100644 --- a/client/agora/public/js/topic-view.js +++ b/client/agora/public/js/topic-view.js @@ -1179,13 +1179,13 @@ if ( openTopicBtn ) { const toggleProfileList = () => { let arrow = document.getElementById( "profiles-toggle" ); - if ( arrow.classList.contains( "down-arrow" ) ) { + if ( arrow.classList.contains( "up-arrow" ) ) { document.getElementById( "permissions-box" ).style.display = "none"; - arrow.setAttribute( 'class', 'arrow up-arrow' ); + arrow.setAttribute( 'class', 'arrow down-arrow' ); } else { document.getElementById( "permissions-box" ).style.display = "flex"; - arrow.setAttribute( 'class', 'arrow down-arrow' ); + arrow.setAttribute( 'class', 'arrow up-arrow' ); } }; @@ -1315,6 +1315,43 @@ const idAndFetch = () => { } }; +const FetchShared = async () => { + console.log( "FetchShared() : Start" ); + const [ isTopic, id ] = getPrefixAndId(); + //console.log( isTopic, id ); + if ( isTopic && id ) { + fetch( "api/v1/auth/topics/" + id, { + method: "GET", + headers: { "Content-Type": "application/json" }, + } ) + .then( ( response ) => response.json() ) + .then( ( response ) => { + fillFields( + response.results.topicName, + response.results.topicDescription, + response.results.topicImage + ); + } ); + } + else if ( id ) { + //console.log( "idAndFetch() : fetch workspace" ); + await fetch( "api/v1/auth/workspaces/" + id, { + method: "GET", + headers: { "Content-Type": "application/json" }, + } ) + .then( ( response ) => response.json() ) + .then( ( response ) => { + fillFields( + response.results.workspaceName, + response.results.workspaceDescription, + response.results.workspaceImage + ); + console.log( "FetchShared() : End - workspacePath" ); + } ); + } + console.log( "FetchShared() : End FINAL" ); +}; + const getTags = async () => { const [ isTopic, id ] = getPrefixAndId(); if ( isTopic && id ) { diff --git a/client/agora/public/js/user.js b/client/agora/public/js/user.js index 2ebe5e23..7701c622 100644 --- a/client/agora/public/js/user.js +++ b/client/agora/public/js/user.js @@ -72,7 +72,6 @@ if( document.getElementById( 'userManageButton' ) ) { } ); } - let manageEmail = document.getElementById( 'manageEmail' ); if( manageEmail ) { // call to non-existant endpoint to check if email is unique @@ -280,3 +279,69 @@ if( document.getElementById( 'passwordToggle' ) ) { pwMask( 'psw' ); } ); } + +const acceptRequestButton = document.getElementById( 'btn-accept-request' ); + +acceptRequestButton.addEventListener( 'click', () => { + // Get the friend_id from the data-id attribute of the button + const friendshipId = acceptRequestButton.getAttribute( 'data-id' ); + + fetch( '/api/v1/auth/friends/requestResponse', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify( { + friendship_id: friendshipId, // Pass the friend_id as a parameter + } ), + } ) + .then( ( response ) => { + if ( response.status === 201 ) { + // Successfully accepted friend request + const message = 'Friend request accepted successfully.'; + console.log( message ); + alert( message ); // Display a pop-up with the message + location.reload(); // Refresh the page + } + else { + const errorMessage = 'Failed to accept friend request.'; + console.error( errorMessage ); + alert( errorMessage ); // Display a pop-up with the error message + } + } ) + .catch( ( error ) => { + console.error( 'Error making accept request:', error ); + alert( 'Error making accept request: ' + error ); // Display a pop-up with the error message + } ); +} ); + +const denyRequestButton = document.getElementById( 'btn-deny-request' ); + +denyRequestButton.addEventListener( 'click', () => { + // Get the friend_id from the data-id attribute of the button + const friendshipId = denyRequestButton.getAttribute( 'data-id' ); + + fetch( '/api/v1/auth/friends/requestResponse', { + method: 'DELETE', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify( { + friendship_id: friendshipId, // Pass the friend_id as a parameter + } ), + } ) + .then( ( response ) => { + if ( response.status === 201 ) { + // Successfully denied friend request + const message = 'Friend request denied successfully.'; + console.log( message ); + alert( message ); // Display a pop-up with the message + location.reload(); // Refresh the page + } + else { + const errorMessage = 'Failed to deny friend request.'; + console.error( errorMessage ); + alert( errorMessage ); // Display a pop-up with the error message + } + } ) + .catch( ( error ) => { + console.error( 'Error making deny request:', error ); + alert( 'Error making deny request: ' + error ); // Display a pop-up with the error message + } ); +} ); \ No newline at end of file diff --git a/client/agora/views/add-friends/add-friends.ejs b/client/agora/views/add-friends/add-friends.ejs new file mode 100644 index 00000000..8d8a721e --- /dev/null +++ b/client/agora/views/add-friends/add-friends.ejs @@ -0,0 +1,24 @@ + + + + + <%- include('../partials/head'); %> + + + + + + + + + + <%- include('../dashboard/side-menu/side-menu.ejs'); %> + <%- include('./partials/gallery/note-gallery.ejs') %> + + <%- include('../partials/jsincludes'); %> + + + \ No newline at end of file diff --git a/client/agora/views/add-friends/partials/gallery/control-bar.ejs b/client/agora/views/add-friends/partials/gallery/control-bar.ejs new file mode 100644 index 00000000..60d3add7 --- /dev/null +++ b/client/agora/views/add-friends/partials/gallery/control-bar.ejs @@ -0,0 +1,41 @@ + \ No newline at end of file diff --git a/client/agora/views/add-friends/partials/gallery/grid-template.ejs b/client/agora/views/add-friends/partials/gallery/grid-template.ejs new file mode 100644 index 00000000..f5aa14cd --- /dev/null +++ b/client/agora/views/add-friends/partials/gallery/grid-template.ejs @@ -0,0 +1,69 @@ +<% //name:string, description:string, tags:array, content:array %> + + + + + \ No newline at end of file diff --git a/client/agora/views/dashboard-shared/partials/gallery/list-template.ejs b/client/agora/views/dashboard-shared/partials/gallery/list-template.ejs new file mode 100644 index 00000000..3ac7cc4e --- /dev/null +++ b/client/agora/views/dashboard-shared/partials/gallery/list-template.ejs @@ -0,0 +1,70 @@ +<% const showTags=(tags)=> { + for(let i=0; i < tags.length; i++) { %> + + <%= tags[i]%> + + <% } } %> + + <% //name:string, description:string, tags:array, content:array %> + <% const renderListCard=(id,name,desc,tags,contentType, content)=> { + name = name.slice(0,18) + if(desc){ + desc = desc.slice(0,180) + } + if (contentType === "Topic") { %> + + +
  • + + <%=name%> + + + <%=contentType%> + + + <% showTags(tags) %> + + + + + <%- include('./dropdown.ejs'); %> + + +
  • + + <% } else if (contentType==="Workspace" ) { %> + + +
  • + + <%=name%> + + + <%=contentType%> + + + <% showTags(tags) %> + + + + + <%- include('./dropdown.ejs'); %> + + +
  • + <% } }%> + + + + -->
    - +
    - + diff --git a/client/agora/views/dashboard/partials/gallery/dropdown.ejs b/client/agora/views/dashboard/partials/gallery/dropdown.ejs index c5d03a52..551a8303 100644 --- a/client/agora/views/dashboard/partials/gallery/dropdown.ejs +++ b/client/agora/views/dashboard/partials/gallery/dropdown.ejs @@ -9,6 +9,8 @@ new tab  edit_square Rename +  person_add Go to Dashboard diff --git a/client/agora/views/dashboard/partials/topic/share-modal.ejs b/client/agora/views/dashboard/partials/topic/share-modal.ejs index 3a4b3efd..def6ea7b 100644 --- a/client/agora/views/dashboard/partials/topic/share-modal.ejs +++ b/client/agora/views/dashboard/partials/topic/share-modal.ejs @@ -1,80 +1,51 @@ <% var sharedWith = [{name: "John Cena", pfp: 'account_circle', status: "Owner"}, {name: "The Rock", pfp: 'account_circle', status: "Member"}, {name: "Jesus", pfp: 'account_circle', status: "Contributer"}]; %> - + diff --git a/client/agora/views/dashboard/partials/topic/share-topic-view.ejs b/client/agora/views/dashboard/partials/topic/share-topic-view.ejs new file mode 100644 index 00000000..588897b6 --- /dev/null +++ b/client/agora/views/dashboard/partials/topic/share-topic-view.ejs @@ -0,0 +1,116 @@ + + + + + <%- include('../../../partials/head'); %> + + + + + + + + +
    + + + + <%- include('../../side-menu/side-menu.ejs');%> + + + <%- include('./workspace-manager-modal.ejs');%> + <%- include('./open-topic.ejs');%> + + +
    + +
    +
    + + +
    + + + + + + + + +
    +
    +
    + +
      + +
      + + + + + + forum + + + <%-include('./discussion-modal.ejs'); %> + <%-include('./comment-template.ejs'); %> + <%-include('./share-modal.ejs'); %> + + + + +
      + + + + + +
      + +
      + add +
      + + +
      +
      +
      + +
      + +
      +
      + + +
      +
      + +
      + +
      +
      +
      + + +
      + + + + +
      + +
      + + <%- include('../../../partials/jsincludes'); %> + <%- include ('../gallery/dropdown'); %> + + + + + diff --git a/client/agora/views/dashboard/side-menu/side-menu.ejs b/client/agora/views/dashboard/side-menu/side-menu.ejs index aec0770c..6448fc37 100644 --- a/client/agora/views/dashboard/side-menu/side-menu.ejs +++ b/client/agora/views/dashboard/side-menu/side-menu.ejs @@ -1,27 +1,29 @@ - - + \ No newline at end of file diff --git a/client/agora/views/friends/friends.ejs b/client/agora/views/friends/friends.ejs new file mode 100644 index 00000000..8d8a721e --- /dev/null +++ b/client/agora/views/friends/friends.ejs @@ -0,0 +1,24 @@ + + + + + <%- include('../partials/head'); %> + + + + + + + + + + <%- include('../dashboard/side-menu/side-menu.ejs'); %> + <%- include('./partials/gallery/note-gallery.ejs') %> + + <%- include('../partials/jsincludes'); %> + + + \ No newline at end of file diff --git a/client/agora/views/friends/partials/gallery/control-bar.ejs b/client/agora/views/friends/partials/gallery/control-bar.ejs new file mode 100644 index 00000000..8caa709e --- /dev/null +++ b/client/agora/views/friends/partials/gallery/control-bar.ejs @@ -0,0 +1,48 @@ + \ No newline at end of file diff --git a/client/agora/views/friends/partials/gallery/dropdown.ejs b/client/agora/views/friends/partials/gallery/dropdown.ejs new file mode 100644 index 00000000..192b4be3 --- /dev/null +++ b/client/agora/views/friends/partials/gallery/dropdown.ejs @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/client/agora/views/friends/partials/gallery/grid-template.ejs b/client/agora/views/friends/partials/gallery/grid-template.ejs new file mode 100644 index 00000000..943e1d82 --- /dev/null +++ b/client/agora/views/friends/partials/gallery/grid-template.ejs @@ -0,0 +1,50 @@ + \ No newline at end of file diff --git a/client/agora/views/friends/partials/gallery/note-gallery.ejs b/client/agora/views/friends/partials/gallery/note-gallery.ejs new file mode 100644 index 00000000..edcf52df --- /dev/null +++ b/client/agora/views/friends/partials/gallery/note-gallery.ejs @@ -0,0 +1,9 @@ + +<%- include('./control-bar.ejs'); %> + +
      +
      + <%- include('./grid-template.ejs'); %> +
      + + diff --git a/client/agora/views/index.ejs b/client/agora/views/index.ejs index a312135d..35d02b07 100644 --- a/client/agora/views/index.ejs +++ b/client/agora/views/index.ejs @@ -1,80 +1,89 @@ - - <%- include('./partials/head'); %> - - - - - - -
      -
      -
      - -
      -
      - -

      Agora

      - -

      -
      Agora is an open, free, cloud based platform you can use to take notes, research and learn. A free digital space that resets our expectations regarding cloud data ownership and privacy
      - -

      - Get Started -

      -
      -
      - -
      + + + <%- include('./partials/head'); %> + + + + + + + +
      +
      +
      + +
      +
      + +

      Agora

      + +

      +
      Agora is an open, free, cloud based platform you can use to + take notes, research and learn. A free digital space that resets our expectations + regarding cloud data ownership and privacy
      + +

      + Get Started +

      +
      +
      +
      -
      -
      - - -
      - -
      -
      - -
      -
      - -

      Agora for your notes


      -
      Notetaking, researching and learning,
      -
      For everyone.
      -
      Privacy guaranteed.

      -
      Agora creates a secure, private, online environment focused on protecting privacy and ownership of data within the system with infrastructure and data that will be managed and protected by the Agora Foundation.
      -
      - - -
      -
      -
      -
      +
      +
      + + +
      + +
      +
      + +
      +
      + +

      Agora for your notes


      +
      Notetaking, researching and learning,
      +
      For everyone.
      +
      Privacy guaranteed.

      +
      Agora creates a secure, private, online environment focused on + protecting privacy and ownership of data within the system with infrastructure and data that + will be managed and protected by the Agora Foundation.
      -

      Create your account Today!

      - - - -
      -
      - + + + +
      +
      +
      +
      +
      +

      Create your account Today!

      + + - - <%- include('./partials/footer'); %> + + + + + + <%- include('./partials/footer'); %> <%- include('./partials/copyright'); %> - -
      - -
      - - <%- include('./partials/jsincludes'); %> - + +
      + +
      + + <%- include('./partials/jsincludes'); %> + + \ No newline at end of file diff --git a/client/agora/views/partials/jsincludes.ejs b/client/agora/views/partials/jsincludes.ejs index 5a083a06..053a0406 100644 --- a/client/agora/views/partials/jsincludes.ejs +++ b/client/agora/views/partials/jsincludes.ejs @@ -1,16 +1,22 @@ - + - - + + + \ No newline at end of file diff --git a/client/agora/views/profile/manage.ejs b/client/agora/views/profile/manage.ejs index e7679f67..46aefc33 100644 --- a/client/agora/views/profile/manage.ejs +++ b/client/agora/views/profile/manage.ejs @@ -75,9 +75,55 @@
      + + +
      +

      Friend Requests

      +

      You have <%= nonFriends.length > 0 ? nonFriends.length : 0 %> new friend requests.

      + +
      + + +
      +
      + <% if( locals.user.profileFilename.toString().substring(0, 7) == "http://" || locals.user.profileFilename.toString().substring(0, 8) == "https://" ) { %> @@ -89,6 +135,8 @@ <% } %> + 0 +
      <%- include('../partials/message'); %> @@ -230,5 +278,11 @@ <%- include('../partials/jsincludes'); %> + \ No newline at end of file diff --git a/client/agora/views/shared-dashboard/partials/filter/search.ejs b/client/agora/views/shared-dashboard/partials/filter/search.ejs new file mode 100644 index 00000000..fd40910d --- /dev/null +++ b/client/agora/views/shared-dashboard/partials/filter/search.ejs @@ -0,0 +1,4 @@ + + + + diff --git a/client/agora/views/shared-dashboard/partials/filter/tags.ejs b/client/agora/views/shared-dashboard/partials/filter/tags.ejs new file mode 100644 index 00000000..e69de29b diff --git a/client/agora/views/shared-dashboard/partials/filterControl.ejs b/client/agora/views/shared-dashboard/partials/filterControl.ejs new file mode 100644 index 00000000..9c79bc4e --- /dev/null +++ b/client/agora/views/shared-dashboard/partials/filterControl.ejs @@ -0,0 +1,7 @@ + + +

      Search

      +<%- include('./filter/search'); %> + +

      Tags

      +<%- include('./filter/tags'); %> diff --git a/client/agora/views/shared-dashboard/partials/gallery/alert-toast.ejs b/client/agora/views/shared-dashboard/partials/gallery/alert-toast.ejs new file mode 100644 index 00000000..c74e1485 --- /dev/null +++ b/client/agora/views/shared-dashboard/partials/gallery/alert-toast.ejs @@ -0,0 +1,7 @@ +
      + +
      diff --git a/client/agora/views/shared-dashboard/partials/gallery/control-bar.ejs b/client/agora/views/shared-dashboard/partials/gallery/control-bar.ejs new file mode 100644 index 00000000..a9433fda --- /dev/null +++ b/client/agora/views/shared-dashboard/partials/gallery/control-bar.ejs @@ -0,0 +1,56 @@ + \ No newline at end of file diff --git a/client/agora/views/shared-dashboard/partials/gallery/delete-modal.ejs b/client/agora/views/shared-dashboard/partials/gallery/delete-modal.ejs new file mode 100644 index 00000000..13fa9899 --- /dev/null +++ b/client/agora/views/shared-dashboard/partials/gallery/delete-modal.ejs @@ -0,0 +1,20 @@ + + + + + diff --git a/client/agora/views/shared-dashboard/partials/gallery/dropdown.ejs b/client/agora/views/shared-dashboard/partials/gallery/dropdown.ejs new file mode 100644 index 00000000..551a8303 --- /dev/null +++ b/client/agora/views/shared-dashboard/partials/gallery/dropdown.ejs @@ -0,0 +1,16 @@ + + + diff --git a/client/agora/views/shared-dashboard/partials/gallery/grid-template.ejs b/client/agora/views/shared-dashboard/partials/gallery/grid-template.ejs new file mode 100644 index 00000000..7871650f --- /dev/null +++ b/client/agora/views/shared-dashboard/partials/gallery/grid-template.ejs @@ -0,0 +1,116 @@ +<% //name:string, description:string, tags:array, content:array %> +<% const renderCard=(workspaceId,name,desc,tags,contentType, content)=> { + //stops text overflow + name = name.slice(0,18) + if(desc){ + desc = desc.slice(0,180) + } + if (contentType === "Topic") { +%> + + + + <% } else if (contentType === "Workspace") { %> + + + +<% + } +} +%> + + + + \ No newline at end of file diff --git a/client/agora/views/shared-dashboard/partials/gallery/list-template.ejs b/client/agora/views/shared-dashboard/partials/gallery/list-template.ejs new file mode 100644 index 00000000..a955227c --- /dev/null +++ b/client/agora/views/shared-dashboard/partials/gallery/list-template.ejs @@ -0,0 +1,71 @@ +<% const showTags=(tags) => { + for(let i=0; i < tags.length; i++) { %> + + <%= tags[i]%> + + <% } +} %> + +<% //name:string, description:string, tags:array, content:array %> + <% const renderListCard=(id,name,desc,tags,contentType, content)=> { + name = name.slice(0,18) + if(desc){ + desc = desc.slice(0,180) + } + if (contentType === "Topic") { %> + + +
    • + <%=name%> + <%=contentType%> + <% showTags(tags) %> + + + + <%- include('./dropdown.ejs'); %> + + +
    • + + <% } else if (contentType === "Workspace") { %> + + +
    • + <%=name%> + <%=contentType%> + <% showTags(tags) %> + + + + <%- include('./dropdown.ejs'); %> + + +
    • + <% } +}%> + + + +