Se agrega usuario autor a cada anotacion
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
proposalSelector = ".proposal-show"
|
||||
|
||||
proposalId = ->
|
||||
annotationsMetadata = ->
|
||||
return {
|
||||
beforeAnnotationCreated: (ann) ->
|
||||
ann.proposal_id = $(proposalSelector).data("id")
|
||||
ann.proposal_id = $(proposalSelector).data("id");
|
||||
ann.user_id = $(proposalSelector).data("user-id");
|
||||
};
|
||||
|
||||
App.annotations =
|
||||
@@ -11,7 +12,7 @@ App.annotations =
|
||||
app = new annotator.App()
|
||||
.include(annotator.ui.main, { element: $(proposalSelector)[0] })
|
||||
.include(annotator.storage.http, { prefix: "", urls: { search: "/annotations/search" } })
|
||||
.include(proposalId)
|
||||
.include(annotationsMetadata)
|
||||
|
||||
app.start()
|
||||
.then( ->
|
||||
|
||||
@@ -34,6 +34,6 @@ class AnnotationsController < ApplicationController
|
||||
params
|
||||
.require(:annotation)
|
||||
.permit(:quote, :text, ranges: [:start, :startOffset, :end, :endOffset])
|
||||
.merge(proposal_id: params[:proposal_id])
|
||||
.merge(proposal_id: params[:proposal_id], user_id: params[:user_id])
|
||||
end
|
||||
end
|
||||
@@ -2,4 +2,5 @@ class Annotation < ActiveRecord::Base
|
||||
serialize :ranges, Array
|
||||
|
||||
belongs_to :proposal
|
||||
belongs_to :user
|
||||
end
|
||||
@@ -6,7 +6,7 @@
|
||||
social_description: @proposal.summary %>
|
||||
<% end %>
|
||||
<% cache [locale_and_user_status(@proposal), @proposal, @proposal.author, Flag.flagged?(current_user, @proposal), @proposal_votes] do %>
|
||||
<section class="proposal-show annotate" data-id=<%= @proposal.id %>>
|
||||
<section class="proposal-show annotate" data-id=<%= @proposal.id %> data-user-id=<%= current_user.id %>>
|
||||
<div id="<%= dom_id(@proposal) %>" class="row">
|
||||
<div class="small-12 medium-9 column">
|
||||
<i class="icon-angle-left left"></i>
|
||||
|
||||
Reference in New Issue
Block a user