Skip to content

Commit

Permalink
Merge branch 'release/1.1.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-denizet committed Apr 24, 2021
2 parents fcb4507 + 6299083 commit faf2cbd
Show file tree
Hide file tree
Showing 12 changed files with 72 additions and 20 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ http://projects.andriylesyuk.com/projects/wiking/wiki

## Compatibility

Tested on Redmine 3.2.1 with Ruby 2.2.3
For Redmine 2.x compatibility, use version 1.0.0b of the plugin
Tested on Redmine 4.1.2.
Should be compatible with 4.x and 3.x

## Downloading and installing the plugin

Expand All @@ -41,6 +41,8 @@ The installation is now finished and you will be able to use the plugin after yo
* Yusuke Kamiyamane for the "Success" and "Failure" icons
* Ki Won Kim for Korean translation
* @addow fix issue #3
* @das-peter fixing repeat of icons
* @atopcu Turkish translations

## How to contribute

Expand Down
14 changes: 10 additions & 4 deletions app/controllers/macros_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ class MacrosController < ApplicationController
layout 'admin'
menu_item :custom_macros

before_filter :require_admin
before_filter :find_macro, :only => [:edit, :update, :destroy]
before_action :require_admin
before_action :find_macro, :only => [:edit, :update, :destroy]

def index
@macros = WikiMacro.order(:name)
Expand All @@ -14,7 +14,7 @@ def new
end

def create
@macro = WikiMacro.new(params[:wiki_macro])
@macro = WikiMacro.new(macro_params)
if request.post? && @macro.save
flash[:notice] = l(:notice_successful_create)
@macro.register!
Expand All @@ -30,7 +30,7 @@ def edit
def update
if params[:wiki_macro]
old_name = @macro.name
@macro.update_attributes(params[:wiki_macro].permit(:name, :description, :content))
@macro.update_attributes(macro_params)
name_changed = @macro.name_changed?
desc_changed = @macro.description_changed?
if @macro.save
Expand Down Expand Up @@ -66,4 +66,10 @@ def find_macro
render_404
end

private

def macro_params
params.require(:wiki_macro).permit(:name, :description, :content)
end

end
2 changes: 1 addition & 1 deletion app/controllers/mentions_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class MentionsController < ApplicationController
include ApplicationHelper

before_filter :find_user
before_action :find_user

def index
count = 0
Expand Down
2 changes: 1 addition & 1 deletion app/models/wiki_macro.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class WikiMacro < ActiveRecord::Base
NAME_MAX_LENGTH = 30


attr_accessible :name, :description, :content
# attr_accessible :name, :description, :content

