Skip to content

Commit

Permalink
more readme work
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandermeindl committed Oct 5, 2024
1 parent 8f7eece commit 8e072a6
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 38 deletions.
50 changes: 31 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,35 @@
Privacy & Terms plugin for Redmine
==================================
# Privacy & Terms plugin for Redmine

[![Rate at redmine.org](https://img.shields.io/badge/rate%20at-redmine.org-blue.svg?style=fla)](https://www.redmine.org/plugins/redmine_privacy_terms) [![Tests](https://github.com/AlphaNodes/redmine_privacy_terms/workflows/Tests/badge.svg)](https://github.com/AlphaNodes/redmine_privacy_terms/actions?query=workflow%3A"Run+Tests) ![Run Linters](https://github.com/AlphaNodes/redmine_privacy_terms/workflows/Run%20Linters/badge.svg)

Features
--------
## Features

* Adds https://cookieconsent.insites.com/ support (cookie agreement)
* Add terms support, which each user has to accept before using Redmine
* Add privacy and security [inspectors](https://github.com/alphanodes/redmine_privacy_terms/blob/master/INSPECTORS.md)
* multilingual support
* API support (if terms are required, API call throw forbitten till user accept terms)

Requirements
------------
## Requirements

* Redmine version >= 5.0
* Redmine Plugin: [additionals](https://github.com/alphanodes/additionals)
* Ruby version >= 2.7
* Ruby version >= 3.0

Installation
------------
## Installation

Install ``redmine_privacy_terms`` plugin for `Redmine`

cd $REDMINE_ROOT
git clone git://github.com/alphanodes/redmine_privacy_terms.git plugins/redmine_privacy_terms
git clone git://github.com/alphanodes/additionals.git plugins/additionals
bundle install --without development test
bundle config set --local without 'development test'
bundle install
bundle exec rake redmine:plugins:migrate RAILS_ENV=production

Restart Redmine (application server) and you should see the plugin show up in the Plugins page.

Usage
-----
## Usage

1. First of all, add a wiki page for the terms and a wiki page with information for those users who reject the agreement.
Don't forget to add the macros on the wiki page with the terms which implement the "accept" and "reject" buttons: {{terms_accept}} | {{terms_reject}}
Expand All @@ -47,9 +43,7 @@ E.g. "my_terms" (used as default), my_terms_de, my_terms_it, etc.

If you did not specify wiki pages or projects, terms are not activated. Even if you assing a non-existing wiki page, terms are not activated. If all settings are correct, you'll find a "show" link behind the wiki page text field.


Configuration
-------------
## Configuration

### Plugin settings

Expand All @@ -65,8 +59,7 @@ The "Inspect" section displays information on possible data protection problems

There is a new permission "Show terms condition" available. Members with this permission can see the terms conditions of other users. A user can always see its own terms condition at his profile (if terms are activated).

Available macros
----------------
## Available macros

### terms_accept

Expand All @@ -80,8 +73,7 @@ You can use title parameter, to overwrite button text. Eg. {{terms_reject(title=

For multilange support use title_de, title_es, etc..

Uninstall
---------
## Uninstall

Uninstall ``redmine_privacy_terms``

Expand All @@ -90,3 +82,23 @@ Uninstall ``redmine_privacy_terms``
rm -rf plugins/redmine_privacy_terms public/plugin_assets/redmine_privacy_terms

Restart Redmine (application server)

## License

This plugin is licensed under the terms of GNU/GPL v2.
See [LICENSE](LICENSE) for details.

## Redmine Copyright

The redmine_hedgedoc is a plugin extension for Redmine Project Management Software, whose Copyright follows.
Copyright (C) 2006- Jean-Philippe Lang

Redmine is a flexible project management web application written using Ruby on Rails framework.
More details can be found in the doc directory or on the official website <http://www.redmine.org>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
4 changes: 2 additions & 2 deletions app/controllers/terms_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def reject
def reset
User.update_all accept_terms_at: nil
Setting.plugin_redmine_privacy_terms = RedminePrivacyTerms.send(:settings).merge last_terms_reset: Time.now.utc.to_s
flash[:notice] = l :notice_terms_reset_successfully
flash[:notice] = flash_msg :notice_terms_reset_successfully
redirect_to plugin_settings_path(id: 'redmine_privacy_terms', tab: 'tools')
end

Expand All @@ -28,7 +28,7 @@ def check_terms_active
if RedminePrivacyTerms.setting? :enable_terms
true
else
flash[:warning] = l :notice_terms_accepted_not_saved
flash[:warning] = flash_msg :notice_terms_accepted_not_saved
redirect_to home_url
end
end
Expand Down
22 changes: 5 additions & 17 deletions test/unit/i18n_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,10 @@ def test_valid_languages
end

def test_locales_validness
lang_files_count = Rails.root.glob('plugins/redmine_privacy_terms/config/locales/*.yml').size

assert_equal 2, lang_files_count

valid_languages.each do |lang|
assert set_language_if_valid(lang)
case lang.to_s
when 'en'

assert_equal 'Result', l(:field_privacy_terms_result)
when 'de'

assert_not l(:field_privacy_terms_result) == 'Result', lang
end
end

set_language_if_valid 'en'
assert_locales_validness plugin: 'redmine_privacy_terms',
file_cnt: 2,
locales: %w[de],
control_string: :field_privacy_terms_result,
control_english: 'Result'
end
end

0 comments on commit 8e072a6

Please sign in to comment.