├── .coveralls.yml ├── .devcontainer ├── Dockerfile ├── create-db-user.sql ├── devcontainer.json ├── docker-compose.yml ├── plugin_generator.sh ├── post-create.sh └── redmine.code-workspace ├── .github └── workflows │ ├── build.yml │ └── release.yml ├── .gitignore ├── .gitpod.yml ├── .gitpod ├── database.yml ├── gitpod.code-workspace ├── ignore ├── launch.json ├── setup.sh └── start.sh ├── .hgeol ├── .hgignore ├── GPL.txt ├── Gemfile_for_test ├── README.md ├── app ├── controllers │ ├── wiki_extensions_controller.rb │ └── wiki_extensions_settings_controller.rb ├── models │ ├── wiki_extensions_comment.rb │ ├── wiki_extensions_comments_mailer.rb │ ├── wiki_extensions_count.rb │ ├── wiki_extensions_menu.rb │ ├── wiki_extensions_setting.rb │ ├── wiki_extensions_tag.rb │ ├── wiki_extensions_tag_relation.rb │ └── wiki_extensions_vote.rb └── views │ ├── wiki_extensions │ ├── _body_bottom.html.erb │ ├── _comment_form.html.erb │ ├── _comment_form.mobile.erb │ ├── _comment_form.pdf.erb │ ├── _html_header.html.erb │ ├── _new_page_macro.html.erb │ ├── _tags_form.html.erb │ └── tag.html.erb │ ├── wiki_extensions_comments_mailer │ ├── wiki_commented.html.erb │ └── wiki_commented.text.erb │ └── wiki_extensions_settings │ ├── _menu.html.erb │ └── _show.html.erb ├── assets ├── images │ ├── add.png │ ├── biggrin.png │ ├── check.png │ ├── empty.gif │ ├── main_smile.png │ ├── minus.gif │ ├── plus.gif │ ├── sad.png │ ├── smile.png │ ├── tongue.png │ ├── warning.png │ ├── wink.png │ └── x_mark.png ├── javascripts │ ├── jquery.tablesorter.js │ ├── wiki_extensions.js │ └── wiki_smiles.js └── stylesheets │ ├── wiki_extensions.css │ ├── wiki_extensions_print.css │ └── wiki_smiles.css ├── build-scripts ├── build.sh ├── cleanup.sh ├── database.yml ├── env.sh └── install.sh ├── config ├── emoticons.yml ├── locales │ ├── de.yml │ ├── en.yml │ ├── es.yml │ ├── fr.yml │ ├── it.yml │ ├── ja.yml │ ├── ko.yml │ ├── no.yml │ ├── pl.yml │ ├── pt-BR.yml │ ├── pt.yml │ ├── ru.yml │ ├── sv.yml │ └── zh.yml └── routes.rb ├── db └── migrate │ ├── 0001_create_wiki_extensions_comments.rb │ ├── 0002_create_wiki_extensions_tags.rb │ ├── 0003_create_wiki_extensions_tag_relations.rb │ ├── 0004_create_wiki_extensions_project_settings.rb │ ├── 0005_create_wiki_extensions_project_menus.rb │ ├── 0006_rename_wiki_extensions_tables.rb │ ├── 0007_create_wiki_extensions_counts.rb │ ├── 0008_add_auto_preview.rb │ ├── 0009_add_parent_id.rb │ ├── 0010_add_disable_sidebar.rb │ ├── 0011_remove_disable_sidebar.rb │ ├── 0012_create_wiki_extensions_votes.rb │ └── 0013_add_disable_tags.rb ├── init.rb ├── lib ├── wiki_extensions_application_hooks.rb ├── wiki_extensions_comments.rb ├── wiki_extensions_count_macro.rb ├── wiki_extensions_div_macro.rb ├── wiki_extensions_emoticons.rb ├── wiki_extensions_footnote.rb ├── wiki_extensions_formatter_patch.rb ├── wiki_extensions_helper.rb ├── wiki_extensions_helper_patch.rb ├── wiki_extensions_iframe_macro.rb ├── wiki_extensions_lastupdated_at_macro.rb ├── wiki_extensions_lastupdated_by_macro.rb ├── wiki_extensions_new_macro.rb ├── wiki_extensions_new_page_macro.rb ├── wiki_extensions_notifiable_patch.rb ├── wiki_extensions_page_break_macro.rb ├── wiki_extensions_project_macro.rb ├── wiki_extensions_projects_helper_patch.rb ├── wiki_extensions_recent_macro.rb ├── wiki_extensions_taggedpages_macro.rb ├── wiki_extensions_tags_macro.rb ├── wiki_extensions_twitter_macro.rb ├── wiki_extensions_util.rb ├── wiki_extensions_vote_macro.rb ├── wiki_extensions_wiki_controller_patch.rb ├── wiki_extensions_wiki_macro.rb └── wiki_extensions_wiki_page_patch.rb └── test ├── fixtures ├── wiki_extensions_comments.yml ├── wiki_extensions_counts.yml ├── wiki_extensions_menus.yml ├── wiki_extensions_settings.yml ├── wiki_extensions_tag_relations.yml ├── wiki_extensions_tags.yml └── wiki_extensions_votes.yml ├── functional ├── wiki_controller_test.rb ├── wiki_extensions_controller_test.rb └── wiki_extensions_settings_controller_test.rb ├── test_helper.rb ├── test_runner.rb └── unit ├── emoticons_test.rb ├── wiki_extensions_comment_test.rb ├── wiki_extensions_count_test.rb ├── wiki_extensions_menu_test.rb ├── wiki_extensions_setting_test.rb ├── wiki_extensions_tag_relation_test.rb ├── wiki_extensions_tag_test.rb └── wiki_extensions_vote_test.rb /.coveralls.yml: -------------------------------------------------------------------------------- 1 | service_name: travis-ci -------------------------------------------------------------------------------- /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG RUBY_VERSION=3.2 2 | ARG REDMINE_VERSION=master 3 | FROM haru/redmine_devcontainer:${REDMINE_VERSION}-ruby${RUBY_VERSION} 4 | COPY .devcontainer/post-create.sh /post-create.sh 5 | 6 | 7 | -------------------------------------------------------------------------------- /.devcontainer/create-db-user.sql: -------------------------------------------------------------------------------- 1 | CREATE USER vscode CREATEDB; 2 | CREATE DATABASE vscode WITH OWNER vscode; 3 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // Redmine plugin boilerplate 2 | // version: 1.0.0 3 | { 4 | "name": "Redmine plugin", 5 | "dockerComposeFile": "docker-compose.yml", 6 | "service": "app", 7 | 8 | "mounts": [ 9 | "source=${localWorkspaceFolder},target=/workspaces/${localWorkspaceFolderBasename},type=bind" 10 | ], 11 | "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", 12 | 13 | // Set *default* container specific settings.json values on container create. 14 | "settings": { 15 | "sqltools.connections": [ 16 | { 17 | "name": "Rails Development Database", 18 | "driver": "PostgreSQL", 19 | "previewLimit": 50, 20 | "server": "localhost", 21 | "port": 5432, 22 | 23 | // update this to match config/database.yml 24 | "database": "app_development", 25 | "username": "vscode" 26 | }, 27 | { 28 | "name": "Rails Test Database", 29 | "driver": "PostgreSQL", 30 | "previewLimit": 50, 31 | "server": "localhost", 32 | "port": 5432, 33 | 34 | // update this to match config/database.yml 35 | "database": "app_test", 36 | "username": "vscode" 37 | } 38 | ] 39 | }, 40 | 41 | // Add the IDs of extensions you want installed when the container is created. 42 | "extensions": [ 43 | "mtxr.sqltools", 44 | "mtxr.sqltools-driver-pg", 45 | "craigmaslowski.erb", 46 | "hridoy.rails-snippets", 47 | "misogi.ruby-rubocop", 48 | "jnbt.vscode-rufo", 49 | "donjayamanne.git-extension-pack", 50 | "ms-azuretools.vscode-docker", 51 | "KoichiSasada.vscode-rdbg", 52 | "Serhioromano.vscode-gitflow", 53 | "github.vscode-github-actions", 54 | "Shopify.ruby-extensions-pack", 55 | "ritwickdey.LiveServer" 56 | ], 57 | 58 | // Use 'forwardPorts' to make a list of ports inside the container available locally. 59 | // "forwardPorts": [3000, 5432], 60 | 61 | // Use 'postCreateCommand' to run commands after the container is created. 62 | "postCreateCommand": "sh -x /post-create.sh", 63 | 64 | // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. 65 | "remoteUser": "vscode", 66 | "features": { 67 | // "git": "latest" 68 | }, 69 | 70 | "containerEnv": { 71 | "PLUGIN_NAME": "${localWorkspaceFolderBasename}" 72 | }, 73 | 74 | "forwardPorts": [3000] 75 | } -------------------------------------------------------------------------------- /.devcontainer/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | app: 5 | build: 6 | context: .. 7 | dockerfile: .devcontainer/Dockerfile 8 | args: 9 | # Update 'VARIANT' to pick a version of Ruby: 3, 3.0, 2, 2.7, 2.6 10 | # Append -bullseye or -buster to pin to an OS version. 11 | # Use -bullseye variants on local arm64/Apple Silicon. 12 | RUBY_VERSION: "3.2" 13 | # Optional Node.js version to install 14 | NODE_VERSION: "lts/*" 15 | REDMINE_VERSION: "6.0-stable" 16 | 17 | # Overrides default command so things don't shut down after the process ends. 18 | command: sleep infinity 19 | 20 | # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function. 21 | # network_mode: service:postgres 22 | # Uncomment the next line to use a non-root user for all processes. 23 | # user: vscode 24 | 25 | # Use "forwardPorts" in **devcontainer.json** to forward an app port locally. 26 | # (Adding the "ports" property to this file will not forward from a Codespace.) 27 | 28 | postgres: 29 | image: postgres:latest 30 | restart: unless-stopped 31 | volumes: 32 | - postgres-data:/var/lib/postgresql/data 33 | - ./create-db-user.sql:/docker-entrypoint-initdb.d/create-db-user.sql 34 | environment: 35 | POSTGRES_USER: postgres 36 | POSTGRES_DB: redmine 37 | POSTGRES_PASSWORD: postgres 38 | # Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally. 39 | # (Adding the "ports" property to this file will not forward from a Codespace.) 40 | 41 | mysql: 42 | image: mysql:latest 43 | restart: unless-stopped 44 | volumes: 45 | - mysql-data:/var/lib/mysql 46 | # network_mode: service:postgres 47 | command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci 48 | environment: 49 | MYSQL_ROOT_PASSWORD: root 50 | MYSQL_USER: redmine 51 | MYSQL_DB: redmine 52 | MYSQL_PASSWORD: remine 53 | volumes: 54 | postgres-data: null 55 | mysql-data: null 56 | -------------------------------------------------------------------------------- /.devcontainer/plugin_generator.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | cd `dirname $0` 5 | cd .. 6 | BASEDIR=`pwd` 7 | PLUGIN_NAME=`basename $BASEDIR` 8 | echo $PLUGIN_NAME 9 | 10 | cd $REDMINE_ROOT 11 | 12 | export RAILS_ENV="production" 13 | 14 | bundle exec rails generate redmine_plugin $PLUGIN_NAME -------------------------------------------------------------------------------- /.devcontainer/post-create.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd $REDMINE_ROOT 3 | 4 | if [ -d .git.sv ] 5 | then 6 | mv -s .git.sv .git 7 | git pull 8 | rm .git 9 | fi 10 | 11 | ln -s /workspaces/${PLUGIN_NAME} plugins/${PLUGIN_NAME} 12 | if [ -f plugins/${PLUGIN_NAME}/Gemfile_for_test ] 13 | then 14 | cp plugins/${PLUGIN_NAME}/Gemfile_for_test plugins/${PLUGIN_NAME}/Gemfile 15 | fi 16 | 17 | 18 | bundle install 19 | 20 | initdb() { 21 | bundle exec rake db:create 22 | bundle exec rake db:migrate 23 | bundle exec rake redmine:plugins:migrate 24 | 25 | bundle exec rake db:drop RAILS_ENV=test 26 | bundle exec rake db:create RAILS_ENV=test 27 | bundle exec rake db:migrate RAILS_ENV=test 28 | bundle exec rake redmine:plugins:migrate RAILS_ENV=test 29 | } 30 | 31 | initdb 32 | 33 | export DB=mysql2 34 | export DB_NAME=redmine 35 | export DB_USERNAME=root 36 | export DB_PASSWORD=root 37 | export DB_HOST=mysql 38 | export DB_PORT=3306 39 | 40 | initdb 41 | 42 | export DB=postgresql 43 | export DB_NAME=redmine 44 | export DB_USERNAME=postgres 45 | export DB_PASSWORD=postgres 46 | export DB_HOST=postgres 47 | export DB_PORT=5432 48 | 49 | initdb -------------------------------------------------------------------------------- /.devcontainer/redmine.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": ".." 5 | }, 6 | { 7 | "path": "../../../usr/local/redmine" 8 | } 9 | ], 10 | "settings": {} 11 | } -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | on: 3 | push: 4 | pull_request: 5 | env: 6 | SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | strategy: 11 | matrix: 12 | db: [sqlite3, mysql, postgres] 13 | ruby_version: ["3.1", "3.2", "3.3"] 14 | redmine_version: [6.0-stable, master] 15 | services: 16 | mysql: 17 | image: mysql:5.7 18 | options: --health-cmd "mysqladmin ping -h localhost" --health-interval 20s --health-timeout 10s --health-retries 10 19 | env: 20 | MYSQL_ROOT_PASSWORD: dbpassword 21 | postgres: 22 | image: postgres 23 | env: 24 | POSTGRES_USER: root 25 | POSTGRES_PASSWORD: dbpassword 26 | options: >- 27 | --health-cmd pg_isready 28 | --health-interval 10s 29 | --health-timeout 5s 30 | --health-retries 5 31 | container: 32 | image: ruby:${{ matrix.ruby_version }} 33 | env: 34 | DB: ${{ matrix.db }} 35 | DB_USERNAME: root 36 | DB_PASSWORD: dbpassword 37 | DB_HOST: ${{ matrix.db }} 38 | REDMINE_VER: ${{ matrix.redmine_version }} 39 | steps: 40 | - uses: actions/checkout@v4 41 | - name: Install 42 | run: bash -x ./build-scripts/install.sh 43 | - name: Build 44 | run: bash -x ./build-scripts/build.sh 45 | - name: Clean 46 | run: bash -x ./build-scripts/cleanup.sh 47 | - uses: codecov/codecov-action@v5 48 | with: 49 | token: ${{ secrets.CODECOV_TOKEN }} 50 | fail_ci_if_error: true 51 | - name: Slack Notification on Failure 52 | uses: rtCamp/action-slack-notify@v2.0.2 53 | if: failure() 54 | env: 55 | SLACK_CHANNEL: plugin-wiki_ext 56 | SLACK_TITLE: Test Failure 57 | SLACK_COLOR: danger 58 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: build_archive 2 | on: 3 | push: 4 | branches-ignore: 5 | - '**' 6 | tags: 7 | - '**' 8 | permissions: 9 | contents: write 10 | env: 11 | SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} 12 | jobs: 13 | archive: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Set version 17 | id: version 18 | run: | 19 | REPOSITORY=$(echo ${{ github.repository }} | sed -e "s#.*/##") 20 | VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g") 21 | echo "version=$VERSION" >> $GITHUB_ENV 22 | echo "filename=$REPOSITORY-$VERSION" >> $GITHUB_ENV 23 | echo "plugin=$REPOSITORY" >> $GITHUB_ENV 24 | - uses: actions/checkout@v4 25 | - name: Archive 26 | run: | 27 | cd ..; zip -r ${{ env.filename }}.zip ${{ env.plugin }}/ -x "*.git*"; mv ${{ env.filename }}.zip ${{ env.plugin }}/ 28 | - name: Release 29 | uses: softprops/action-gh-release@v1 30 | with: 31 | draft: true 32 | files: ${{ env.filename }}.zip -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | coverage 2 | Gemfile 3 | Gemfile.lock 4 | -------------------------------------------------------------------------------- /.gitpod.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # List the start up tasks. Learn more https://www.gitpod.io/docs/config-start-tasks/ 3 | tasks: 4 | - init: sh -x ./.gitpod/setup.sh 5 | command: pwd; sh -x /workspace/*/.gitpod/start.sh 6 | env: 7 | REDMINE_VERSION: '5.0-stable' 8 | 9 | # List the ports to expose. Learn more https://www.gitpod.io/docs/config-ports/ 10 | ports: 11 | - port: 3000 12 | onOpen: open-browser 13 | 14 | workspaceLocation: "./redmine" 15 | 16 | vscode: 17 | extensions: 18 | - bung87.rails 19 | - rebornix.ruby 20 | - aliariff.vscode-erb-beautify 21 | - mbessey.vscode-rufo 22 | -------------------------------------------------------------------------------- /.gitpod/database.yml: -------------------------------------------------------------------------------- 1 | # Default setup is given for MySQL 5.7.7 or later. 2 | # Examples for PostgreSQL, SQLite3 and SQL Server can be found at the end. 3 | # Line indentation must be 2 spaces (no tabs). 4 | 5 | production: 6 | adapter: sqlite3 7 | database: db/redmine.sqlite3 8 | 9 | development: 10 | adapter: sqlite3 11 | database: db/redmine_dev.sqlite3 12 | 13 | # Warning: The database defined as "test" will be erased and 14 | # re-generated from your development database when you run "rake". 15 | # Do not set this db to the same as development or production. 16 | test: 17 | adapter: sqlite3 18 | database: db/redmine_test.sqlite3 19 | 20 | -------------------------------------------------------------------------------- /.gitpod/gitpod.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | }, 6 | { 7 | "path": "../__PLUGIN__NAME" 8 | } 9 | ], 10 | "settings": {} 11 | } -------------------------------------------------------------------------------- /.gitpod/ignore: -------------------------------------------------------------------------------- 1 | .vscode/launch.json 2 | /gitpod.code-workspace 3 | -------------------------------------------------------------------------------- /.gitpod/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | 8 | 9 | { 10 | "name": "Rails server", 11 | "type": "Ruby", 12 | "request": "launch", 13 | "program": "${workspaceRoot}/bin/rails", 14 | "args": [ 15 | "server" 16 | ], 17 | "useBundler": true 18 | }, 19 | { 20 | "name": "Plugin test", 21 | "type": "Ruby", 22 | "request": "launch", 23 | "program": "${workspaceRoot}/bin/rake", 24 | "args": [ 25 | "redmine:plugins:test" 26 | ], 27 | "env": { 28 | "RAILS_ENV": "test" 29 | }, 30 | "useBundler": true 31 | } 32 | ] 33 | } -------------------------------------------------------------------------------- /.gitpod/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd $(dirname "$0") || exit 3 | GITPODDIR=$(pwd) 4 | IGNOREDIR="$HOME"/.config/git 5 | mkdir -p "$IGNOREDIR" 6 | cp "$GITPODDIR"/ignore "$IGNOREDIR" 7 | cd .. 8 | BASEDIR=$(pwd) 9 | 10 | if [ -f Gemfile_for_test ]; then 11 | cp Gemfile_for_test Gemfile 12 | fi 13 | cd .. 14 | REDMINEDIR=$(pwd)/redmine 15 | if [ ! -d redmine ]; then 16 | git clone https://github.com/redmine/redmine.git -b "$REDMINE_VERSION" 17 | cd redmine || exit 18 | mv .git .git.org 19 | cd "$REDMINEDIR"/plugins || exit 20 | ln -s "$BASEDIR" . 21 | cp "$GITPODDIR"/database.yml "$REDMINEDIR"/config/ 22 | mkdir "$REDMINEDIR"/.vscode 23 | cd "$REDMINEDIR"/.vscode || exit 24 | ln -s "$GITPODDIR"/launch.json . 25 | echo "gem 'ruby-debug-ide'" >> "$REDMINEDIR"/Gemfile 26 | echo "gem 'debase'" >> "$REDMINEDIR"/Gemfile 27 | sed -i 's/^end$/ config.hosts.clear\nend/' "$REDMINEDIR"/config/environments/development.rb 28 | fi 29 | 30 | 31 | -------------------------------------------------------------------------------- /.gitpod/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | REDMINEDIR=/workspace/redmine 4 | cd $(dirname "$0") || exit 5 | GITPODDIR=$(pwd) 6 | cd .. 7 | BASEDIR=$(pwd) 8 | PLUGIN_NAME=$(basename "$BASEDIR") 9 | 10 | cd "$REDMINEDIR" || exit 11 | sed "s/__PLUGIN__NAME/$PLUGIN_NAME/" "$GITPODDIR"/gitpod.code-workspace > "$REDMINEDIR"/gitpod.code-workspace 12 | gem install ruby-debug-ide 13 | bundle install --path vendor/bundle 14 | bundle exec rake db:migrate 15 | bundle exec rake redmine:plugins:migrate 16 | bundle exec rake db:migrate RAILS_ENV=test 17 | bundle exec rake redmine:plugins:migrate RAILS_ENV=test -------------------------------------------------------------------------------- /.hgeol: -------------------------------------------------------------------------------- 1 | [patterns] 2 | **.* = NATIVE 3 | -------------------------------------------------------------------------------- /.hgignore: -------------------------------------------------------------------------------- 1 | ^coverage/ 2 | ^rails/ 3 | ^VERSION$ 4 | ^pkg/ 5 | ^Gemfile.lock$ 6 | syntax: glob 7 | test/coverage 8 | *.orig 9 | Gemfile -------------------------------------------------------------------------------- /Gemfile_for_test: -------------------------------------------------------------------------------- 1 | 2 | group :test do 3 | # gem 'factory_girl_rails' 4 | #gem 'shoulda-matchers' 5 | gem 'shoulda' 6 | gem 'simplecov-lcov', :require => false 7 | end 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![build](https://github.com/haru/redmine_wiki_extensions/actions/workflows/build.yml/badge.svg)](https://github.com/haru/redmine_wiki_extensions/actions/workflows/build.yml) 2 | [![Maintainability](https://api.codeclimate.com/v1/badges/35932ef513dece9c304c/maintainability)](https://codeclimate.com/github/haru/redmine_wiki_extensions/maintainability) 3 | [![codecov](https://codecov.io/gh/haru/redmine_wiki_extensions/branch/develop/graph/badge.svg?token=8WUARY4BRK)](https://codecov.io/gh/haru/redmine_wiki_extensions) 4 | 5 | # Redmine Wiki Extensions Plugin 6 | 7 | Wiki Extensions is a plugin which adds several useful wiki macros to Redmine. 8 | 9 | https://www.r-labs.org/projects/r-labs/wiki/Wiki_Extensions_en 10 | 11 | ## Plugin installation 12 | 13 | 1. Copy the plugin directory into the plugins directory 14 | 15 | 2. Migrate plugin: 16 | rake redmine:plugins:migrate RAILS_ENV=production 17 | 18 | 3. Start Redmine 19 | 20 | 4. Add wiki extensions module into your project. 21 | 22 | ## Note 23 | 24 | This plugin works only on production mode. 25 | 26 | ## Language contributors 27 | 28 | * ru.yml - Dim A 29 | * fr.yml - Pascal Menut 30 | * de.yml - Albrecht Backhaus 31 | * it.yml - earcar 32 | * sv.yml - Henrik Jönsson 33 | * es.yml - Francisco Benítez León 34 | * no.yml - Thomas Nygreen 35 | * pt.yml - Marcelo Fernandes 36 | * pt-BR.yml - Marcelo Fernandes 37 | * pl.yml - Łukasz Rymarczyk 38 | * zh.yml - Tim lin, Steven Wong 39 | -------------------------------------------------------------------------------- /app/controllers/wiki_extensions_controller.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2009-2024 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | class WikiExtensionsController < ApplicationController 19 | menu_item :wiki 20 | before_action :find_project, :find_user 21 | before_action :authorize, except: [:stylesheet, :emoticon] 22 | 23 | def add_comment 24 | comment = WikiExtensionsComment.new 25 | comment.wiki_page_id = params[:wiki_page_id].to_i 26 | comment.user_id = @user.id 27 | comment.comment = params[:comment] 28 | comment.save 29 | page = WikiPage.find(comment.wiki_page_id) 30 | # Send email-notification to watchers of wiki page 31 | WikiExtensionsCommentsMailer.deliver_wiki_commented(comment, page) if Setting.notified_events.include? "wiki_comment_added" 32 | redirect_to :controller => "wiki", :action => "show", :project_id => @project, :id => page.title 33 | end 34 | 35 | def reply_comment 36 | comment = WikiExtensionsComment.new 37 | comment.parent_id = params[:comment_id].to_i 38 | comment.wiki_page_id = params[:wiki_page_id].to_i 39 | comment.user_id = @user.id 40 | comment.comment = params[:reply] 41 | comment.save 42 | page = WikiPage.find(comment.wiki_page_id) 43 | # Send email-notification to watchers of wiki page 44 | WikiExtensionsCommentsMailer.deliver_wiki_commented(comment, page) if Setting.notified_events.include? "wiki_comment_added" 45 | redirect_to :controller => "wiki", :action => "show", :project_id => @project, :id => page.title 46 | end 47 | 48 | def tag 49 | tag_id = params[:tag_id].to_i 50 | @tag = WikiExtensionsTag.find(tag_id) 51 | end 52 | 53 | def forward_wiki_page 54 | menu_id = params[:menu_id].to_i 55 | menu = WikiExtensionsMenu.find_or_create(@project.id, menu_id) 56 | redirect_to :controller => "wiki", :action => "show", :project_id => @project, :id => menu.page_name 57 | end 58 | 59 | def destroy_comment 60 | comment_id = params[:comment_id].to_i 61 | comment = WikiExtensionsComment.find(comment_id) 62 | unless User.current.admin or User.current.id == comment.user.id 63 | render_403 64 | return false 65 | end 66 | 67 | page = WikiPage.find(comment.wiki_page_id) 68 | comment.destroy 69 | redirect_to :controller => "wiki", :action => "show", :project_id => @project, :id => page.title 70 | end 71 | 72 | def update_comment 73 | comment_id = params[:comment_id].to_i 74 | comment = WikiExtensionsComment.find(comment_id) 75 | unless User.current.admin or User.current.id == comment.user.id 76 | render_403 77 | return false 78 | end 79 | 80 | page = WikiPage.find(comment.wiki_page_id) 81 | comment.comment = params[:comment] 82 | comment.save 83 | redirect_to :controller => "wiki", :action => "show", :project_id => @project, :id => page.title 84 | end 85 | 86 | def vote 87 | target_class_name = params[:target_class_name] 88 | target_id = params[:target_id].to_i 89 | key = params[:key] 90 | vote = WikiExtensionsVote.find_or_create(target_class_name, target_id, key) 91 | session[:wiki_extension_voted] = Hash.new unless session[:wiki_extension_voted] 92 | unless session[:wiki_extension_voted][vote.id] 93 | vote.countup 94 | vote.save! 95 | session[:wiki_extension_voted][vote.id] = 1 96 | end 97 | 98 | render :inline => " #{vote.count}" 99 | end 100 | 101 | def stylesheet 102 | stylesheet = WikiPage.find_by(wiki_id: @project.wiki.id, title: "StyleSheet") 103 | unless stylesheet 104 | render_404 105 | return 106 | end 107 | 108 | unless stylesheet.visible? 109 | render_403 110 | return 111 | end 112 | render plain: stylesheet.content.text, content_type: "text/css" 113 | end 114 | 115 | def emoticon 116 | icon_name = params[:icon_name] 117 | icon_name += ".#{params[:format]}" if params[:format].present? 118 | directory = File.expand_path(File.dirname(__FILE__) + "/../../assets/images/") 119 | icon_path = File.join(directory, icon_name) 120 | # icon_pathが示すPNGファイルのバイナリデータをクライアントに返す 121 | if File.exist?(icon_path) 122 | send_file icon_path, type: "image/png", disposition: "inline" 123 | else 124 | render_404 125 | end 126 | end 127 | 128 | private 129 | 130 | def find_project 131 | # @project variable must be set before calling the authorize filter 132 | @project = Project.find(params[:id]) unless params[:id].blank? 133 | end 134 | 135 | def find_user 136 | @user = User.current 137 | end 138 | end 139 | -------------------------------------------------------------------------------- /app/controllers/wiki_extensions_settings_controller.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2009-2024 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | class WikiExtensionsSettingsController < ApplicationController 19 | layout 'base' 20 | 21 | before_action :find_project, :authorize, :find_user 22 | 23 | def update 24 | menus = params[:menus] 25 | 26 | setting = WikiExtensionsSetting.find_or_create @project.id 27 | begin 28 | setting.transaction do 29 | menus.each_pair {|menu_no, menu| 30 | menu_setting = WikiExtensionsMenu.find_or_create(@project.id, menu[:menu_no].to_i) 31 | menu_setting.enabled = false 32 | menu_setting.attributes = menu.permit(:enabled, :menu_no, :title, :page_name) 33 | menu_setting.save! 34 | } 35 | end 36 | flash[:notice] = l(:notice_successful_update) 37 | rescue => e 38 | flash[:error] = "Updating failed." + e.message 39 | throw e 40 | end 41 | 42 | redirect_to :controller => 'projects', :action => "settings", :id => @project, :tab => 'wiki_extensions' 43 | end 44 | 45 | private 46 | def find_project 47 | # @project variable must be set before calling the authorize filter 48 | @project = Project.find(params[:id]) 49 | end 50 | 51 | def find_user 52 | @user = User.current 53 | end 54 | end 55 | -------------------------------------------------------------------------------- /app/models/wiki_extensions_comment.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2009-2024 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | class WikiExtensionsComment < ApplicationRecord 18 | belongs_to :user 19 | belongs_to :wiki_page 20 | validates_presence_of :comment, :wiki_page_id, :user_id 21 | 22 | def children(comments) 23 | comments.select { |comment| comment.parent_id == id } 24 | end 25 | 26 | def project 27 | wiki_page.wiki.project 28 | end 29 | 30 | acts_as_event :title => Proc.new { |o| "Wiki comment: #{o.wiki_page.title}" }, 31 | :author => :user, 32 | :description => :comment, 33 | :datetime => :updated_at, 34 | :url => Proc.new { |o| {:controller => 'wiki', :action => 'show', :id => o.wiki_page.title, :project_id => o.project} } 35 | 36 | acts_as_activity_provider :type => 'wiki_comment', 37 | :permission => :view_wiki_edits, 38 | :timestamp => "updated_at", 39 | :author_key => "user_id", 40 | :scope => select("#{WikiExtensionsComment.table_name}.updated_at, #{WikiExtensionsComment.table_name}.comment, #{WikiExtensionsComment.table_name}.user_id, #{WikiExtensionsComment.table_name}.wiki_page_id") 41 | .joins("LEFT JOIN #{WikiPage.table_name} ON #{WikiPage.table_name}.id = #{WikiExtensionsComment.table_name}.wiki_page_id " + 42 | "LEFT JOIN #{Wiki.table_name} ON #{Wiki.table_name}.id = #{WikiPage.table_name}.wiki_id " + 43 | "LEFT JOIN #{Project.table_name} ON #{Project.table_name}.id = #{Wiki.table_name}.project_id") 44 | 45 | #:find_options => {:include => {:wiki_page => {:wiki => :project}}} 46 | 47 | end 48 | -------------------------------------------------------------------------------- /app/models/wiki_extensions_comments_mailer.rb: -------------------------------------------------------------------------------- 1 | require 'mailer' 2 | 3 | class WikiExtensionsCommentsMailer < Mailer 4 | def self.deliver_wiki_commented(comment, wiki_page) 5 | # Send notification to watchers and author of wiki page 6 | users = wiki_page.watchers.collect { |watcher|watcher.user} | wiki_page.content.notified_users 7 | users.each do |user| 8 | wiki_commented(user, comment, wiki_page).deliver_now 9 | end 10 | end 11 | 12 | def wiki_commented(user, comment, wiki_page) 13 | project = wiki_page.project 14 | author = comment.user 15 | text = comment.comment 16 | redmine_headers 'Project' => project, 17 | 'Wiki-Page-Id' => wiki_page.id, 18 | 'Author' => author 19 | message_id wiki_page 20 | 21 | subject = "[#{project.name} - Wiki - #{wiki_page.title}] commented" 22 | 23 | @project = project 24 | @author = author 25 | @text = text 26 | @wiki_page_title = wiki_page.title 27 | @wiki_page_url = url_for(:controller => 'wiki', :action => 'show', :project_id => project, :id => wiki_page.title) 28 | 29 | mail :to => user, 30 | :subject => subject 31 | 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /app/models/wiki_extensions_count.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2009-2024 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | class WikiExtensionsCount < ApplicationRecord 18 | belongs_to :project 19 | belongs_to :page, :foreign_key => :page_id, :class_name => 'WikiPage' 20 | validates_presence_of :project 21 | validates_presence_of :page 22 | validates_presence_of :date 23 | validates_presence_of :count 24 | validates_uniqueness_of :page_id, :scope => :date 25 | 26 | def self.countup(wiki_page_id, date = nil) 27 | date = Date.today unless date 28 | count = WikiExtensionsCount.where(:date => date).where(:page_id => wiki_page_id).first 29 | unless count 30 | page = WikiPage.find(wiki_page_id) 31 | count = WikiExtensionsCount.new 32 | count.project = page.wiki.project 33 | count.page = page 34 | count.date = date 35 | count.count = 0 36 | end 37 | count.count = count.count + 1 38 | count.save! 39 | end 40 | 41 | def self.access_count(wiki_page_id, date = nil) 42 | conditions = ['page_id = ?', wiki_page_id] unless date 43 | conditions = ['date >= ? and page_id = ?', date, wiki_page_id] if date 44 | #total = WikiExtensionsCount.sum(:count, :conditions => conditions) 45 | WikiExtensionsCount.where(conditions).sum(:count) 46 | end 47 | 48 | def self.popularity(project_id, term = 0) 49 | conditions = ['project_id = ?', project_id] if term == 0 50 | conditions = ['project_id = ? and date > ?', project_id, Date.today - term.to_i] if term > 0 51 | WikiExtensionsCount.where(conditions).group(:page_id).sum(:count).to_a.sort_by{|x|0 - x[1]}.map{|x| [x[0], x[1].to_i]} 52 | end 53 | end 54 | -------------------------------------------------------------------------------- /app/models/wiki_extensions_menu.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2024 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | class WikiExtensionsMenu < ApplicationRecord 18 | include Redmine::SafeAttributes 19 | belongs_to :project 20 | validates_presence_of :project_id 21 | validates_presence_of :menu_no 22 | 23 | #attr_accessible 'enabled', 'menu_no', 'title', 'page_name' 24 | 25 | def self.find_or_create(pj_id, no) 26 | menu = WikiExtensionsMenu.where(:project_id => pj_id).where(:menu_no => no).first 27 | unless menu 28 | menu = WikiExtensionsMenu.new 29 | menu.project_id = pj_id 30 | menu.menu_no = no 31 | menu.enabled = false 32 | menu.save! 33 | end 34 | return menu 35 | end 36 | 37 | def self.enabled?(pj_id, no) 38 | begin 39 | menu = find_or_create(pj_id, no) 40 | return false if menu.page_name.blank? 41 | menu.enabled 42 | rescue 43 | return false 44 | end 45 | end 46 | 47 | def self.title(pj_id, no) 48 | begin 49 | menu = find_or_create(pj_id, no) 50 | return menu.title unless menu.title.blank? 51 | return menu.page_name unless menu.page_name.blank? 52 | return nil 53 | rescue 54 | return nil 55 | end 56 | end 57 | 58 | def validate 59 | return true unless enabled 60 | #errors.add("title", "is empty") unless attribute_present?("title") 61 | #errors.add("page_name", "is empty") unless attribute_present?("page_name") 62 | 63 | end 64 | end 65 | -------------------------------------------------------------------------------- /app/models/wiki_extensions_setting.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2011-2024 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | class WikiExtensionsSetting < ApplicationRecord 18 | belongs_to :project 19 | #attr_accessible :auto_preview_enabled, :tag_disabled 20 | 21 | def self.find_or_create(pj_id) 22 | setting = WikiExtensionsSetting.find_by(project_id: pj_id) 23 | unless setting 24 | setting = WikiExtensionsSetting.new 25 | setting.project_id = pj_id 26 | setting.save! 27 | end 28 | 5.times do |i| 29 | WikiExtensionsMenu.find_or_create(pj_id, i + 1) 30 | end 31 | return setting 32 | end 33 | 34 | def auto_preview_enabled 35 | false 36 | end 37 | 38 | def menus 39 | WikiExtensionsMenu.where(:project_id => project_id).order("menu_no") 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /app/models/wiki_extensions_tag.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2009-2024 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | class WikiExtensionsTag < ApplicationRecord 18 | #attr_accessible :name, :project_id 19 | validates_presence_of :name, :project_id 20 | validates_uniqueness_of :name, :scope => :project_id 21 | 22 | def WikiExtensionsTag.find_or_create(project_id, name) 23 | obj = WikiExtensionsTag.find_or_create_by(name: name, project_id: project_id) 24 | end 25 | 26 | def ==(obj) 27 | return false unless self.project_id == obj.project_id 28 | return self.name == obj.name 29 | end 30 | 31 | def pages 32 | return @pages if @pages 33 | relations = WikiExtensionsTagRelation.where(:tag_id => id).all 34 | @pages = [] 35 | relations.each{|relation| 36 | @pages << relation.wiki_page 37 | } 38 | return @pages 39 | end 40 | 41 | def page_count 42 | pages.length 43 | end 44 | 45 | def <=> obj 46 | self.name <=> obj.name 47 | end 48 | end 49 | -------------------------------------------------------------------------------- /app/models/wiki_extensions_tag_relation.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2009-2024 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | class WikiExtensionsTagRelation < ApplicationRecord 18 | belongs_to :wiki_page 19 | belongs_to :tag, :class_name => 'WikiExtensionsTag', :foreign_key => :tag_id 20 | validates_presence_of :wiki_page_id, :tag_id 21 | validates_uniqueness_of :tag_id, :scope => :wiki_page_id 22 | 23 | def destroy 24 | ret = super 25 | target_tag = WikiExtensionsTag.find(tag_id) if tag_id 26 | target_tag.destroy if target_tag.page_count.zero? 27 | ret 28 | end 29 | 30 | end 31 | -------------------------------------------------------------------------------- /app/models/wiki_extensions_vote.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2024 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | class WikiExtensionsVote < ApplicationRecord 19 | validates_presence_of :target_class_name, :target_id, :keystr, :count 20 | validates_uniqueness_of :keystr, :scope => [:target_class_name, :target_id] 21 | 22 | def target 23 | return nil unless self.target_class_name 24 | return nil unless self.target_id 25 | targetclass = eval self.target_class_name 26 | targetclass.find(self.target_id) 27 | end 28 | 29 | def target=(obj) 30 | self.target_class_name = obj.class.name 31 | self.target_id = obj.id 32 | end 33 | 34 | def countup 35 | self.count = 0 unless self.count 36 | self.count = self.count + 1 37 | end 38 | 39 | def self.find_or_create(class_name, obj_id, key_str) 40 | vote = WikiExtensionsVote.where(:target_class_name => class_name).where(:target_id => obj_id).where(:keystr => key_str).first 41 | unless vote 42 | vote = WikiExtensionsVote.new 43 | vote.count = 0 44 | vote.target_class_name = class_name 45 | vote.target_id = obj_id 46 | vote.keystr = key_str 47 | end 48 | return vote 49 | end 50 | end 51 | -------------------------------------------------------------------------------- /app/views/wiki_extensions/_body_bottom.html.erb: -------------------------------------------------------------------------------- 1 | <% # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2012-2019 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | -%> 18 | 19 | <% 20 | 21 | return unless WikiExtensionsUtil.is_enabled?(project) 22 | 23 | context = {:project => project, :controller => controller, :request => request} 24 | 25 | return unless controller.class.name == 'WikiController' 26 | action_name = controller.action_name 27 | 28 | params = request.parameters if request 29 | page_name = params[:id] if params 30 | wiki = project.wiki 31 | return unless wiki 32 | page = wiki.find_page(page_name) if page_name 33 | 34 | context = {:project => project, :controller => controller, :request => request} 35 | %> 36 | 37 | <% if action_name == 'edit' or (action_name == 'show' and page_name and page == nil) %> 38 | <%= render :partial => 'wiki_extensions/tags_form', :locals => context %> 39 | 40 | 41 | <% else %> 42 | 43 | 47 | <%= raw javascript_tag('wiki_extension_create_table_header();') %> 48 | 49 | <% end %> -------------------------------------------------------------------------------- /app/views/wiki_extensions/_comment_form.html.erb: -------------------------------------------------------------------------------- 1 | <% # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2012-2013 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | -%> 18 | <% 19 | 20 | url = url_for(:controller => 'wiki_extensions', :action => 'add_comment', :id => @project) 21 | -%> 22 | 23 |
24 | <%= link_to_function(l(:label_comment_add), "$('##{div_id}').show();") %> 25 |
26 | 40 | <%= raw(wikitoolbar_for(area_id)) %> 41 | -------------------------------------------------------------------------------- /app/views/wiki_extensions/_comment_form.mobile.erb: -------------------------------------------------------------------------------- 1 | <%# 2 | # To change this template, choose Tools | Templates 3 | # and open the template in the editor. 4 | %> 5 | 6 | {{comment_form}} macro is not supported with mobile_face. 7 | -------------------------------------------------------------------------------- /app/views/wiki_extensions/_comment_form.pdf.erb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haru/redmine_wiki_extensions/8feb9bfc0e29dd1dcbc15b2dc6ad433cdba5a133/app/views/wiki_extensions/_comment_form.pdf.erb -------------------------------------------------------------------------------- /app/views/wiki_extensions/_html_header.html.erb: -------------------------------------------------------------------------------- 1 | <% # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2010-2012 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | -%> 18 | 19 | <% if WikiExtensionsUtil.is_enabled?(project) -%> 20 | <% 21 | wiki = project.wiki 22 | style_sheet = wiki.find_page('StyleSheet') if wiki 23 | baseurl = Redmine::Utils.relative_url_root 24 | -%> 25 | 26 | <% if style_sheet -%> 27 | <%= stylesheet_link_tag( wiki_extensions_stylesheet_path(@project)) %> 28 | <% end -%> 29 | 30 | 31 | <%= javascript_include_tag("jquery.tablesorter.js", plugin: "redmine_wiki_extensions") %> 32 | <%= stylesheet_link_tag("wiki_extensions.css", plugin: "redmine_wiki_extensions") %> 33 | <%= stylesheet_link_tag("wiki_extensions_print.css", plugin: "redmine_wiki_extensions", media: 'print') %> 34 | <%= javascript_include_tag("wiki_extensions.js", plugin: "redmine_wiki_extensions") %> 35 | <% end %> 36 | -------------------------------------------------------------------------------- /app/views/wiki_extensions/_new_page_macro.html.erb: -------------------------------------------------------------------------------- 1 | <% # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2011-2012 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | -%> 18 | <% if User.current.allowed_to?({:controller => 'wiki', :action => 'edit'}, @project) %> 19 | 20 | 30 | 31 | <% 32 | randnum = rand(10000) 33 | element_id = "new_page_title_#{randnum}" 34 | div_id = "newpage_form_id_#{randnum}" 35 | -%> 36 | <%= link_to_function l(:wiki_extensions_new_wiki_page), "$('##{div_id}').show('blind')" %> 37 | 43 | 44 | <% end %> -------------------------------------------------------------------------------- /app/views/wiki_extensions/_tags_form.html.erb: -------------------------------------------------------------------------------- 1 | <% # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2013-2017 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | -%> 18 | 19 | <% 20 | page = controller.wiki_extensions_get_current_page 21 | tags = page.wiki_ext_tags.sort { |a, b| a.name <=> b.name } 22 | baseurl = Redmine::Utils.relative_url_root 23 | img = baseurl + "/images/add.png" 24 | if WikiExtensionsUtil.tag_enabled? @project 25 | -%> 26 | 27 | 28 |

