activity_notification 2.4.1 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -2
- data/app/jobs/activity_notification/cascading_notification_job.rb +123 -0
- data/docs/Functions.md +197 -1
- data/lib/activity_notification/apis/cascading_notification_api.rb +208 -0
- data/lib/activity_notification/apis/notification_api.rb +3 -0
- data/lib/activity_notification/config.rb +10 -0
- data/lib/activity_notification/mailers/helpers.rb +27 -1
- data/lib/activity_notification/version.rb +1 -1
- data/lib/generators/templates/activity_notification.rb +8 -0
- metadata +5 -441
- data/.codeclimate.yml +0 -33
- data/.coveralls.yml +0 -1
- data/.github/ISSUE_TEMPLATE/bug_report.md +0 -22
- data/.github/ISSUE_TEMPLATE/feature_request.md +0 -17
- data/.github/pull_request_template.md +0 -13
- data/.github/workflows/build.yml +0 -100
- data/.gitignore +0 -74
- data/.rspec +0 -3
- data/.rubocop.yml +0 -1157
- data/.yardopts +0 -6
- data/CHANGELOG.md +0 -452
- data/Gemfile +0 -31
- data/Procfile +0 -2
- data/Rakefile +0 -28
- data/activity_notification.gemspec +0 -44
- data/ai-curated-specs/issues/172/design.md +0 -220
- data/ai-curated-specs/issues/172/tasks.md +0 -326
- data/ai-curated-specs/issues/188/design.md +0 -227
- data/ai-curated-specs/issues/188/requirements.md +0 -78
- data/ai-curated-specs/issues/188/tasks.md +0 -203
- data/ai-curated-specs/issues/188/upstream-contributions.md +0 -592
- data/ai-curated-specs/issues/50/design.md +0 -235
- data/ai-curated-specs/issues/50/requirements.md +0 -49
- data/ai-curated-specs/issues/50/tasks.md +0 -232
- data/bin/_dynamodblocal +0 -4
- data/bin/bundle_update.sh +0 -7
- data/bin/deploy_on_heroku.sh +0 -16
- data/bin/install_dynamodblocal.sh +0 -5
- data/bin/start_dynamodblocal.sh +0 -47
- data/bin/stop_dynamodblocal.sh +0 -34
- data/gemfiles/Gemfile.rails-5.0 +0 -25
- data/gemfiles/Gemfile.rails-5.1 +0 -25
- data/gemfiles/Gemfile.rails-5.2 +0 -24
- data/gemfiles/Gemfile.rails-6.0 +0 -23
- data/gemfiles/Gemfile.rails-6.1 +0 -22
- data/gemfiles/Gemfile.rails-7.0 +0 -25
- data/gemfiles/Gemfile.rails-7.1 +0 -23
- data/gemfiles/Gemfile.rails-7.2 +0 -23
- data/gemfiles/Gemfile.rails-8.0 +0 -24
- data/package.json +0 -8
- data/spec/channels/notification_api_channel_shared_examples.rb +0 -59
- data/spec/channels/notification_api_channel_spec.rb +0 -49
- data/spec/channels/notification_api_with_devise_channel_spec.rb +0 -76
- data/spec/channels/notification_channel_shared_examples.rb +0 -59
- data/spec/channels/notification_channel_spec.rb +0 -48
- data/spec/channels/notification_with_devise_channel_spec.rb +0 -97
- data/spec/concerns/apis/notification_api_spec.rb +0 -1627
- data/spec/concerns/apis/subscription_api_spec.rb +0 -474
- data/spec/concerns/common_spec.rb +0 -213
- data/spec/concerns/models/group_spec.rb +0 -61
- data/spec/concerns/models/notifiable_spec.rb +0 -782
- data/spec/concerns/models/notifier_spec.rb +0 -71
- data/spec/concerns/models/subscriber_spec.rb +0 -800
- data/spec/concerns/models/target_spec.rb +0 -1285
- data/spec/concerns/renderable_spec.rb +0 -129
- data/spec/config_spec.rb +0 -85
- data/spec/controllers/common_controller_spec.rb +0 -25
- data/spec/controllers/controller_spec_utility.rb +0 -100
- data/spec/controllers/dummy_common_controller.rb +0 -5
- data/spec/controllers/notifications_api_controller_shared_examples.rb +0 -619
- data/spec/controllers/notifications_api_controller_spec.rb +0 -19
- data/spec/controllers/notifications_api_with_devise_controller_spec.rb +0 -60
- data/spec/controllers/notifications_controller_shared_examples.rb +0 -743
- data/spec/controllers/notifications_controller_spec.rb +0 -11
- data/spec/controllers/notifications_with_devise_controller_spec.rb +0 -97
- data/spec/controllers/subscriptions_api_controller_shared_examples.rb +0 -750
- data/spec/controllers/subscriptions_api_controller_spec.rb +0 -19
- data/spec/controllers/subscriptions_api_with_devise_controller_spec.rb +0 -60
- data/spec/controllers/subscriptions_controller_shared_examples.rb +0 -946
- data/spec/controllers/subscriptions_controller_spec.rb +0 -11
- data/spec/controllers/subscriptions_with_devise_controller_spec.rb +0 -97
- data/spec/factories/admins.rb +0 -5
- data/spec/factories/articles.rb +0 -5
- data/spec/factories/comments.rb +0 -6
- data/spec/factories/dummy/dummy_group.rb +0 -4
- data/spec/factories/dummy/dummy_notifiable.rb +0 -4
- data/spec/factories/dummy/dummy_notifier.rb +0 -4
- data/spec/factories/dummy/dummy_subscriber.rb +0 -4
- data/spec/factories/dummy/dummy_target.rb +0 -4
- data/spec/factories/notifications.rb +0 -7
- data/spec/factories/subscriptions.rb +0 -8
- data/spec/factories/users.rb +0 -11
- data/spec/generators/controllers_generator_spec.rb +0 -85
- data/spec/generators/install_generator_spec.rb +0 -43
- data/spec/generators/migration/migration_generator_spec.rb +0 -80
- data/spec/generators/models_generator_spec.rb +0 -96
- data/spec/generators/views_generator_spec.rb +0 -195
- data/spec/helpers/polymorphic_helpers_spec.rb +0 -89
- data/spec/helpers/view_helpers_spec.rb +0 -547
- data/spec/jobs/notification_resilience_job_spec.rb +0 -167
- data/spec/jobs/notify_all_job_spec.rb +0 -23
- data/spec/jobs/notify_job_spec.rb +0 -23
- data/spec/jobs/notify_to_job_spec.rb +0 -23
- data/spec/mailers/mailer_spec.rb +0 -214
- data/spec/mailers/notification_resilience_spec.rb +0 -263
- data/spec/models/dummy/dummy_group_spec.rb +0 -10
- data/spec/models/dummy/dummy_notifiable_spec.rb +0 -10
- data/spec/models/dummy/dummy_notifier_spec.rb +0 -10
- data/spec/models/dummy/dummy_subscriber_spec.rb +0 -8
- data/spec/models/dummy/dummy_target_spec.rb +0 -10
- data/spec/models/notification_spec.rb +0 -472
- data/spec/models/subscription_spec.rb +0 -215
- data/spec/optional_targets/action_cable_api_channel_spec.rb +0 -34
- data/spec/optional_targets/action_cable_channel_spec.rb +0 -41
- data/spec/optional_targets/amazon_sns_spec.rb +0 -47
- data/spec/optional_targets/base_spec.rb +0 -45
- data/spec/optional_targets/slack_spec.rb +0 -44
- data/spec/orm/dynamoid_spec.rb +0 -115
- data/spec/rails_app/Rakefile +0 -15
- data/spec/rails_app/app/assets/config/manifest.js +0 -3
- data/spec/rails_app/app/assets/images/.keep +0 -0
- data/spec/rails_app/app/assets/javascripts/application.js +0 -3
- data/spec/rails_app/app/assets/javascripts/cable.js +0 -12
- data/spec/rails_app/app/assets/stylesheets/application.css +0 -15
- data/spec/rails_app/app/assets/stylesheets/reset.css +0 -85
- data/spec/rails_app/app/assets/stylesheets/style.css +0 -244
- data/spec/rails_app/app/controllers/admins_controller.rb +0 -21
- data/spec/rails_app/app/controllers/application_controller.rb +0 -5
- data/spec/rails_app/app/controllers/articles_controller.rb +0 -67
- data/spec/rails_app/app/controllers/comments_controller.rb +0 -36
- data/spec/rails_app/app/controllers/concerns/.keep +0 -0
- data/spec/rails_app/app/controllers/spa_controller.rb +0 -7
- data/spec/rails_app/app/controllers/users/notifications_controller.rb +0 -2
- data/spec/rails_app/app/controllers/users/notifications_with_devise_controller.rb +0 -2
- data/spec/rails_app/app/controllers/users/subscriptions_controller.rb +0 -2
- data/spec/rails_app/app/controllers/users/subscriptions_with_devise_controller.rb +0 -2
- data/spec/rails_app/app/controllers/users_controller.rb +0 -26
- data/spec/rails_app/app/helpers/application_helper.rb +0 -2
- data/spec/rails_app/app/helpers/devise_helper.rb +0 -2
- data/spec/rails_app/app/javascript/App.vue +0 -40
- data/spec/rails_app/app/javascript/components/DeviseTokenAuth.vue +0 -82
- data/spec/rails_app/app/javascript/components/Top.vue +0 -98
- data/spec/rails_app/app/javascript/components/notifications/Index.vue +0 -200
- data/spec/rails_app/app/javascript/components/notifications/Notification.vue +0 -133
- data/spec/rails_app/app/javascript/components/notifications/NotificationContent.vue +0 -122
- data/spec/rails_app/app/javascript/components/subscriptions/Index.vue +0 -279
- data/spec/rails_app/app/javascript/components/subscriptions/NewSubscription.vue +0 -112
- data/spec/rails_app/app/javascript/components/subscriptions/NotificationKey.vue +0 -141
- data/spec/rails_app/app/javascript/components/subscriptions/Subscription.vue +0 -226
- data/spec/rails_app/app/javascript/config/development.js +0 -5
- data/spec/rails_app/app/javascript/config/environment.js +0 -7
- data/spec/rails_app/app/javascript/config/production.js +0 -5
- data/spec/rails_app/app/javascript/config/test.js +0 -5
- data/spec/rails_app/app/javascript/packs/application.js +0 -18
- data/spec/rails_app/app/javascript/packs/spa.js +0 -14
- data/spec/rails_app/app/javascript/router/index.js +0 -73
- data/spec/rails_app/app/javascript/store/index.js +0 -37
- data/spec/rails_app/app/mailers/.keep +0 -0
- data/spec/rails_app/app/mailers/custom_notification_mailer.rb +0 -5
- data/spec/rails_app/app/models/admin.rb +0 -35
- data/spec/rails_app/app/models/article.rb +0 -54
- data/spec/rails_app/app/models/comment.rb +0 -81
- data/spec/rails_app/app/models/dummy/dummy_base.rb +0 -11
- data/spec/rails_app/app/models/dummy/dummy_group.rb +0 -23
- data/spec/rails_app/app/models/dummy/dummy_notifiable.rb +0 -15
- data/spec/rails_app/app/models/dummy/dummy_notifiable_target.rb +0 -27
- data/spec/rails_app/app/models/dummy/dummy_notifier.rb +0 -15
- data/spec/rails_app/app/models/dummy/dummy_subscriber.rb +0 -14
- data/spec/rails_app/app/models/dummy/dummy_target.rb +0 -16
- data/spec/rails_app/app/models/user.rb +0 -73
- data/spec/rails_app/app/views/activity_notification/mailer/dummy_subscribers/test_key.text.erb +0 -1
- data/spec/rails_app/app/views/activity_notification/notifications/default/article/_update.html.erb +0 -146
- data/spec/rails_app/app/views/activity_notification/notifications/default/custom/_path_test.html.erb +0 -1
- data/spec/rails_app/app/views/activity_notification/notifications/default/custom/_test.html.erb +0 -1
- data/spec/rails_app/app/views/activity_notification/notifications/users/_custom_index.html.erb +0 -1
- data/spec/rails_app/app/views/activity_notification/notifications/users/custom/_test.html.erb +0 -1
- data/spec/rails_app/app/views/activity_notification/notifications/users/overridden/custom/_test.html.erb +0 -1
- data/spec/rails_app/app/views/activity_notification/optional_targets/admins/amazon_sns/comment/_default.text.erb +0 -10
- data/spec/rails_app/app/views/articles/_form.html.erb +0 -24
- data/spec/rails_app/app/views/articles/edit.html.erb +0 -8
- data/spec/rails_app/app/views/articles/index.html.erb +0 -113
- data/spec/rails_app/app/views/articles/new.html.erb +0 -7
- data/spec/rails_app/app/views/articles/show.html.erb +0 -49
- data/spec/rails_app/app/views/layouts/_header.html.erb +0 -46
- data/spec/rails_app/app/views/layouts/application.html.erb +0 -15
- data/spec/rails_app/app/views/spa/index.html.erb +0 -2
- data/spec/rails_app/babel.config.js +0 -72
- data/spec/rails_app/bin/bundle +0 -3
- data/spec/rails_app/bin/rails +0 -4
- data/spec/rails_app/bin/rake +0 -4
- data/spec/rails_app/bin/setup +0 -29
- data/spec/rails_app/bin/webpack +0 -18
- data/spec/rails_app/bin/webpack-dev-server +0 -18
- data/spec/rails_app/config/application.rb +0 -54
- data/spec/rails_app/config/boot.rb +0 -5
- data/spec/rails_app/config/cable.yml +0 -8
- data/spec/rails_app/config/database.yml +0 -36
- data/spec/rails_app/config/dynamoid.rb +0 -13
- data/spec/rails_app/config/environment.rb +0 -26
- data/spec/rails_app/config/environments/development.rb +0 -60
- data/spec/rails_app/config/environments/production.rb +0 -85
- data/spec/rails_app/config/environments/test.rb +0 -53
- data/spec/rails_app/config/initializers/activity_notification.rb +0 -104
- data/spec/rails_app/config/initializers/assets.rb +0 -11
- data/spec/rails_app/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/rails_app/config/initializers/cookies_serializer.rb +0 -3
- data/spec/rails_app/config/initializers/copy_it.aws.rb.template +0 -6
- data/spec/rails_app/config/initializers/devise.rb +0 -278
- data/spec/rails_app/config/initializers/devise_token_auth.rb +0 -55
- data/spec/rails_app/config/initializers/filter_parameter_logging.rb +0 -4
- data/spec/rails_app/config/initializers/inflections.rb +0 -16
- data/spec/rails_app/config/initializers/mime_types.rb +0 -4
- data/spec/rails_app/config/initializers/mysql.rb +0 -9
- data/spec/rails_app/config/initializers/session_store.rb +0 -3
- data/spec/rails_app/config/initializers/wrap_parameters.rb +0 -14
- data/spec/rails_app/config/initializers/zeitwerk.rb +0 -10
- data/spec/rails_app/config/locales/activity_notification.en.yml +0 -26
- data/spec/rails_app/config/locales/devise.en.yml +0 -62
- data/spec/rails_app/config/mongoid.yml +0 -13
- data/spec/rails_app/config/routes.rb +0 -50
- data/spec/rails_app/config/secrets.yml +0 -22
- data/spec/rails_app/config/webpack/development.js +0 -5
- data/spec/rails_app/config/webpack/environment.js +0 -7
- data/spec/rails_app/config/webpack/loaders/vue.js +0 -6
- data/spec/rails_app/config/webpack/production.js +0 -5
- data/spec/rails_app/config/webpack/test.js +0 -5
- data/spec/rails_app/config/webpacker.yml +0 -97
- data/spec/rails_app/config.ru +0 -4
- data/spec/rails_app/db/migrate/20160716000000_create_test_tables.rb +0 -42
- data/spec/rails_app/db/migrate/20181209000000_create_activity_notification_tables.rb +0 -33
- data/spec/rails_app/db/migrate/20191201000000_add_tokens_to_users.rb +0 -10
- data/spec/rails_app/db/schema.rb +0 -98
- data/spec/rails_app/db/seeds.rb +0 -95
- data/spec/rails_app/lib/custom_optional_targets/console_output.rb +0 -16
- data/spec/rails_app/lib/custom_optional_targets/raise_error.rb +0 -14
- data/spec/rails_app/lib/custom_optional_targets/wrong_target.rb +0 -13
- data/spec/rails_app/lib/mailer_previews/mailer_preview.rb +0 -29
- data/spec/rails_app/package.json +0 -23
- data/spec/rails_app/postcss.config.js +0 -12
- data/spec/rails_app/public/404.html +0 -67
- data/spec/rails_app/public/422.html +0 -67
- data/spec/rails_app/public/500.html +0 -66
- data/spec/rails_app/public/favicon.ico +0 -0
- data/spec/roles/acts_as_group_spec.rb +0 -30
- data/spec/roles/acts_as_notifiable_spec.rb +0 -432
- data/spec/roles/acts_as_notifier_spec.rb +0 -30
- data/spec/roles/acts_as_target_spec.rb +0 -36
- data/spec/spec_helper.rb +0 -56
- data/spec/version_spec.rb +0 -31
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
body {
|
|
2
|
-
font-family: 'Lucida Grande', Meiryo, sans-serif;
|
|
3
|
-
color: #4f4f4f;
|
|
4
|
-
font-weight: normal;
|
|
5
|
-
font-style: normal;
|
|
6
|
-
background-color: #fafafa;
|
|
7
|
-
}
|
|
8
|
-
a {
|
|
9
|
-
color: #4363ba;
|
|
10
|
-
}
|
|
11
|
-
a:hover {
|
|
12
|
-
color: #27a5eb;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/* notice */
|
|
16
|
-
.notice_wrapper {
|
|
17
|
-
width: 100%;
|
|
18
|
-
background-color: #fafafa;
|
|
19
|
-
border-bottom: 1px solid #e5e5e5;
|
|
20
|
-
}
|
|
21
|
-
.notice_wrapper .notice {
|
|
22
|
-
font-size: 14px;
|
|
23
|
-
padding: 14px 40px;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/* header */
|
|
27
|
-
header{
|
|
28
|
-
width: 100%;
|
|
29
|
-
border-bottom: 1px solid #e5e5e5;
|
|
30
|
-
background-color: #fff;
|
|
31
|
-
}
|
|
32
|
-
header .header_area {
|
|
33
|
-
padding: 20px 40px;
|
|
34
|
-
}
|
|
35
|
-
header .header_area:after{
|
|
36
|
-
content: "";
|
|
37
|
-
clear: both;
|
|
38
|
-
display: block;
|
|
39
|
-
}
|
|
40
|
-
header .header_area .header_root_wrapper{
|
|
41
|
-
float: left;
|
|
42
|
-
}
|
|
43
|
-
header .header_area .header_root_wrapper a{
|
|
44
|
-
font-size: 24px;
|
|
45
|
-
letter-spacing: 0.1em;
|
|
46
|
-
}
|
|
47
|
-
header .header_area .header_menu_wrapper,
|
|
48
|
-
header .header_area .header_notification_wrapper {
|
|
49
|
-
float: right;
|
|
50
|
-
}
|
|
51
|
-
header .header_area .header_menu_wrapper p,
|
|
52
|
-
header .header_area .header_notification_wrapper p {
|
|
53
|
-
font-size: 14px;
|
|
54
|
-
font-weight: bold;
|
|
55
|
-
height: 24px;
|
|
56
|
-
}
|
|
57
|
-
header .header_area .header_menu_wrapper p a,
|
|
58
|
-
header .header_area .header_notification_wrapper p a {
|
|
59
|
-
margin-left: 10px;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/* article */
|
|
63
|
-
article{
|
|
64
|
-
width: 1000px;
|
|
65
|
-
margin: 0 auto;
|
|
66
|
-
padding: 40px 40px;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
section{
|
|
70
|
-
position: relative;
|
|
71
|
-
width: 600px;
|
|
72
|
-
border: 1px solid #e5e5e5;
|
|
73
|
-
background-color: #fff;
|
|
74
|
-
|
|
75
|
-
padding: 20px;
|
|
76
|
-
box-sizing: border-box;
|
|
77
|
-
margin-bottom: 30px;
|
|
78
|
-
}
|
|
79
|
-
section:last-of-type{
|
|
80
|
-
margin-bottom: 0;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.create_button_wrapper{
|
|
84
|
-
position: absolute;
|
|
85
|
-
right: 0;
|
|
86
|
-
top: 0;
|
|
87
|
-
padding: 20px;
|
|
88
|
-
margin-top: 10px;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
h1 {
|
|
92
|
-
font-size: 24px;
|
|
93
|
-
letter-spacing: 0.1em;
|
|
94
|
-
margin-bottom: 10px;
|
|
95
|
-
}
|
|
96
|
-
.list_wrapper + h2{
|
|
97
|
-
margin-top: 20px;
|
|
98
|
-
}
|
|
99
|
-
h2 {
|
|
100
|
-
font-size: 20px;
|
|
101
|
-
letter-spacing: 0.1em;
|
|
102
|
-
line-height: 1.4;
|
|
103
|
-
margin-bottom: 10px;
|
|
104
|
-
}
|
|
105
|
-
p{
|
|
106
|
-
font-size: 16px;
|
|
107
|
-
line-height: 2.0;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/* list */
|
|
111
|
-
.list_wrapper {
|
|
112
|
-
padding: 15px 10px;
|
|
113
|
-
position: relative;
|
|
114
|
-
border-bottom: 1px solid #e5e5e5;
|
|
115
|
-
}
|
|
116
|
-
.list_wrapper:last-child {
|
|
117
|
-
border-bottom: none;
|
|
118
|
-
}
|
|
119
|
-
.list_wrapper:after{
|
|
120
|
-
content: "";
|
|
121
|
-
clear: both;
|
|
122
|
-
display: block;
|
|
123
|
-
}
|
|
124
|
-
.list_wrapper .list_image {
|
|
125
|
-
float: left;
|
|
126
|
-
width: 40px;
|
|
127
|
-
height: 40px;
|
|
128
|
-
background-position: center;
|
|
129
|
-
background-repeat: no-repeat;
|
|
130
|
-
background-size: cover;
|
|
131
|
-
background-color: #979797;
|
|
132
|
-
}
|
|
133
|
-
.list_wrapper .list_image.large {
|
|
134
|
-
width: 120px;
|
|
135
|
-
height: 90px;
|
|
136
|
-
}
|
|
137
|
-
.list_image.large + .list_description_wrapper {
|
|
138
|
-
width: calc(100% - 130px);
|
|
139
|
-
}
|
|
140
|
-
.list_wrapper .list_description_wrapper {
|
|
141
|
-
float: left;
|
|
142
|
-
width: calc(100% - 50px);
|
|
143
|
-
margin-top: 0;
|
|
144
|
-
margin-left: 10px;
|
|
145
|
-
}
|
|
146
|
-
.list_wrapper .list_description_wrapper .list_title {
|
|
147
|
-
font-size: 18px;
|
|
148
|
-
font-weight: bold;
|
|
149
|
-
line-height: 1.4;
|
|
150
|
-
}
|
|
151
|
-
.list_wrapper .list_description_wrapper .list_description {
|
|
152
|
-
color: #979797;
|
|
153
|
-
font-size: 14px;
|
|
154
|
-
line-height: 1.6;
|
|
155
|
-
}
|
|
156
|
-
.list_wrapper .list_description_wrapper .list_description span{
|
|
157
|
-
color: #4f4f4f;
|
|
158
|
-
font-weight: bold;
|
|
159
|
-
}
|
|
160
|
-
.list_wrapper .list_description_wrapper .list_button_wrapper{
|
|
161
|
-
margin-top: 16px;
|
|
162
|
-
text-align: right;
|
|
163
|
-
margin-bottom: 10px;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
/* form */
|
|
167
|
-
.input_wrapper{
|
|
168
|
-
width: 100%;
|
|
169
|
-
background-color: #fff;
|
|
170
|
-
border: 1px solid #e5e5e5;
|
|
171
|
-
border-radius: 5px;
|
|
172
|
-
padding: 10px;
|
|
173
|
-
box-sizing: border-box;
|
|
174
|
-
cursor: text;
|
|
175
|
-
margin-bottom: 10px;
|
|
176
|
-
}
|
|
177
|
-
.input_wrapper input{
|
|
178
|
-
width: 100%;
|
|
179
|
-
font-size: 16px;
|
|
180
|
-
outline: 0;
|
|
181
|
-
border: none;
|
|
182
|
-
}
|
|
183
|
-
.textarea_wrapper{
|
|
184
|
-
width: 100%;
|
|
185
|
-
background-color: #fff;
|
|
186
|
-
border: 1px solid #e5e5e5;
|
|
187
|
-
border-radius: 5px;
|
|
188
|
-
padding: 10px;
|
|
189
|
-
box-sizing: border-box;
|
|
190
|
-
cursor: text;
|
|
191
|
-
}
|
|
192
|
-
.textarea_wrapper textarea{
|
|
193
|
-
width: 100%;
|
|
194
|
-
height: 100px;
|
|
195
|
-
font-size: 16px;
|
|
196
|
-
outline: 0;
|
|
197
|
-
border: none;
|
|
198
|
-
resize: none;
|
|
199
|
-
}
|
|
200
|
-
.submit_button_wrapper{
|
|
201
|
-
text-align: right;
|
|
202
|
-
margin-top: 10px;
|
|
203
|
-
}
|
|
204
|
-
.left_button_wrapper{
|
|
205
|
-
margin-top: 16px;
|
|
206
|
-
text-align: left;
|
|
207
|
-
margin-bottom: 10px;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
/* button */
|
|
211
|
-
.gray_button{
|
|
212
|
-
color: #4f4f4f;
|
|
213
|
-
font-weight: bold;
|
|
214
|
-
font-size: 12px;
|
|
215
|
-
padding: 10px 14px;
|
|
216
|
-
margin-left: 10px;
|
|
217
|
-
border: 1px solid #e5e5e5;
|
|
218
|
-
background-color: #fafafa;
|
|
219
|
-
}
|
|
220
|
-
.gray_button:first-child {
|
|
221
|
-
margin-left: 0;
|
|
222
|
-
}
|
|
223
|
-
.gray_button:hover{
|
|
224
|
-
color: #4f4f4f;
|
|
225
|
-
border: 1px solid #e5e5e5;
|
|
226
|
-
background-color: #efefef;
|
|
227
|
-
}
|
|
228
|
-
.green_button{
|
|
229
|
-
color: #fff;
|
|
230
|
-
font-weight: bold;
|
|
231
|
-
font-size: 12px;
|
|
232
|
-
padding: 10px 14px;
|
|
233
|
-
margin-left: 10px;
|
|
234
|
-
border: 1px solid #59e58f;
|
|
235
|
-
background-color: #59e58f;
|
|
236
|
-
}
|
|
237
|
-
.green_button:first-child {
|
|
238
|
-
margin-left: 0;
|
|
239
|
-
}
|
|
240
|
-
.green_button:hover{
|
|
241
|
-
color: #fff;
|
|
242
|
-
border: 1px solid #3fbc60;
|
|
243
|
-
background-color: #3fbc60;
|
|
244
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
class AdminsController < ApplicationController
|
|
2
|
-
before_action :set_admin, only: [:show]
|
|
3
|
-
|
|
4
|
-
# GET /admins
|
|
5
|
-
def index
|
|
6
|
-
render json: {
|
|
7
|
-
users: Admin.all.as_json(include: :user, methods: [:printable_target_name, :notification_action_cable_allowed?, :notification_action_cable_with_devise?])
|
|
8
|
-
}
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
# GET /admins/:id
|
|
12
|
-
def show
|
|
13
|
-
render json: @admin.as_json(include: :user, methods: [:printable_target_name, :notification_action_cable_allowed?, :notification_action_cable_with_devise?])
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
private
|
|
17
|
-
# Use callbacks to share common setup or constraints between actions.
|
|
18
|
-
def set_admin
|
|
19
|
-
@admin = Admin.find(params[:id])
|
|
20
|
-
end
|
|
21
|
-
end
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
class ArticlesController < ApplicationController
|
|
2
|
-
before_action :authenticate_user!, except: [:index, :show]
|
|
3
|
-
before_action :set_article, only: [:show, :edit, :update, :destroy]
|
|
4
|
-
|
|
5
|
-
# GET /articles
|
|
6
|
-
def index
|
|
7
|
-
@exists_notifications_routes = respond_to?('notifications_path')
|
|
8
|
-
@exists_user_notifications_routes = respond_to?('user_notifications_path')
|
|
9
|
-
@exists_admins_notifications_routes = respond_to?('admins_notifications_path')
|
|
10
|
-
@exists_admin_notifications_routes = respond_to?('admin_notifications_path')
|
|
11
|
-
@articles = Article.all.includes(:user)
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
# GET /articles/1
|
|
15
|
-
def show
|
|
16
|
-
@comment = Comment.new
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
# GET /articles/new
|
|
20
|
-
def new
|
|
21
|
-
@article = Article.new
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
# GET /articles/1/edit
|
|
25
|
-
def edit
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
# POST /articles
|
|
29
|
-
def create
|
|
30
|
-
@article = Article.new(article_params)
|
|
31
|
-
@article.user = current_user
|
|
32
|
-
|
|
33
|
-
if @article.save
|
|
34
|
-
@article.notify :users, key: 'article.create'
|
|
35
|
-
redirect_to @article, notice: 'Article was successfully created.'
|
|
36
|
-
else
|
|
37
|
-
render :new
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
# PATCH/PUT /articles/1
|
|
42
|
-
def update
|
|
43
|
-
if @article.update(article_params)
|
|
44
|
-
@article.notify :users, key: 'article.update'
|
|
45
|
-
redirect_to @article, notice: 'Article was successfully updated.'
|
|
46
|
-
else
|
|
47
|
-
render :edit
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
# DELETE /articles/1
|
|
52
|
-
def destroy
|
|
53
|
-
@article.destroy
|
|
54
|
-
redirect_to articles_url, notice: 'Article was successfully destroyed.'
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
private
|
|
58
|
-
# Use callbacks to share common setup or constraints between actions.
|
|
59
|
-
def set_article
|
|
60
|
-
@article = Article.includes(:user).find(params[:id])
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
# Only allow a trusted parameter "white list" through.
|
|
64
|
-
def article_params
|
|
65
|
-
params.require(:article).permit(:title, :body)
|
|
66
|
-
end
|
|
67
|
-
end
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
class CommentsController < ApplicationController
|
|
2
|
-
before_action :set_comment, only: [:destroy]
|
|
3
|
-
|
|
4
|
-
# POST /comments
|
|
5
|
-
def create
|
|
6
|
-
@comment = Comment.new(comment_params)
|
|
7
|
-
@comment.user = current_user
|
|
8
|
-
|
|
9
|
-
if @comment.save
|
|
10
|
-
@comment.notify_now :users, key: 'comment.create', parameters: { notifier_name: @comment.user.printable_notifier_name, article_title: @comment.article.title }
|
|
11
|
-
# @comment.notify_later :users, key: 'comment.create', parameters: { notifier_name: @comment.user.printable_notifier_name, article_title: @comment.article.title }
|
|
12
|
-
# @comment.notify :users, key: 'comment.create', notify_later: true, parameters: { notifier_name: @comment.user.printable_notifier_name, article_title: @comment.article.title }
|
|
13
|
-
redirect_to @comment.article, notice: 'Comment was successfully created.'
|
|
14
|
-
else
|
|
15
|
-
redirect_to @comment.article
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
# DELETE /comments/1
|
|
20
|
-
def destroy
|
|
21
|
-
article = @comment.article
|
|
22
|
-
@comment.destroy
|
|
23
|
-
redirect_to article, notice: 'Comment was successfully destroyed.'
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
private
|
|
27
|
-
# Use callbacks to share common setup or constraints between actions.
|
|
28
|
-
def set_comment
|
|
29
|
-
@comment = Comment.find(params[:id])
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
# Only allow a trusted parameter "white list" through.
|
|
33
|
-
def comment_params
|
|
34
|
-
params.require(:comment).permit(:article_id, :body)
|
|
35
|
-
end
|
|
36
|
-
end
|
|
File without changes
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
class UsersController < ApplicationController
|
|
2
|
-
before_action :set_user, only: [:show]
|
|
3
|
-
|
|
4
|
-
# GET /users
|
|
5
|
-
def index
|
|
6
|
-
render json: {
|
|
7
|
-
users: User.all
|
|
8
|
-
}
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
# GET /users/:id
|
|
12
|
-
def show
|
|
13
|
-
render json: @user
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
# GET /users/find
|
|
17
|
-
def find
|
|
18
|
-
render json: User.find_by_email!(params[:email])
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
private
|
|
22
|
-
# Use callbacks to share common setup or constraints between actions.
|
|
23
|
-
def set_user
|
|
24
|
-
@user = User.find(params[:id])
|
|
25
|
-
end
|
|
26
|
-
end
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<router-view />
|
|
4
|
-
</div>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
import Vue from 'vue'
|
|
9
|
-
import VueMoment from 'vue-moment'
|
|
10
|
-
import moment from 'moment-timezone'
|
|
11
|
-
import VuePluralize from 'vue-pluralize'
|
|
12
|
-
import ActionCableVue from 'actioncable-vue'
|
|
13
|
-
import axios from 'axios'
|
|
14
|
-
import env from './config/environment'
|
|
15
|
-
|
|
16
|
-
axios.defaults.baseURL = "/api/v2"
|
|
17
|
-
|
|
18
|
-
Vue.use(VueMoment, { moment })
|
|
19
|
-
Vue.use(VuePluralize)
|
|
20
|
-
Vue.use(ActionCableVue, {
|
|
21
|
-
debug: true,
|
|
22
|
-
debugLevel: 'error',
|
|
23
|
-
connectionUrl: env.ACTION_CABLE_CONNECTION_URL,
|
|
24
|
-
connectImmediately: true
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
export default {
|
|
28
|
-
name: 'App',
|
|
29
|
-
mounted () {
|
|
30
|
-
if (this.$store.getters.userSignedIn) {
|
|
31
|
-
for (var authHeader of Object.keys(this.$store.getters.authHeaders)) {
|
|
32
|
-
axios.defaults.headers.common[authHeader] = this.$store.getters.authHeaders[authHeader];
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
</script>
|
|
38
|
-
|
|
39
|
-
<style scoped>
|
|
40
|
-
</style>
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div id="login">
|
|
3
|
-
<h2>Log in</h2>
|
|
4
|
-
<form class="new_user" @submit.prevent="login">
|
|
5
|
-
<div class="field">
|
|
6
|
-
<label for="user_email">Email</label><br />
|
|
7
|
-
<input v-model="loginParams.email" autofocus="autofocus" autocomplete="email" type="email" value="" name="user[email]" id="user_email" />
|
|
8
|
-
</div>
|
|
9
|
-
<div class="field">
|
|
10
|
-
<label for="user_password">Password</label><br />
|
|
11
|
-
<input v-model="loginParams.password" autocomplete="current-password" type="password" name="user[password]" id="user_password" />
|
|
12
|
-
</div>
|
|
13
|
-
<div class="actions">
|
|
14
|
-
<input type="submit" name="commit" value="Log in" data-disable-with="Log in" />
|
|
15
|
-
</div>
|
|
16
|
-
</form>
|
|
17
|
-
</div>
|
|
18
|
-
</template>
|
|
19
|
-
|
|
20
|
-
<script>
|
|
21
|
-
import axios from 'axios'
|
|
22
|
-
|
|
23
|
-
export default {
|
|
24
|
-
name: 'DeviseTokenAuth',
|
|
25
|
-
props: {
|
|
26
|
-
isLogout: {
|
|
27
|
-
type: Boolean,
|
|
28
|
-
default: false
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
data () {
|
|
32
|
-
return {
|
|
33
|
-
loginParams: {
|
|
34
|
-
email: "",
|
|
35
|
-
password: ""
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
mounted () {
|
|
40
|
-
if (this.isLogout) {
|
|
41
|
-
this.logout();
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
methods: {
|
|
45
|
-
login () {
|
|
46
|
-
axios
|
|
47
|
-
.post('/auth/sign_in', { email: this.loginParams.email, password: this.loginParams.password })
|
|
48
|
-
.then(response => {
|
|
49
|
-
if (response.status == 200) {
|
|
50
|
-
let authHeaders = {};
|
|
51
|
-
for (let authHeader of ['access-token', 'client', 'uid']) {
|
|
52
|
-
authHeaders[authHeader] = response.headers[authHeader];
|
|
53
|
-
axios.defaults.headers.common[authHeader] = authHeaders[authHeader];
|
|
54
|
-
}
|
|
55
|
-
this.$store.commit('signIn', { user: response.data.data, authHeaders: authHeaders });
|
|
56
|
-
if (this.$route.query.redirect) {
|
|
57
|
-
this.$router.push(this.$route.query.redirect);
|
|
58
|
-
} else {
|
|
59
|
-
this.$router.push('/');
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
})
|
|
63
|
-
.catch (error => {
|
|
64
|
-
console.log("Authentication failed");
|
|
65
|
-
if (error.response.status == 401) {
|
|
66
|
-
this.$router.go({path: this.$router.currentRoute.path});
|
|
67
|
-
}
|
|
68
|
-
})
|
|
69
|
-
},
|
|
70
|
-
logout () {
|
|
71
|
-
for (var authHeader of Object.keys(this.$store.getters.authHeaders)) {
|
|
72
|
-
delete axios.defaults.headers.common[authHeader];
|
|
73
|
-
}
|
|
74
|
-
this.$store.commit('signOut');
|
|
75
|
-
this.$router.push('/');
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
</script>
|
|
80
|
-
|
|
81
|
-
<style scoped>
|
|
82
|
-
</style>
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<section>
|
|
4
|
-
<h1>Authentecated User</h1>
|
|
5
|
-
<div class="list_wrapper">
|
|
6
|
-
<div class="list_image"></div>
|
|
7
|
-
<div class="list_description_wrapper">
|
|
8
|
-
<div class="list_description">
|
|
9
|
-
<div v-if="userSignedIn">
|
|
10
|
-
<span>{{ currentUser.name }}</span> · {{ currentUser.email }} · <router-link v-bind:to="{ path: '/logout' }">Logout</router-link><br>
|
|
11
|
-
</div>
|
|
12
|
-
<div v-else>
|
|
13
|
-
<span>Not logged in</span> · <router-link v-bind:to="{ path: '/login' }">Login</router-link><br>
|
|
14
|
-
</div>
|
|
15
|
-
<router-link v-bind:to="{ name : 'AuthenticatedUserNotificationsIndex' }">Notifications</router-link> /
|
|
16
|
-
<router-link v-bind:to="{ name : 'AuthenticatedUserSubscriptionsIndex' }">Subscriptions</router-link>
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
</section>
|
|
21
|
-
|
|
22
|
-
<section>
|
|
23
|
-
<h1>Listing Users</h1>
|
|
24
|
-
<div v-for="user in users" :key="`${user.id}`" class="list_wrapper">
|
|
25
|
-
<div class="list_image"></div>
|
|
26
|
-
<div class="list_description_wrapper">
|
|
27
|
-
<p class="list_description">
|
|
28
|
-
<span>{{ user.name }}</span> · {{ user.email }}<br>
|
|
29
|
-
<router-link v-bind:to="{ name : 'UnauthenticatedTargetNotificationsIndex', params : { target_type: 'users', target_id: user.id, target: user }}">Notifications</router-link> /
|
|
30
|
-
<router-link v-bind:to="{ name : 'UnauthenticatedTargetSubscriptionsIndex', params : { target_type: 'users', target_id: user.id, target: user }}">Subscriptions</router-link>
|
|
31
|
-
</p>
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
</section>
|
|
35
|
-
|
|
36
|
-
<section>
|
|
37
|
-
<h1>Authentecated User as Admin</h1>
|
|
38
|
-
<div class="list_wrapper">
|
|
39
|
-
<div class="list_image"></div>
|
|
40
|
-
<div class="list_description_wrapper">
|
|
41
|
-
<div class="list_description">
|
|
42
|
-
<div v-if="userSignedIn">
|
|
43
|
-
<span>{{ currentUser.name }}</span> · {{ currentUser.email }} · <span v-if="currentUser.admin">(admin)</span><span v-else>(not admin)</span><br>
|
|
44
|
-
</div>
|
|
45
|
-
<div v-else>
|
|
46
|
-
<span>Not logged in</span> · <router-link v-bind:to="{ path: '/login' }">Login</router-link><br>
|
|
47
|
-
</div>
|
|
48
|
-
<router-link v-bind:to="{ name : 'AuthenticatedAdminNotificationsIndex' }">Notifications</router-link> /
|
|
49
|
-
<router-link v-bind:to="{ name : 'AuthenticatedAdminSubscriptionsIndex' }">Subscriptions</router-link>
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
</div>
|
|
53
|
-
</section>
|
|
54
|
-
|
|
55
|
-
<section>
|
|
56
|
-
<h1>Listing Admins</h1>
|
|
57
|
-
<div v-for="admin in admins" :key="`${admin.id}`" class="list_wrapper">
|
|
58
|
-
<div class="list_image"></div>
|
|
59
|
-
<div class="list_description_wrapper">
|
|
60
|
-
<p class="list_description">
|
|
61
|
-
<span>{{ admin.user.name }}</span> · {{ admin.user.email }}<br>
|
|
62
|
-
<router-link v-bind:to="{ name : 'UnauthenticatedTargetNotificationsIndex', params : { target_type: 'admins', target_id: admin.id, target: admin }}">Notifications</router-link> /
|
|
63
|
-
<router-link v-bind:to="{ name : 'UnauthenticatedTargetSubscriptionsIndex', params : { target_type: 'admins', target_id: admin.id, target: admin }}">Subscriptions</router-link>
|
|
64
|
-
</p>
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
</section>
|
|
68
|
-
</div>
|
|
69
|
-
</template>
|
|
70
|
-
|
|
71
|
-
<script>
|
|
72
|
-
import axios from 'axios'
|
|
73
|
-
|
|
74
|
-
export default {
|
|
75
|
-
name: 'Top',
|
|
76
|
-
data () {
|
|
77
|
-
return {
|
|
78
|
-
userSignedIn: this.$store.getters.userSignedIn,
|
|
79
|
-
currentUser: this.$store.getters.currentUser,
|
|
80
|
-
users: [],
|
|
81
|
-
admins: []
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
mounted () {
|
|
85
|
-
axios
|
|
86
|
-
.get('/users')
|
|
87
|
-
.then(response => {
|
|
88
|
-
this.users = response.data.users;
|
|
89
|
-
this.admins = this.users
|
|
90
|
-
.filter(user => user.admin)
|
|
91
|
-
.map(user => Object.assign(Object.create(user.admin), { user: user }))
|
|
92
|
-
})
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
</script>
|
|
96
|
-
|
|
97
|
-
<style scoped>
|
|
98
|
-
</style>
|