voluntary_feedback 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/CHANGELOG.md +16 -0
- data/README.md +3 -2
- data/app/assets/javascripts/voluntary_feedback/app.js.coffee +9 -0
- data/app/assets/javascripts/voluntary_feedback/application.js +3 -0
- data/app/assets/javascripts/voluntary_feedback/components/reply_cell_component.js.coffee +44 -0
- data/app/assets/javascripts/voluntary_feedback/components/reply_comments_component.js.coffee +17 -0
- data/app/assets/javascripts/voluntary_feedback/controllers/community/categories_controller.js.coffee +5 -0
- data/app/assets/javascripts/voluntary_feedback/controllers/community/category_controller.js.coffee +1 -0
- data/app/assets/javascripts/voluntary_feedback/controllers/community/communities_controller.js.coffee +5 -0
- data/app/assets/javascripts/voluntary_feedback/controllers/community/community_controller.js.coffee +2 -0
- data/app/assets/javascripts/voluntary_feedback/controllers/community/edit_category_controller.js.coffee +2 -0
- data/app/assets/javascripts/voluntary_feedback/controllers/community/edit_community_controller.js.coffee +2 -0
- data/app/assets/javascripts/voluntary_feedback/controllers/community/edit_feedback_controller.js.coffee +2 -0
- data/app/assets/javascripts/voluntary_feedback/controllers/community/feedback_controller.js.coffee +25 -0
- data/app/assets/javascripts/voluntary_feedback/controllers/community/feedbacks_controller.js.coffee +11 -0
- data/app/assets/javascripts/voluntary_feedback/controllers/community/new_category_controller.js.coffee +2 -0
- data/app/assets/javascripts/voluntary_feedback/controllers/community/new_community_controller.js.coffee +2 -0
- data/app/assets/javascripts/voluntary_feedback/controllers/community/new_feedback_controller.js.coffee +2 -0
- data/app/assets/javascripts/voluntary_feedback/helpers/mood_icon_helper.js.coffee +11 -0
- data/app/assets/javascripts/voluntary_feedback/mixins/community_category_persistence.js.coffee +29 -0
- data/app/assets/javascripts/voluntary_feedback/mixins/community_persistence.js.coffee +33 -0
- data/app/assets/javascripts/voluntary_feedback/mixins/feedback_persistence.js.coffee +39 -0
- data/app/assets/javascripts/voluntary_feedback/mixins/pagination_controller.js.coffee +56 -0
- data/app/assets/javascripts/voluntary_feedback/models/community.js.coffee +7 -0
- data/app/assets/javascripts/voluntary_feedback/models/community_category.js.coffee +4 -0
- data/app/assets/javascripts/voluntary_feedback/models/feedback.js.coffee +12 -0
- data/app/assets/javascripts/voluntary_feedback/models/reply.js.coffee +6 -0
- data/app/assets/javascripts/voluntary_feedback/models/user.js.coffee +18 -0
- data/app/assets/javascripts/voluntary_feedback/router.js.coffee +34 -0
- data/app/assets/javascripts/voluntary_feedback/routes/community/categories_route.js.coffee +10 -0
- data/app/assets/javascripts/voluntary_feedback/routes/community/category_route.js.coffee +7 -0
- data/app/assets/javascripts/voluntary_feedback/routes/community/communities_route.js.coffee +9 -0
- data/app/assets/javascripts/voluntary_feedback/routes/community/community_route.js.coffee +4 -0
- data/app/assets/javascripts/voluntary_feedback/routes/community/edit_category_route.js.coffee +9 -0
- data/app/assets/javascripts/voluntary_feedback/routes/community/edit_community_route.js.coffee +16 -0
- data/app/assets/javascripts/voluntary_feedback/routes/community/edit_feedback_route.js.coffee +29 -0
- data/app/assets/javascripts/voluntary_feedback/routes/community/feedback_route.js.coffee +28 -0
- data/app/assets/javascripts/voluntary_feedback/routes/community/feedbacks_route.js.coffee +42 -0
- data/app/assets/javascripts/voluntary_feedback/routes/community/new_category_route.js.coffee +3 -0
- data/app/assets/javascripts/voluntary_feedback/routes/community/new_community_route.js.coffee +7 -0
- data/app/assets/javascripts/voluntary_feedback/routes/community/new_feedback_route.js.coffee +8 -0
- data/app/assets/javascripts/voluntary_feedback/templates/application.handlebars.erb +20 -0
- data/app/assets/javascripts/voluntary_feedback/templates/category_form.js.handlebars +13 -0
- data/app/assets/javascripts/voluntary_feedback/templates/communities.js.handlebars +32 -0
- data/app/assets/javascripts/voluntary_feedback/templates/community.js.handlebars +24 -0
- data/app/assets/javascripts/voluntary_feedback/templates/community/categories.js.handlebars +32 -0
- data/app/assets/javascripts/voluntary_feedback/templates/community/category.js.handlebars +11 -0
- data/app/assets/javascripts/voluntary_feedback/templates/community/edit_category.js.handlebars +3 -0
- data/app/assets/javascripts/voluntary_feedback/templates/community/edit_feedback.js.handlebars +3 -0
- data/app/assets/javascripts/voluntary_feedback/templates/community/feedback.js.handlebars +68 -0
- data/app/assets/javascripts/voluntary_feedback/templates/community/feedbacks.js.handlebars +51 -0
- data/app/assets/javascripts/voluntary_feedback/templates/community/new_category.js.handlebars +3 -0
- data/app/assets/javascripts/voluntary_feedback/templates/community/new_feedback.js.handlebars +3 -0
- data/app/assets/javascripts/voluntary_feedback/templates/community_form.js.handlebars +29 -0
- data/app/assets/javascripts/voluntary_feedback/templates/components/reply-cell.js.handlebars +34 -0
- data/app/assets/javascripts/voluntary_feedback/templates/components/reply-comments.js.handlebars +27 -0
- data/app/assets/javascripts/voluntary_feedback/templates/edit_community.js.handlebars +3 -0
- data/app/assets/javascripts/voluntary_feedback/templates/feedback_form.js.handlebars +91 -0
- data/app/assets/javascripts/voluntary_feedback/templates/navigation.js.handlebars +28 -0
- data/app/assets/javascripts/voluntary_feedback/templates/new_community.js.handlebars +3 -0
- data/app/assets/javascripts/voluntary_feedback/templates/shared/_pagination.js.handlebars +23 -0
- data/app/assets/stylesheets/voluntary_feedback/application.css +15 -0
- data/app/controllers/product/feedback_controller.rb +16 -0
- data/app/controllers/voluntary/api/v1/communities_controller.rb +67 -0
- data/app/controllers/voluntary/api/v1/community_categories_controller.rb +87 -0
- data/app/controllers/voluntary/api/v1/feedbacks_controller.rb +83 -0
- data/app/controllers/voluntary/api/v1/replies_controller.rb +91 -0
- data/app/models/community.rb +21 -0
- data/app/models/community_category.rb +21 -0
- data/app/models/community_category_feedback.rb +7 -0
- data/app/models/feedback.rb +54 -0
- data/app/models/product/feedback.rb +2 -0
- data/app/models/reply.rb +16 -0
- data/app/serializers/community_category_serializer.rb +3 -0
- data/app/serializers/community_serializer.rb +11 -0
- data/app/serializers/feedback_serializer.rb +11 -0
- data/app/serializers/reply_serializer.rb +19 -0
- data/app/views/product/feedback/index.html.erb +0 -0
- data/config/locales/resources/community/en.yml +36 -0
- data/config/locales/resources/community_category/en.yml +26 -0
- data/config/locales/resources/feedback/en.yml +42 -0
- data/config/locales/resources/reply/en.yml +29 -0
- data/config/routes.rb +11 -1
- data/db/migrate/20150825160004_add_feedback_product.rb +79 -0
- data/lib/voluntary_feedback.rb +3 -1
- data/lib/voluntary_feedback/concerns/model/organization/has_communities.rb +15 -0
- data/lib/voluntary_feedback/concerns/model/user/has_communities.rb +15 -0
- data/lib/voluntary_feedback/engine.rb +13 -0
- data/lib/voluntary_feedback/version.rb +2 -2
- metadata +353 -20
- data/MIT-LICENSE +0 -20
@@ -0,0 +1,10 @@
|
|
1
|
+
Volontariat.CommunityCategoriesRoute = Ember.Route.extend
|
2
|
+
model: (params) ->
|
3
|
+
@controllerFor('community.categories').set 'communitySlug', @modelFor('community').slug
|
4
|
+
@controllerFor('community.categories').set 'page', parseInt(params.page)
|
5
|
+
|
6
|
+
@store.query 'community_category', community_slug: @modelFor('community').slug, page: params.page
|
7
|
+
|
8
|
+
setupController: (controller, model) ->
|
9
|
+
controller.send('goToPageWithoutRedirect', controller.get('page'))
|
10
|
+
controller.set('model', model)
|
@@ -0,0 +1,7 @@
|
|
1
|
+
Volontariat.CommunityCategoryRoute = Ember.Route.extend
|
2
|
+
model: (params) ->
|
3
|
+
@controllerFor('community.category').set 'communitySlug', @modelFor('community').slug
|
4
|
+
@controllerFor('community.category').set 'slug', params.category_slug
|
5
|
+
|
6
|
+
Ember.$.getJSON("/api/v1/community_categories/#{params.category_slug}?community_slug=#{@modelFor('community').slug}").then (json) =>
|
7
|
+
json.community_category
|
@@ -0,0 +1,9 @@
|
|
1
|
+
Volontariat.CommunitiesRoute = Ember.Route.extend
|
2
|
+
model: (params) ->
|
3
|
+
@controllerFor('communities').set 'page', parseInt(params.page)
|
4
|
+
|
5
|
+
@store.query 'community', page: params.page
|
6
|
+
|
7
|
+
setupController: (controller, model) ->
|
8
|
+
controller.send('goToPageWithoutRedirect', controller.get('page'))
|
9
|
+
controller.set('model', model)
|
@@ -0,0 +1,9 @@
|
|
1
|
+
Volontariat.CommunityEditCategoryRoute = Ember.Route.extend
|
2
|
+
model: (params) ->
|
3
|
+
@controllerFor('community.edit_category').set 'communitySlug', @modelFor('community').slug
|
4
|
+
@controllerFor('community.edit_category').set 'categorySlug', params.category_slug
|
5
|
+
|
6
|
+
Ember.$.getJSON("/api/v1/community_categories/#{params.category_slug}?community_slug=#{@modelFor('community').slug}").then (json) =>
|
7
|
+
@controllerFor('community.edit_category').set 'name', json.community_category.name
|
8
|
+
|
9
|
+
json.community_category
|
data/app/assets/javascripts/voluntary_feedback/routes/community/edit_community_route.js.coffee
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
Volontariat.EditCommunityRoute = Ember.Route.extend
|
2
|
+
model: (params) ->
|
3
|
+
@controllerFor('edit_community').set 'slug', params.slug
|
4
|
+
|
5
|
+
if Volontariat.User.current()
|
6
|
+
Ember.$.getJSON(
|
7
|
+
"/api/v1/users/#{Volontariat.User.current().id}/organizations.json"
|
8
|
+
).then (json) =>
|
9
|
+
@controllerFor('edit_community').set 'organizations', json.organizations
|
10
|
+
|
11
|
+
Ember.$.getJSON("/api/v1/communities/#{params.slug}").then (json) =>
|
12
|
+
$('#community_organization_id').val(json.community.organization_id)
|
13
|
+
@controllerFor('edit_community').set 'name', json.community.name
|
14
|
+
@controllerFor('edit_community').set 'text', json.community.text
|
15
|
+
|
16
|
+
json.brainstorming
|
@@ -0,0 +1,29 @@
|
|
1
|
+
Volontariat.CommunityEditFeedbackRoute = Ember.Route.extend
|
2
|
+
model: (params) ->
|
3
|
+
@controllerFor('community.edit_feedback').set 'communitySlug', @modelFor('community').slug
|
4
|
+
@controllerFor('community.edit_feedback').set 'slug', params.feedback_slug
|
5
|
+
|
6
|
+
Ember.$.getJSON("/api/v1/feedbacks/#{params.feedback_slug}?community_slug=#{@modelFor('community').slug}").then (json) =>
|
7
|
+
@controllerFor('community.edit_feedback').set 'name', json.feedback.name
|
8
|
+
@controllerFor('community.edit_feedback').set 'text', json.feedback.text
|
9
|
+
@controllerFor('community.edit_feedback').set 'moodText', json.feedback.mood_text
|
10
|
+
|
11
|
+
setTimeout (=>
|
12
|
+
$('#feedback_feedback_type').val(json.feedback.feedback_type)
|
13
|
+
|
14
|
+
unless json.feedback.mood_type == null
|
15
|
+
$('input[name="feedback[mood_type]"][value="' + json.feedback.mood_type + '"]').click()
|
16
|
+
), 100
|
17
|
+
|
18
|
+
Ember.$.getJSON(
|
19
|
+
"/api/v1/community_categories.json?community_slug=#{@modelFor('community').slug}"
|
20
|
+
).then (json) =>
|
21
|
+
@controllerFor('community.edit_feedback').set 'categories', json.community_categories
|
22
|
+
|
23
|
+
Ember.$.getJSON(
|
24
|
+
"/api/v1/community_categories.json?community_slug=#{@modelFor('community').slug}&feedback_slug=#{params.feedback_slug}"
|
25
|
+
).then (json) =>
|
26
|
+
setTimeout (->
|
27
|
+
jQuery.each json.community_categories, (i, category) ->
|
28
|
+
$("input[name='category_ids[]'][value='#{category.id}']").click()
|
29
|
+
), 100
|
@@ -0,0 +1,28 @@
|
|
1
|
+
Volontariat.CommunityFeedbackRoute = Ember.Route.extend
|
2
|
+
model: (params) ->
|
3
|
+
@controllerFor('community.feedback').set 'page', parseInt(params.page)
|
4
|
+
@controllerFor('community.feedback').set 'communitySlug', @modelFor('community').slug
|
5
|
+
@controllerFor('community.feedback').set 'slug', params.feedback_slug
|
6
|
+
|
7
|
+
Ember.$.getJSON("/api/v1/feedbacks/#{params.feedback_slug}?community_slug=#{@modelFor('community').slug}").then (json) =>
|
8
|
+
@controllerFor('community.feedback').set 'feedbackType', json.feedback.feedback_type
|
9
|
+
|
10
|
+
Ember.$.getJSON(
|
11
|
+
"/api/v1/replies?feedback_id=#{json.feedback.id}&page=#{params.page}"
|
12
|
+
).then (replyJson) =>
|
13
|
+
@controllerFor('community.feedback').set 'metadata', replyJson.meta
|
14
|
+
|
15
|
+
replies = $.map replyJson.replies, (reply, i) ->
|
16
|
+
reply.replies = $.map reply.replies, (subReply, i) ->
|
17
|
+
subReply.reply
|
18
|
+
|
19
|
+
reply
|
20
|
+
|
21
|
+
@controllerFor('community.feedback').set 'replies', replies
|
22
|
+
@controllerFor('community.feedback').send 'goToPageWithoutRedirect', parseInt(params.page)
|
23
|
+
|
24
|
+
json.feedback
|
25
|
+
|
26
|
+
setupController: (controller, model) ->
|
27
|
+
controller.send('goToPageWithoutRedirect', controller.get('page'))
|
28
|
+
controller.set('model', model)
|
@@ -0,0 +1,42 @@
|
|
1
|
+
Volontariat.CommunityFeedbacksRoute = Ember.Route.extend
|
2
|
+
controllerName: 'community.feedbacks'
|
3
|
+
|
4
|
+
model: (params) ->
|
5
|
+
if @get('routeName').split('.').length == 3
|
6
|
+
feedbackType = @get('routeName').split('.')[2]
|
7
|
+
else
|
8
|
+
feedbackType = @get('routeName').split('.')[1]
|
9
|
+
|
10
|
+
@controllerFor('community.feedbacks').set 'feedbackType', feedbackType.singularize().capitalize()
|
11
|
+
@controllerFor('community.feedbacks').set 'paginationRoute', "community.#{feedbackType}"
|
12
|
+
@controllerFor('community.feedbacks').set 'page', parseInt(params.page)
|
13
|
+
@controllerFor('community.feedbacks').set 'communitySlug', @modelFor('community').slug
|
14
|
+
|
15
|
+
if @get('routeName').split('.').length == 3
|
16
|
+
categorySlug = if @modelFor('community.category') then @modelFor('community.category').slug else null
|
17
|
+
@controllerFor('community.feedbacks').set 'categorySlug', categorySlug
|
18
|
+
|
19
|
+
if feedbackType == 'feedbacks'
|
20
|
+
@store.query 'feedback', community_slug: @modelFor('community').slug, category_slug: categorySlug, page: params.page
|
21
|
+
else
|
22
|
+
@store.query 'feedback', community_slug: @modelFor('community').slug, category_slug: categorySlug, feedback_type: feedbackType.singularize().capitalize(), page: params.page
|
23
|
+
|
24
|
+
setupController: (controller, model) ->
|
25
|
+
controller.send('goToPageWithoutRedirect', controller.get('page'))
|
26
|
+
controller.set('model', model)
|
27
|
+
|
28
|
+
renderTemplate: ->
|
29
|
+
@render 'community/feedbacks'
|
30
|
+
|
31
|
+
Volontariat.CommunityProblemsRoute = Volontariat.CommunityFeedbacksRoute.extend()
|
32
|
+
Volontariat.CommunityQuestionsRoute = Volontariat.CommunityFeedbacksRoute.extend()
|
33
|
+
Volontariat.CommunityIdeasRoute = Volontariat.CommunityFeedbacksRoute.extend()
|
34
|
+
Volontariat.CommunityPraisesRoute = Volontariat.CommunityFeedbacksRoute.extend()
|
35
|
+
Volontariat.CommunityAnnouncementsRoute = Volontariat.CommunityFeedbacksRoute.extend()
|
36
|
+
|
37
|
+
Volontariat.CommunityCategoryFeedbacksRoute = Volontariat.CommunityFeedbacksRoute.extend()
|
38
|
+
Volontariat.CommunityCategoryProblemsRoute = Volontariat.CommunityFeedbacksRoute.extend()
|
39
|
+
Volontariat.CommunityCategoryQuestionsRoute = Volontariat.CommunityFeedbacksRoute.extend()
|
40
|
+
Volontariat.CommunityCategoryIdeasRoute = Volontariat.CommunityFeedbacksRoute.extend()
|
41
|
+
Volontariat.CommunityCategoryPraisesRoute = Volontariat.CommunityFeedbacksRoute.extend()
|
42
|
+
Volontariat.CommunityCategoryAnnouncementsRoute = Volontariat.CommunityFeedbacksRoute.extend()
|
@@ -0,0 +1,7 @@
|
|
1
|
+
Volontariat.NewCommunityRoute = Ember.Route.extend
|
2
|
+
model: (params) ->
|
3
|
+
if Volontariat.User.current()
|
4
|
+
Ember.$.getJSON(
|
5
|
+
"/api/v1/users/#{Volontariat.User.current().id}/organizations.json"
|
6
|
+
).then (json) =>
|
7
|
+
@controllerFor('new_community').set 'organizations', json.organizations
|
@@ -0,0 +1,8 @@
|
|
1
|
+
Volontariat.CommunityNewFeedbackRoute = Ember.Route.extend
|
2
|
+
model: (params) ->
|
3
|
+
@controllerFor('community.new_feedback').set 'communitySlug', @modelFor('community').slug
|
4
|
+
|
5
|
+
Ember.$.getJSON(
|
6
|
+
"/api/v1/community_categories.json?community_slug=#{@modelFor('community').slug}"
|
7
|
+
).then (json) =>
|
8
|
+
@controllerFor('community.new_feedback').set 'categories', json.community_categories
|
@@ -0,0 +1,20 @@
|
|
1
|
+
{{render 'navigation'}}
|
2
|
+
|
3
|
+
<section id="dialog">
|
4
|
+
<img alt="Ajax-loader-small" class="hide " id="dialog_body_spinner" src="<%=asset_path('voluntary/ember_js/spinner.gif')%>"/>
|
5
|
+
<div id="dialog_body"/>
|
6
|
+
</section>
|
7
|
+
|
8
|
+
<div class='container-fluid'>
|
9
|
+
<div class="row">
|
10
|
+
<div class="col-md-12">
|
11
|
+
<div id="alert" class="alert alert-dismissible" role="alert" style="display:none;">
|
12
|
+
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
13
|
+
<span id="alert_message"></span>
|
14
|
+
</div>
|
15
|
+
{{outlet}}
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
{{!render modal}}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<form class="simple_form form-vertical" novalidate="novalidate" accept-charset="UTF-8" method="post">
|
2
|
+
<div class="form-group string required community_category_name">
|
3
|
+
<label class="string required control-label control-label" for="community_category_name">
|
4
|
+
<abbr title="required">*</abbr> {{t 'attributes.name'}}
|
5
|
+
</label>
|
6
|
+
{{input value=name class="string required form-control" type="text" name="community_category[name]" id="community_category_name"}}
|
7
|
+
</div>
|
8
|
+
{{#if categorySlug}}
|
9
|
+
<input type="submit" name="commit" value="{{t 'community_categories.update.title' true }}" class="btn btn-default" {{action 'save'}}/>
|
10
|
+
{{else}}
|
11
|
+
<input type="submit" name="commit" value="{{t 'community_categories.create.title' true }}" class="btn btn-default" {{action 'save'}}/>
|
12
|
+
{{/if}}
|
13
|
+
</form>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<h2>{{t 'communities.index.title'}}</h2>
|
2
|
+
|
3
|
+
{{#if anyItems}}
|
4
|
+
<table class="table table-striped" style="margin-top:15px;">
|
5
|
+
<tbody>
|
6
|
+
{{#each model as |community|}}
|
7
|
+
<tr>
|
8
|
+
<td>
|
9
|
+
{{#link-to 'community.feedbacks' community.slug 1}}{{community.name}}{{/link-to}}
|
10
|
+
</td>
|
11
|
+
<td>
|
12
|
+
{{#link-to 'edit_community' community.slug}}
|
13
|
+
<span class="glyphicon glyphicon-pencil"></span> {{t 'general.edit'}}
|
14
|
+
{{/link-to}}
|
15
|
+
|
|
16
|
+
<a {{action 'destroy' community.slug}} class="remove_community_link">
|
17
|
+
<span class="glyphicon glyphicon-remove"></span> {{t 'general.remove'}}
|
18
|
+
</a>
|
19
|
+
</td>
|
20
|
+
</tr>
|
21
|
+
{{/each}}
|
22
|
+
</tbody>
|
23
|
+
</table>
|
24
|
+
{{else}}
|
25
|
+
{{t 'communities.index.empty_collection'}}
|
26
|
+
{{/if}}
|
27
|
+
|
28
|
+
{{partial 'shared/pagination'}}
|
29
|
+
|
30
|
+
{{#link-to 'new_community'}}
|
31
|
+
<span class="glyphicon glyphicon-plus"></span> {{t 'communities.new.title'}}
|
32
|
+
{{/link-to}}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<nav class="navbar navbar-default">
|
2
|
+
<div class="container-fluid" style="padding-top:0px;">
|
3
|
+
<div class="navbar-header" style="white-space:nowrap;">
|
4
|
+
<span class="navbar-brand">
|
5
|
+
{{#link-to 'community.feedbacks' model.slug 1}}{{model.name}}{{/link-to}}
|
6
|
+
{{#link-to 'edit_community' model.slug}}
|
7
|
+
<span class="glyphicon glyphicon-pencil"></span>
|
8
|
+
{{/link-to}}
|
9
|
+
<a {{action 'destroy' model.slug}}>
|
10
|
+
<span class="glyphicon glyphicon-remove"></span>
|
11
|
+
</a>
|
12
|
+
</span>
|
13
|
+
</div>
|
14
|
+
<div id="navbar" class="navbar-collapse collapse">
|
15
|
+
<ul class="nav navbar-nav">
|
16
|
+
{{#link-to 'community.categories' model.slug 1 tagName='li'}}
|
17
|
+
<a>{{t 'community_categories.index.title'}}</a>
|
18
|
+
{{/link-to}}
|
19
|
+
</ul>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
</nav>
|
23
|
+
|
24
|
+
{{outlet}}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<h2>{{t 'community_categories.index.title'}}</h2>
|
2
|
+
|
3
|
+
{{#if anyItems}}
|
4
|
+
<table class="table table-striped" style="margin-top:15px;">
|
5
|
+
<tbody>
|
6
|
+
{{#each model as |category|}}
|
7
|
+
<tr>
|
8
|
+
<td>
|
9
|
+
{{#link-to 'community.category.feedbacks' communitySlug category.slug 1}}{{category.name}}{{/link-to}}
|
10
|
+
</td>
|
11
|
+
<td>
|
12
|
+
{{#link-to 'community.edit_category' communitySlug category.slug}}
|
13
|
+
<span class="glyphicon glyphicon-pencil"></span> {{t 'general.edit'}}
|
14
|
+
{{/link-to}}
|
15
|
+
|
|
16
|
+
<a {{action 'destroy' category.slug}} class="remove_category_link">
|
17
|
+
<span class="glyphicon glyphicon-remove"></span> {{t 'general.remove'}}
|
18
|
+
</a>
|
19
|
+
</td>
|
20
|
+
</tr>
|
21
|
+
{{/each}}
|
22
|
+
</tbody>
|
23
|
+
</table>
|
24
|
+
{{else}}
|
25
|
+
{{t 'community_categories.index.empty_collection'}}
|
26
|
+
{{/if}}
|
27
|
+
|
28
|
+
{{partial 'shared/pagination'}}
|
29
|
+
|
30
|
+
{{#link-to 'community.new_category'}}
|
31
|
+
<span class="glyphicon glyphicon-plus"></span> {{t 'community_categories.new.title'}}
|
32
|
+
{{/link-to}}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<h2>
|
2
|
+
{{model.name}}
|
3
|
+
{{#link-to 'community.edit_category' model.slug}}
|
4
|
+
<span class="glyphicon glyphicon-pencil"></span>
|
5
|
+
{{/link-to}}
|
6
|
+
<a {{action 'destroy' model.slug}}>
|
7
|
+
<span class="glyphicon glyphicon-remove"></span>
|
8
|
+
</a>
|
9
|
+
</h2>
|
10
|
+
|
11
|
+
{{outlet}}
|
@@ -0,0 +1,68 @@
|
|
1
|
+
<h2>
|
2
|
+
{{#link-to feedbackTypeRoute communitySlug 1}}{{model.feedback_type}}:{{/link-to}}
|
3
|
+
{{model.name}}
|
4
|
+
{{#link-to 'community.edit_feedback' communitySlug model.slug class='edit_feedback_link'}}
|
5
|
+
<span class="glyphicon glyphicon-pencil"></span>
|
6
|
+
{{/link-to}}
|
7
|
+
<a {{action 'destroy' model.slug}} class="remove_feedback_link">
|
8
|
+
<span class="glyphicon glyphicon-remove"></span>
|
9
|
+
</a>
|
10
|
+
</h2>
|
11
|
+
|
12
|
+
<p>
|
13
|
+
<strong>{{model.user_name}}:</strong> {{mood-icon model.mood_type}} {{model.mood_text}}
|
14
|
+
</p>
|
15
|
+
|
16
|
+
<p>
|
17
|
+
{{model.text}}
|
18
|
+
</p>
|
19
|
+
|
20
|
+
{{like-or-dislike targetType='Feedback' targetId=model.id positive=model.positive likes=model.likes_count dislikes=model.dislikes_count}}
|
21
|
+
|
22
|
+
<h3>{{t 'replies.index.title'}}</h3>
|
23
|
+
|
24
|
+
<table class="table">
|
25
|
+
{{#if anyReplies}}
|
26
|
+
{{#each replies as |reply|}}
|
27
|
+
<tr>
|
28
|
+
<td style="width:150px;">{{reply.user_name}}</td>
|
29
|
+
<td style="text-align:right;">{{formatted-datetime reply.created_at}}</td>
|
30
|
+
</tr>
|
31
|
+
<tr>
|
32
|
+
<td></td>
|
33
|
+
<td class="reply_text">
|
34
|
+
{{reply-cell userId=reply.user_id feedbackId=model.id feedbackSlug=model.slug selectedId=replyId id=reply.id text=reply.text editAction='editReply' leaveEditReplyModeAction='leaveEditReplyMode' reloadAction='reload'}}
|
35
|
+
<br/>
|
36
|
+
{{like-or-dislike targetType='Reply' targetId=reply.id positive=reply.positive likes=reply.likes_count dislikes=reply.dislikes_count}}
|
37
|
+
{{reply-comments replyId=reply.id selectedReplyId=replyId collection=reply.replies editAction='editReply' leaveEditReplyModeAction='leaveEditReplyMode' reloadAction='reload'}}
|
38
|
+
</td>
|
39
|
+
</tr>
|
40
|
+
<tr>
|
41
|
+
<td colspan="2">
|
42
|
+
<hr style="margin-top:10px; margin-bottom:10px;"/>
|
43
|
+
</td>
|
44
|
+
</tr>
|
45
|
+
{{/each}}
|
46
|
+
{{else}}
|
47
|
+
<tr>
|
48
|
+
<td colspan="2">
|
49
|
+
{{t 'replies.index.empty_collection'}}
|
50
|
+
</td>
|
51
|
+
</tr>
|
52
|
+
{{/if}}
|
53
|
+
|
54
|
+
{{#if newReplyMode}}
|
55
|
+
<tr>
|
56
|
+
<td style="width:150px;"></td>
|
57
|
+
<td>
|
58
|
+
{{reply-cell feedbackId=model.id reloadAction='reload' leaveNewReplyModeAction='leaveNewReplyMode'}}
|
59
|
+
</td>
|
60
|
+
</tr>
|
61
|
+
{{/if}}
|
62
|
+
</table>
|
63
|
+
|
64
|
+
<a class="new_reply_link" {{action 'newReply'}}>
|
65
|
+
<span class="glyphicon glyphicon-plus"></span> {{t 'replies.new.title' }}
|
66
|
+
</a>
|
67
|
+
|
68
|
+
{{partial 'shared/pagination'}}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
<ul class="nav nav-pills" style="padding-bottom:15px;">
|
2
|
+
{{#if categorySlug}}
|
3
|
+
{{#link-to 'community.category.feedbacks' communitySlug categorySlug 1 tagName="li" class=feedbackClass}}<a href="{{view.href}}">{{t 'communities.show.all'}}</a>{{/link-to}}
|
4
|
+
{{#link-to 'community.category.problems' communitySlug categorySlug 1 tagName="li" class=problemClass}}<a href="{{view.href}}">{{t 'communities.show.problems'}}</a>{{/link-to}}
|
5
|
+
{{#link-to 'community.category.questions' communitySlug categorySlug 1 tagName="li" class=questionClass}}<a href="{{view.href}}">{{t 'communities.show.questions'}}</a>{{/link-to}}
|
6
|
+
{{#link-to 'community.category.ideas' communitySlug categorySlug 1 tagName="li" class=ideaClass}}<a href="{{view.href}}">{{t 'communities.show.ideas'}}</a>{{/link-to}}
|
7
|
+
{{#link-to 'community.category.praises' communitySlug categorySlug 1 tagName="li" class=praiseClass}}<a href="{{view.href}}">{{t 'communities.show.praises'}}</a>{{/link-to}}
|
8
|
+
{{#link-to 'community.category.announcements' communitySlug categorySlug 1 tagName="li" class=announcementClass}}<a href="{{view.href}}">{{t 'communities.show.announcements'}}</a>{{/link-to}}
|
9
|
+
{{else}}
|
10
|
+
{{#link-to 'community.feedbacks' communitySlug 1 tagName="li" class=feedbackClass}}<a href="{{view.href}}">{{t 'communities.show.all'}}</a>{{/link-to}}
|
11
|
+
{{#link-to 'community.problems' communitySlug 1 tagName="li" class=problemClass}}<a href="{{view.href}}">{{t 'communities.show.problems'}}</a>{{/link-to}}
|
12
|
+
{{#link-to 'community.questions' communitySlug 1 tagName="li" class=questionClass}}<a href="{{view.href}}">{{t 'communities.show.questions'}}</a>{{/link-to}}
|
13
|
+
{{#link-to 'community.ideas' communitySlug 1 tagName="li" class=ideaClass}}<a href="{{view.href}}">{{t 'communities.show.ideas'}}</a>{{/link-to}}
|
14
|
+
{{#link-to 'community.praises' communitySlug 1 tagName="li" class=praiseClass}}<a href="{{view.href}}">{{t 'communities.show.praises'}}</a>{{/link-to}}
|
15
|
+
{{#link-to 'community.announcements' communitySlug 1 tagName="li" class=announcementClass}}<a href="{{view.href}}">{{t 'communities.show.announcements'}}</a>{{/link-to}}
|
16
|
+
{{/if}}
|
17
|
+
</ul>
|
18
|
+
|
19
|
+
{{#if anyItems}}
|
20
|
+
<table class="table table-striped" style="margin-top:15px;">
|
21
|
+
<tbody>
|
22
|
+
{{#each model as |feedback|}}
|
23
|
+
<tr>
|
24
|
+
<td>{{feedback.feedbackType}}</td>
|
25
|
+
<td>
|
26
|
+
{{#link-to 'community.feedback' communitySlug feedback.slug 1}}{{feedback.name}}{{/link-to}}
|
27
|
+
</td>
|
28
|
+
<td>
|
29
|
+
{{#link-to 'community.edit_feedback' communitySlug feedback.slug class='edit_feedback_link'}}
|
30
|
+
<span class="glyphicon glyphicon-pencil"></span> {{t 'general.edit'}}
|
31
|
+
{{/link-to}}
|
32
|
+
|
|
33
|
+
<a {{action 'destroy' feedback.slug}} class="remove_feedback_link">
|
34
|
+
<span class="glyphicon glyphicon-remove"></span> {{t 'general.remove'}}
|
35
|
+
</a>
|
36
|
+
</td>
|
37
|
+
</tr>
|
38
|
+
{{/each}}
|
39
|
+
</tbody>
|
40
|
+
</table>
|
41
|
+
{{else}}
|
42
|
+
<p>
|
43
|
+
{{t 'feedbacks.index.empty_collection'}}
|
44
|
+
</p>
|
45
|
+
{{/if}}
|
46
|
+
|
47
|
+
{{partial 'shared/pagination'}}
|
48
|
+
|
49
|
+
{{#link-to 'community.new_feedback' communitySlug class='new_feedback_link'}}
|
50
|
+
<span class="glyphicon glyphicon-plus"></span> {{t 'feedbacks.new.title'}}
|
51
|
+
{{/link-to}}
|