29 | 30 | 31 | 32 | 33 | 34 | <% 35 | i = 0 36 | maxline = 5 37 | %> 38 | <% 39 | maxline.times { |line| 40 | style = '' 41 | style = 'style="display:none;"' if line != 0 and line > (tags.length - 1) / 4 42 | %> 43 | id="<%= "tag_line_#{line.to_s}" %>"> 44 | <% 45 | 4.times { 46 | value = '' 47 | value = 'value="' + tags[i].name + '"' if tags[i] 48 | %> 49 | 50 | class="wikiext_tag_inputs"/> 52 | 53 | <% 54 | i = i + 1 55 | } 56 | 57 | nextline = line + 1 58 | %> 59 | 60 | <% if (line < maxline - 1) %> 61 | 62 | <%= image_tag(img, :onclick => raw("$('#tag_line_#{nextline.to_s}').show()")) %> 63 | 64 | <% end %> 65 | 66 |
67 | <% 68 | } 69 | %> 70 | 71 | 72 |
73 |

74 | 92 | <% end %> -------------------------------------------------------------------------------- /app/views/wiki_extensions/tag.html.erb: -------------------------------------------------------------------------------- 1 | <% # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2010-2011 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | -%> 18 | 19 | -------------------------------------------------------------------------------- /app/views/wiki_extensions_comments_mailer/wiki_commented.html.erb: -------------------------------------------------------------------------------- 1 | <%= 2 | l(:wiki_page_commented_header, :project_name => @project.name, :page_title => @wiki_page_title, :author => @author) 3 | %> 4 |
5 | <%= 6 | l(:wiki_page_commented_comment_head) 7 | %> 8 |

