Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
23c2d71
#327 modification on the way of store the date ad user who modify the…
PabloMrBot Aug 4, 2025
ab61819
#327 change the trigger to the class and now we use validator Project…
PabloMrBot Aug 5, 2025
e5a579c
#327 changes on the way to hidde the info
PabloMrBot Aug 8, 2025
3122374
#327 changes on the way to hidde the info
PabloMrBot Aug 13, 2025
ea3def6
change the validator to independent the function, changes and check o…
PabloMrBot Aug 14, 2025
ef15650
implement the forbidden over odk process and block on many views with…
PabloMrBot Aug 21, 2025
33866d1
implement the forbidden over odk process and block on many views with…
PabloMrBot Aug 22, 2025
0d3874e
adapt the test to the actual develop and take off the button of enkeko
PabloMrBot Aug 22, 2025
8c5ba4a
modification include the section for the api to avoid the modificatio…
PabloMrBot Aug 26, 2025
6bce410
add the message for the forbidden on the jinja
PabloMrBot Aug 27, 2025
aeac576
Added the function to email to all admin when the project finish
PabloMrBot Aug 28, 2025
e77e4b3
hash to the description on curation projects,V3 of changes
PabloMrBot Sep 8, 2025
a9b8f41
edit proyect advance
PabloMrBot Sep 11, 2025
ec12fb8
email finish with data on prose
PabloMrBot Oct 20, 2025
c2773c3
template modifications on dashboard, finishproject and close
PabloMrBot Nov 4, 2025
f19312c
merge changes
PabloMrBot Nov 5, 2025
333c4b5
Labels changes
PabloMrBot Nov 10, 2025
e7f31be
columns crop & country added to all projects
PabloMrBot Nov 11, 2025
60b600a
text change
PabloMrBot Nov 20, 2025
6409f3d
Merge branch 'develop' of https://github.com/mrbotcr/py3ClimMob into …
PabloMrBot Nov 26, 2025
81bbe19
Merge branch 'develop' of https://github.com/mrbotcr/py3ClimMob into …
PabloMrBot Feb 11, 2026
0785ae4
Hide close button when the proyect is fin
PabloMrBot Feb 19, 2026
11a7614
changes on finalize warning banner to a warning popup.
PabloMrBot Feb 24, 2026
0e8285f
fix an error about project_registration_and_analysis modification form
PabloMrBot Feb 25, 2026
10ba760
text edition
PabloMrBot Feb 27, 2026
fad3f0a
v9 it requiere changest
PabloMrBot Mar 18, 2026
b10cd1c
changes over finalized
PabloMrBot Mar 18, 2026
4eb70b7
final changes figma v11
PabloMrBot Mar 20, 2026
28c313a
final changes figma v12
PabloMrBot Mar 26, 2026
c21fa22
final changes figma v13
PabloMrBot Mar 26, 2026
94a3cf9
final changes figma v13. delete can edit on proyectlist
PabloMrBot Mar 26, 2026
59f665c
changes on the way of country is display/ changes on the recipents to…
PabloMrBot Apr 14, 2026
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
38 changes: 25 additions & 13 deletions climmob/config/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
)
from climmob.views.assessment import (
assessment_view,
deleteAssessmentSection_view,
DeleteAssessmentSectionView,
getAssessmentDetails_view,
assessmenthead_view,
deleteassessmenthead_view,
Expand All @@ -170,7 +170,8 @@
HomeView,
HealthView,
NotFoundView,
ForbiddenView,
# ForbiddenView,
Forbidden,
LoginView,
RegisterView,
LogoutView,
Expand All @@ -185,12 +186,12 @@
from climmob.views.cloneProjects.cloneProjects import CloneProjectsView
from climmob.views.dashboard import dashboard_view, projectInformation_view
from climmob.views.editData import (
editDataView,
EditDataView,
downloadDataView,
downloadErroLogDocument_view,
)
from climmob.views.enumerator import (
getEnumeratorDetails_view,
GetEnumeratorDetailsView,
enumerators_view,
deleteEnumerator_view,
)
Expand Down Expand Up @@ -239,19 +240,20 @@
CurationOfProjectsView,
GetUnitOfAnalysisByLocationView,
GetObjectivesByLocationAndUnitOfAnalysisView,
FinishProjectView,
)
from climmob.views.projectHelp.projectHelp import projectHelp_view
from climmob.views.project_analysis import analysisDataView
from climmob.views.project_combinations import projectCombinations_view
from climmob.views.project_enumerators import (
projectEnumerators_view,
ProjectEnumeratorsView,
removeProjectEnumerators_view,
)
from climmob.views.project_metadata import (
ProjectMetadataFormView,
ShowMetadataFormView,
)
from climmob.views.project_technologies import projectTecnologies_view
from climmob.views.project_technologies import ProjectTechnologiesView
from climmob.views.projectsSummary.projectsSummary import (
DownloadProjectsSummaryView,
ProjectsSummaryCurationView,
Expand Down Expand Up @@ -732,7 +734,7 @@ def loadRoutes(config):
addRoute(
"getEnumeratorDetails",
"/user/{user}/enumerator/{enumid}",
getEnumeratorDetails_view,
GetEnumeratorDetailsView,
"json",
)
)
Expand Down Expand Up @@ -864,7 +866,7 @@ def loadRoutes(config):
addRoute(
"prjenumerators",
"/user/{user}/project/{project}/enumerators",
projectEnumerators_view,
ProjectEnumeratorsView,
"project/enumerators/enumerators.jinja2",
)
)
Expand Down Expand Up @@ -943,6 +945,14 @@ def loadRoutes(config):
"project/closepregistry.jinja2",
)
)
routes.append(
addRoute(
"finishproject",
"/user/{user}/project/{project}/finishproject",
FinishProjectView,
"project/finishproject.jinja2",
)
)

