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
199a8a0e
Commit
199a8a0e
authored
2 years ago
by
Ivan Procaccini
Browse files
Options
Downloads
Patches
Plain Diff
Feat: Support creation of new project
parent
9533ce65
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/templates/pages/project-form.html
+1
-1
1 addition, 1 deletion
app/templates/pages/project-form.html
app/views/staff.py
+10
-4
10 additions, 4 deletions
app/views/staff.py
with
11 additions
and
5 deletions
app/templates/pages/project-form.html
+
1
−
1
View file @
199a8a0e
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
<section
class=
"w3-section"
>
<section
class=
"w3-section"
>
<label>
<label>
Description
Description
<textarea
class=
"w3-input w3-border"
placeholder=
"Description of my new project..."
required
rows=
"10"
></textarea>
<textarea
name=
"description"
class=
"w3-input w3-border"
placeholder=
"Description of my new project..."
required
rows=
"10"
></textarea>
</label>
</label>
</section>
</section>
<button
type=
"submit"
class=
"w3-btn w3-teal"
>
Save
</button>
<button
type=
"submit"
class=
"w3-btn w3-teal"
>
Save
</button>
...
...
This diff is collapsed.
Click to expand it.
app/views/staff.py
+
10
−
4
View file @
199a8a0e
from
datetime
import
datetime
from
datetime
import
datetime
from
flask
import
render_template
,
Blueprint
,
redirect
,
url_for
,
flash
,
request
from
flask
import
render_template
,
Blueprint
,
redirect
,
url_for
,
flash
,
request
,
g
from
flask_login
import
login_required
from
flask_login
import
login_required
,
current_user
from
app
import
Project
,
db
,
messages
from
app
import
Project
,
db
,
messages
...
@@ -12,8 +12,14 @@ bp = Blueprint("staff", __name__, url_prefix="/staff")
...
@@ -12,8 +12,14 @@ bp = Blueprint("staff", __name__, url_prefix="/staff")
@login_required
@login_required
def
projects
():
def
projects
():
if
request
.
method
==
"
POST
"
:
if
request
.
method
==
"
POST
"
:
# Save new project
project
=
Project
(
pass
title
=
request
.
form
[
"
title
"
],
description
=
request
.
form
[
"
description
"
],
proposer
=
current_user
.
username
,
)
db
.
session
.
add
(
project
)
db
.
session
.
commit
()
return
redirect
(
url_for
(
"
staff.projects
"
))
active_projects
:
list
[
Project
]
=
Project
.
query
.
filter
(
active_projects
:
list
[
Project
]
=
Project
.
query
.
filter
(
Project
.
deleted
.
is_
(
None
)
Project
.
deleted
.
is_
(
None
)
).
all
()
).
all
()
...
...
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