Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
048c569
Fixed typo for return
Vedant1202 Apr 5, 2020
61661f6
merge fix
Vedant1202 Apr 7, 2020
85c4997
Fix for refresh during first slide upload
Vedant1202 Apr 7, 2020
6979fa8
Fixed refresh on first slide upload
Vedant1202 Apr 7, 2020
50b2cc8
Added space after 'if' for eslint configuration
Vedant1202 Apr 7, 2020
1e94b81
Added functionality to delete slide from system
Vedant1202 Apr 7, 2020
8f1c7f6
Merge branch 'develop' of https://github.com/Vedant1202/caMicroscope …
Vedant1202 Apr 7, 2020
31460c7
Removed refresh on first slide upload
Vedant1202 Apr 7, 2020
9f2438a
Added alert for slide deletion success
Vedant1202 Apr 7, 2020
e8bbcd8
Update to fix linting errors
Vedant1202 Apr 7, 2020
b0cef11
Update to fix linting errors
Vedant1202 Apr 7, 2020
4e2bf41
Fix linting errors
Vedant1202 Apr 7, 2020
37fd15c
Fix lint errors
Vedant1202 Apr 7, 2020
7bbc144
Fix lint error
Vedant1202 Apr 7, 2020
27b5299
Rechained promises to handle mishandled slide deletions
Vedant1202 Apr 8, 2020
8477ee6
Merge fix
Vedant1202 Apr 8, 2020
2d805a8
Merge fix
Vedant1202 Apr 8, 2020
3411a5d
style fix
birm Apr 11, 2020
be0480c
Added delete slide request functionality
Vedant1202 Apr 11, 2020
59cc361
Merge branch 'develop' of https://github.com/camicroscope/caMicroscop…
Vedant1202 Apr 11, 2020
0c9e74d
merge fix
Vedant1202 Apr 11, 2020
31763f3
style fix
Vedant1202 Apr 11, 2020
51f6552
style fix
Vedant1202 Apr 11, 2020
554e5c5
style fix
Vedant1202 Apr 11, 2020
0ce49cc
style fix
Vedant1202 Apr 11, 2020
2055317
style fix
Vedant1202 Apr 11, 2020
b5082cc
Merge branch 'develop' into develop
Vedant1202 Apr 12, 2020
a51c0a2
Client side changes for handling new 'requests' collection
Vedant1202 Apr 12, 2020
0f67e0a
merge fix
Vedant1202 Apr 15, 2020
0157d35
merge fix
Vedant1202 Apr 15, 2020
9470c65
merge fix
Vedant1202 Apr 15, 2020
07c0c0c
Fix for direct deletion of slides
Vedant1202 Apr 15, 2020
b1689c4
style fix
Vedant1202 Apr 15, 2020
45a187d
Added feature for user registration requests
Vedant1202 Apr 16, 2020
7de0148
merge fix
Vedant1202 Apr 16, 2020
302af9d
Merge branch 'develop' of https://github.com/Vedant1202/caMicroscope …
Vedant1202 Apr 16, 2020
adc9c16
style fix
Vedant1202 Apr 16, 2020
5612529
Commented line stating that signup page is just for admins
Vedant1202 Apr 16, 2020
ca8919d
Added line explaining new workflow of signup page
Vedant1202 Apr 16, 2020
2076b0c
Merge branch 'develop' into develop
Vedant1202 Apr 17, 2020
03f00c9
Added popups for success instead of alerts and moved showSuccessPopup…
Vedant1202 Apr 17, 2020
14195ce
Comment fix
Vedant1202 Apr 17, 2020
e801362
Style fix
Vedant1202 Apr 17, 2020
0c2b5ac
Merge branch 'develop' of https://github.com/camicroscope/caMicroscop…
Vedant1202 Apr 17, 2020
d3ca2e2
Merge branch 'develop' of https://github.com/camicroscope/caMicroscop…
Vedant1202 Apr 17, 2020
7e8d644
Solved permsisions is not defined error in signup.html
Vedant1202 Apr 17, 2020
2cd0aef
Merge branch 'develop' of https://github.com/Vedant1202/caMicroscope …
Vedant1202 Apr 17, 2020
e89ec80
Comment fix
Vedant1202 Apr 17, 2020
d3fd9ab
catch promise error
Vedant1202 Apr 17, 2020
e2924e7
error handling on fetching requests
Vedant1202 Apr 17, 2020
46849bd
Merge branch 'develop' into develop
birm Apr 17, 2020
52d9ac1
Update apps/table.html
birm Apr 17, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 81 additions & 34 deletions apps/signup/signup.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,29 @@

<link rel='stylesheet' type='text/css' media='all' href='../../css/normalize.css'/>
<link rel='stylesheet' type='text/css' media='all' href='signup.css'/>
<link rel='stylesheet' type='text/css' media='all' href='../../css/popup.css'/>