9 | <%= 10 | @text 11 | %> 12 |
13 | <%= 14 | l(:wiki_page_commented_url) 15 | %> 16 |
17 | <%= link_to(h(@wiki_page_url), @wiki_page_url) 18 | -%> 19 | -------------------------------------------------------------------------------- /app/views/wiki_extensions_comments_mailer/wiki_commented.text.erb: -------------------------------------------------------------------------------- 1 | <%= 2 | l(:wiki_page_commented_header, :project_name => @project.name, :page_title => @wiki_page_title, :author => @author) 3 | %> 4 | ---------------------------------------- 5 | <%= 6 | l(:wiki_page_commented_comment_head) 7 | %> 8 | 9 | <%= 10 | @text 11 | %> 12 | ---------------------------------------- 13 | <%= 14 | l(:wiki_page_commented_url) 15 | %> 16 | <%= 17 | @wiki_page_url 18 | %> 19 | -------------------------------------------------------------------------------- /app/views/wiki_extensions_settings/_menu.html.erb: -------------------------------------------------------------------------------- 1 | <% 2 | # Wiki Extensions plugin for Redmine 3 | # Copyright (C) 2009-2012 Haruyuki Iida 4 | # 5 | # This program is free software; you can redistribute it and/or 6 | # modify it under the terms of the GNU General Public License 7 | # as published by the Free Software Foundation; either version 2 8 | # of the License, or (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | -%> 19 | <% 20 | i = menu.menu_no - 1 21 | -%> 22 |
23 | <%= check_box_tag "menus[#{i}][enabled]", true, menu.enabled == true, :onclick => "click_wiki_menu_tab(#{i})" %> 24 | <%=h l(:label_wikiextensions_tab) %>#<%= menu.menu_no%> 25 | <%= hidden_field_tag "menus[#{i}][menu_no]", menu.menu_no %> 26 | 27 |

28 | 29 | <%= text_field_tag "menus[#{i}][title]", menu.title, :size => 70, :required => true, :disabled => !menu.enabled %> 30 |

31 |

32 | 33 | <%= text_field_tag "menus[#{i}][page_name]", menu.page_name, :size => 70, :required => true, :disabled => !menu.enabled %> 34 |

35 |
36 | -------------------------------------------------------------------------------- /app/views/wiki_extensions_settings/_show.html.erb: -------------------------------------------------------------------------------- 1 | <% 2 | # Wiki Extensions plugin for Redmine 3 | # Copyright (C) 2009-2012 Haruyuki Iida 4 | # 5 | # This program is free software; you can redistribute it and/or 6 | # modify it under the terms of the GNU General Public License 7 | # as published by the Free Software Foundation; either version 2 8 | # of the License, or (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | -%> 19 | 33 | 34 |
35 | <% 36 | @wiki_extensions_setting = WikiExtensionsSetting.find_or_create(@project.id) 37 | %> 38 | 39 | <%= labelled_form_for :setting, @wiki_extensions_setting, 40 | :url => {:controller => 'wiki_extensions_settings', 41 | :action => 'update', :id => @project, :tab => 'wiki_extensions', 42 | :partial => 'wiki_extensions_settings/update', 43 | :setting_id => @wiki_extensions_setting.id} do |f| %> 44 | <%= error_messages_for 'wiki_extensions_setting' %> 45 |
46 |

47 | 48 | 49 | 50 |


