[Logilogi-svn] SF.net SVN: logilogi:[1640] trunk
Status: Beta
Brought to you by:
wybow
|
From: <wy...@us...> - 2009-11-18 14:05:18
|
Revision: 1640
http://logilogi.svn.sourceforge.net/logilogi/?rev=1640&view=rev
Author: wybow
Date: 2009-11-18 14:05:07 +0000 (Wed, 18 Nov 2009)
Log Message:
-----------
Separated remarks from annotations and cleaned up interface
Modified Paths:
--------------
trunk/app/controllers/application_controller.rb
trunk/app/controllers/comments_controller.rb
trunk/app/controllers/external_links_controller.rb
trunk/app/controllers/links_controller.rb
trunk/app/controllers/logi_inserts_controller.rb
trunk/app/controllers/ratings_controller.rb
trunk/app/controllers/remarks_controller.rb
trunk/app/controllers/users_controller.rb
trunk/app/controllers/votes_controller.rb
trunk/app/helpers/application_helper.rb
trunk/app/models/logi.rb
trunk/app/models/logi_version.rb
trunk/app/models/remark.rb
trunk/app/views/application/_panel_with_tabs_js.html.erb
trunk/app/views/application/_popover_listing.html.erb
trunk/app/views/comments/_new.html.erb
trunk/app/views/external_links/edit.html.erb
trunk/app/views/links/_listing.html.erb
trunk/app/views/links/edit.html.erb
trunk/app/views/logi_inserts/_remove_bar.html.erb
trunk/app/views/logi_inserts/new.html.erb
trunk/app/views/logis/_commenting_logis.html.erb
trunk/app/views/logis/_comments_on.html.erb
trunk/app/views/logis/_navigation_bar_edit.html.erb
trunk/app/views/logis/_snippet.html.erb
trunk/app/views/remarks/_list.html.erb
trunk/config/routes.rb
trunk/db/schema.rb
trunk/doc/README_FOR_APP
trunk/public/javascripts/application.js
trunk/public/javascripts/body_inserter.js
trunk/public/stylesheets/logilogi.css
trunk/test/fixtures/remarks.yml
trunk/test/unit/logi_test.rb
trunk/test/unit/logi_version_test.rb
trunk/test/unit/remark_test.rb
Added Paths:
-----------
trunk/app/controllers/annotations_controller.rb
trunk/app/controllers/linked_logis_controller.rb
trunk/app/models/annotation.rb
trunk/app/views/annotations/
trunk/app/views/annotations/_listing.html.erb
trunk/app/views/annotations/_new.html.erb
trunk/app/views/annotations/edit.html.erb
trunk/app/views/logi_inserts/_insert_bar_remove.html.erb
trunk/app/views/logis/_insert_bar.html.erb
trunk/app/views/logis/_navigation_bar_insert.html.erb
trunk/db/migrate/20091113112526_positioned_remarks_as_annotations.rb
trunk/test/fixtures/annotations.yml
trunk/test/unit/annotation_test.rb
Removed Paths:
-------------
trunk/app/views/logi_inserts/_edit_bar_remove.html.erb
trunk/app/views/remarks/_listing.html.erb
Added: trunk/app/controllers/annotations_controller.rb
===================================================================
--- trunk/app/controllers/annotations_controller.rb (rev 0)
+++ trunk/app/controllers/annotations_controller.rb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -0,0 +1,97 @@
+#--#
+# Copyright: (c) 2006-2009 The LogiLogi Foundation <fou...@lo...>
+#
+# License:
+# This file is part of the LogiLogi program. LogiLogi is Free Software.
+# You can run/distribute/modify LogiLogi under the terms of the GNU Affero
+# General Public License version 3. The Affero GPL states that running a
+# modified version or a derivative work also requires you to make the source
+# code of that work available to everyone that can interact with it. We
+# chose the Affero GPL to ensure that LogiLogi remains open and libre
+# (doc/LICENSE contains the full text of the legally binding license).
+#++#
+
+class AnnotationsController < ApplicationController
+ layout 'blank'
+
+ ### Filters
+
+ before_filter :resolve_context, :page_name, :find_logi_and_logi_version, :except => :index
+
+ ### Bodies
+
+ top_body :navigation_bar_insert,
+ : [:create, :edit, :destroy]
+
+ def create
+ new_annotation_position_range_list = self.weave_out_annotations(
+ params[:body_with_inserts], @logi_version, @logi)
+ if new_annotation_position_range_list.empty?
+ @logi.errors.add(:selection, 'needs to be made in the logi at the' +
+ ' location where the annotation should be inserted and the annotation should not be empty')
+ end
+
+ if @logi.errors.empty?
+ # Only one at the same time for now
+ @annotation = new_annotation_position_range_list.first.annotation
+ @annotation.user = current_user
+ @annotation.logi = @logi
+ @annotation.position_ranges = new_annotation_position_range_list.translate_from_view(
+ @logi_version.position_ranges)
+ else
+ @annotation = Annotation.new(:message => params[:annotation][:message])
+ end
+
+ if @logi.errors.empty? and @annotation.valid? and self.thorny_form_free_of_spam?
+ @annotation.save
+ flash[:notice] = "Successfully added annotation"
+ redirect_to logi_url(@logi)
+ else
+ flash.now[:error] = "Problem adding annotation"
+ @selected = 'annotation'
+ render :template => 'logi_inserts/new'
+ end
+ end
+
+ def edit
+ @annotations = @logi.annotations
+ end
+
+ def destroy
+ # TODO fix remove them
+ if params[:deleted_inserts] and !params[:deleted_inserts].empty?
+ params[:deleted_inserts].each do |annotation_id|
+ @logi.annotations.find(annotation_id).destroy
+ end
+ flash[:notice] = "Successfully removed annotations"
+ redirect_to logi_url(@logi.link)
+ else
+ flash[:warning] = "No annotation selected"
+ self.edit
+ render :template => 'annotations/edit'
+ end
+ end
+
+ # AJAX-calls
+
+ def listing
+ render :partial => 'listing', :locals => {
+ :annotations => Annotation.find(:all, :conditions => ["id IN (?)", params[:ids].split(',')]) }
+ end
+
+ ### Private methods
+
+ protected
+
+ # Gets the link-clusters + positions from the given text.
+ #
+ def weave_out_annotations(body_with_annotations, logi_version, logi)
+ annotation_pos_ranges = PositionRange::List.new
+ self.weave_out(body_with_annotations, logi_version, logi) do |pos_range, inserted_string|
+ inserted_string.gsub!('__DOUBLE_QUOTES__','"')
+ pos_range.annotation = Annotation.new(:message => inserted_string)
+ annotation_pos_ranges.push(pos_range)
+ end
+ return annotation_pos_ranges
+ end
+end
Modified: trunk/app/controllers/application_controller.rb
===================================================================
--- trunk/app/controllers/application_controller.rb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/app/controllers/application_controller.rb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -151,7 +151,7 @@
def popover_listing
@links_hash_arr = get_links_for_ids(params['link_ids'])
@external_links = get_external_links_for_ids(params['external_link_ids'])
- @remarks = get_remark_ids(params['remark_ids'])
+ @annotations = get_annotation_ids(params['annotation_ids'])
render :partial => 'popover_listing'
end
@@ -182,9 +182,9 @@
end
end
- def get_remark_ids(ids)
+ def get_annotation_ids(ids)
if ids
- return Remark.find(:all,
+ return Annotation.find(:all,
:conditions => ["id IN (?)", ids.split(',')])
else
return []
@@ -437,7 +437,7 @@
if link_string.empty?
if logi.comments_on_logis.empty?
# TODO fix better
- logi.errors.add(:tags, 'should not be empty if it is not a replying' +
+ logi.errors.add(:tags, 'should not be empty if it is not a commenting' +
' logi')
else
logi.untag
@@ -658,4 +658,8 @@
def navigation_bar_edit
render_body 'logis/navigation_bar_edit'
end
+
+ def navigation_bar_insert
+ render_body 'logis/navigation_bar_insert'
+ end
end
Modified: trunk/app/controllers/comments_controller.rb
===================================================================
--- trunk/app/controllers/comments_controller.rb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/app/controllers/comments_controller.rb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -24,15 +24,6 @@
### REST-methods
- def index
- @comments = Commenting.find(:all)
- respond_to do |format|
- format.xml do
- render :xml => @comments
- end
- end
- end
-
def new
@selected = params[:selected] || 'new_logi'
@commenting_logi = Logi.new_with(:creator => current_user,
@@ -45,7 +36,7 @@
alias :show :new
def create
- if params[:perma_link] and !params[:positioned]
+ if params[:perma_link]
@link = Link.new_from_s(params[:perma_link])
@link.resolve
@@ -59,29 +50,23 @@
:to_logi => @link.volatile_to_logi, :user => current_user)
@commenting.save
- flash[:notice] = "Successfully added replying logi" +
+ flash[:notice] = "Successfully added commenting logi" +
" #{@link.volatile_to_logi.to_s(:for => :full_show)}"
render :update do |page|
page.redirect_to logi_ll_url(@logi)
end
else
transfer_errors(@link, @logi, :attribute => :comment_link)
- flash[:error] = "Problem connecting replying logi"
+ flash[:error] = "Problem connecting commenting logi"
@selected = 'existing_logi'
end
- else # new logi, possibly positioned
+ else # new logi
@commenting_logi, @commenting_logi_version = self.create_logi(
params[:logi], :untagged => true)
@commenting = Commenting.new(:from_logi => @logi,
:to_logi => @commenting_logi, :user => current_user)
body_with_inserts = params[:body_with_inserts]
- if params[:positioned] and
- body_with_inserts !~ /#{Const::Logi::INSERT_STRING}/
- @logi.errors.add(:text, ': at least some text needs to be selected' +
- ' to add the replying logi to')
- end
-
transfer_errors(@commenting_logi, @logi)
if @logi.errors.empty? and @commenting_logi_version.valid? and
@@ -90,47 +75,18 @@
@commenting_logi.save
@commenting.save
- if params[:positioned]
- body_with_comment_link = self.insert_comment_link(
- body_with_inserts, @commenting_logi)
- self.insert_links(@logi, @logi_version, body_with_comment_link)
- end
-
- flash[:notice] = "Successfully created replying logi" +
+ flash[:notice] = "Successfully created commenting logi" +
" #{@commenting_logi.to_s(:for => :full_show)}"
- if params[:positioned]
- redirect_to logi_ll_url(@logi)
- else
- render :update do |page|
- page.redirect_to logi_ll_url(@logi)
- end
+ render :update do |page|
+ page.redirect_to logi_ll_url(@logi)
end
else
transfer_errors(@commenting_logi_version, @logi_version)
- if params[:positioned]
- flash[:error] = "Problem creating replying logi"
- @selected = 'comment'
- render :template => 'logi_inserts/new'
- return
- else
- flash[:error] = "Problem creating replying logi"
- @selected = 'new_logi'
- end
+ flash[:error] = "Problem creating commenting logi"
+ @selected = 'new_logi'
end
end
end
-
- def edit
- end
-
- ### Private methods
-
- protected
-
- def insert_comment_link(body_with_inserts, commenting_logi)
- return body_with_inserts.gsub(/#{Const::Logi::INSERT_STRING}/,
- commenting_logi.link.to_s)
- end
end
Modified: trunk/app/controllers/external_links_controller.rb
===================================================================
--- trunk/app/controllers/external_links_controller.rb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/app/controllers/external_links_controller.rb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -21,7 +21,7 @@
### Bodies
- top_body :navigation_bar_edit,
+ top_body :navigation_bar_insert,
: [:create, :edit, :destroy]
### REST-methods
Added: trunk/app/controllers/linked_logis_controller.rb
===================================================================
--- trunk/app/controllers/linked_logis_controller.rb (rev 0)
+++ trunk/app/controllers/linked_logis_controller.rb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -0,0 +1,81 @@
+#--#
+# Copyright: (c) 2006-2009 The LogiLogi Foundation <fou...@lo...>
+#
+# License:
+# This file is part of the LogiLogi program. LogiLogi is Free Software.
+# You can run/distribute/modify LogiLogi under the terms of the GNU Affero
+# General Public License version 3. The Affero GPL states that running a
+# modified version or a derivative work also requires you to make the source
+# code of that work available to everyone that can interact with it. We
+# chose the Affero GPL to ensure that LogiLogi remains open and libre
+# (doc/LICENSE contains the full text of the legally binding license).
+#++#
+
+class LinkedLogisController < ApplicationController
+ layout 'blank'
+
+ ### Filters
+
+ before_filter :resolve_context, :find_logi_and_logi_version, :except => :index
+
+ ### Bodies
+
+ top_body :navigation_bar_edit
+
+ ### REST-methods
+
+ def new
+ @selected = params[:selected] || 'new_logi'
+ @new_logi = Logi.new_with(:creator => current_user,
+ :user_group => current_prefs.user_group)
+ @new_logi_version = @new_logi.current_logi_version
+ render :partial => 'new.html.erb', :locals => {
+ :selected => @selected}
+ end
+ # needed to switch tags after error
+ alias :show :new
+
+ def create
+ @new_logi, @new_logi_version = self.create_logi(
+ params[:logi], :untagged => true)
+ body_with_inserts = params[:body_with_inserts]
+
+ if body_with_inserts !~ /#{Const::Logi::INSERT_STRING}/
+ @logi.errors.add(:text, ': at least some text needs to be selected' +
+ ' to link the new logi to')
+ end
+
+ transfer_errors(@new_logi, @logi)
+
+ if @logi.errors.empty? and @new_logi_version.valid? and
+ self.thorny_form_free_of_spam?
+ # we can save as we know the link is valid on the logi
+ @new_logi.save
+
+ body_with_comment_link = self.insert_link_to_new_logi(
+ body_with_inserts, @new_logi)
+ self.insert_links(@logi, @logi_version, body_with_comment_link)
+
+ flash[:notice] = "Successfully created new logi and linked it" +
+ " #{@new_logi.to_s(:for => :full_show)}"
+
+ redirect_to logi_ll_url(@logi)
+ else
+ transfer_errors(@new_logi_version, @logi_version)
+
+ flash[:error] = "Problem creating new, linked logi"
+ @selected = 'comment'
+ render :template => 'logi_inserts/new'
+ return
+ end
+ end
+
+ ### Private methods
+
+ protected
+
+ def insert_link_to_new_logi(body_with_inserts, new_logi)
+ return body_with_inserts.gsub(/#{Const::Logi::INSERT_STRING}/,
+ new_logi.link.to_s)
+ end
+end
Modified: trunk/app/controllers/links_controller.rb
===================================================================
--- trunk/app/controllers/links_controller.rb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/app/controllers/links_controller.rb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -21,20 +21,11 @@
### Bodies
- top_body :navigation_bar_edit,
+ top_body :navigation_bar_insert,
: [:create, :edit, :destroy]
### REST-methods
- def index
- @links = Link.find(:all)
- respond_to do |format|
- format.xml do
- render :xml => @links
- end
- end
- end
-
def create
self.insert_links(@logi, @logi_version, params[:body_with_inserts])
Modified: trunk/app/controllers/logi_inserts_controller.rb
===================================================================
--- trunk/app/controllers/logi_inserts_controller.rb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/app/controllers/logi_inserts_controller.rb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -22,12 +22,13 @@
### Bodies
- top_body :navigation_bar_edit
+ top_body :navigation_bar_insert
### REST-methods
def new
@selected = params[:selected]
+ @link_selected = params[:link_selected]
render :layout => 'blank'
end
end
Modified: trunk/app/controllers/ratings_controller.rb
===================================================================
--- trunk/app/controllers/ratings_controller.rb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/app/controllers/ratings_controller.rb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -23,15 +23,6 @@
### REST-methods
- def index
- @ratings = Rating.find(:all)
- respond_to do |format|
- format.xml do
- render :xml => @ratings
- end
- end
- end
-
def show
end
end
Modified: trunk/app/controllers/remarks_controller.rb
===================================================================
--- trunk/app/controllers/remarks_controller.rb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/app/controllers/remarks_controller.rb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -24,59 +24,19 @@
: [:create, :edit, :destroy]
### REST-methods
- def index
- @remarks = Remark.find(:all)
- respond_to do |format|
- format.xml do
- render :xml => @remarks
- end
- end
- end
-
-
+
def create
- if params[:positioned]
- new_remark_position_range_list = self.weave_out_remarks(
- params[:body_with_inserts], @logi_version, @logi)
- if new_remark_position_range_list.empty?
- @logi.errors.add(:selection, 'needs to be made in the logi at the' +
- ' location where the remark should be inserted and the remark should not be empty')
- end
+ @remark = Remark.new(:logi => @logi, :user => current_user,
+ :message => params[:remark][:message])
- if @logi.errors.empty?
- # Only one at the same time for now
- @remark = new_remark_position_range_list.first.remark
- @remark.user = current_user
- @remark.logi = @logi
- @remark.position_ranges = new_remark_position_range_list.translate_from_view(
- @logi_version.position_ranges)
- else
- @remark = Remark.new(:message => params[:remark][:message])
- end
- else
- @remark = Remark.new(:logi => @logi, :user => current_user,
- :message => params[:remark][:message])
- end
-
if @logi.errors.empty? and @remark.valid? and self.thorny_form_free_of_spam?
@remark.save
- if params[:positioned]
- flash[:notice] = "Successfully added remark"
- redirect_to logi_url(@logi)
- else
- self.get_remarks
- @remark = Remark.new
- render :partial => 'logis/remarks'
- end
+ self.get_remarks
+ @remark = Remark.new
+ render :partial => 'logis/remarks'
else
- if params[:positioned]
- flash.now[:error] = "Problem adding remark"
- @selected = 'remark'
- render :template => 'logi_inserts/new'
- else
- self.get_remarks
- render :partial => 'logis/remarks'
- end
+ self.get_remarks
+ render :partial => 'logis/remarks'
end
end
@@ -85,6 +45,7 @@
end
def destroy
+ # TODO fix/add removal of remarks
if params[:deleted_inserts] and !params[:deleted_inserts].empty?
params[:deleted_inserts].each do |remark_id|
@logi.remarks.find(remark_id).destroy
@@ -98,29 +59,10 @@
end
end
- # AJAX-calls
-
- def listing
- render :partial => 'listing', :locals => {
- :remarks => Remark.find(:all, :conditions => ["id IN (?)", params[:ids].split(',')]) }
- end
-
### Private methods
protected
- # Gets the link-clusters + positions from the given text.
- #
- def weave_out_remarks(body_with_remarks, logi_version, logi)
- remark_pos_ranges = PositionRange::List.new
- self.weave_out(body_with_remarks, logi_version, logi) do |pos_range, inserted_string|
- inserted_string.gsub!('__DOUBLE_QUOTES__','"')
- pos_range.remark = Remark.new(:message => inserted_string)
- remark_pos_ranges.push(pos_range)
- end
- return remark_pos_ranges
- end
-
def get_remarks
@remarks = @logi.remarks.find(:all, :limit => 10, :order => ["created_at DESC"])
end
Modified: trunk/app/controllers/users_controller.rb
===================================================================
--- trunk/app/controllers/users_controller.rb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/app/controllers/users_controller.rb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -33,10 +33,6 @@
@users = User.paginate(:page => params[:page], :per_page => 36)
render :layout => 'broad'
end
- format.xml do
- @users = User.find(:all)
- render :xml => @users
- end
end
end
Modified: trunk/app/controllers/votes_controller.rb
===================================================================
--- trunk/app/controllers/votes_controller.rb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/app/controllers/votes_controller.rb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -24,18 +24,6 @@
### REST-methods
- def index
- # ALERT you need to add the plural of the model-name to the config/routes.rb file
- # where votes is already (the second occurrance of votes in the file)
- @votes = Vote.positive.find(:all) # ALERT the positive should be removed for other cases
- # And don't remove it here, I will be watching the commit-logs :-)
- respond_to do |format|
- format.xml do
- render :xml => @votes
- end
- end
- end
-
def create
begin
Rating.transaction do
Modified: trunk/app/helpers/application_helper.rb
===================================================================
--- trunk/app/helpers/application_helper.rb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/app/helpers/application_helper.rb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -93,8 +93,8 @@
tabs.concat([
{:text => _("Contenders"), :name => "contending_logis",
:description => _("Logis competing for the same tags")},
- {:text => _("In Reply to"), :name => "comments_on",
- :description => _("This logi replies to the following logis"),
+ {:text => _("Comments on"), :name => "comments_on",
+ :description => _("This logi comments to the following logis"),
:disabled => logi.comments_on_logis.empty?},
{:text => _("Path"), :name => "paths",
:description => _("This logi is part of a read-path"),
@@ -118,6 +118,8 @@
:description => '<h2>' + _("Currently browsing logis") + '</h2>'},
{:text => _("View"), :name => "navigation_view",
:description => '<h2>' + _("Currently viewing a logi about") + '</h2>'},
+ {:text => _("Insert"), :name => "navigation_insert",
+ :description => '<h2>' + _("Currently inserting things in a logi") + '</h2>'},
{:text => _("Edit"), :name => "navigation_edit",
:description => '<h2>' + _("Currently editing a logi") + '</h2>'},
{:text => _("New"), :name => "navigation_new",
@@ -128,10 +130,9 @@
tabs[1][:url] = browse_ll_url(current_context.link)
tabs[2][:url] = ll_url(current_context.link)
logi = current_context.link.volatile_to_logi
+ tabs[3][:url] = new_logi_logi_inserts_url(logi)
if logi.edit_rights?(current_user)
- tabs[3][:url] = edit_logi_url(current_context.link.volatile_to_logi)
- else
- tabs[3][:url] = edit_logi_remarks_url(logi)
+ tabs[4][:url] = edit_logi_url(current_context.link.volatile_to_logi)
end
end
return tabs
@@ -141,12 +142,6 @@
logi = current_context.link.volatile_to_logi
tabs = [{:text => _("Text"), :name => "edit_text",
:description => _("Currently editing the text")},
- {:text => _("Insert"), :name => "edit_insert",
- :url => new_logi_logi_inserts_url(logi),
- :description => _("Currently inserting into logi")},
- {:text => _("Take out"), :name => "edit_remove",
- :url => edit_logi_remarks_url(logi),
- :description => _("Currently removing from logi")},
{:text => _("Settings"), :name => "edit_settings",
:description => _("Currently editing logi settings")}]
@@ -154,22 +149,34 @@
tabs[0][:url] = edit_logi_url(logi)
end
if logi.admin_rights?(current_user)
- tabs[3][:url] = edit_logi_logi_settings_url(logi)
+ tabs[1][:url] = edit_logi_logi_settings_url(logi)
end
return tabs
end
+ def insert_tabs
+ logi = current_context.link.volatile_to_logi
+ tabs = [{:text => _("Insert into text"), :name => "insert_insert",
+ :url => new_logi_logi_inserts_url(logi),
+ :description => _("Currently inserting into logi")},
+ {:text => _("Remove from text"), :name => "insert_remove",
+ :url => edit_logi_annotations_url(logi),
+ :description => _("Currently removing from logi")}]
+ return tabs
+ end
+
+
def remove_tabs
logi = current_context.link.volatile_to_logi
tabs = [{:text => _("Links"), :name => "remove_links",
:url => edit_logi_links_url(logi),
- :description => _("Remove links to tags or to logis")},
- {:text => _("External Links"), :name => "remove_external_links",
+ :description => _("Extract links to tags or to logis")},
+ {:text => _("External links"), :name => "remove_external_links",
:url => edit_logi_external_links_url(logi),
- :description => _("Remove links to different sites")},
- {:text => _("Remarks"), :name => "remove_remarks",
- :url => edit_logi_remarks_url(logi),
- :description => _("Remove remarks")}]
+ :description => _("Extract links to different sites")},
+ {:text => _("Annotations"), :name => "remove_annotations",
+ :url => edit_logi_annotations_url(logi),
+ :description => _("Extract annotations")}]
return tabs
end
@@ -239,14 +246,14 @@
logi = logi_version.logi
p_r_list = logi.from_links.position_range_list_translated(logi_version)
p_r_list.concat(logi.external_links.position_range_list_translated(logi_version))
- p_r_list.concat(logi.remarks.position_range_list_translated(logi_version))
+ p_r_list.concat(logi.annotations.position_range_list_translated(logi_version))
p_r_clusters = p_r_list.cluster_overlaps
p_r_clusters.each do |p_r_cluster|
first_p_r = p_r_cluster.first
links = []
external_links = []
- remarks = []
+ annotations = []
p_r_cluster.each {|p_r|
if p_r.link
links << p_r.link
@@ -254,13 +261,13 @@
if p_r.external_link
external_links << p_r.external_link
end
- if p_r.remark
- remarks << p_r.remark
+ if p_r.annotation
+ annotations << p_r.annotation
end
}
opening, closing = popovers_listing_opening_closing(
:links => links, :external_links => external_links,
- :remarks => remarks)
+ :annotations => annotations)
weaver.next_set
weaver.add_opening(first_p_r.first, opening)
weaver.add_closing(first_p_r.last, closing)
@@ -273,7 +280,7 @@
elsif options[:external_link]
new_options = {:external_links => [options[:external_link]]}
else
- new_options = {:remarks => [options[:remark]]}
+ new_options = {:annotations => [options[:annotation]]}
end
opening, closing = popovers_listing_opening_closing(new_options)
return opening + text + closing
@@ -304,9 +311,9 @@
if options[:external_links] and !options[:external_links].empty?
url += '&external_link_ids=' + options[:external_links].collect {|external_link| external_link.id.to_s}.join(',')
end
- if options[:remarks] and !options[:remarks].empty?
- css_class += ' logilogi_remark'
- url += '&remark_ids=' + options[:remarks].collect {|remark| remark.id.to_s}.join(',')
+ if options[:annotations] and !options[:annotations].empty?
+ css_class += ' logilogi_annotation'
+ url += '&annotation_ids=' + options[:annotations].collect {|annotation| annotation.id.to_s}.join(',')
end
return ['<a class="' + css_class[1..-1] + '" href="' + href + '" title="' + title +
'" http://log.logilogi.org" rel="nofollow">log.logilogi.org
+ #
+ def log_create_to_log_log
+ if GlobalConfig.use_log_log
+ m = LogLogMessage.new(
+ :kind => "Annotation",
+ :channel_names => ['all', 'annotation',
+ 'for_' + self.logi.creator.unix_name].join(','),
+ :author => self.user.name,
+ :title => 'On: ' + self.logi.current_title,
+ :text => self.message,
+ :url => GlobalConfig.site_url + self.logi.link.to_s)
+ m.save
+ end
+ end
+
+ ### Validation-functions
+
+ protected
+
+ def validate
+ # no html-tags
+ if self.message =~ Const::LogiVersion::HTML_TAG
+ self.errors.add(:message, "html tags are not allowed inside annotations")
+ end
+ end
+end
Modified: trunk/app/models/logi.rb
===================================================================
--- trunk/app/models/logi.rb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/app/models/logi.rb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -77,9 +77,10 @@
has_many :external_links, :dependent => :destroy,
:extend => InsertPositionRangeListExtensionModule
# Getting the position-ranges
- has_many :remarks, :dependent => :destroy,
+ has_many :annotations, :dependent => :destroy,
:extend => InsertPositionRangeListExtensionModule
# Getting the position-ranges
+ has_many :remarks, :dependent => :destroy
has_many :steps, :dependent => :destroy
tags_strings nil
@@ -337,7 +338,7 @@
# Returns all things that are inserted in this logi.
#
def inserts
- return self.remarks.positioned + self.from_links + self.external_links
+ return self.annotations + self.from_links + self.external_links
end
### Setters
Modified: trunk/app/models/logi_version.rb
===================================================================
--- trunk/app/models/logi_version.rb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/app/models/logi_version.rb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -389,7 +389,7 @@
return true
end
- # Destroys all links, external links and positioned remarks that are
+ # Destroys all links, external links and annotations that are
# not in the current version.
#
def destroy_orphaned_inserts
Modified: trunk/app/models/remark.rb
===================================================================
--- trunk/app/models/remark.rb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/app/models/remark.rb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -20,19 +20,12 @@
belongs_to :logi
belongs_to :user
- attr_accessor :position_ranges
-
- ### Named Scopes
-
- named_scope :positioned, :conditions => ['position_ranges_string != ""']
-
### Filters
# TODO find a solution for long words, like word wrap or chopping up
# words
# after_initialize
- before_save :stringify_position_ranges
after_create :log_create_to_log_log
### Validations
@@ -46,30 +39,6 @@
protected
- # Sets the position_ranges attribute and associates each PositionRange
- # with it's position in the un-sorted list.
- #
- def after_initialize
- if self.new_record?
- @position_ranges = PositionRange::List.new()
- else
- @position_ranges = PositionRange::List.from_s(self.position_ranges_string, :remark => self)
- end
- return true
- end
-
- # Does a sanity-check on the position_ranges and turns them into a
- # string for saving.
- #
- def stringify_position_ranges
- if !@position_ranges.below?(self.logi.text_stack.size) # sanity check
- raise StandardError, 'End of PositionRange bigger than the logi (' +
- self.logi.text_stack.size.to_s + ')'
- end
- self.position_ranges_string = @position_ranges.to_s
- return true
- end
-
# Logs creation to log.logilogi.org
#
def log_create_to_log_log
Added: trunk/app/views/annotations/_listing.html.erb
===================================================================
--- trunk/app/views/annotations/_listing.html.erb (rev 0)
+++ trunk/app/views/annotations/_listing.html.erb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -0,0 +1,8 @@
+<h4><%= _("Annotations") %></h4>
+<ol>
+<% @annotations.each do |annotation| %>
+ <li>
+ <%= annotation.message %>
+ </li>
+<% end %>
+</ol>
Added: trunk/app/views/annotations/_new.html.erb
===================================================================
--- trunk/app/views/annotations/_new.html.erb (rev 0)
+++ trunk/app/views/annotations/_new.html.erb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -0,0 +1,4 @@
+<% render :layout => 'application/panel', :locals => {:title => _("Adding Annotation"), :id => "annotation_panel"} do %>
+ <label><%= _("Annotation") %></label>
+ <%= text_area_tag 'annotation[message]', @annotation.message, :id => "annotation" %>
+<% end %>
Added: trunk/app/views/annotations/edit.html.erb
===================================================================
--- trunk/app/views/annotations/edit.html.erb (rev 0)
+++ trunk/app/views/annotations/edit.html.erb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -0,0 +1,62 @@
+<% form_for(:logi, @logi, :url => logi_annotations_url(@logi),
+ :html => {:method => :delete, :id => "remove_form"}) do |form| %>
+
+ <%= render :partial => 'logi_inserts/insert_bar_remove' %>
+
+ <% render :layout => 'logi_inserts/remove_bar', :locals => {
+ :selected => "remove_annotations", :logi => @logi} do %>
+ <p>There are <%= @annotations.size %> annotations in this logi</p>
+ <% end %>
+
+ <div class="main_column">
+ <%= show_flash %>
+ </div>
+ <div class="spacer"></div>
+
+ <div class="main_column">
+ <% render :layout => 'application/panel' do %>
+ <div class="min_height"></div>
+ <label><%= _("List") %></label><br /><br />
+ <ul id="available_list" class="remove_list">
+ <% if @annotations.empty? %>
+ <li><i><%= _("None") %></i></li>
+ <% else %>
+ <% @annotations.order_by_created_at.each do |annotation| %>
+ <li id="r_<%= annotation.id.to_s %>">
+ <a href="javascript:logiInsertsRemove('<%= annotation.id.to_s %>', 'delete', 'undo');">
+ [ <span class="action">delete</span> <%= image_tag 'remove_cross.png' %> ]
+ </a>
+ <%= popover_listing(truncate(annotation.message, :length => 35), :annotation => annotation) %> -
+ <%= user_ll_link(annotation.user) %>
+ </li>
+ <% end %>
+ <% end %>
+ </ul>
+ <% end %>
+ </div>
+
+ <div class="side_column">
+ <% render :layout => 'application/wizzard_cloud_panel' do %>
+ <h3><%= _('Which annotations ?') %></h3>
+ <p>Click on the crosses of the annotations you want to delete. This will move them to the deletion list</p>
+ <% end %>
+ </div>
+ <div class="spacer"></div>
+
+ <div class="main_column">
+ <%= render :partial => 'logi_inserts/deletion_list' %>
+ </div>
+
+ <div class="side_column">
+ <% render :layout => 'application/wizzard_cloud_panel' do %>
+ <h3><%= _('Are you sure ?') %></h3>
+ <p>Check if these are indeed the annotations you want to remove. Then submit</p>
+ <% end %>
+ </div>
+ <div class="spacer"></div>
+
+ <div class="main_column">
+ <%= render :partial => 'application/submit', :locals => {:form => form,
+ :cancel_url => logi_url(@logi)} %>
+ </div>
+<% end %>
Modified: trunk/app/views/application/_panel_with_tabs_js.html.erb
===================================================================
--- trunk/app/views/application/_panel_with_tabs_js.html.erb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/app/views/application/_panel_with_tabs_js.html.erb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -15,7 +15,8 @@
<li class="<%= tab[:name] %>_selected">
<a href="#<%= local_assigns[:id]
%>" ><%= tab[:text] %></a>
+ '<%= tab[:name] %>','<%= tab[:mcorners_tab_name] %>');
+ <%= tab[:onclick] %>"><%= tab[:text] %></a>
</li>
<% end %>
</ul>
Modified: trunk/app/views/application/_popover_listing.html.erb
===================================================================
--- trunk/app/views/application/_popover_listing.html.erb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/app/views/application/_popover_listing.html.erb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -5,7 +5,7 @@
<% if !@external_links.empty? %>
<%= render :partial => 'external_links/listing' %>
<% end %>
- <% if !@remarks.empty? %>
- <%= render :partial => 'remarks/listing' %>
+ <% if !@annotations.empty? %>
+ <%= render :partial => 'annotations/listing' %>
<% end %>
</div>
Modified: trunk/app/views/comments/_new.html.erb
===================================================================
--- trunk/app/views/comments/_new.html.erb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/app/views/comments/_new.html.erb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -4,7 +4,7 @@
<% render :layout => 'application/panel_with_tabs_ajax', :locals => {:tabs => [
{:text => _("New Logi"), :name => "new_logi",
- :description => _("Create a new logi in reply")},
+ :description => _("Create a new logi as a comment")},
{:text => _("Existing Logi"), :name => "existing_logi",
:description => _("Paste (Ctrl V) the permanent link to the logi you want to add")}],
:selected => selected, :id => "new_comment", :update_selected => true} do %>
Modified: trunk/app/views/external_links/edit.html.erb
===================================================================
--- trunk/app/views/external_links/edit.html.erb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/app/views/external_links/edit.html.erb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -1,7 +1,7 @@
<% form_for(:logi, @logi, :url => logi_external_links_url(@logi),
:html => {:method => :delete, :id => "remove_form"}) do |form| %>
- <%= render :partial => 'logi_inserts/edit_bar_remove' %>
+ <%= render :partial => 'logi_inserts/insert_bar_remove' %>
<% render :layout => 'logi_inserts/remove_bar', :locals => {
:selected => "remove_external_links", :logi => @logi} do %>
Modified: trunk/app/views/links/_listing.html.erb
===================================================================
--- trunk/app/views/links/_listing.html.erb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/app/views/links/_listing.html.erb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -1,4 +1,4 @@
-<h4><%= _("Links") %></h4>
+<h4><%= _("Logi links") %></h4>
<ol>
<% @links_hash_arr.each do |links_hash| %>
<li>
Modified: trunk/app/views/links/edit.html.erb
===================================================================
--- trunk/app/views/links/edit.html.erb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/app/views/links/edit.html.erb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -1,7 +1,7 @@
<% form_for(:logi, @logi, :url => logi_links_url(@logi),
:html => {:method => :delete, :id => "remove_form"}) do |form| %>
- <%= render :partial => 'logi_inserts/edit_bar_remove' %>
+ <%= render :partial => 'logi_inserts/insert_bar_remove' %>
<% render :layout => 'logi_inserts/remove_bar', :locals => {
:selected => "remove_links", :logi => @logi} do %>
Deleted: trunk/app/views/logi_inserts/_edit_bar_remove.html.erb
===================================================================
--- trunk/app/views/logi_inserts/_edit_bar_remove.html.erb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/app/views/logi_inserts/_edit_bar_remove.html.erb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -1,3 +0,0 @@
-<% render :layout => 'logis/edit_bar', :locals => {:selected => "edit_remove"} do %>
- <p><%= _('You are removing things from a logi') %></p>
-<% end %>
Added: trunk/app/views/logi_inserts/_insert_bar_remove.html.erb
===================================================================
--- trunk/app/views/logi_inserts/_insert_bar_remove.html.erb (rev 0)
+++ trunk/app/views/logi_inserts/_insert_bar_remove.html.erb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -0,0 +1,3 @@
+<% render :layout => 'logis/insert_bar', :locals => {:selected => "insert_remove"} do %>
+ <p><%= _('You are removing things from a logi') %></p>
+<% end %>
Modified: trunk/app/views/logi_inserts/_remove_bar.html.erb
===================================================================
--- trunk/app/views/logi_inserts/_remove_bar.html.erb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/app/views/logi_inserts/_remove_bar.html.erb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -8,7 +8,7 @@
<div class="side_column">
<% render :layout => 'application/wizzard_step_cloud_panel' do %>
<h2><%= _('What to remove ?') %></h2>
- <p><%= _('Select what you want to remove; links to logis, external links, or short remarks') %></p>
+ <p><%= _('Select what you want to remove; links to logis, external links, or annotations') %></p>
<% end %>
</div>
Modified: trunk/app/views/logi_inserts/new.html.erb
===================================================================
--- trunk/app/views/logi_inserts/new.html.erb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/app/views/logi_inserts/new.html.erb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -1,18 +1,18 @@
<%
@link ||= Link.new
-@remark ||= Remark.new
+@annotation ||= Annotation.new
@external_link ||= ExternalLink.new
%>
<% thorny_form_for(:logi, @logi, :url => logi_url(@logi), :method => :post,
:html => {:id => "insert_form"}) do |form| %>
- <% render :layout => 'logis/edit_bar', :locals => {
- :selected => "edit_insert"} do %>
+ <% render :layout => 'logis/insert_bar', :locals => {
+ :selected => "insert_insert"} do %>
<p><%= _('Everyone can insert things into all logis') %></p>
<% end %>
<div class="main_column">
<%= show_flash %>
- <%= show_errors('logi_version','logi','remark','external_link','link') %>
+ <%= show_errors('logi_version','logi','annotation','external_link','link') %>
</div>
<div class="spacer"></div>
@@ -38,7 +38,7 @@
<div class="main_column">
<div id="selected_text">
<% render :layout => 'application/panel', :locals => {
- :id => "remarking"} do %>
+ :id => "annotating"} do %>
<div class="min_height"></div>
<p><%= _('Selected text') %></p>
<div id="selected_text_text"></div>
@@ -65,64 +65,60 @@
<div class="spacer"></div>
<div class="main_column">
- <% @selected ||= "remark" %>
+ <% @selected ||= "annotation" %>
<% render :layout => 'application/panel_with_tabs_js', :locals => {
:tabs => [
- {:text => _("Logi as a Reply"), :name => "comment",
- :description => _("Insert a logi in reply"),
- : 'logi_editor.initialize_tiny_mce_now()'},
- {:text => _("Link"), :name => "link",
- :description => _("Insert a link")},
- {:text => _("Remark"), :name => "remark",
- :description => _("Insert a remark")}],
+ {:text => _("Logi link to..."), :name => "link",
+ :description => _("Insert a link to another logi"),
+ :mcorners_tab_name => 'tags_link'},
+ {:text => _("External link"), :name => "external_link",
+ :description => _("Insert a link to a different site")},
+ {:text => _("Annotation"), :name => "annotation",
+ :description => _("Insert a annotation")}],
:selected => @selected, :id => "insert_options"} do %>
- <div id="insert_comment"
- class="no_for_link no_for_external_link no_for_remark">
- <%= render :partial => 'logis/edit', :locals => {
- :name => 'comment', :logi_version => nil, :defer => true} %>
- <div class="spacer"></div>
- </div><!-- end only_comments -->
-
<div id="insert_link"
- class="no_for_comment no_for_external_link no_for_remark">
+ class="no_for_external_link no_for_annotation">
<% @link_selected ||= "tags_link" %>
<% render :layout => 'application/panel_with_tabs_js', :locals => {
:tabs => [
+ {:text => _("New logi"), :name => "linked_logi",
+ :description => _("Insert a link to a newly created logi"),
+ : 'logi_editor.initialize_tiny_mce_now()'},
{:text => _("Tags"), :name => "tags_link",
:description => _("Insert a link to all logis with the following tags")},
- {:text => _("Specific Logi"), :name => "perma_link",
- :description => _("Paste (Ctrl V) a permanent link to a specific logi")},
- {:text => _("External Link"), :name => "external_link",
- :description => _("Insert a link to a different site")}],
+ {:text => _("Specific logi"), :name => "perma_link",
+ :description => _("Paste (Ctrl V) a perma-link to a specific logi")}],
:selected => @link_selected, :id => "link_insert_options"} do %>
+ <div id="insert_linked_logi"
+ class="no_for_tags_link no_for_perma_link">
+ <%= render :partial => 'logis/edit', :locals => {
+ :name => 'edit_linked_logi', :logi_version => nil, :defer => true} %>
+ <div class="spacer"></div>
+ </div><!-- end only_linked_logis -->
+
<div id="insert_tags_link"
- class="no_for_perma_link no_for_external_link">
+ class="no_for_linked_logi no_for_perma_link">
<%= render :partial => 'links/new' %>
</div><!-- end only_tags_links -->
<div id="insert_perma_link"
- class="no_for_tags_link no_for_external_link">
+ class="no_for_linked_logi no_for_tags_link">
<%= render :partial => 'perma_links/new' %>
</div><!-- end only_perma_links -->
-
- <div id="insert_external_link"
- class="no_for_tags_link no_for_perma_link">
- <%= render :partial => 'external_links/new' %>
- </div><!-- end only_external_links -->
<% end %><!-- end link_panel_with_tabs_js -->
</div><!-- end only_links -->
<div id="insert_external_link"
- class="no_for_comment no_for_link no_for_remark">
+ class="no_for_link no_for_annotation">
<%= render :partial => 'external_links/new' %>
</div><!-- end only_external_links -->
- <div id="insert_remark"
- class="no_for_comment no_for_link no_for_external_link">
- <%= render :partial => 'remarks/new' %>
- </div><!-- end only_remarks -->
+ <div id="insert_annotation"
+ class="no_for_link no_for_external_link">
+ <%= render :partial => 'annotations/new' %>
+ </div><!-- end only_annotations -->
<div class="common">
<%= hidden_field_tag :positioned, true %>
@@ -141,15 +137,21 @@
<div class="side_column">
<% render :layout => 'application/wizzard_step_cloud_panel' do %>
<h2><%= _('What to insert ?') %></h2>
- <p><%= _('Select what you want to insert; a commenting logi,' +
- ' various types of links, or a short remark') %></p>
+ <p><%= _('Select what you want to insert; a new logi,' +
+ ' various types of links, or an annotation') %></p>
<% end %>
</div>
<% end %><!-- end form-->
<% javascript_tag do -%>
- <% ['comment','link','external_link','remark'].each do |select_option| %>
- <% if @selected != select_option %>
+ <%
+ if @selected == 'link'
+ defer_selected = @link_selected
+ else
+ defer_selected = @selected
+ end
+ ['linked_logi','tags_link','perma_link','external_link','annotation'].each do |select_option|
+ if defer_selected != select_option %>
mcorners.defer('<%= select_option + "', '#insert_" + select_option %>',
'div.remove_tag');
mcorners.defer('<%= select_option + "', '#insert_" + select_option %>',
@@ -160,7 +162,7 @@
'div.logi_body');
<% end %>
<% end %>
- <% if @selected == "comment" %>
+ <% if defer_selected == "linked_logi" %>
logi_editor.initialize_tiny_mce();
<% end %>
<% end -%>
Modified: trunk/app/views/logis/_commenting_logis.html.erb
===================================================================
--- trunk/app/views/logis/_commenting_logis.html.erb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/app/views/logis/_commenting_logis.html.erb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -1,13 +1,13 @@
<% render :layout => 'application/panel_with_header',
- :locals => {:title => _("Received replying Logis"), :id => "commenting"} do %>
+ :locals => {:title => _("Commenting logis"), :id => "commenting"} do %>
<div class="mirrored_notice_cloud"><%= _('Want to give a more in-depth response ?') %></div>
<div class="description">
- <p><%= _('%{nr} Logis are replying') % {:nr => logis.size} %></p>
+ <p><%= _('This logi has %{nr} comments') % {:nr => logis.size} %></p>
</div>
<div class="spacer"></div>
<%= toggle_button_to_remote 'or add a logi below', {:update => "comment_area",
:url => new_logi_comments_url(@logi), :method => :get},
:class => 'unfold_button', :disabled => local_assigns[:unfold_disabled] %>
- <%= button_to 'insert a logi as a reply', new_logi_logi_inserts_url(@logi,
- :selected => 'comment'), :class => 'insert_button' %>
+ <%= button_to 'create a new logi and link to it', new_logi_logi_inserts_url(@logi,
+ :selected => 'link', :link_selected => 'linked_logi'), :class => 'insert_button' %>
<% end %>
Modified: trunk/app/views/logis/_comments_on.html.erb
===================================================================
--- trunk/app/views/logis/_comments_on.html.erb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/app/views/logis/_comments_on.html.erb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -1,7 +1,7 @@
<div id="contenders_padding">
<div class="description">
<p>
- <%= _('This logi replies to %{nr} logis') % {
+ <%= _('This logi comments to %{nr} logis') % {
:nr => @logi.comments_on_logis.size} %>
</p>
</div>
Added: trunk/app/views/logis/_insert_bar.html.erb
===================================================================
--- trunk/app/views/logis/_insert_bar.html.erb (rev 0)
+++ trunk/app/views/logis/_insert_bar.html.erb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -0,0 +1,14 @@
+<% tabs = insert_tabs() %>
+<div class="main_column">
+ <%= render :partial => 'application/panel_with_tabs', :locals => {
+ :tabs => tabs, :selected => selected, :id => "insert_bar"} %>
+</div>
+
+<div class="side_column">
+ <% render :layout => 'application/wizzard_step_cloud_panel' do %>
+ <h2><%= _('Insert or remove ?') %></h2>
+ <p>Select whether you want to insert things into the text, or remove them from the text</p>
+ <% end %>
+</div>
+
+<div class="spacer"></div>
Modified: trunk/app/views/logis/_navigation_bar_edit.html.erb
===================================================================
--- trunk/app/views/logis/_navigation_bar_edit.html.erb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/app/views/logis/_navigation_bar_edit.html.erb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -1,5 +1,4 @@
<% render :layout => 'logis/navigation_bar', :locals => {
:selected => "navigation_edit", :header => render_to_string(
:partial => 'logis/navigation_bar_edit_header')} do %>
- <%= render :partial => 'logis/navigation_bar_user_group_select' %>
<% end %>
Added: trunk/app/views/logis/_navigation_bar_insert.html.erb
===================================================================
--- trunk/app/views/logis/_navigation_bar_insert.html.erb (rev 0)
+++ trunk/app/views/logis/_navigation_bar_insert.html.erb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -0,0 +1,4 @@
+<% render :layout => 'logis/navigation_bar', :locals => {
+ :selected => "navigation_insert", :header => render_to_string(
+ :partial => 'logis/navigation_bar_edit_header')} do %>
+<% end %>
Modified: trunk/app/views/logis/_snippet.html.erb
===================================================================
--- trunk/app/views/logis/_snippet.html.erb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/app/views/logis/_snippet.html.erb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -7,9 +7,9 @@
<div class="comments">
<span class="comments_label">
<% if logi.comments_on_logis.count > 0 %>
- <em>Replies to <%= logi.comments_on_logis.count %> logis<%= ( logi.commenting_logis.count > 0 ? ', has ' + logi.commenting_logis.count.to_s + ' replies' : '') %></em>
+ <em>Comments on <%= logi.comments_on_logis.count %> logis<%= ( logi.commenting_logis.count > 0 ? ', has ' + logi.commenting_logis.count.to_s + ' comments' : '') %></em>
<% else %>
- <em>Has <%= logi.commenting_logis.count %> replies</em>
+ <em>Has <%= logi.commenting_logis.count %> comments</em>
<% end %>
</span>
</div>
Modified: trunk/app/views/remarks/_list.html.erb
===================================================================
--- trunk/app/views/remarks/_list.html.erb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/app/views/remarks/_list.html.erb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -1,10 +1,6 @@
<% if !remarks.empty? %>
<% remarks.each do |remark| %>
- <% if remark.position_ranges.empty? %>
- <div class="box secondary_border_panel remark" >
- <% else %>
- <div class="box secondary_border_panel remark ranged">
- <% end %>
+ <div class="box secondary_border_panel remark">
<div class="panel_content_padding">
<%= by_author(remark.user, :length => 18) %>
<%= gravatar_for(remark.user, :class => 'avatar') %>
Deleted: trunk/app/views/remarks/_listing.html.erb
===================================================================
--- trunk/app/views/remarks/_listing.html.erb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/app/views/remarks/_listing.html.erb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -1,8 +0,0 @@
-<h4><%= _("Short Remarks") %></h4>
-<ol>
-<% @remarks.each do |remark| %>
- <li>
- <%= remark.message %>
- </li>
-<% end %>
-</ol>
Modified: trunk/config/routes.rb
===================================================================
--- trunk/config/routes.rb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/config/routes.rb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -34,13 +34,15 @@
:name_prefix => '_hidden_',
:requirements => { :ll_link_string => /.*/ }
map.resource :links, :ratings, :logi_settings, :logi_inserts, :logi_tags,
- :logi_versions, :remarks, :external_links, :perma_links, :comments,
+ :logi_versions, :remarks, :annotations, :external_links, :perma_links,
+ :linked_logis, :comments,
:path_prefix => ':ll_link_string/do',
:name_prefix => '_hidden_',
:requirements => { :ll_link_string => /.*/ }
map.resources :users, :peer_group_admin_memberships, :peer_group_memberships,
- :user_groups, :prefs_profiles, :invitations, :votes, :remarks, :comments, :links,
- :ratings, :paths, :steps,
+ :user_groups, :prefs_profiles, :invitations, :votes, :remarks,
+ :annotations, :links, :linked_logis, :comments, :ratings, :paths,
+ :steps,
:path_prefix => 'do'
map.resources :peer_groups,
:path_prefix => 'do', :has_many => :invitations, :shallow => true
@@ -66,7 +68,7 @@
:requirements => { :ll_link_string => /.*/ },
:conditions => { :method => :get }
- # Popover clouds with remarks & links
+ # Popover clouds with annotations & links
map.popover_listing 'do/popovers/listing',
:controller => 'application',
:action => 'popover_listing'
Added: trunk/db/migrate/20091113112526_positioned_remarks_as_annotations.rb
===================================================================
--- trunk/db/migrate/20091113112526_positioned_remarks_as_annotations.rb (rev 0)
+++ trunk/db/migrate/20091113112526_positioned_remarks_as_annotations.rb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -0,0 +1,16 @@
+class PositionedRemarksAsAnnotations < ActiveRecord::Migration
+ def self.up
+ create_table :annotations do |t|
+ t.references :logi, :null => false
+ t.references :user, :null => false
+ t.string :message, :null => false
+ t.string :position_ranges_string, :limit => 80, :null => false
+ t.datetime :created_at, :null => false
+ end
+ remove_column :remarks, :position_ranges_string
+ end
+
+ def self.down
+ raise 'No way back'
+ end
+end
Modified: trunk/db/schema.rb
===================================================================
--- trunk/db/schema.rb 2009-11-15 22:30:42 UTC (rev 1639)
+++ trunk/db/schema.rb 2009-11-18 14:05:07 UTC (rev 1640)
@@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20091019213633) do
+ActiveRecord::Schema.define(:version => 20091113112526) do
create_table "acts_as_xapian_jobs", :force => true do |t|
t.string "model", :null => false
@@ -19,6 +19,14 @@
add_index "acts_as_xapian_jobs", ["model", "model_id"], :name => "index_acts_as_xapian_jobs_on_model_and_model_id", :unique => true
+ create_table "annotations", :for...
[truncated message content] |