validates_presence_of :name, :description, :content
validates_length_of :name, :in => 1..NAME_MAX_LENGTH
Expand Down
4 changes: 4 additions & 0 deletions assets/stylesheets/wiking.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
}
.jstb_more {
background-image: url(../images/jstoolbar/bt_more.png);
background-repeat: no-repeat;
}
span.wiking-hidden {
opacity: 0.25;
Expand All @@ -23,10 +24,12 @@ div.wiking.flash {
}
div.wiking.warning {
background-image: url(../images/warning.png);
background-repeat: no-repeat;
color: #863D09;
}
div.wiking.notice {
background-image: url(../images/notice.png);
background-repeat: no-repeat;
background-color: #c5e7f8;
border-color: #759fcf;
color: #00365f;
Expand Down Expand Up @@ -262,6 +265,7 @@ dt.news-comments {
}
#admin-menu a.custom-macros {
background-image: url(../images/macro.png);
background-repeat: no-repeat;
}
.new_wiki_macro ul.argument-syntax, .edit_wiki_macro ul.argument-syntax {
padding-left: 210px;
Expand Down
23 changes: 23 additions & 0 deletions config/locales/tr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,26 @@ tr:

glyph_left_quote:
glyph_right_quote:

label_custom_wiki_macro_plural: Kullanıcı tanımlı wiki makroları
label_custom_wiki_macro_new: Yeni makro

notice_custom_macro_edit: Düzenleme hatırlatması, bu makro halihazırda kullanılıyor olabilir!

text_custom_wiki_macro_name_info: Sadece küçük harfler (a-z), rakamlar ve altçizgi kabul edilir.
text_custom_wiki_macro_desc_info: 'Wiki Söz dizini desteklenir. Örnek:'
text_custom_wiki_macro_desc_sample: Eğer varsa açıklamaları ile birlikte tüm makroların bir listesini görüntüler
text_custom_wiki_macro_content_info: 'HTML desteklenir. Argümanlar için söz dizimi:'
text_custom_wiki_macro_named_argument: '%{name} - isimlendirilmiş argüman kullanımı: isim=değer.'
text_custom_wiki_macro_unnamed_argument: '%[1] - isimlendirilmemiş argümanlar değerleri ile kullanılır.'
text_custom_wiki_macro_body: '%(*) - makronun gövde metni.'

label_mentions: Anmalar
label_user_mentions: Mentions of %{value}
label_view_all_mentions: Tüm anmaları gör
label_total_number_of_mentions: Anma sayısı
label_user_mentioned: Kullanıcı anıldı

mail_subject_you_mentioned: Portalda anıldınız
mail_body_you_mentioned: "%{title} başlığı altında anıldınız."
mail_body_check_mention: Anıldığınız yeri kontrol edin ...
2 changes: 1 addition & 1 deletion init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
author_url 'http://www.andriylesyuk.com/'
description 'Wiki Next Generation plugin extends Redmine Wiki syntax.'
url 'https://github.com/martin-denizet/wiking'
version '1.1.2'
version '1.1.3'

project_module :wiki do
permission :view_hidden_content, {}
Expand Down
20 changes: 15 additions & 5 deletions lib/wiking_application_helper_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,22 @@ def self.included(base)
base.class_eval do
unloadable

alias_method_chain :textilizable, :wiking
alias_method_chain :parse_headings, :wiking unless Redmine::VERSION::MAJOR == 1 && Redmine::VERSION::MINOR == 0
alias_method_chain :parse_wiki_links, :wiking
alias_method_chain :parse_redmine_links, :wiking
alias_method :textilizable_without_wiking, :textilizable
alias_method :textilizable, :textilizable_with_wiking

alias_method_chain :link_to_user, :login
unless Redmine::VERSION::MAJOR == 1 && Redmine::VERSION::MINOR == 0
alias_method :parse_headings_without_wiking, :parse_headings
alias_method :parse_headings, :parse_headings_with_wiking
end

alias_method :parse_wiki_links_without_wiking, :parse_wiki_links
alias_method :parse_wiki_links, :parse_wiki_links_with_wiking

alias_method :parse_redmine_links_without_wiking, :parse_redmine_links
alias_method :parse_redmine_links, :parse_redmine_links_with_wiking

alias_method :link_to_user_without_login, :link_to_user
alias_method :link_to_user, :link_to_user_with_login

define_method :parse_wiking_conditions, instance_method(:parse_wiking_conditions)
define_method :parse_glyphs, instance_method(:parse_glyphs)
Expand Down
9 changes: 7 additions & 2 deletions lib/wiking_macros_definitions_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ def self.included(base)
base.class_eval do
unloadable

alias_method_chain :macro_exists?, :custom if method_defined?(:macro_exists?)
alias_method_chain :exec_macro, :custom
if method_defined?(:macro_exists?)
alias_method :macro_exists_without_custom?, :macro_exists?
alias_method :macro_exists?, :macro_exists_with_custom?
end

alias_method :exec_macro_without_custom, :exec_macro
alias_method :exec_macro, :exec_macro_with_custom
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/wiking_notifiable_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def self.included(base)
unloadable

class << self
alias_method_chain :all, :wiking
alias_method :all_with_wiking, :all
end
end
end
Expand Down
6 changes: 4 additions & 2 deletions lib/wiking_pdf_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ def self.included(base)
unloadable

if method_defined?(:formatted_text)
alias_method_chain :formatted_text, :wiking
alias_method :formatted_text_without_wiking, :formatted_text
alias_method :formatted_text, :formatted_text_with_wiking
else
alias_method_chain :fix_text_encoding, :wiking
alias_method :fix_text_encoding_without_wiking, :fix_text_encoding
alias_method :formatted_text, :fix_text_encoding_with_wiking
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/wiking_wiki_helper_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module ClassMethods

module InstanceMethods

def wikitoolbar_with_wiking_for(field_id)
def wikitoolbar_with_wiking_for(field_id, preview_url = preview_text_path)
unless @heads_for_wiki_formatter_included
content_for :header_tags do
wiki_heads = ''
Expand Down

0 comments on commit faf2cbd

Please sign in to comment.