51 | <%=h l(:wiki_extensions_add_tab)%> 52 | <%= render :partial => "wiki_extensions_settings/menu", :collection => @wiki_extensions_setting.menus, :as => :menu %> 53 | 54 |
55 | <%= submit_tag l(:button_update) %> 56 | <% end %> 57 |
-------------------------------------------------------------------------------- /assets/images/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haru/redmine_wiki_extensions/8feb9bfc0e29dd1dcbc15b2dc6ad433cdba5a133/assets/images/add.png -------------------------------------------------------------------------------- /assets/images/biggrin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haru/redmine_wiki_extensions/8feb9bfc0e29dd1dcbc15b2dc6ad433cdba5a133/assets/images/biggrin.png -------------------------------------------------------------------------------- /assets/images/check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haru/redmine_wiki_extensions/8feb9bfc0e29dd1dcbc15b2dc6ad433cdba5a133/assets/images/check.png -------------------------------------------------------------------------------- /assets/images/empty.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haru/redmine_wiki_extensions/8feb9bfc0e29dd1dcbc15b2dc6ad433cdba5a133/assets/images/empty.gif -------------------------------------------------------------------------------- /assets/images/main_smile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haru/redmine_wiki_extensions/8feb9bfc0e29dd1dcbc15b2dc6ad433cdba5a133/assets/images/main_smile.png -------------------------------------------------------------------------------- /assets/images/minus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haru/redmine_wiki_extensions/8feb9bfc0e29dd1dcbc15b2dc6ad433cdba5a133/assets/images/minus.gif -------------------------------------------------------------------------------- /assets/images/plus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haru/redmine_wiki_extensions/8feb9bfc0e29dd1dcbc15b2dc6ad433cdba5a133/assets/images/plus.gif -------------------------------------------------------------------------------- /assets/images/sad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haru/redmine_wiki_extensions/8feb9bfc0e29dd1dcbc15b2dc6ad433cdba5a133/assets/images/sad.png -------------------------------------------------------------------------------- /assets/images/smile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haru/redmine_wiki_extensions/8feb9bfc0e29dd1dcbc15b2dc6ad433cdba5a133/assets/images/smile.png -------------------------------------------------------------------------------- /assets/images/tongue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haru/redmine_wiki_extensions/8feb9bfc0e29dd1dcbc15b2dc6ad433cdba5a133/assets/images/tongue.png -------------------------------------------------------------------------------- /assets/images/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haru/redmine_wiki_extensions/8feb9bfc0e29dd1dcbc15b2dc6ad433cdba5a133/assets/images/warning.png -------------------------------------------------------------------------------- /assets/images/wink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haru/redmine_wiki_extensions/8feb9bfc0e29dd1dcbc15b2dc6ad433cdba5a133/assets/images/wink.png -------------------------------------------------------------------------------- /assets/images/x_mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haru/redmine_wiki_extensions/8feb9bfc0e29dd1dcbc15b2dc6ad433cdba5a133/assets/images/x_mark.png -------------------------------------------------------------------------------- /assets/javascripts/wiki_extensions.js: -------------------------------------------------------------------------------- 1 | /* 2 | # Wiki Extensions plugin for Redmine 3 | # Copyright (C) 2009-2019 Haruyuki Iida 4 | # 5 | # This program is free software; you can redistribute it and/or 6 | # modify it under the terms of the GNU General Public License 7 | # as published by the Free Software Foundation; either version 2 8 | # of the License, or (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | function add_wiki_extensions_tags_form() { 22 | var tags_form = $('#wiki_extensions_tag_form'); 23 | $('#wiki_form div.box').append(tags_form); 24 | } 25 | 26 | function set_tag_atuto_complete(taglist) { 27 | var inputs = $('.wikiext_tag_inputs'); 28 | 29 | inputs.each(function(index, obj){ 30 | $(obj).autocomplete({ 31 | source: taglist 32 | }) 33 | }) 34 | } 35 | 36 | 37 | 38 | function is_table_for_sort(tbody) { 39 | var trs = tbody.getElementsByTagName('tr'); 40 | if (trs.length == 0) { 41 | return false; 42 | } 43 | var tds = trs[0].getElementsByTagName('td'); 44 | if (tds.length != 0) { 45 | return false; 46 | } 47 | 48 | return true; 49 | } 50 | function wiki_extension_create_table_header() { 51 | 52 | var tbodys = $('.wiki table tbody'); 53 | for (var i = 0; i < tbodys.length; i++) { 54 | var tbody = tbodys[i]; 55 | if (!is_table_for_sort(tbody)) { 56 | continue; 57 | } 58 | var table = tbody.parentNode; 59 | var header = tbody.removeChild(tbody.firstChild); 60 | var thead = table.insertBefore(document.createElement('thead'), tbody); 61 | thead.appendChild(header); 62 | 63 | } 64 | 65 | $('table').each(function(i) { 66 | $(this).tablesorter(); 67 | }); 68 | 69 | } 70 | 71 | /* 72 | * Author: Dmitry Manayev 73 | */ 74 | var DOM; 75 | var Opera; 76 | var IE; 77 | var Firefox; 78 | 79 | function do_some(src, evt) { 80 | if (!Firefox) { 81 | cls = src.parentNode.className; 82 | if (cls=='list_item ExpandOpen') { 83 | src.parentNode.className = 'list_item ExpandClosed'; 84 | } else { 85 | src.parentNode.className = 'list_item ExpandOpen'; 86 | } 87 | window.event.cancelBubble = true; 88 | } else { 89 | if (evt.eventPhase!=3) { 90 | cls = src.parentNode.className; 91 | if (cls=='list_item ExpandOpen') { 92 | src.parentNode.className = 'list_item ExpandClosed'; 93 | } else { 94 | src.parentNode.className = 'list_item ExpandOpen'; 95 | } 96 | } 97 | } 98 | } 99 | 100 | function Check() { 101 | if (!Firefox) { 102 | window.event.cancelBubble = true; 103 | } 104 | } 105 | 106 | DOM = document.getElementById; 107 | Opera = window.opera && DOM; 108 | IE = document.all && !Opera; 109 | Firefox = navigator.userAgent.indexOf("Gecko") >= 0; 110 | 111 | 112 | $.fn.we_serialize2json = function() 113 | { 114 | var o = {}; 115 | var a = this.serializeArray(); 116 | $.each(a, function() { 117 | if (o[this.name]) { 118 | if (!o[this.name].push) { 119 | o[this.name] = [o[this.name]]; 120 | } 121 | o[this.name].push(this.value || ''); 122 | } else { 123 | o[this.name] = this.value || ''; 124 | } 125 | }); 126 | return o; 127 | }; -------------------------------------------------------------------------------- /assets/javascripts/wiki_smiles.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Dmitry Manayev 3 | * modified by Haruyuki Iida. 4 | */ 5 | 6 | emoticons_image_url = ""; 7 | redmine_base_url = ""; 8 | /** 9 | * This class used to add group of elements in tooltip. 10 | * @param {Object} title 11 | * @param {Object} scope 12 | * @param {Object} className 13 | */ 14 | function jsTooltip(title, scope, className) { 15 | if(typeof jsToolBar.strings == 'undefined') { 16 | this.title = title || null; 17 | } else { 18 | this.title = jsToolBar.strings[title] || title || null; 19 | } 20 | this.scope = scope || null; 21 | this.className = className || null; 22 | } 23 | jsTooltip.prototype = { 24 | 25 | mode: 'wiki', 26 | elements: {}, 27 | 28 | getMode: function () { 29 | return this.mode; 30 | }, 31 | 32 | setMode: function (mode) { 33 | this.mode = mode || 'wiki'; 34 | }, 35 | 36 | button: function (toolName) { 37 | var tool = this.elements[toolName]; 38 | if (typeof tool.fn[this.mode] != 'function') return null; 39 | var b = new jsButton(tool.title, tool.fn[this.mode], this.scope, 'jstb_' + toolName); 40 | if (tool.icon != undefined) b.icon = tool.icon; 41 | return b; 42 | }, 43 | 44 | draw: function () { 45 | if (!this.scope) return null; 46 | 47 | this.tooltip = document.createElement('div'); 48 | if (this.className) 49 | this.tooltip.className = this.className; 50 | this.tooltip.title = this.title; 51 | 52 | if (this.icon != undefined) { 53 | this.tooltip.style.backgroundImage = 'url(' + this.icon + ')'; 54 | } 55 | 56 | // Empty tooltip 57 | while (this.tooltip.hasChildNodes()) { 58 | this.tooltip.removeChild(tooltip.firstChild) 59 | } 60 | this.toolNodes = {}; 61 | 62 | this.a = document.createElement('a'); 63 | this.a.title = 'Smiles'; 64 | this.a.className = 'smiles'; 65 | this.img = document.createElement('img'); 66 | this.img.title = 'Smiles'; 67 | this.img.src = 'plugin_assets/redmine_wiki_extensions/images/main_smile.png?dummy_param'; 68 | this.img.id = 'smiles_img'; 69 | this.img.tabIndex = 200; 70 | this.a.appendChild(this.img); 71 | 72 | this.div = document.createElement('div'); 73 | this.div.id = 'group_of_smiles'; 74 | 75 | // Draw toolbar elements 76 | var k; 77 | 78 | k = 0; 79 | for (var i in this.elements) { 80 | var b, tool, newTool; 81 | b = this.elements[i]; 82 | 83 | var disabled = 84 | b.type == undefined || b.type == '' 85 | || (b.disabled != undefined && b.disabled) 86 | || (b.context != undefined && b.context != null && b.context != this.context); 87 | 88 | if (!disabled && typeof this[b.type] == 'function') { 89 | tool = this[b.type](i); 90 | if (tool) newTool = tool.draw(); 91 | if (k % 7 == 0 && k != 0) this.div.appendChild(document.createElement('br')); 92 | if (newTool) { 93 | this.toolNodes[i] = newTool; 94 | this.div.appendChild(newTool); 95 | k++; 96 | } 97 | } 98 | } 99 | 100 | this.a.appendChild(this.div); 101 | this.tooltip.appendChild(this.a); 102 | 103 | return this.tooltip; 104 | } 105 | }; 106 | 107 | jsToolBar.prototype.tooltip = function (toolName) { 108 | var tool = this.elements[toolName]; 109 | var b = new jsTooltip(tool.title, this, 'jstt_' + toolName); 110 | if (tool.icon != undefined) b.icon = tool.icon; 111 | return b; 112 | }; 113 | 114 | 115 | // spacer 116 | jsToolBar.prototype.elements.space5 = { 117 | type: 'space' 118 | }; 119 | 120 | //buttons for smiles: 121 | function setEmoticonButtons(buttons, url) { 122 | emoticons_image_url = url; 123 | for (var i = 0; i < buttons.length; i++) { 124 | var button = buttons[i]; 125 | var func = new Function('this.encloseSelection("' + button[0] + ' ");'); 126 | 127 | jsTooltip.prototype.elements[button[1]] = { 128 | type: 'button', 129 | title: button[2], 130 | icon: url + '/' + button[1] + '?dummy_param', 131 | string: button[0], 132 | fn: { 133 | wiki: func 134 | } 135 | } 136 | } 137 | } 138 | 139 | 140 | 141 | //smiles 142 | jsToolBar.prototype.elements.smiles = { 143 | type: 'tooltip', 144 | title: 'Smiles' 145 | }; 146 | -------------------------------------------------------------------------------- /assets/stylesheets/wiki_extensions.css: -------------------------------------------------------------------------------- 1 | a.wiki_extensions_fn{ 2 | vertical-align:super; 3 | font-size:x-small; 4 | } 5 | 6 | div.wiki_extensions_fnlist ul li span.wiki_extensions_fn{ 7 | vertical-align:super; 8 | font-size:x-small; 9 | } 10 | 11 | .wiki_extensions_fnlist{ 12 | /* 13 | font-size:10px; 14 | */ 15 | } 16 | 17 | div.wiki_extensions_fnlist ul li { 18 | list-style-type: none; 19 | list-style-image: none; 20 | } 21 | 22 | div.wiki_extensions_fnlist ul { 23 | padding-left:0; 24 | 25 | } 26 | 27 | .wiki_ext_new_date { 28 | font-weight: bold; 29 | } 30 | 31 | .wiki_ext_new_mark { 32 | font-style: italic; 33 | color: #ff0000; 34 | } 35 | 36 | #wiki_extensions_tag_form .tag_field { 37 | margin-right: 1em; 38 | } 39 | 40 | .tag_level5{ 41 | font-size:xx-large; 42 | } 43 | 44 | .tag_level4{ 45 | font-size:x-large; 46 | } 47 | 48 | .tag_level3{ 49 | font-size:large; 50 | } 51 | 52 | .tag_level2{ 53 | font-size:small; 54 | } 55 | 56 | .tag_level1{ 57 | font-size:x-small; 58 | } 59 | 60 | #wikiext_taglist_complete { 61 | background-color: #E6E6FA; 62 | padding: 0; 63 | } 64 | 65 | #wikiext_taglist_complete ul { 66 | padding-left: 1em; 67 | margin: 0; 68 | } 69 | 70 | #wikiext_taglist_complete li{ 71 | list-style-type: none; 72 | margin: 0; 73 | } 74 | 75 | #sidebar ol.wikiext-popularity { 76 | padding-left: 20px; 77 | } 78 | ul.wikiext-tags, ul.wikiext-tags li{ 79 | list-style: none; 80 | margin: 0; 81 | padding: 0; 82 | } 83 | ul.wikiext-tags li{ 84 | display: inline; 85 | } 86 | ul.wikiext-tags li{ 87 | margin-right: 4px; 88 | } 89 | ul.wikiext-tags:before{ 90 | content: 'Tags: '; 91 | display: block; 92 | float: left; 93 | } 94 | ul.wikiext-tags:after{ 95 | content: "."; 96 | height: 0; 97 | display: block; 98 | clear: left; 99 | visibility: hidden; 100 | } 101 | 102 | 103 | .Expand { float: left; height:9px; width:9px; margin-top:5px; } 104 | 105 | .ExpandLeaf .Expand { 106 | background-image: none; 107 | cursor: auto; 108 | } 109 | .ExpandOpen .Expand { 110 | background-image: url(../images/minus.gif); 111 | } 112 | 113 | .ExpandClosed .Expand { 114 | background-image: url(../images/plus.gif); 115 | } 116 | 117 | .ExpandClosed .Expand, .ExpandOpen .Expand { 118 | cursor:pointer; 119 | } 120 | .ExpandOpen .list { 121 | display: block; 122 | } 123 | 124 | .ExpandClosed .list { 125 | display: none; 126 | } 127 | 128 | .wiki_left{ 129 | margin-left:15px; 130 | } 131 | 132 | li.ExpandOpen {list-style-type: none;} 133 | 134 | li.ExpandClosed {list-style-type: none;} 135 | 136 | li.list_item {list-style-type: none;} 137 | 138 | ul.list {display:block;list-style-type: none;list-style-image: none;} 139 | ul.IsRoot { margin-left:0px; list-style-type:none;} 140 | 141 | /** 142 | * Styles for page_break macro 143 | */ 144 | .wiki .wikiext-page-break { 145 | height: 1px; 146 | width: 95%; 147 | border-top: 1px dashed #ccc; 148 | margin: 3em auto; 149 | } 150 | -------------------------------------------------------------------------------- /assets/stylesheets/wiki_extensions_print.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Styles for page_break macro 3 | */ 4 | .wiki .wikiext-page-break { 5 | page-break-before: always; 6 | margin: 0 !important; 7 | border: 0 !important; 8 | visibility: hidden; 9 | } 10 | -------------------------------------------------------------------------------- /assets/stylesheets/wiki_smiles.css: -------------------------------------------------------------------------------- 1 | /* Here added styles for smiles */ 2 | 3 | .jstb_smile { 4 | background-image: url(../images/smile.png); 5 | } 6 | .jstb_sad { 7 | background-image: url(../images/sad.png); 8 | } 9 | .jstb_tongue { 10 | background-image: url(../images/tongue.png); 11 | } 12 | .jstb_biggrin { 13 | background-image: url(../images/biggrin.png); 14 | } 15 | .jstb_wink { 16 | background-image: url(../images/wink.png); 17 | } 18 | .jstb_check { 19 | background-image: url(../images/check.png); 20 | } 21 | .jstb_warn { 22 | background-image: url(../images/warning.png); 23 | } 24 | .jstb_add { 25 | background-image: url(../images/add.png); 26 | } 27 | 28 | .jstt_smiles #smiles_img { 29 | background-color:#F7F7F7; 30 | background-position:50% 50%; 31 | background-repeat:no-repeat; 32 | border:1px solid #DDDDDD; 33 | height:22px; 34 | margin-right:6px; 35 | width:22px; 36 | } 37 | 38 | .jstt_smiles #smiles_img:hover { 39 | border-color:#000000; 40 | } 41 | 42 | .jstt_smiles #group_of_smiles { 43 | background-color:#F7F7F7; 44 | border:1px solid #507AAA; 45 | display:none; 46 | position:absolute; 47 | width:210px; 48 | } 49 | 50 | .jstt_smiles a:hover #group_of_smiles{ 51 | display:block; 52 | z-index:80; 53 | } 54 | 55 | .jstt_smiles { 56 | float:left; 57 | } 58 | 59 | .jstElements button { 60 | float:left; 61 | } 62 | .jstElements, .jstSpacer { 63 | float:left; 64 | } 65 | -------------------------------------------------------------------------------- /build-scripts/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | cd `dirname $0` 6 | . env.sh 7 | cd .. 8 | 9 | if [ "$NAME_OF_PLUGIN" == "" ] 10 | then 11 | export NAME_OF_PLUGIN=`basename $PATH_TO_PLUGIN` 12 | fi 13 | 14 | cd $PATH_TO_REDMINE 15 | 16 | 17 | # run tests 18 | # bundle exec rake TEST=test/unit/role_test.rb 19 | bundle exec rake redmine:plugins:test NAME=$NAME_OF_PLUGIN 20 | 21 | cp -pr plugins/$NAME_OF_PLUGIN/coverage $PATH_TO_PLUGIN 22 | -------------------------------------------------------------------------------- /build-scripts/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | cd `dirname $0` 6 | . env.sh 7 | cd .. 8 | 9 | rm -rf $TESTSPACE -------------------------------------------------------------------------------- /build-scripts/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite version 3.x 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | # 7 | sqlite3: &sqlite3 8 | adapter: sqlite3 9 | pool: 5 10 | timeout: 5000 11 | database: db/redmine.sqlite3 12 | 13 | mysql: &mysql 14 | adapter: mysql2 15 | encoding: utf8 16 | database: <%= ENV['DB_NAME'] || 'redmine' %> 17 | username: <%= ENV['DB_USERNAME'] %> 18 | password: <%= ENV['DB_PASSWORD'] %> 19 | host: <%= ENV['DB_HOST'] %> 20 | port: <%= ENV['DB_PORT'] || 3306 %> 21 | 22 | postgres: &postgres 23 | adapter: postgresql 24 | encoding: utf8 25 | database: <%= ENV['DB_NAME'] || 'redmine' %> 26 | username: <%= ENV['DB_USERNAME'] %> 27 | password: <%= ENV['DB_PASSWORD'] %> 28 | host: <%= ENV['DB_HOST'] %> 29 | port: <%= ENV['DB_PORT'] || 5432 %> 30 | 31 | development: 32 | <<: *<%= ENV['DB'] || 'sqlite3' %> 33 | 34 | # Warning: The database defined as "test" will be erased and 35 | # re-generated from your development database when you run "rake". 36 | # Do not set this db to the same as development or production. 37 | test: 38 | <<: *<%= ENV['DB'] || 'sqlite3' %> 39 | 40 | production: 41 | <<: *<%= ENV['DB'] || 'sqlite3' %> 42 | 43 | 44 | -------------------------------------------------------------------------------- /build-scripts/env.sh: -------------------------------------------------------------------------------- 1 | export TRAVISDIR=`pwd` 2 | export PATH_TO_PLUGIN=`dirname ${TRAVISDIR}` 3 | export TESTSPACE_NAME=testspace 4 | export TESTSPACE=$PATH_TO_PLUGIN/$TESTSPACE_NAME 5 | export PATH_TO_REDMINE=$TESTSPACE/redmine 6 | export RAILS_ENV=test -------------------------------------------------------------------------------- /build-scripts/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | cd `dirname $0` 6 | . env.sh 7 | SCRIPTDIR=$(pwd) 8 | cd .. 9 | 10 | if [[ ! "$TESTSPACE" = /* ]] || 11 | [[ ! "$PATH_TO_REDMINE" = /* ]] || 12 | [[ ! "$PATH_TO_PLUGIN" = /* ]]; 13 | then 14 | echo "You should set"\ 15 | " TESTSPACE, PATH_TO_REDMINE,"\ 16 | " PATH_TO_PLUGIN"\ 17 | " environment variables" 18 | echo "You set:"\ 19 | "$TESTSPACE"\ 20 | "$PATH_TO_REDMINE"\ 21 | "$PATH_TO_PLUGIN" 22 | exit 1; 23 | fi 24 | 25 | if [ "$REDMINE_VER" = "" ] 26 | then 27 | export REDMINE_VER=master 28 | fi 29 | 30 | if [ "$NAME_OF_PLUGIN" == "" ] 31 | then 32 | export NAME_OF_PLUGIN=`basename $PATH_TO_PLUGIN` 33 | fi 34 | 35 | mkdir -p $TESTSPACE 36 | 37 | export REDMINE_GIT_REPO=https://github.com/redmine/redmine.git 38 | export REDMINE_GIT_TAG=$REDMINE_VER 39 | export BUNDLE_GEMFILE=$PATH_TO_REDMINE/Gemfile 40 | 41 | if [ -f Gemfile_for_test ] 42 | then 43 | cp Gemfile_for_test Gemfile 44 | fi 45 | 46 | # checkout redmine 47 | git clone $REDMINE_GIT_REPO $PATH_TO_REDMINE 48 | if [ -d test/fixtures ] 49 | then 50 | cp test/fixtures/* ${PATH_TO_REDMINE}/test/fixtures/ 51 | fi 52 | 53 | cd $PATH_TO_REDMINE 54 | if [ ! "$REDMINE_GIT_TAG" = "master" ]; 55 | then 56 | git checkout -b $REDMINE_GIT_TAG origin/$REDMINE_GIT_TAG 57 | fi 58 | 59 | 60 | mkdir -p plugins/$NAME_OF_PLUGIN 61 | find $PATH_TO_PLUGIN -mindepth 1 -maxdepth 1 ! -name $TESTSPACE_NAME -exec cp -r {} plugins/$NAME_OF_PLUGIN/ \; 62 | 63 | cp "$SCRIPTDIR/database.yml" config/database.yml 64 | 65 | 66 | 67 | # install gems 68 | bundle install 69 | 70 | # run redmine database migrations 71 | bundle exec rake db:create 72 | bundle exec rake db:migrate 73 | 74 | # run plugin database migrations 75 | bundle exec rake redmine:plugins:migrate 76 | 77 | 78 | -------------------------------------------------------------------------------- /config/emoticons.yml: -------------------------------------------------------------------------------- 1 | ## YAML Template. 2 | --- 3 | - emoticon: ":)" 4 | image: smile.png 5 | title: Smile 6 | - emoticon: ':(' 7 | image: sad.png 8 | title: Sad 9 | - emoticon: ':P' 10 | image: tongue.png 11 | title: Tongue 12 | - emoticon: ':D' 13 | image: biggrin.png 14 | title: Big grin 15 | - emoticon: ';)' 16 | image: wink.png 17 | title: Wink 18 | - emoticon: '(/)' 19 | image: check.png 20 | title: Check 21 | - emoticon: '(x)' 22 | image: x_mark.png 23 | title: X_mark 24 | - emoticon: '(!)' 25 | image: warning.png 26 | title: Warning 27 | -------------------------------------------------------------------------------- /config/locales/de.yml: -------------------------------------------------------------------------------- 1 | # German strings go 2 | de: 3 | label_wikiextensions_tags: Tags 4 | label_wikiextensions_new: Neu 5 | wiki_extensions: Wiki-Erweiterungen 6 | label_wikiextensions_tab: Menüpunkt 7 | wiki_extensions_add_tab: "Menüpunkte zum Projektmenü hinzufügen:" 8 | permission_add_wiki_comment: Wiki-Kommentare hinzufügen 9 | permission_delete_wiki_comments: Wiki-Kommentare löschen 10 | permission_edit_wiki_comments: Wiki-Kommentare bearbeiten 11 | permission_wiki_extensions_settings: Wiki-Extensions verwalten 12 | 13 | field_auto_preview_enabled: Automatische Vorschau aktivieren 14 | field_sidebar_disabled: Sidebar deaktivieren 15 | wiki_extensions_vote: vote 16 | 17 | 18 | wiki_page_commented_header: Kommentar zur Wiki-Seite "%{page_title}" des Projektes "%{project_name}" hinzugefügt von %{author} 19 | wiki_page_commented_comment_head: 'Kommentar:' 20 | wiki_page_commented_url: 'Sie können die Kommentarseite mit folgendem Link ansehen:' 21 | label_wiki_comment_added: 'Wiki-Kommentar hinzugefügt' 22 | label_wiki_comment_plural: 'Wiki-Kommentare' 23 | 24 | wiki_extensions_new_wiki_page: 'Neue Seite' -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # English strings go 2 | en: 3 | label_wikiextensions_tags: Tags 4 | label_wikiextensions_new: New 5 | wiki_extensions: Wiki Extensions 6 | label_wikiextensions_tab: Tab 7 | wiki_extensions_add_tab: "Add tabs to the project menu." 8 | permission_add_wiki_comment: Add Wiki comments 9 | permission_delete_wiki_comments: Delete Wiki comments 10 | permission_edit_wiki_comments: Edit Wiki comments 11 | permission_wiki_extensions_settings: Manage Wiki Extensions 12 | 13 | field_auto_preview_enabled: Enable auto preview 14 | field_sidebar_disabled: Disable side bar 15 | wiki_extensions_vote: vote 16 | 17 | # Wiki comments notification 18 | wiki_page_commented_header: Comment to wiki page "%{page_title}" of project "%{project_name}" added by user %{author} 19 | wiki_page_commented_comment_head: 'Comment:' 20 | wiki_page_commented_url: 'You can see page with comment by the following link:' 21 | label_wiki_comment_added: 'Wiki comment added' 22 | label_wiki_comment_plural: 'Wiki comments' 23 | 24 | wiki_extensions_new_wiki_page: 'New page' 25 | field_tag_disabled: 'Disable tagging function' -------------------------------------------------------------------------------- /config/locales/es.yml: -------------------------------------------------------------------------------- 1 | # Spanish strings go 2 | es: 3 | label_wikiextensions_tags: Etiquetas 4 | label_wikiextensions_new: Nueva 5 | wiki_extensions: Extensiones de la Wiki 6 | label_wikiextensions_tab: Pestaña 7 | wiki_extensions_add_tab: "Añadir pestañas al menú del proyecto." 8 | permission_add_wiki_comment: Add Wiki comments 9 | permission_delete_wiki_comments: Delete Wiki comments 10 | permission_edit_wiki_comments: Edit Wiki comments 11 | permission_wiki_extensions_settings: Manage Wiki Extensions 12 | 13 | field_auto_preview_enabled: Enable auto preview 14 | field_sidebar_disabled: Disable side bar 15 | wiki_extensions_vote: vote 16 | 17 | 18 | wiki_page_commented_header: Comment to wiki page "%{page_title}" of project "%{project_name}" added by user %{author} 19 | wiki_page_commented_comment_head: 'Comment:' 20 | wiki_page_commented_url: 'You can see page with comment by the following link:' 21 | label_wiki_comment_added: 'Wiki comment added' 22 | label_wiki_comment_plural: 'Wiki comments' 23 | 24 | wiki_extensions_new_wiki_page: 'New page' -------------------------------------------------------------------------------- /config/locales/fr.yml: -------------------------------------------------------------------------------- 1 | # French strings go 2 | fr: 3 | label_wikiextensions_tags: Tags 4 | label_wikiextensions_new: Nouveau 5 | wiki_extensions: Extensions du Wiki 6 | label_wikiextensions_tab: Onglet 7 | wiki_extensions_add_tab: "Ajouter un onglet au menu du projet." 8 | permission_add_wiki_comment: Add Wiki comments 9 | permission_delete_wiki_comments: Delete Wiki comments 10 | permission_edit_wiki_comments: Edit Wiki comments 11 | permission_wiki_extensions_settings: Manage Wiki Extensions 12 | 13 | field_auto_preview_enabled: Enable auto preview 14 | field_sidebar_disabled: Disable side bar 15 | wiki_extensions_vote: vote 16 | 17 | 18 | wiki_page_commented_header: Comment to wiki page "%{page_title}" of project "%{project_name}" added by user %{author} 19 | wiki_page_commented_comment_head: 'Comment:' 20 | wiki_page_commented_url: 'You can see page with comment by the following link:' 21 | label_wiki_comment_added: 'Wiki comment added' 22 | label_wiki_comment_plural: 'Wiki comments' 23 | 24 | wiki_extensions_new_wiki_page: 'New page' -------------------------------------------------------------------------------- /config/locales/it.yml: -------------------------------------------------------------------------------- 1 | # Le frasi in italiano vanno qui 2 | it: 3 | label_wikiextensions_tags: Tags 4 | label_wikiextensions_new: Nuovo 5 | wiki_extensions: Estensioni del Wiki 6 | label_wikiextensions_tab: Tab 7 | wiki_extensions_add_tab: "Aggiungi dei tab al menù del progetto." 8 | permission_add_wiki_comment: Add Wiki comments 9 | permission_delete_wiki_comments: Delete Wiki comments 10 | permission_edit_wiki_comments: Edit Wiki comments 11 | permission_wiki_extensions_settings: Manage Wiki Extensions 12 | 13 | field_auto_preview_enabled: Enable auto preview 14 | field_sidebar_disabled: Disable side bar 15 | wiki_extensions_vote: vote 16 | 17 | 18 | wiki_page_commented_header: Comment to wiki page "%{page_title}" of project "%{project_name}" added by user %{author} 19 | wiki_page_commented_comment_head: 'Comment:' 20 | wiki_page_commented_url: 'You can see page with comment by the following link:' 21 | label_wiki_comment_added: 'Wiki comment added' 22 | label_wiki_comment_plural: 'Wiki comments' 23 | 24 | wiki_extensions_new_wiki_page: 'New page' -------------------------------------------------------------------------------- /config/locales/ja.yml: -------------------------------------------------------------------------------- 1 | ja: 2 | label_wikiextensions_tags: タグ 3 | label_wikiextensions_new: New 4 | wiki_extensions: Wiki Extensions 5 | label_wikiextensions_tab: タブ 6 | wiki_extensions_add_tab: "プロジェクトメニューにタブを追加" 7 | permission_add_wiki_comment: Wikiにコメントを追加 8 | permission_delete_wiki_comments: Wikiのコメントを削除 9 | permission_edit_wiki_comments: Wikiのコメントを編集 10 | permission_wiki_extensions_settings: Wiki Extensions の管理 11 | 12 | field_auto_preview_enabled: オートプレビューを有効にする 13 | field_sidebar_disabled: サイドバーを無効にする 14 | wiki_extensions_vote: 投票 15 | 16 | 17 | 18 | wiki_page_commented_header: プロジェクト"%{project_name}"のWikiページ "%{page_title}" へのコメントが %{author}によって追加されました。 19 | wiki_page_commented_comment_head: 'コメント:' 20 | wiki_page_commented_url: 'コメントへのリンク:' 21 | label_wiki_comment_added: Wikiコメントが追加されました 22 | label_wiki_comment_plural: Wiki コメント 23 | 24 | wiki_extensions_new_wiki_page: 新規ページ 25 | field_tag_disabled: タグを利用しない 26 | -------------------------------------------------------------------------------- /config/locales/ko.yml: -------------------------------------------------------------------------------- 1 | # Translation by Ki Won Kim (http://blog.naver.com/xyz37, xyz37@naver.com) 2 | ko: 3 | wiki_extensions: "확장 위키" 4 | label_wikiextensions_tags: "태그" 5 | label_wikiextensions_new: "신규" 6 | field_auto_preview_enabled: "자동 미리 보기 가능" 7 | label_wikiextensions_tab: "탭" 8 | wiki_extensions_add_tab: "프로젝트에 탭을 추가합니다." 9 | 10 | permission_add_wiki_comment: "위키 설명 추가" 11 | permission_delete_wiki_comments: "위키 설명 삭제" 12 | permission_edit_wiki_comments: "위키 설명 수정" 13 | permission_wiki_extensions_settings: "확장 위키 관리" 14 | field_sidebar_disabled: "사이드 바 금지" 15 | wiki_extensions_vote: "투표" 16 | 17 | 18 | wiki_page_commented_header: '"%{project_name}" 프로젝트의 "%{page_title}" 위키 페이지의 설명이 %{author}에 의해 추가 되었습니다.' 19 | wiki_page_commented_comment_head: "설명:" 20 | wiki_page_commented_url: "아래 링크에서 설명을 볼 수 있습니다:" 21 | label_wiki_comment_added: "위키 설명 추가" 22 | label_wiki_comment_plural: "위키 설명" 23 | 24 | wiki_extensions_new_wiki_page: "새 페이지" -------------------------------------------------------------------------------- /config/locales/no.yml: -------------------------------------------------------------------------------- 1 | "no": 2 | label_wikiextensions_tags: Merkelapper 3 | label_wikiextensions_new: Ny 4 | wiki_extensions: Wiki-tillegg 5 | label_wikiextensions_tab: Fane 6 | wiki_extensions_add_tab: "Legg til faner i prosjekt-menyen." 7 | permission_add_wiki_comment: Legge til wiki-kommentarer 8 | permission_delete_wiki_comments: Slette wiki-kommentarer 9 | permission_edit_wiki_comments: Redigere wiki-kommentarer 10 | permission_wiki_extensions_settings: Behandle innstillinger for wiki-tillegg 11 | 12 | field_auto_preview_enabled: Skru på automatisk forhåndsvisning 13 | field_sidebar_disabled: Disable side bar 14 | wiki_extensions_vote: vote 15 | 16 | 17 | 18 | wiki_page_commented_header: Comment to wiki page "%{page_title}" of project "%{project_name}" added by user %{author} 19 | wiki_page_commented_comment_head: 'Comment:' 20 | wiki_page_commented_url: 'You can see page with comment by the following link:' 21 | label_wiki_comment_added: 'Wiki comment added' 22 | label_wiki_comment_plural: 'Wiki comments' 23 | 24 | wiki_extensions_new_wiki_page: 'New page' -------------------------------------------------------------------------------- /config/locales/pl.yml: -------------------------------------------------------------------------------- 1 | # English strings go 2 | pl: 3 | label_wikiextensions_tags: Znaczniki 4 | label_wikiextensions_new: Nowy 5 | wiki_extensions: Rozszerzenia Wiki 6 | label_wikiextensions_tab: Zakładka 7 | wiki_extensions_add_tab: "Dodaj zakładki do menu projektu." 8 | permission_add_wiki_comment: Dodaj komentarze Wiki 9 | permission_delete_wiki_comments: Usułmentarze Wiki 10 | permission_edit_wiki_comments: Edytuj komentarze Wiki 11 | permission_wiki_extensions_settings: Zarzłdzaj komentarzami Wiki 12 | 13 | field_auto_preview_enabled: Włącz autopodgląd 14 | field_sidebar_disabled: Wyłącz panel boczny 15 | wiki_extensions_vote: vote 16 | 17 | 18 | wiki_page_commented_header: Comment to wiki page "%{page_title}" of project "%{project_name}" added by user %{author} 19 | wiki_page_commented_comment_head: 'Comment:' 20 | wiki_page_commented_url: 'You can see page with comment by the following link:' 21 | label_wiki_comment_added: 'Wiki comment added' 22 | label_wiki_comment_plural: 'Wiki comments' 23 | 24 | wiki_extensions_new_wiki_page: 'New page' -------------------------------------------------------------------------------- /config/locales/pt-BR.yml: -------------------------------------------------------------------------------- 1 | # Português Brasil strings go 2 | pt-BR: 3 | label_wikiextensions_tags: Tags 4 | label_wikiextensions_new: Novo 5 | wiki_extensions: Extensões Wiki 6 | label_wikiextensions_tab: Tab 7 | wiki_extensions_add_tab: "Adicionar tabs para o menu do project." 8 | permission_add_wiki_comment: Adicionar comentários Wiki 9 | permission_delete_wiki_comments: Apagar comentários Wiki 10 | permission_edit_wiki_comments: Editar comentários Wiki 11 | permission_wiki_extensions_settings: Gerenciar Extensões Wiki 12 | 13 | field_auto_preview_enabled: Habilitar auto preview 14 | field_sidebar_disabled: Disable side bar 15 | wiki_extensions_vote: vote 16 | 17 | 18 | wiki_page_commented_header: Comment to wiki page "%{page_title}" of project "%{project_name}" added by user %{author} 19 | wiki_page_commented_comment_head: 'Comment:' 20 | wiki_page_commented_url: 'You can see page with comment by the following link:' 21 | label_wiki_comment_added: 'Wiki comment added' 22 | label_wiki_comment_plural: 'Wiki comments' 23 | 24 | wiki_extensions_new_wiki_page: 'New page' -------------------------------------------------------------------------------- /config/locales/pt.yml: -------------------------------------------------------------------------------- 1 | # Português strings go 2 | pt: 3 | label_wikiextensions_tags: Tags 4 | label_wikiextensions_new: Novo 5 | wiki_extensions: Extensões Wiki 6 | label_wikiextensions_tab: Tab 7 | wiki_extensions_add_tab: "Adicionar tabs para o menu do project." 8 | permission_add_wiki_comment: Adicionar comentários Wiki 9 | permission_delete_wiki_comments: Apagar comentários Wiki 10 | permission_edit_wiki_comments: Editar comentários Wiki 11 | permission_wiki_extensions_settings: Gerenciar Extensões Wiki 12 | 13 | field_auto_preview_enabled: Habilitar auto preview 14 | field_sidebar_disabled: Disable side bar 15 | wiki_extensions_vote: vote 16 | 17 | 18 | wiki_page_commented_header: Comment to wiki page "%{page_title}" of project "%{project_name}" added by user %{author} 19 | wiki_page_commented_comment_head: 'Comment:' 20 | wiki_page_commented_url: 'You can see page with comment by the following link:' 21 | label_wiki_comment_added: 'Wiki comment added' 22 | label_wiki_comment_plural: 'Wiki comments' 23 | 24 | wiki_extensions_new_wiki_page: 'New page' -------------------------------------------------------------------------------- /config/locales/ru.yml: -------------------------------------------------------------------------------- 1 | # Russian strings go 2 | ru: 3 | label_wikiextensions_tags: Метки 4 | label_wikiextensions_new: Новое 5 | wiki_extensions: Расширения Wiki 6 | label_wikiextensions_tab: Вкладка 7 | wiki_extensions_add_tab: "Добавить вкладку в меню проекта." 8 | permission_add_wiki_comment: Add Wiki comments 9 | permission_delete_wiki_comments: Delete Wiki comments 10 | permission_edit_wiki_comments: Edit Wiki comments 11 | permission_wiki_extensions_settings: Manage Wiki Extensions 12 | 13 | field_auto_preview_enabled: Enable auto preview 14 | field_sidebar_disabled: Disable side bar 15 | wiki_extensions_vote: vote 16 | 17 | # Wiki comments notification 18 | wiki_page_commented_header: Вики-страница "%{page_title}" проекта "%{project_name}" прокомментированна пользователем %{author} 19 | wiki_page_commented_comment_head: 'Комментарий:' 20 | wiki_page_commented_url: 'Вы можете просмотреть страницу с комментарием перейдя по следующей ссылке:' 21 | label_wiki_comment_added: 'Wiki comment added' 22 | label_wiki_comment_plural: 'Wiki comments' 23 | 24 | wiki_extensions_new_wiki_page: 'New page' 25 | -------------------------------------------------------------------------------- /config/locales/sv.yml: -------------------------------------------------------------------------------- 1 | # Swedish strings go 2 | sv: 3 | label_wikiextensions_tags: Taggar 4 | label_wikiextensions_new: Ny 5 | wiki_extensions: Wiki Extensions 6 | label_wikiextensions_tab: Tabb 7 | wiki_extensions_add_tab: "Lägg till tabbar till projektmenyn." 8 | permission_add_wiki_comment: Lägg till Wiki kommentarer 9 | permission_delete_wiki_comments: Ta bort Wiki kommentarer 10 | permission_edit_wiki_comments: Ändra Wiki kommentarer 11 | permission_wiki_extensions_settings: Hantera Wiki Extensions 12 | 13 | field_auto_preview_enabled: Aktivera automatisk förhandsgranskning 14 | field_sidebar_disabled: Disable side bar 15 | wiki_extensions_vote: vote 16 | 17 | 18 | wiki_page_commented_header: Comment to wiki page "%{page_title}" of project "%{project_name}" added by user %{author} 19 | wiki_page_commented_comment_head: 'Comment:' 20 | wiki_page_commented_url: 'You can see page with comment by the following link:' 21 | label_wiki_comment_added: 'Wiki comment added' 22 | label_wiki_comment_plural: 'Wiki comments' 23 | 24 | wiki_extensions_new_wiki_page: 'New page' -------------------------------------------------------------------------------- /config/locales/zh.yml: -------------------------------------------------------------------------------- 1 | # Simplified Chinese strings go here 2 | zh: 3 | label_wikiextensions_tags: 标签 4 | label_wikiextensions_new: 新建 5 | wiki_extensions: Wiki Extensions 6 | label_wikiextensions_tab: 标签 7 | wiki_extensions_add_tab: "增加标签到项目菜单栏." 8 | permission_add_wiki_comment: 增加Wiki注释 9 | permission_delete_wiki_comments: 删除Wiki注释 10 | permission_edit_wiki_comments: 编辑Wiki注释 11 | permission_wiki_extensions_settings: 管理Wiki Extensions 12 | 13 | field_auto_preview_enabled: 打开自动预览 14 | field_sidebar_disabled: 禁止侧栏 15 | wiki_extensions_vote: 投票 16 | 17 | 18 | wiki_page_commented_header: 用户 %{author} 对项目 "%{project_name}" 的Wiki "%{page_title}" 评论已创建。 19 | wiki_page_commented_comment_head: '评论:' 20 | wiki_page_commented_url: '您可以按以下链接查看相关评论:' 21 | label_wiki_comment_added: 'Wiki 评论已添加' 22 | label_wiki_comment_plural: 'Wiki comments' 23 | 24 | wiki_extensions_new_wiki_page: 'New page' -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2012-2015 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | RedmineApp::Application.routes.draw do 19 | match "projects/:id/wiki_extensions/stylesheet", to: "wiki_extensions#stylesheet", via: [:get, :post], as: "wiki_extensions_stylesheet" 20 | match "projects/:id/wiki_extensions/:action", :controller => "wiki_extensions", :via => [:get, :post] 21 | match "projects/:id/wiki_extensions_settings/:action", :controller => "wiki_extensions_settings", :via => [:get, :post, :put, :patch] 22 | match "/wiki_extentions/emoticon/:icon_name", :controller => "wiki_extensions", :action => "emoticon", :via => [:get], :as => "wiki_extensions_emoticon" 23 | end 24 | -------------------------------------------------------------------------------- /db/migrate/0001_create_wiki_extensions_comments.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2009-2017 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | class CreateWikiExtensionsComments < ActiveRecord::Migration[4.2] 18 | def self.up 19 | create_table :wiki_extensions_comments do |t| 20 | t.column :wiki_page_id, :integer 21 | t.column :key_word, :string 22 | t.column :user_id, :integer 23 | t.column :comment, :text 24 | t.column :created_at, :timestamp 25 | t.column :updated_at, :timestamp 26 | end 27 | end 28 | 29 | def self.down 30 | drop_table :wiki_extensions_comments 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /db/migrate/0002_create_wiki_extensions_tags.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2009-2017 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | class CreateWikiExtensionsTags < ActiveRecord::Migration[4.2] 18 | def self.up 19 | create_table :wiki_extensions_tags do |t| 20 | t.column :project_id, :integer 21 | 22 | t.column :name, :string 23 | 24 | t.column :created_at, :timestamp 25 | 26 | end 27 | end 28 | 29 | def self.down 30 | drop_table :wiki_extensions_tags 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /db/migrate/0003_create_wiki_extensions_tag_relations.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2009-2017 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | class CreateWikiExtensionsTagRelations < ActiveRecord::Migration[4.2] 18 | def self.up 19 | create_table :wiki_extensions_tag_relations do |t| 20 | 21 | t.column :tag_id, :integer 22 | 23 | t.column :wiki_page_id, :integer 24 | 25 | t.column :created_at, :timestamp 26 | 27 | end 28 | 29 | add_index :wiki_extensions_tag_relations, :tag_id 30 | add_index :wiki_extensions_tag_relations, :wiki_page_id 31 | end 32 | 33 | def self.down 34 | drop_table :wiki_extensions_tag_relations 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /db/migrate/0004_create_wiki_extensions_project_settings.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2009-2017 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | class CreateWikiExtensionsProjectSettings < ActiveRecord::Migration[4.2] 18 | def self.up 19 | create_table :wiki_extensions_settings do |t| 20 | 21 | t.column :project_id, :integer 22 | 23 | t.column :created_at, :timestamp 24 | 25 | t.column :updated_at, :timestamp 26 | 27 | t.column :lock_version, :integer 28 | 29 | end 30 | end 31 | 32 | def self.down 33 | drop_table :wiki_extensions_settings 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /db/migrate/0005_create_wiki_extensions_project_menus.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2009-2017 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | class CreateWikiExtensionsProjectMenus < ActiveRecord::Migration[4.2] 18 | def self.up 19 | create_table :wiki_extensions_menus do |t| 20 | 21 | t.column :project_id, :integer 22 | t.column :menu_no, :integer 23 | t.column :page_name, :string 24 | t.column :title, :string 25 | t.column :enabled, :boolean 26 | 27 | end 28 | end 29 | 30 | def self.down 31 | drop_table :wiki_extensions_menus 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /db/migrate/0006_rename_wiki_extensions_tables.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2009-2017 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | class RenameWikiExtensionsTables < ActiveRecord::Migration[4.2] 18 | def self.up 19 | rename_table :wiki_extensions_project_menus, :wiki_extensions_menus if table_exists? :wiki_extensions_project_menus 20 | rename_table :wiki_extensions_project_settings, :wiki_extensions_settings if table_exists? :wiki_extensions_project_settings 21 | end 22 | 23 | def self.down 24 | 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /db/migrate/0007_create_wiki_extensions_counts.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2009-2017 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | class CreateWikiExtensionsCounts < ActiveRecord::Migration[4.2] 18 | def self.up 19 | create_table :wiki_extensions_counts do |t| 20 | 21 | t.column :project_id, :integer 22 | 23 | t.column :page_id, :integer 24 | 25 | t.column :date, :date 26 | 27 | t.column :count, :integer 28 | 29 | end 30 | end 31 | 32 | def self.down 33 | drop_table :wiki_extensions_counts 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /db/migrate/0008_add_auto_preview.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2009-2017 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | class AddAutoPreview < ActiveRecord::Migration[4.2] 19 | 20 | def self.up 21 | add_column(:wiki_extensions_settings, "auto_preview_enabled", :boolean, :default => false, :null => false) 22 | end 23 | 24 | def self.down 25 | remove_column(:wiki_extensions_settings, "auto_preview_enabled") 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /db/migrate/0009_add_parent_id.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2009-2017 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | class AddParentId < ActiveRecord::Migration[4.2] 19 | 20 | def self.up 21 | add_column(:wiki_extensions_comments, "parent_id", :integer) 22 | end 23 | 24 | def self.down 25 | remove_column(:wiki_extensions_comments, "parent_id") 26 | end 27 | end -------------------------------------------------------------------------------- /db/migrate/0010_add_disable_sidebar.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2009-2017 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | class AddDisableSidebar < ActiveRecord::Migration[4.2] 19 | 20 | def self.up 21 | add_column(:wiki_extensions_settings, "sidebar_disabled", :boolean, :default => false, :null => false) 22 | end 23 | 24 | def self.down 25 | remove_column(:wiki_extensions_settings, "sidebar_disabled") 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /db/migrate/0011_remove_disable_sidebar.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2009-2017 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | class RemoveDisableSidebar < ActiveRecord::Migration[4.2] 19 | 20 | def self.up 21 | remove_column(:wiki_extensions_settings, "sidebar_disabled") 22 | end 23 | 24 | def self.down 25 | add_column(:wiki_extensions_settings, "sidebar_disabled", :boolean, :default => false, :null => false) 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /db/migrate/0012_create_wiki_extensions_votes.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2010-2017 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | class CreateWikiExtensionsVotes < ActiveRecord::Migration[4.2] 19 | def self.up 20 | create_table :wiki_extensions_votes do |t| 21 | 22 | t.column :keystr, :string 23 | 24 | t.column :target_class_name, :string 25 | 26 | t.column :target_id, :integer 27 | 28 | t.column :count, :integer 29 | 30 | end 31 | end 32 | 33 | def self.down 34 | drop_table :wiki_extensions_votes 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /db/migrate/0013_add_disable_tags.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2014-2017 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | class AddDisableTags < ActiveRecord::Migration[4.2] 19 | 20 | def self.up 21 | add_column(:wiki_extensions_settings, "tag_disabled", :boolean, :default => false) 22 | end 23 | 24 | def self.down 25 | remove_column(:wiki_extensions_settings, "tag_disabled") 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /init.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2009-2024 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | require 'redmine' 18 | begin 19 | require 'config/initializers/session_store.rb' 20 | rescue LoadError 21 | end 22 | require 'redmine/wiki_formatting/textile/redcloth3' 23 | 24 | $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib" 25 | 26 | Rails.configuration.to_prepare do 27 | WikiExtensionsProjectsHelperPatch.apply 28 | end 29 | 30 | require_dependency 'wiki_extensions_notifiable_patch' 31 | Dir::foreach(File.join(File.dirname(__FILE__), 'lib')) do |file| 32 | next unless /\.rb$/ =~ file 33 | require file 34 | end 35 | ActionView::Base.class_eval do 36 | include ActionView::Helpers::WikiExtensionsHelper 37 | end 38 | 39 | Redmine::Plugin.register :redmine_wiki_extensions do 40 | name 'Redmine Wiki Extensions plugin' 41 | author 'Haruyuki Iida' 42 | author_url 'http://twitter.com/haru_iida' 43 | description 'This is a Wiki Extensions plugin for Redmine' 44 | url 'http://www.r-labs.org/projects/r-labs/wiki/Wiki_Extensions_en' 45 | version '1.0.2' 46 | requires_redmine :version_or_higher => '6.0.0' 47 | 48 | project_module :wiki_extensions do 49 | permission :wiki_extensions_vote, { :wiki_extensions => [:vote, :show_vote] }, :public => true 50 | permission :add_wiki_comment, { :wiki_extensions => [:add_comment, :reply_comment] } 51 | permission :delete_wiki_comments, { :wiki_extensions => [:destroy_comment] } 52 | permission :edit_wiki_comments, { :wiki_extensions => [:update_comment] } 53 | permission :show_wiki_extension_tabs, { :wiki_extensions => [:forward_wiki_page] }, :public => true 54 | permission :view_wiki_comment, { :wiki_extensions => [:show_comments] }, :public => true 55 | permission :show_wiki_tags, { :wiki_extensions => [:tag] }, :public => true 56 | permission :wiki_extensions_settings, { :wiki_extensions_settings => [:show, :update] } 57 | end 58 | 59 | menulist = [:wiki_extensions1, :wiki_extensions2, :wiki_extensions3, :wiki_extensions4, :wiki_extensions5] 60 | menulist.length.times { |i| 61 | no = i + 1 62 | before = :wiki 63 | before = menulist[i - 1] if i > 0 64 | 65 | menu :project_menu, menulist[i], { :controller => 'wiki_extensions', :action => 'forward_wiki_page', :menu_id => no }, :after => before, 66 | :caption => Proc.new { |proj| WikiExtensionsMenu.title(proj.id, no) }, 67 | :if => Proc.new { |proj| WikiExtensionsMenu.enabled?(proj.id, no) } 68 | } 69 | 70 | RedCloth3::ALLOWED_TAGS << 'div' 71 | 72 | activity_provider :wiki_comment, :class_name => 'WikiExtensionsComment', :default => false 73 | end 74 | -------------------------------------------------------------------------------- /lib/wiki_extensions_application_hooks.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2009-2019 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | require "redmine" 18 | require "application_helper" 19 | 20 | class WikiExtensionsApplicationHooks < Redmine::Hook::ViewListener 21 | include ApplicationHelper 22 | 23 | render_on :view_layouts_base_html_head, :partial => "wiki_extensions/html_header" 24 | render_on :view_layouts_base_body_bottom, :partial => "wiki_extensions/body_bottom" 25 | end 26 | -------------------------------------------------------------------------------- /lib/wiki_extensions_comments.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2009-2013 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | require 'redmine' 18 | 19 | module WikiExtensionsComments 20 | Redmine::WikiFormatting::Macros.register do 21 | desc "Displays a comment form." 22 | macro :comment_form do |obj, args| 23 | return unless @project 24 | return nil unless WikiExtensionsUtil.is_enabled?(@project) 25 | unless User.current.allowed_to?({:controller => 'wiki_extensions', :action => 'add_comment'}, @project) 26 | return '' 27 | end 28 | page = obj.page if obj 29 | 30 | num = rand(10000) 31 | area_id = "add_comment_area_#{num}" 32 | div_id = "add_comment_form_div#{num}" 33 | 34 | o = @_controller.send(:render_to_string, {:partial => "wiki_extensions/comment_form", :locals =>{:page => page, :area_id => area_id, :div_id => div_id}}) 35 | raw o.html_safe 36 | end 37 | end 38 | 39 | Redmine::WikiFormatting::Macros.register do 40 | desc "Display comments of the page." 41 | macro :comments do |obj, args| 42 | return '' unless obj 43 | unless User.current.allowed_to?({:controller => 'wiki_extensions', :action => 'show_comments'}, @project) 44 | return '' 45 | end 46 | page = obj.page 47 | return unless page 48 | 49 | data = page.wiki_extension_data 50 | comments = WikiExtensionsComment.where(:wiki_page_id => page.id).all 51 | 52 | raw display_comments_tree(comments,nil,page,data) 53 | 54 | end 55 | end 56 | end 57 | -------------------------------------------------------------------------------- /lib/wiki_extensions_count_macro.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2009-2012 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | require 'redmine' 18 | 19 | module WikiExtensionsCountMacro 20 | Redmine::WikiFormatting::Macros.register do 21 | desc "Count access to the pages.\n\n"+ 22 | " !{{count}}\n" 23 | macro :count do |obj, args| 24 | return nil unless obj 25 | page = obj.page 26 | session[:access_count_table] = Hash.new unless session[:access_count_table] 27 | unless session[:access_count_table][page.id] 28 | WikiExtensionsCount.countup(page.id) 29 | session[:access_count_table][page.id] = 1 30 | end 31 | 32 | return '' 33 | end 34 | end 35 | 36 | Redmine::WikiFormatting::Macros.register do 37 | desc "Displays an access count of the page.\n\n"+ 38 | " !{{show_count}}\n" 39 | macro :show_count do |obj, args| 40 | return nil unless obj 41 | page = obj.page 42 | count = WikiExtensionsCount.access_count(page.id) 43 | 44 | return "#{count}".html_safe 45 | end 46 | end 47 | 48 | Redmine::WikiFormatting::Macros.register do 49 | desc "Displays list of the popular pages.\n\n"+ 50 | " !{{popularity}}\n" + 51 | " !{{popularity(max)}}\n" + 52 | " !{{popularity(max, term)}}\n" 53 | macro :popularity do |obj, args| 54 | return nil unless obj 55 | term = 0 56 | term = args[1].to_i if args[1] 57 | list = WikiExtensionsCount.popularity(@project.id, term) 58 | max = 0 59 | max = args[0].to_i if args.length 60 | 61 | o = '' 62 | o << '
    ' 63 | cnt = 0 64 | list.each{|value| 65 | page = WikiPage.where(:id => value[0]).first 66 | next unless page 67 | o << '
  1. ' 68 | o << link_to(page.pretty_title, :controller => 'wiki', :action => 'show', :project_id => page.project, :id => page.title) 69 | o << "(#{value[1]})" 70 | o << '
  2. ' 71 | cnt = cnt + 1 72 | break if (cnt >= max and max > 0) 73 | } 74 | o << '
' 75 | return o.html_safe 76 | end 77 | end 78 | end 79 | -------------------------------------------------------------------------------- /lib/wiki_extensions_div_macro.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2009-2013 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | module WikiExtensionsDivMacro 19 | Redmine::WikiFormatting::Macros.register do 20 | desc "Displays a
' + "\n\n" + 21 | " !{{div_start_tag(id_name)}}" + "'\n" + 22 | " !{{div_start_tag(id_name, class_name)}}" 23 | macro :div_start_tag do |obj, args| 24 | o = '
' if args.length == 0 25 | o = '
' if args.length == 1 26 | o = '
' if args.length == 2 27 | o.html_safe 28 | end 29 | end 30 | end 31 | 32 | module WikiExtensionsDivMacro 33 | Redmine::WikiFormatting::Macros.register do 34 | desc "Displays a
\n\n" + 35 | " !{{div_end_tag}}" 36 | macro :div_end_tag do |obj, args| 37 | return '
'.html_safe 38 | end 39 | end 40 | end 41 | 42 | -------------------------------------------------------------------------------- /lib/wiki_extensions_emoticons.rb: -------------------------------------------------------------------------------- 1 | # To change this template, choose Tools | Templates 2 | # and open the template in the editor. 3 | require "yaml" 4 | 5 | module WikiExtensionsEmoticons 6 | YAML_FILE = File.join(File.dirname(__FILE__), '../config/emoticons.yml') 7 | class Emoticons 8 | def emoticons 9 | @@emoticons ||= YAML.load_file(YAML_FILE) 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/wiki_extensions_footnote.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2009-2012 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | require 'redmine' 18 | 19 | module WikiExtensionsFootnote 20 | 21 | def WikiExtensionsFootnote.preview_page 22 | @@preview_page ||= WikiPage.new 23 | end 24 | 25 | Redmine::WikiFormatting::Macros.register do 26 | desc "Create a footnote.\n\n" + 27 | " \{{fn(word, description)}}" 28 | macro :fn do |obj, args| 29 | return nil if args.length < 2 30 | return nil unless WikiExtensionsUtil.is_enabled?(@project) 31 | word = args.shift 32 | description = args.join(",").strip 33 | page = obj.page if obj 34 | page = WikiExtensionsFootnote.preview_page unless page 35 | data = page.wiki_extension_data 36 | data[:footnotes] ||= [] 37 | data[:footnotes] << {'word' => word, 'description' => description} 38 | 39 | 40 | o = "" 41 | o << word 42 | o << '' 43 | o << "*#{data[:footnotes].length}" 44 | o << '' 45 | return o.html_safe 46 | end 47 | end 48 | 49 | Redmine::WikiFormatting::Macros.register do 50 | desc "Displays footnotes of the page." 51 | macro :fnlist do |obj, args| 52 | return nil unless WikiExtensionsUtil.is_enabled?(@project) 53 | page = obj.page if obj 54 | page = WikiExtensionsFootnote.preview_page unless page 55 | data = page.wiki_extension_data 56 | return '' if data[:footnotes].blank? or data[:footnotes].empty? 57 | o = '
' 58 | o << "
\n" 59 | o << '' 66 | o << '
' 67 | WikiExtensionsFootnote.preview_page.wiki_extension_data[:footnotes] = [] 68 | return o.html_safe 69 | end 70 | end 71 | end 72 | -------------------------------------------------------------------------------- /lib/wiki_extensions_formatter_patch.rb: -------------------------------------------------------------------------------- 1 | # Wiki Extensions plugin for Redmine 2 | # Copyright (C) 2011-2017 Haruyuki Iida 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | require_dependency "redmine/wiki_formatting/textile/formatter" 19 | 20 | module WikiExtensionsFormatterPatch 21 | Redmine::WikiFormatting::Textile::Formatter::RULES << :inline_smiles 22 | 23 | private 24 | 25 | def inline_smiles(text) 26 | emoticon_path = WikiExtentionEmoticonPath.new 27 | 28 | @emoticons = WikiExtensionsEmoticons::Emoticons.new 29 | @emoticons.emoticons.each { |emoticon| 30 | src = emoticon_path.get_emoticon_path(emoticon["image"]) 31 | text.gsub!(Regexp.new("#{Regexp.escape(emoticon["emoticon"])}(\\s|
|

)"), 32 | "\"#{emoticon["emoticon"]}\"\\1") 33 | } 34 | end 35 | 36 | class WikiExtentionEmoticonPath 37 | include Rails.application.routes.url_helpers 38 | 39 | def get_emoticon_path(emoticon) 40 | wiki_extensions_emoticon_path(emoticon) 41 | end 42 | end 43 | end 44 | 45 | Redmine::WikiFormatting::Textile::Formatter.prepend(WikiExtensionsFormatterPatch) 46 | -------------------------------------------------------------------------------- /lib/wiki_extensions_helper.rb: -------------------------------------------------------------------------------- 1 | #Author: Dmitry Manayev 2 | 3 | require 'redmine' 4 | module WikiExtensionsHelper 5 | #This needed to define WikiExtensionsHelper for WikiExtensionsController. 6 | end 7 | module ActionView 8 | module Helpers 9 | module WikiExtensionsHelper 10 | 11 | 12 | ## Method for displaying tree of comments\n 13 | #comments_tree - is orderly array of comments; 14 | #parent_id - is id of parent comment; 15 | #k - is number of tree nodes;\n 16 | #page - is wiki_page object; 17 | #data - is wiki_extensions_data on this page 18 | def display_comments_tree(comments_tree, parent_id,page,data,k = 0) 19 | ret = ' ' 20 | 21 | if k != 0 22 | ret << '