Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Project Allocator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
edtech
Project Allocator
Commits
f6480d01
Commit
f6480d01
authored
2 years ago
by
Andrea Callia D'Iddio
Browse files
Options
Downloads
Patches
Plain Diff
Feat: show projects from other staff members in the staff project page.
parent
85a0d6cc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#360851
failed
2 years ago
Stage: lint
Stage: test
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/templates/pages/staff/projects.html
+13
-3
13 additions, 3 deletions
app/templates/pages/staff/projects.html
app/views/staff.py
+10
-2
10 additions, 2 deletions
app/views/staff.py
with
23 additions
and
5 deletions
app/templates/pages/staff/projects.html
+
13
−
3
View file @
f6480d01
{% extends "components/layout.html" %}
{% block content %}
{% macro project_list(header, projects, allow_edit) %}
<div
class=
"w3-content"
>
<div
class=
"w3-container"
>
<h1
class=
"w3-center w3-text-teal"
>
Your current project proposals
</h1>
<h1
class=
"w3-center w3-text-teal"
>
{{ header }}
</h1>
{% if projects %}
<section
class=
"w3-section"
>
<ul
class=
"w3-ul"
>
...
...
@@ -29,11 +28,22 @@
{% else %}
{{ utils.placeholder_text("No projects to show yet.") }}
{% endif %}
{% if allow_edit %}
<section
class=
"w3-section"
>
<a
href=
"{{ url_for("
staff.create_project
")
}}"
class=
"w3-btn w3-{{ theme_colour }}"
>
Add new
proposal
</a>
</section>
{% endif %}
</div>
</div>
{% endmacro %}
{% block content %}
{{ project_list('Your current project proposals', own_projects,allow_edit) }}
<hr>
{{ project_list('Other projects', other_projects, False) }}
{% endblock %}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
app/views/staff.py
+
10
−
2
View file @
f6480d01
...
...
@@ -38,13 +38,21 @@ def unshortlist_old_proposer(project: Project):
@staff_only
def
projects
():
allow_edit
=
True
if
datetime
.
utcnow
()
<=
DEADLINE_FOR_STAFF_CHANGES
else
False
active
_projects
:
list
[
Project
]
=
(
own
_projects
:
list
[
Project
]
=
(
Project
.
query
.
filter_by
(
proposer
=
current_user
.
username
)
.
filter
(
Project
.
deleted
.
is_
(
None
))
.
all
()
)
other_projects
:
list
[
Project
]
=
(
Project
.
query
.
filter
(
Project
.
proposer
!=
current_user
.
username
)
.
filter
(
Project
.
deleted
.
is_
(
None
))
.
all
()
)
return
render_template
(
"
pages/staff/projects.html
"
,
projects
=
active_projects
,
allow_edit
=
allow_edit
"
pages/staff/projects.html
"
,
own_projects
=
own_projects
,
other_projects
=
other_projects
,
allow_edit
=
allow_edit
,
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment