-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added admin tab on organization view (#2872)
* Added admin tab on organization view
- Loading branch information
1 parent
f9e84be
commit 424b39f
Showing
7 changed files
with
115 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
...tlin/com/saveourtool/save/frontend/common/components/views/organization/RenderAdminTab.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
@file:Suppress("FILE_NAME_MATCH_CLASS") | ||
|
||
package com.saveourtool.save.frontend.common.components.views.organization | ||
|
||
import com.saveourtool.save.entities.OrganizationDto | ||
import react.FC | ||
import react.Props | ||
import react.dom.html.ReactHTML.div | ||
import react.dom.html.ReactHTML.input | ||
import react.dom.html.ReactHTML.label | ||
import web.cssom.ClassName | ||
import web.html.InputType | ||
|
||
val renderAdminTab: FC<RenderAdminTabProps> = FC { props -> | ||
|
||
div { | ||
className = ClassName("row justify-content-center mb-2 text-gray-900") | ||
div { | ||
className = ClassName("col-4 mb-2 pl-0 pr-0 mr-2 ml-2") | ||
div { | ||
className = ClassName("text-xs text-center font-weight-bold text-primary text-uppercase mb-3") | ||
+"Main settings" | ||
} | ||
div { | ||
className = ClassName("card card-body mt-0 p-0") | ||
div { | ||
className = ClassName("d-sm-flex justify-content-center form-check pl-3 pr-3 pt-3") | ||
div { | ||
input { | ||
className = ClassName("form-check-input") | ||
type = InputType.checkbox | ||
value = props.organization.canCreateContests.toString() | ||
id = "canCreateContestsCheckbox" | ||
checked = props.organization.canCreateContests | ||
onChange = { | ||
props.onCanCreateContestsChange(!props.organization.canCreateContests) | ||
} | ||
} | ||
} | ||
div { | ||
label { | ||
className = ClassName("form-check-label") | ||
htmlFor = "canCreateContestsCheckbox" | ||
+"Can create contests" | ||
} | ||
} | ||
} | ||
|
||
div { | ||
className = ClassName("d-sm-flex justify-content-center form-check pl-3 pr-3 pt-3") | ||
div { | ||
input { | ||
className = ClassName("form-check-input") | ||
type = InputType.checkbox | ||
value = props.organization.canBulkUpload.toString() | ||
id = "canBulkUploadCosvFilesCheckbox" | ||
checked = props.organization.canBulkUpload | ||
onChange = { | ||
props.onCanBulkUploadCosvFilesChange(!props.organization.canBulkUpload) | ||
} | ||
} | ||
} | ||
div { | ||
label { | ||
className = ClassName("form-check-label") | ||
htmlFor = "canBulkUploadCosvFilesCheckbox" | ||
+"Can bulk upload COSV files" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* RenderInfoTab component props | ||
*/ | ||
@Suppress("MISSING_KDOC_CLASS_ELEMENTS") | ||
external interface RenderAdminTabProps : Props { | ||
/** | ||
* Organization | ||
*/ | ||
var organization: OrganizationDto | ||
|
||
/** | ||
* Callback invoked in order to change canCreateContests flag | ||
*/ | ||
var onCanCreateContestsChange: (Boolean) -> Unit | ||
|
||
/** | ||
* Callback invoked in order to change canBulkUpload flag | ||
*/ | ||
var onCanBulkUploadCosvFilesChange: (Boolean) -> Unit | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters