Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Trac2Gitlab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stud.IP
Plugins
Trac2Gitlab
Commits
7f2798b4
Commit
7f2798b4
authored
Feb 7, 2024
by
Jan-Hendrik Willms
Browse files
Options
Downloads
Patches
Plain Diff
fixes
#52
parent
b46180ea
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
assets/releases.scss
+8
-0
8 additions, 0 deletions
assets/releases.scss
controllers/releases.php
+18
-9
18 additions, 9 deletions
controllers/releases.php
plugin.manifest
+1
-1
1 addition, 1 deletion
plugin.manifest
views/releases/index.php
+12
-2
12 additions, 2 deletions
views/releases/index.php
with
39 additions
and
12 deletions
assets/releases.scss
+
8
−
0
View file @
7f2798b4
...
@@ -5,3 +5,11 @@
...
@@ -5,3 +5,11 @@
tr
:not
(
:last-child
)
td
.table-divider
{
tr
:not
(
:last-child
)
td
.table-divider
{
border-bottom-color
:
var
(
--
light-gray-color-80
);
border-bottom-color
:
var
(
--
light-gray-color-80
);
}
}
.release-files
{
>
a
:not
(
:first-of-type
)
::before
{
content
:
'|'
;
pointer-events
:
none
;
color
:
var
(
--
black
)
!
important
;
}
}
This diff is collapsed.
Click to expand it.
controllers/releases.php
+
18
−
9
View file @
7f2798b4
...
@@ -104,28 +104,37 @@ final class ReleasesController extends \TracToGitlab\Controller
...
@@ -104,28 +104,37 @@ final class ReleasesController extends \TracToGitlab\Controller
return
strcmp
(
$a
[
'name'
],
$b
[
'name'
]);
return
strcmp
(
$a
[
'name'
],
$b
[
'name'
]);
});
});
$sources
=
array_map
(
function
(
array
$asset
):
array
{
$asset
[
'size'
]
=
$this
->
getFileSize
(
$asset
[
'url'
]);
return
$asset
;
},
$release
[
'assets'
][
'sources'
]
??
[]
);
$changelog
=
sprintf
(
$changelog
=
sprintf
(
'https://gitlab.studip.de/studip/studip/-/blob/%s/ChangeLog%s'
,
'https://gitlab.studip.de/studip/studip/-/blob/%s/ChangeLog%s'
,
$release
[
'tag_name'
],
$release
[
'tag_name'
],
$release
[
'tag_name'
]
>=
'v5.3'
?
'.md'
:
''
$release
[
'tag_name'
]
>=
'v5.3'
?
'.md'
:
''
);
);
try
{
$file
=
$this
->
gitlab
->
repositoryFiles
()
->
getFile
(
$this
->
gitlabProjectId
,
'RELEASE-NOTES.md'
,
$release
[
'tag_name'
]
);
$release_notes
=
sprintf
(
'https://gitlab.studip.de/studip/studip/-/blob/%s/%s'
,
$release
[
'tag_name'
],
$file
[
'file_name'
]
);
}
catch
(
Exception
$e
)
{
$release_notes
=
null
;
}
return
[
return
[
'name'
=>
$release
[
'name'
],
'name'
=>
$release
[
'name'
],
'description'
=>
$release
[
'description'
],
'description'
=>
$release
[
'description'
],
'url'
=>
$release
[
'_links'
][
'self'
],
'url'
=>
$release
[
'_links'
][
'self'
],
'changelog'
=>
$changelog
,
'changelog'
=>
$changelog
,
'notes'
=>
$release_notes
,
'released'
=>
strtotime
(
$release
[
'released_at'
]),
'released'
=>
strtotime
(
$release
[
'released_at'
]),
'sources'
=>
$release
[
'assets'
][
'sources'
],
'sources'
=>
$release
[
'assets'
][
'sources'
],
'links'
=>
$links
'links'
=>
$links
,
];
];
},
},
$this
->
gitlab
->
repositories
()
->
releases
(
$this
->
gitlabProjectId
)
$this
->
gitlab
->
repositories
()
->
releases
(
$this
->
gitlabProjectId
)
...
...
This diff is collapsed.
Click to expand it.
plugin.manifest
+
1
−
1
View file @
7f2798b4
...
@@ -2,6 +2,6 @@ pluginname=Trac to gitlab converter
...
@@ -2,6 +2,6 @@ pluginname=Trac to gitlab converter
pluginclassname=TracToGitlabPlugin
pluginclassname=TracToGitlabPlugin
pluginclassname=StudipReleasesPlugin
pluginclassname=StudipReleasesPlugin
origin=UOL
origin=UOL
version=1.4.
4
version=1.4.
5
studipMinVersion=5.0
studipMinVersion=5.0
localedomain=trac2gitlab
localedomain=trac2gitlab
This diff is collapsed.
Click to expand it.
views/releases/index.php
+
12
−
2
View file @
7f2798b4
...
@@ -35,17 +35,27 @@
...
@@ -35,17 +35,27 @@
</span>
</span>
</td>
</td>
<?
endforeach
;
?>
<?
endforeach
;
?>
<td
class=
"hidden-small-down"
>
<td
class=
"hidden-small-down
release-files
"
>
<a
href=
"
<?=
URLHelper
::
getLink
(
$release
[
'changelog'
])
?>
"
target=
"_blank"
rel=
"noopener noreferrer"
>
<a
href=
"
<?=
URLHelper
::
getLink
(
$release
[
'changelog'
])
?>
"
target=
"_blank"
rel=
"noopener noreferrer"
>
ChangeLog
ChangeLog
</a>
</a>
<?
if
(
$release
[
'notes'
])
:
?>
<a
href=
"
<?=
URLHelper
::
getLink
(
$release
[
'notes'
])
?>
"
target=
"_blank"
rel=
"noopener noreferrer"
>
Release notes
</a>
<?
endif
;
?>
</td>
</td>
</tr>
</tr>
<tr
class=
"hidden-medium-up"
>
<tr
class=
"hidden-medium-up"
>
<td
colspan=
"5"
class=
"table-divider"
>
<td
colspan=
"5"
class=
"table-divider
release-files
"
>
<a
href=
"
<?=
URLHelper
::
getLink
(
$release
[
'changelog'
])
?>
"
target=
"_blank"
rel=
"noopener noreferrer"
>
<a
href=
"
<?=
URLHelper
::
getLink
(
$release
[
'changelog'
])
?>
"
target=
"_blank"
rel=
"noopener noreferrer"
>
ChangeLog
ChangeLog
</a>
</a>
<?
if
(
$release
[
'notes'
])
:
?>
<a
href=
"
<?=
URLHelper
::
getLink
(
$release
[
'notes'
])
?>
"
target=
"_blank"
rel=
"noopener noreferrer"
>
Release notes
</a>
<?
endif
;
?>
</td>
</td>
</tr>
</tr>
<?
endforeach
;
?>
<?
endforeach
;
?>
...
...
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