Skip to content

Commit

Permalink
New version under new name
Browse files Browse the repository at this point in the history
Repository was transferred to github.com/intra2net and the plugin
is now called "Note Diff". The copyright notice and other strings
were fixed accordingly.

The version was adjusted such that 2.0.0 corresponds to the
version of the plugin that works on MantisBT v2 and a Github
Actions workflow was added to generate tarballs and zip packages
when tags are pushed upstream.
  • Loading branch information
samiraguiar committed Aug 26, 2020
1 parent 2803232 commit 4bda0eb
Show file tree
Hide file tree
Showing 26 changed files with 128 additions and 41 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Create Release

on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
# `github.ref` is in the form /refs/tags/vx.x.x so we need to extract the tagname
# to correctly fill asset_name (which will be the actual name for downloaded files)
- name: Set variables
id: vars
run: |
echo "::set-output name=product::NoteDiff-${GITHUB_REF/refs\/tags\/v/}"
- name: Checkout code
uses: actions/checkout@v2

- name: Build packages
id: build_packages
# before creating the archives, make sure to exclude the files we don't want.
# however, leave .gitattributes uncommitted -- we want these files present in
# the "source" packages generated by github when we create a tag
run: |
echo ".github export-ignore" >> .gitattributes
git archive --worktree-attributes --format tar.gz --prefix ${{ steps.vars.outputs.product }}/ -o ./NoteDiff.tar.gz ${{ github.ref }}
git archive --worktree-attributes --format zip --prefix ${{ steps.vars.outputs.product }}/ -o ./NoteDiff.zip ${{ github.ref }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Upload Release Tarball
id: upload-release-tarball
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./NoteDiff.tar.gz
asset_name: ${{ steps.vars.outputs.product }}.tar.gz
asset_content_type: application/gzip

- name: Upload Release Zip
id: upload-release-zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./NoteDiff.zip
asset_name: ${{ steps.vars.outputs.product }}.zip
asset_content_type: application/zip
28 changes: 14 additions & 14 deletions IssuesDiff.php → NoteDiff/NoteDiff.php
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
<?php

# IssuesDiff - a MantisBT plugin that adds a visual diff between revisions
#
# You should have received a copy of the GNU General Public License
# along with IssuesDiff. If not, see <http://www.gnu.org/licenses/>.
/**
* Note Diff - a MantisBT plugin to diff revisions of notes and issue descriptions
*
* You should have received a copy of the GNU General Public License
* along with Note Diff. If not, see <http://www.gnu.org/licenses/>.
*
* @copyright Copyright (C) 2020 Intra2net AG - www.intra2net.com
*/

/**
* @copyright Copyright (C) 2017 Samir Aguiar for Intra2net AG - www.intra2net.com
*/

class IssuesDiffPlugin extends MantisPlugin {
class NoteDiffPlugin extends MantisPlugin {

public function register() {
$this->name = plugin_lang_get("title");
$this->description = plugin_lang_get("description");
$this->page = '';

$this->version = "1.1";
$this->version = "2.0.0";
$this->requires = array(
"MantisCore" => "2.5.0",
"MantisCore" => "2.1.0",
);

$this->author = "Samir Aguiar";
$this->contact = "samirjaguiar@gmail.com";
$this->url = "https://github.com/samiraguiar/issues-diff";
$this->author = "Intra2net AG";
$this->contact = "opensource@intra2net.com";
$this->url = "https://github.com/intra2net/mantisbt-note-diff";
}

public function hooks() {
Expand Down
15 changes: 12 additions & 3 deletions files/css/diff_style.css → NoteDiff/files/css/diff_style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/**
* Note Diff - a MantisBT plugin to diff revisions of notes and issue descriptions
*
* You should have received a copy of the GNU General Public License
* along with Note Diff. If not, see <http://www.gnu.org/licenses/>.
*
* @copyright Copyright (C) 2020 Intra2net AG - www.intra2net.com
*/

form.diff-form select {
position: relative;
top: 1;
Expand All @@ -7,18 +16,18 @@ form.diff-form input.diff-form-submit {
position: relative;
}

.issue-diff-area {
.note-diff-area {
background-color: #F9F9F9;
}

form.diff-form .issue-diff-separator {
form.diff-form .note-diff-separator {
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
padding: 10% 0;
left: 2;
position: relative;
}

.issue-diff-area tr td.Right {
.note-diff-area tr td.Right {
text-align: left;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/**
* Note Diff - a MantisBT plugin to diff revisions of notes and issue descriptions
*
* You should have received a copy of the GNU General Public License
* along with Note Diff. If not, see <http://www.gnu.org/licenses/>.
*
* @copyright Copyright (C) 2020 Intra2net AG - www.intra2net.com
*/

(function() {
var baseAnchor = document.getElementById("view-diff-anchor");
var diffPageUrl = baseAnchor.getAttribute('data-base-href');
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions NoteDiff/lang/strings_english.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

/**
* Note Diff - a MantisBT plugin to diff revisions of notes and issue descriptions
*
* You should have received a copy of the GNU General Public License
* along with Note Diff. If not, see <http://www.gnu.org/licenses/>.
*
* @copyright Copyright (C) 2020 Intra2net AG - www.intra2net.com
*/

$s_plugin_NoteDiff_title = 'Note Diff';
$s_plugin_NoteDiff_description = 'Shows a visual diff between issues revisions';
$s_plugin_NoteDiff_menu_title = 'View Diff';
$s_plugin_NoteDiff_revision_range= 'Revision range';
$s_plugin_NoteDiff_diff= 'Diff';
$s_plugin_NoteDiff_view= 'View';
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<?php
# IssuesDiff - a MantisBT plugin that adds a visual diff between revisions
#
# You should have received a copy of the GNU General Public License
# along with IssuesDiff. If not, see <http://www.gnu.org/licenses/>.

/**
* @copyright Copyright (C) 2017 Samir Aguiar for Intra2net AG - www.intra2net.com
* Note Diff - a MantisBT plugin to diff revisions of notes and issue descriptions
*
* Parts of this code were taken from MantisBT `bug_revision_view_page.php`.
* You should have received a copy of the GNU General Public License
* along with Note Diff. If not, see <http://www.gnu.org/licenses/>.
*
* @copyright Copyright (C) 2020 Intra2net AG - www.intra2net.com
*/

require_once( 'core.php' );
Expand Down Expand Up @@ -138,7 +137,7 @@ function show_diff($t_prev_revision, $t_last_revision)
echo $t_label . ' ' . plugin_lang_get('diff');
?>
</th>
<td colspan="3" class="issue-diff-area">
<td colspan="3" class="note-diff-area">
<?php
echo $diff->render($renderer);
?>
Expand Down Expand Up @@ -233,7 +232,7 @@ function get_options_list($revisions, $selected_id) {
<select name="prev">
<?php echo get_options_list($t_bug_revisions, $previous_rev_id); ?>
</select>
<span class="issue-diff-separator"> ... </span>
<span class="note-diff-separator"> ... </span>
<select name="last">
<?php
reset($t_bug_revisions);
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# MantisBT Issues Diff
MantisBT Plugin to get a visual diff between issues revisions.
# MantisBT Note Diff
MantisBT Plugin to get a visual diff between the revisions of a note or an issue description.

### For MantisBT v2
![issues_diff_plugin_v2](http://i.imgur.com/ZVfeFLt.png)
![note_diff_plugin_v2](http://i.imgur.com/ZVfeFLt.png)

### For MantisBT v1
![issues diff plugin_v1](http://i.imgur.com/STu5oHB.png)
![note_diff plugin_v1](http://i.imgur.com/STu5oHB.png)

Copyright (C) 2017 Samir Aguiar for Intra2net AG - www.intra2net.com
Copyright (C) 2020 Intra2net AG - www.intra2net.com
11 changes: 0 additions & 11 deletions lang/strings_english.txt

This file was deleted.

0 comments on commit 4bda0eb

Please sign in to comment.