# Assessment
routes.append(
Expand Down Expand Up @@ -1023,7 +1033,7 @@ def loadRoutes(config):
addRoute(
"deleteassessmentgroup",
"/user/{user}/project/{project}/assessment/{assessmentid}/{groupid}/delete",
deleteAssessmentSection_view,
DeleteAssessmentSectionView,
"json",
)
)
Expand All @@ -1048,7 +1058,7 @@ def loadRoutes(config):
addRoute(
"prjtechnologies",
"/user/{user}/project/{project}/technologies",
projectTecnologies_view,
ProjectTechnologiesView,
"project/technologies/technologies.jinja2",
)
)
Expand Down Expand Up @@ -1147,15 +1157,15 @@ def loadRoutes(config):
addRoute(
"EditDataRegistry",
"/user/{user}/project/{project}/form/{formid}/EditData",
editDataView,
EditDataView,
"project/editData/editData.jinja2",
)
)
routes.append(
addRoute(
"EditDataAssessment",
"/user/{user}/project/{project}/form/{formid}/{codeid}/EditData",
editDataView,
EditDataView,
"project/editData/editData.jinja2",
)
)
Expand Down Expand Up @@ -2254,7 +2264,9 @@ def loadRoutes(config):
appendToRoutes(routes)

config.add_notfound_view(NotFoundView, renderer="404.jinja2")
config.add_forbidden_view(ForbiddenView, renderer="403.jinja2")
# config.add_forbidden_view(ForbiddenView, renderer="403.jinja2")

config.add_forbidden_view(Forbidden, renderer="403.jinja2")

# Custom mapping can happen here AFTER the host maps
for plugin in p.PluginImplementations(p.IRoutes):
Expand Down
30 changes: 29 additions & 1 deletion climmob/processes/db/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
"getProjectFullDetailsById",
"getProjectsByUserThatRequireSetup",
"update_project_status",
"get_user_access_type_in_project",
"get_project_status",
]


Expand Down Expand Up @@ -455,6 +457,11 @@ def extraDetailsForProject(activeProject, request):
activeProject["languages"] = getPrjLangInProject(
activeProject["project_id"], request
)
activeProject["Country"] = (
request.dbsession.query(Country)
.filter_by(cnty_cod=activeProject["project_cnty"])
.first()
)

for plugin in p.PluginImplementations(p.IProjectTechnologyOptions):
activeProject = plugin.get_extra_information_for_data_exchange(
Expand Down Expand Up @@ -955,6 +962,27 @@ def update_project_status(project_id, status, request):
request.dbsession.query(Project).filter(
Project.project_id == project_id
).update({"project_status": status})
return True
return True, ""
except Exception as e:
return False, str(e)


def get_user_access_type_in_project(project_id, user, request):
res = mapFromSchema(
request.dbsession.query(userProject.access_type)
.filter(userProject.user_name == user)
.filter(userProject.project_id == project_id)
.first()
)
if res:
return True, res["access_type"]
return False, ""


def get_project_status(projectId, request):
project_status = mapFromSchema(
request.dbsession.query(Project.project_status)
.filter(Project.project_id == projectId)
.first()
)
return project_status["project_status"]
4 changes: 3 additions & 1 deletion climmob/processes/db/project_metadata_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ def knowIfTheProjectMetadataIsComplete(request, projectId):
quantityRequired = mapFromSchema(
request.dbsession.query(
func.count(MetadataForm.metadata_id).label("quantity_required")
).one()
)
.filter(MetadataForm.metadata_active == 1)
.one()
)
quantityCompleted = mapFromSchema(
request.dbsession.query(
Expand Down
57 changes: 29 additions & 28 deletions climmob/templates/403.jinja2
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ _("ClimMob | 403 Error") }}</title>

{% block css %}
{% cssresource request,'coreresources','style' %}
{% endblock css %}
</head>
</head>

<body class="gray-bg">
<div class="middle-box text-center animated fadeInDown">
<h1>403</h1>
<h3 class="font-bold">{{ _("Forbidden") }}</h3>

<div class="error-desc">
{{ _("We are sorry, but you do not have access to this page or resource.") }}<br/>

{{ _("You can go back to main page") }}: <br/><a href="{{ request.route_url('dashboard') }}" class="btn btn-primary m-t">{{ _("Home") }}</a>
</div>
</div>
</body>

</html>
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ _("ClimMob | 403 Error") }}</title>

{% block css %}
{% cssresource request,'coreresources','style' %}
{% endblock css %}
</head>
</head>

<body class="gray-bg">
<div class="middle-box text-center animated fadeInDown">
<h1>403</h1>
<h3 class="font-bold">{{ _("Forbidden") }}</h3>

<div class="error-desc">
{{ _("We are sorry, but you do not have access to this page or resource.") }}<br/>
<p>{{ message }}</p>

{{ _("You can go back to main page") }}: <br/><a href="{{ request.route_url('dashboard') }}" class="btn btn-primary m-t">{{ _("Home") }}</a>
</div>
</div>
</body>

</html>
Loading