Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Entwicklungsportal - ARCHIVED
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
FIT-Connect
Entwicklungsportal - ARCHIVED
Commits
8dce94c0
Commit
8dce94c0
authored
1 year ago
by
René Rösner
Browse files
Options
Downloads
Patches
Plain Diff
Feat(
planning#1067
): Added edit link functionality to template
parent
0ee70056
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
pages/resources/[resourceName].tsx
+3
-2
3 additions, 2 deletions
pages/resources/[resourceName].tsx
shared/use-content.ts
+0
-5
0 additions, 5 deletions
shared/use-content.ts
views/Resource.tsx
+17
-0
17 additions, 0 deletions
views/Resource.tsx
with
20 additions
and
7 deletions
pages/resources/[resourceName].tsx
+
3
−
2
View file @
8dce94c0
import
{
Resource
Card
}
from
'
@/views/Resource
'
import
{
Resource
}
from
'
@/views/Resource
'
import
Link
from
'
next/link
'
import
{
IconChevronLeft
}
from
'
@tabler/icons
'
...
...
@@ -37,7 +37,7 @@ export default function ({ resourceName }) {
</
div
>
</
div
>
</
nav
>
<
Resource
Card
<
Resource
contact
=
{
{
name
:
content
.
contactInformation
.
name
,
mail
:
content
.
contactInformation
.
mail
,
...
...
@@ -47,6 +47,7 @@ export default function ({ resourceName }) {
alt
:
content
.
logo
.
title
,
}
}
title
=
{
content
?.
name
}
slug
=
{
content
?.
slug
}
description
=
{
content
?.
text
}
developer
=
{
{
name
:
content
?.
developer
.
name
,
...
...
This diff is collapsed.
Click to expand it.
shared/use-content.ts
+
0
−
5
View file @
8dce94c0
...
...
@@ -22,11 +22,6 @@ const useContent = () => {
}
}
function
getContentEditUrl
(
selectedResourceName
:
string
):
string
{
const
gitBranch
=
process
.
env
.
CURRENT_BRANCH
||
'
main
'
const
contentDirPath
=
'
content/resources
'
return
`https://git.fitko.de/-/ide/project/fit-connect/entwicklungsportal/edit/
${
gitBranch
}
/-/
${
contentDirPath
}
/
${
selectedResourceName
}
/
${
selectedResourceName
}
.md`
}
function
getContentByResourceName
(
selectedResourceName
:
string
)
{
return
prepareResourceContent
(
selectedResourceName
)
...
...
This diff is collapsed.
Click to expand it.
views/Resource.tsx
+
17
−
0
View file @
8dce94c0
...
...
@@ -4,6 +4,7 @@ import ResourceCard from '@/components/ResourceCard'
type
ResourceContentProperties
=
{
title
:
string
slug
:
string
description
:
string
img
?:
{
src
:
string
...
...
@@ -25,8 +26,15 @@ type ResourceContentProperties = {
resources
:
any
[]
}
const
getContentEditUrl
=
function
(
selectedResourceName
:
string
):
string
{
const
gitBranch
=
process
.
env
.
CURRENT_BRANCH
||
'
main
'
const
contentDirPath
=
'
content/resources
'
return
`https://git.fitko.de/-/ide/project/fit-connect/entwicklungsportal/edit/
${
gitBranch
}
/-/
${
contentDirPath
}
/
${
selectedResourceName
}
/
${
selectedResourceName
}
.md`
}
export
function
Resource
({
title
,
slug
,
description
,
img
,
developer
,
...
...
@@ -133,6 +141,15 @@ export function Resource({
</
div
>
</
div
>
)
}
{
(
<
div
className
=
"sm:col-span-1"
>
<
div
className
=
"sm:text-center sm:max-w-lg lg:mxw-0 flex items-stretch flex-grow"
>
<
a
className
=
"text-center text-lg relative inline-flex space-x-2 px-4 py-2 font-medium rounded-md text-white bg-yellow-400 hover:bg-yellow-300 hover:cursor-pointer shadow-sm"
href
=
{
getContentEditUrl
(
slug
)
}
>
Inhalt bearbeiten
</
a
>
</
div
>
</
div
>
)
}
</
ResourceCard
>
)
}
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