Skip to content

Commit a6db440

Browse files
authored
Initial setup as minimum and dummy tags.json (#12)
Signed-off-by: Ko Nagase <[email protected]>
1 parent 65eb683 commit a6db440

File tree

5 files changed

+66
-0
lines changed

5 files changed

+66
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
class SmashTagsController < ApplicationController
2+
3+
before_action :find_project_by_project_id
4+
before_action :authorize
5+
6+
accept_api_auth :index
7+
8+
def index
9+
example = [{
10+
sectionname: "[GTT] Task note",
11+
sectiondescription: "GTT task with image",
12+
sectionnicon: "image",
13+
forms: [
14+
{
15+
formname: "Take a photo",
16+
formitems: [
17+
{
18+
key: "title",
19+
islabel: "true",
20+
value: "",
21+
icon: "infoCircle",
22+
type: "string",
23+
mandatory: "yes"
24+
}
25+
]
26+
}
27+
]
28+
}]
29+
respond_to do |format|
30+
format.api { render json: example }
31+
end
32+
end
33+
end

config/locales/en.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# English strings go here for Rails i18n
2+
en:
3+
# my_label: "My label"

config/routes.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Plugin's routes
2+
# See: http://guides.rubyonrails.org/routing.html
3+
4+
scope 'projects/:project_id' do
5+
resources :smash_tags, only: %i(index), as: :project_smash_tags
6+
end

init.rb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
require 'redmine'
2+
3+
Redmine::Plugin.register :redmine_gtt_smash do
4+
name 'Redmine GTT SMASH Plugin'
5+
author 'Georepublic'
6+
description 'Adds SMASH integration capabilities for GTT projects'
7+
version '0.0.1'
8+
url 'https://github.com/gtt-project/redmine_gtt_smash'
9+
author_url 'https://github.com/gtt-project'
10+
11+
requires_redmine :version_or_higher => '4.0.0'
12+
13+
# settings default: {
14+
# }, partial: 'settings/gtt_smash_settings'
15+
16+
project_module :gtt_smash do
17+
permission :view_gtt_smash, {
18+
smash_tags: %i( index )
19+
}, require: :member, read: true
20+
end
21+
22+
end

test/test_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Load the Redmine helper
2+
require File.expand_path(File.dirname(__FILE__) + '/../../../test/test_helper')

0 commit comments

Comments
 (0)