<!-- JQuery -->
<script
src="https://code.jquery.com/jquery-3.4.1.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
crossorigin="anonymous"></script>
<!-- Bootstrap core JavaScript -->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
crossorigin="anonymous"></script>
<!-- Bootstrap tooltips -->
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
crossorigin="anonymous"></script>



</head>
<script>
var userSignupUrl = "../../data/User/post"
var permissions;

function addUser(){
var email = document.getElementById("mail").value
var filters = document.getElementById("filters").value
Expand All @@ -32,29 +52,52 @@
if (attr == "2"){
userType = "Editor"
}
var doc = {email: email, userType: userType, userFilter:filters}
fetch(userSignupUrl, {
method: 'POST',
mode: 'cors', // no-cors, cors, *same-origin
cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
credentials: 'same-origin', // include, *same-origin, omit
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(doc)
}).then(x=>{
if (x.status>=400){
throw "failed to sign up user"
}
x.json()
}).then(x=>{
window.alert("success")
console.log(x)
}).catch(e=>{
// window.alert("error!")
console.error(e)
})
// if (getUserType() === "Admin") {
if (permissions.user.post == true) {
var doc = {email: email, userType: userType, userFilter:filters}
fetch(userSignupUrl, {
method: 'POST',
mode: 'cors', // no-cors, cors, *same-origin
cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
credentials: 'same-origin', // include, *same-origin, omit
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(doc),
}).then(x=>{
if (x.status>=400){
throw "failed to sign up user"
}
x.json()
}).then(x=>{
window.alert("User registered successfully")
console.log(x)
}).catch(e=>{
// window.alert("error!")
console.error(e)
});
} else {
const store = new Store('../data/');
store.requestToCreateUser(email, filters, userType);
}
}

$(window).on('load', function() {
$('#sub').text('Sign up');
$('#sub').removeAttr('disabled');

getUserPermissions(getUserType())
.then(response => response.text())
.then((data) => {
return (data ? JSON.parse(data) : null);
})
.then((data)=> {
if(data===null)
return;
permissions = data;
})
});

</script>

<body>
Expand Down Expand Up @@ -91,7 +134,7 @@
</div>
<!-- <hr style="width: 24.25em; height: 0.01em; background-color: black; margin-top: 0em; margin-bottom: 0;"> -->

<form>
<form id="userForm" onsubmit="return false;">
<h2 style="margin-top: -.5em;">User Signup</h2>
<hr
style="width: 24.25em; margin-left: -1.9em; height: 0.01em; background-color: rgb(172, 172, 172); margin-bottom: 2em;">
Expand Down Expand Up @@ -121,21 +164,25 @@ <h2 style="margin-top: -.5em;">User Signup</h2>

<br> <br>
<div class="form-group">
<button type="submit" id="sub" class="btn btn-primary btn-block btn-lg sub-btn" onclick="addUser()">Sign
Up</button>
<button type="submit" id="sub" class="btn btn-primary btn-block btn-lg sub-btn" onclick="addUser()" disabled>
Please wait ...
</button>
</div>
<p class="small text-center">This form is only useful to Admin users. If you reach this page, it's likely that you tried to log into this instance but lack
access. Email the administrator if you want to be added.</p>
<!-- <p class="small text-center">This form is only useful to Admin users. If you reach this page, it's likely that you tried to log into this instance but lack
access. Email the administrator if you want to be added.</p> -->
<p class="small text-center">
Non-admin users have to submit a request ticket to admins to get their approval to signup new users.
If you are an Admin, you can directly signup users.
</p>
</form>
<div class="text-center">Already have an account? </div>
</div>
<!-- popup -->
<div id="popup-container"></div>


<script src="../../common/util.js"></script>
<script src="../../core/Store.js"></script>

<!-- JQuery -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<!-- Bootstrap tooltips -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.4/umd/popper.min.js"></script>
<!-- Bootstrap core JavaScript -->
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.4.1/js/bootstrap.min.js"></script>
</body>
</html>
14 changes: 14 additions & 0 deletions apps/table.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ nav li:not(.active):hover a{
cursor: pointer;
}

#notification-box {
overflow-y: scroll;
max-height: 40em;
}

/* Tooltip container */
.tooltipCustom {
position: relative;
Expand Down Expand Up @@ -86,6 +91,11 @@ nav li:not(.active):hover a{
padding: 10px 0px;
color: black;
}

#tabs, #content {
width: 100%;
}

.bg-gray{
background-color: #eee;
}
Expand Down Expand Up @@ -139,6 +149,10 @@ nav li:not(.active):hover a{
color: #aaa;
}

.nav-tabs {
/* display: flex; */
}

.collapse.in {
display: inline !important;
}
Loading