logilogi-svn Mailing List for LogiLogi - Software Libre for the Web (Page 10)
Status: Beta
Brought to you by:
wybow
You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
(7) |
Apr
(18) |
May
(59) |
Jun
(73) |
Jul
(31) |
Aug
(19) |
Sep
(18) |
Oct
(31) |
Nov
(9) |
Dec
(15) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(30) |
Feb
(62) |
Mar
(70) |
Apr
(75) |
May
(139) |
Jun
(85) |
Jul
(28) |
Aug
(33) |
Sep
(145) |
Oct
(45) |
Nov
(76) |
Dec
(48) |
| 2009 |
Jan
(12) |
Feb
(39) |
Mar
(5) |
Apr
(6) |
May
(23) |
Jun
(44) |
Jul
(17) |
Aug
(15) |
Sep
(49) |
Oct
(28) |
Nov
(14) |
Dec
(6) |
| 2010 |
Jan
(22) |
Feb
(24) |
Mar
(14) |
Apr
(3) |
May
(2) |
Jun
(30) |
Jul
(9) |
Aug
(9) |
Sep
(10) |
Oct
(1) |
Nov
|
Dec
(1) |
| 2011 |
Jan
(2) |
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <wy...@us...> - 2009-09-04 12:42:08
|
Revision: 1559
http://logilogi.svn.sourceforge.net/logilogi/?rev=1559&view=rev
Author: wybow
Date: 2009-09-04 12:22:39 +0000 (Fri, 04 Sep 2009)
Log Message:
-----------
Updated for rmagick
Modified Paths:
--------------
trunk/doc/README_FOR_APP
Modified: trunk/doc/README_FOR_APP
===================================================================
--- trunk/doc/README_FOR_APP 2009-08-30 09:27:30 UTC (rev 1558)
+++ trunk/doc/README_FOR_APP 2009-09-04 12:22:39 UTC (rev 1559)
@@ -185,20 +185,18 @@
sudo apt-get install ruby ruby1.8-dev libzlib-ruby rdoc irb rake
-And to get MySQL, Subversion and libopenssl, gettext, Xapian and
-libxml2:
+And to get MySQL, Subversion and libopenssl, gettext, Xapian,
+ImageMagick and libxml2:
sudo apt-get install make mysql-server mysql-client
mysqlclient15-dev subversion libopenssl-ruby1.8 libxapian15
- libxapian-ruby1.8 gettext libxml2
+ libxapian-ruby1.8 gettext libxml2 imagemagick librsvg2-dev
+ libmagick9-dev
-RMagick will build extensions from source. Don't forget to install
-librsvg2-dev, and libmagick9-dev, before installing the rmagick gem,
-so you have svg support for the background-images.
+RMagick will build extensions from source. If you have to install
+ImageMagick from source (because it is out of date compared to
+RMagick), you can do it with:
-And if you have to install ImageMagick from source, you can do it
-with:
-
./configure --disable-openmp; make; sudo make install;
sudo gem install rmagick
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wy...@us...> - 2009-08-30 09:27:37
|
Revision: 1558
http://logilogi.svn.sourceforge.net/logilogi/?rev=1558&view=rev
Author: wybow
Date: 2009-08-30 09:27:30 +0000 (Sun, 30 Aug 2009)
Log Message:
-----------
Fixed invites bug
Modified Paths:
--------------
trunk/app/controllers/invitations_controller.rb
trunk/test/functional/invitations_controller_test.rb
Modified: trunk/app/controllers/invitations_controller.rb
===================================================================
--- trunk/app/controllers/invitations_controller.rb 2009-08-29 07:48:20 UTC (rev 1557)
+++ trunk/app/controllers/invitations_controller.rb 2009-08-30 09:27:30 UTC (rev 1558)
@@ -75,6 +75,9 @@
def load_invitation_using_token
@invitation = Invitation.find_by_token(params[:id])
unless @invitation
+ @invitation = Invitation.find_by_id(params[:id])
+ end
+ unless @invitation
flash[:notice] = "We're sorry, but we could not find your invitation. " +
"If you are having issues try copying and pasting the URL " +
"from your email into your browser or ask for a new invitation."
Modified: trunk/test/functional/invitations_controller_test.rb
===================================================================
--- trunk/test/functional/invitations_controller_test.rb 2009-08-29 07:48:20 UTC (rev 1557)
+++ trunk/test/functional/invitations_controller_test.rb 2009-08-30 09:27:30 UTC (rev 1558)
@@ -75,9 +75,9 @@
assert_response :success
end
- def test_edit
+ def test_edit_and_id
login(:eduard_edison)
- get :edit, :id => invitations(:freddy_walker_biologers).token
+ get :edit, :id => invitations(:freddy_walker_biologers)
assert_response :success
end
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wy...@us...> - 2009-08-29 07:48:27
|
Revision: 1557
http://logilogi.svn.sourceforge.net/logilogi/?rev=1557&view=rev
Author: wybow
Date: 2009-08-29 07:48:20 +0000 (Sat, 29 Aug 2009)
Log Message:
-----------
Shortened version-note
Modified Paths:
--------------
trunk/app/views/layouts/_title_bar.html.erb
Modified: trunk/app/views/layouts/_title_bar.html.erb
===================================================================
--- trunk/app/views/layouts/_title_bar.html.erb 2009-08-27 11:45:44 UTC (rev 1556)
+++ trunk/app/views/layouts/_title_bar.html.erb 2009-08-29 07:48:20 UTC (rev 1557)
@@ -23,7 +23,7 @@
<%= site_link(:length => 18) %>
</div>
<div id="version" title="The second version of LogiLogi, now in public beta">
- version Manta
+ Manta
</div>
<div id="title_line">
<%= GlobalConfig.title_line %>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wy...@us...> - 2009-08-27 11:45:52
|
Revision: 1556
http://logilogi.svn.sourceforge.net/logilogi/?rev=1556&view=rev
Author: wybow
Date: 2009-08-27 11:45:44 +0000 (Thu, 27 Aug 2009)
Log Message:
-----------
Fixed tag-bug
Modified Paths:
--------------
trunk/app/models/tag.rb
trunk/test/unit/tag_test.rb
Modified: trunk/app/models/tag.rb
===================================================================
--- trunk/app/models/tag.rb 2009-08-26 06:40:46 UTC (rev 1555)
+++ trunk/app/models/tag.rb 2009-08-27 11:45:44 UTC (rev 1556)
@@ -100,7 +100,7 @@
end
tag_string = tag_string.dup
# add spaces before upper-case letters in WikiWords
- tag_string.gsub!(/([^\s_.])([A-Z][\w-])/,'\1 \2')
+ tag_string.gsub!(/([^\s_.])([A-Z][a-z-])/,'\1 \2')
# replace spaces by underscores
tag_string.gsub!(/\s/,'_')
# add capitals after underscores
Modified: trunk/test/unit/tag_test.rb
===================================================================
--- trunk/test/unit/tag_test.rb 2009-08-26 06:40:46 UTC (rev 1555)
+++ trunk/test/unit/tag_test.rb 2009-08-27 11:45:44 UTC (rev 1556)
@@ -34,6 +34,19 @@
no_upper = Tag.from_s('no upper')
assert_equal 'No_Upper', no_upper.string
+ all_upper = Tag.from_s('LIRMM')
+ assert_equal 'LIRMM', all_upper.string
+
+ abbrev_upper = Tag.from_s('W.C.')
+ assert_equal 'W.C.', abbrev_upper.string
+
+ strange_case_string = 'Le_TsT_EsT.T.hisWELL'
+ strange_case = Tag.from_s('LeTsTEsT.T.hisWELL')
+ assert_equal strange_case_string, strange_case.string
+
+ stranger_case = Tag.from_s(strange_case.string)
+ assert_equal strange_case_string, stranger_case.string
+
camel_case = Tag.from_s('CamelCase')
assert_equal 'Camel_Case', camel_case.string
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wy...@us...> - 2009-08-26 06:40:53
|
Revision: 1555
http://logilogi.svn.sourceforge.net/logilogi/?rev=1555&view=rev
Author: wybow
Date: 2009-08-26 06:40:46 +0000 (Wed, 26 Aug 2009)
Log Message:
-----------
Fixed openid bug reported by LiquidPub pplz
Modified Paths:
--------------
trunk/app/controllers/users_controller.rb
trunk/app/models/link.rb
trunk/app/models/user.rb
trunk/app/views/users/_method.html.erb
trunk/test/unit/user_test.rb
Modified: trunk/app/controllers/users_controller.rb
===================================================================
--- trunk/app/controllers/users_controller.rb 2009-08-25 20:04:42 UTC (rev 1554)
+++ trunk/app/controllers/users_controller.rb 2009-08-26 06:40:46 UTC (rev 1555)
@@ -58,6 +58,9 @@
else
flash.now[:error] = "Could not create your account"
shift_return_url
+ if !@user.openid_identifier.nil?
+ @selected = "openid"
+ end
render :action => :new
end
end
Modified: trunk/app/models/link.rb
===================================================================
--- trunk/app/models/link.rb 2009-08-25 20:04:42 UTC (rev 1554)
+++ trunk/app/models/link.rb 2009-08-26 06:40:46 UTC (rev 1555)
@@ -106,7 +106,7 @@
###### Validations
- # validate
+ validate :quick_validate
validates_presence_of :from_logi
validates_presence_of :requested_tags_string
validates_presence_of :received_tags_string
@@ -915,12 +915,6 @@
###### Validation-functions
- # Validates that it is to a different logi.
- #
- def validate
- self.quick_validate
- end
-
public
# Also called when adding links.
Modified: trunk/app/models/user.rb
===================================================================
--- trunk/app/models/user.rb 2009-08-25 20:04:42 UTC (rev 1554)
+++ trunk/app/models/user.rb 2009-08-26 06:40:46 UTC (rev 1555)
@@ -22,6 +22,8 @@
acts_as_authentic do |options|
options.login_field = :email
+ options.validate_email_field = false
+ options.validate_login_field = false
end
### Relationships
@@ -47,8 +49,8 @@
### Filters
- validate :normalize_openid_identifier
before_validation_on_create :set_home_page_tag # see HomePageModule
+ validate :name_not_reserved, :normalize_openid_identifier
before_create :assert_persistence_token
after_create :create_personal_user_group, :create_prefs_profiles, :create_home_page
before_destroy :reset_dependents
@@ -57,14 +59,14 @@
### Validations
# more in HomePageModule
+ validates_presence_of :name
validates_uniqueness_of :name
- validates_format_of :name, :with => /\s/,
- :message => "should be your full name"
validates_format_of :name, :with => /^[A-Z].*$/,
:message => "must start with a capital letter"
validates_format_of :name, :with => /^[\w\ _.-]+$/,
:message => "should only contain alphanumerical symbols, spaces," +
" underscores, dots and hyphens"
+ validates_presence_of :email
validates_uniqueness_of :email
validates_format_of :email, :with => /^[A-Za-z0-9_\.\-]+@[A-Za-z0-9\._-]+\.[A-Za-z]+$/,
:message => "is incorrect, please check for typo's"
@@ -189,18 +191,6 @@
protected
- # Makes sure the openid is normalized.
- #
- def normalize_openid_identifier
- if !self.openid_identifier.blank?
- begin
- self.openid_identifier = OpenIdAuthentication.normalize_identifier(self.openid_identifier)
- rescue OpenIdAuthentication::InvalidOpenId => e
- errors.add(:openid_identifier, e.message)
- end
- end
- end
-
# Makes sure the persistence token is not null.
#
def assert_persistence_token
@@ -289,4 +279,27 @@
end
return true
end
+
+
+ ###### Validation-functions
+
+ # Validates that it is to a different logi.
+ #
+ def name_not_reserved
+ if self.name =~ Const::Tag::RESERVED_WORDS_RE
+ errors.add(:name, 'can\'t be a reserved word')
+ end
+ end
+
+ # Makes sure the openid is normalized.
+ #
+ def normalize_openid_identifier
+ if !self.openid_identifier.blank?
+ begin
+ self.openid_identifier = OpenIdAuthentication.normalize_identifier(self.openid_identifier)
+ rescue OpenIdAuthentication::InvalidOpenId => e
+ errors.add(:openid_identifier, e.message)
+ end
+ end
+ end
end
Modified: trunk/app/views/users/_method.html.erb
===================================================================
--- trunk/app/views/users/_method.html.erb 2009-08-25 20:04:42 UTC (rev 1554)
+++ trunk/app/views/users/_method.html.erb 2009-08-26 06:40:46 UTC (rev 1555)
@@ -20,10 +20,11 @@
<% if selected == "normal" %>
<%= f.password_field :password %>
<%= f.password_field :password_confirmation %>
+ <%= f.submit _('Complete!') %>
<% else %>
<%= f.text_field :openid_identifier %>
+ <%= f.submit _('Continue') %>
<% end %>
- <%= f.submit _('Complete!') %>
<% end %>
<% end %>
Modified: trunk/test/unit/user_test.rb
===================================================================
--- trunk/test/unit/user_test.rb 2009-08-25 20:04:42 UTC (rev 1554)
+++ trunk/test/unit/user_test.rb 2009-08-26 06:40:46 UTC (rev 1555)
@@ -62,8 +62,8 @@
:name => 'covert cobra', :email => 'ra...@sn...')
# not starting with a capital leter
assert !u.save
- # no space, no full name
- u.name = "Cobra"
+ # reserved word
+ u.name = "Do"
assert !u.save
# ok
u.name = "Covert Cobra"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wy...@us...> - 2009-08-25 20:04:51
|
Revision: 1554
http://logilogi.svn.sourceforge.net/logilogi/?rev=1554&view=rev
Author: wybow
Date: 2009-08-25 20:04:42 +0000 (Tue, 25 Aug 2009)
Log Message:
-----------
Fixed the minor but annoying do-bug (adding do if redirected from www)
Modified Paths:
--------------
trunk/config/routes.rb
Modified: trunk/config/routes.rb
===================================================================
--- trunk/config/routes.rb 2009-08-25 19:35:46 UTC (rev 1553)
+++ trunk/config/routes.rb 2009-08-25 20:04:42 UTC (rev 1554)
@@ -8,9 +8,9 @@
:requirements => {:js_file => /all/}
#map.root :controller => 'logis', :action => 'show', :ll_link_string => 'Logi_Logi'
+ map.root :controller => 'main_page', :action => 'index'
map.formatted_root 'do.:format',
:controller => 'main_page', :action => 'index'
- map.root :controller => 'main_page', :action => 'index'
# For OpenID logins
map.resource :user_session,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wy...@us...> - 2009-08-25 19:36:02
|
Revision: 1553
http://logilogi.svn.sourceforge.net/logilogi/?rev=1553&view=rev
Author: wybow
Date: 2009-08-25 19:35:46 +0000 (Tue, 25 Aug 2009)
Log Message:
-----------
Added test for max logi size
Modified Paths:
--------------
trunk/app/controllers/logis_controller.rb
trunk/app/models/logi.rb
trunk/test/functional/logis_controller_test.rb
Modified: trunk/app/controllers/logis_controller.rb
===================================================================
--- trunk/app/controllers/logis_controller.rb 2009-08-25 16:30:54 UTC (rev 1552)
+++ trunk/app/controllers/logis_controller.rb 2009-08-25 19:35:46 UTC (rev 1553)
@@ -162,7 +162,7 @@
format.html do
@logi, @logi_version = self.update_logi(@logi, params[:logi])
- if @logi.errors.empty? and @logi_version.valid? and
+ if @logi.errors.empty? and @logi.valid? and @logi_version.valid? and
self.thorny_form_free_of_spam?
@logi.update_if_changed(@logi_version)
flash[:notice] = "Successfully saved #{@logi.to_s(:for => :full_show)}"
@@ -179,7 +179,7 @@
:body => entry.content,
:link_string => entry.categories.collect {|c| c.term}.join('/'))
- if @logi.errors.empty? and @logi_version.valid?
+ if @logi.errors.empty? and @logi.valid? and @logi_version.valid?
@logi.update_if_changed(@logi_version)
head :ok
else
Modified: trunk/app/models/logi.rb
===================================================================
--- trunk/app/models/logi.rb 2009-08-25 16:30:54 UTC (rev 1552)
+++ trunk/app/models/logi.rb 2009-08-25 19:35:46 UTC (rev 1553)
@@ -347,6 +347,9 @@
#
# Saves only the logi if it's tags changed.
#
+ # Note that validation of both the logi and the logi version has to
+ # be done before calling this method.
+ #
def update_if_changed(logi_version)
if self.logi_version_different?(logi_version)
self.logi_versions << logi_version
Modified: trunk/test/functional/logis_controller_test.rb
===================================================================
--- trunk/test/functional/logis_controller_test.rb 2009-08-25 16:30:54 UTC (rev 1552)
+++ trunk/test/functional/logis_controller_test.rb 2009-08-25 19:35:46 UTC (rev 1553)
@@ -79,6 +79,17 @@
assert_equal [Tag.from_s('Logi_Logi'), Tag.from_s('Extra_Main')], l.tags
end
+ def test_create_too_big
+ post :create, {:ll_link_string => 'Manta/Logi_Logi',
+ :logi => {:link_string => "Logi_Logi/Extra_Main",
+ :title => 'K', :body => ('x' * GlobalConfig.maximum_logi_version_size)
+ }}.merge(self.thorny_ok_hash)
+ l = Logi.find_by_text_stack('<h1>K</h1> ' +
+ ('x' * GlobalConfig.maximum_logi_version_size))
+ assert_response :success
+ assert !l
+ end
+
def test_thorny_form
# too early
now = Time.now.to_i.to_s
@@ -155,6 +166,26 @@
assert_equal [Tag.from_s('Logi_Logi'), Tag.from_s('Extra_Main')], l.tags
end
+ def test_update_too_big
+ eduard = users(:eduard_edison)
+ login(eduard)
+ l = logis(:medieval_economics_politics)
+ title = l.current_logi_version.title
+ link = l.link.to_s
+ l_id = l.id
+ l_versions = l.logi_versions.size
+ l.text_stack += 'x' * (GlobalConfig.maximum_logi_size - 4000)
+ l.save
+ post :update, {:ll_link_string => link,
+ :logi => {:link_string => "Logi_Logi/Extra_Main",
+ :title => title, :body => ('y' * 4000) + ' <p>s0-unusu4l</p>'
+ }}.merge(self.thorny_ok_hash)
+ assert_response :success
+ l = Logi.find(l_id) # needed for tags refresh
+ assert l.current_logi_version.body !~ /.* <p>s0-unusu4l<\/p>$/
+ assert_equal l_versions, l.logi_versions.size
+ end
+
def test_destroy
# anonymous users cannot destroy owned logis
i = logis(:sailing)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wy...@us...> - 2009-08-25 16:31:10
|
Revision: 1552
http://logilogi.svn.sourceforge.net/logilogi/?rev=1552&view=rev
Author: wybow
Date: 2009-08-25 16:30:54 +0000 (Tue, 25 Aug 2009)
Log Message:
-----------
Restyled max length warning
Modified Paths:
--------------
trunk/app/views/logis/_edit.html.erb
trunk/public/stylesheets/logilogi.css
Modified: trunk/app/views/logis/_edit.html.erb
===================================================================
--- trunk/app/views/logis/_edit.html.erb 2009-08-24 16:55:26 UTC (rev 1551)
+++ trunk/app/views/logis/_edit.html.erb 2009-08-25 16:30:54 UTC (rev 1552)
@@ -18,5 +18,6 @@
<%= (local_assigns[:defer] ? 'true' : 'false') %>);
<% end -%>
- <div id="length_warning"></div>
<% end -%>
+
+<div id="length_warning"></div>
Modified: trunk/public/stylesheets/logilogi.css
===================================================================
--- trunk/public/stylesheets/logilogi.css 2009-08-24 16:55:26 UTC (rev 1551)
+++ trunk/public/stylesheets/logilogi.css 2009-08-25 16:30:54 UTC (rev 1552)
@@ -1116,7 +1116,9 @@
/* errors */
-#length_warning {
+#length_warning.warning,
+#length_warning.error {
+ padding-left: 1em;
padding-top: 0.5em;
font-size: 1.2em;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wy...@us...> - 2009-08-24 16:55:42
|
Revision: 1551
http://logilogi.svn.sourceforge.net/logilogi/?rev=1551&view=rev
Author: wybow
Date: 2009-08-24 16:55:26 +0000 (Mon, 24 Aug 2009)
Log Message:
-----------
Fixed bug with adding tag and layout in edit/new page in IE
Modified Paths:
--------------
trunk/app/controllers/logis_controller.rb
trunk/app/helpers/application_helper.rb
trunk/app/views/application/_errors.html.erb
trunk/app/views/application/_flash.html.erb
trunk/app/views/layouts/main.html.erb
trunk/app/views/logis/_edit_with_tags.html.erb
trunk/app/views/logis/_tag_list.html.erb
Modified: trunk/app/controllers/logis_controller.rb
===================================================================
--- trunk/app/controllers/logis_controller.rb 2009-08-22 14:08:41 UTC (rev 1550)
+++ trunk/app/controllers/logis_controller.rb 2009-08-24 16:55:26 UTC (rev 1551)
@@ -358,9 +358,9 @@
# Url-bars with context.
#
def navigation_bar
- if params[:action] == "new"
+ if params[:action] == "new" or params[:action] == "create"
render_body 'navigation_bar_new'
- elsif params[:action] == "edit"
+ elsif params[:action] == "edit" or params[:action] == "update"
render_body 'navigation_bar_edit'
elsif params[:action] == "show"
render_body 'navigation_bar_view'
Modified: trunk/app/helpers/application_helper.rb
===================================================================
--- trunk/app/helpers/application_helper.rb 2009-08-22 14:08:41 UTC (rev 1550)
+++ trunk/app/helpers/application_helper.rb 2009-08-24 16:55:26 UTC (rev 1551)
@@ -453,10 +453,13 @@
Logi::RESTRICTIONS[restriction]
end
- def show_flash(type = nil)
- if flash[:warning] or flash[:notice] or flash[:error] or (type and flash[type])
+ def show_flash(options = {})
+ if flash[:warning] or flash[:notice] or flash[:error] or (options[:type] and flash[options[:type]])
render :partial => 'application/flash',
- :locals => { :flash => flash, :type => type }
+ :locals => {
+ :flash => flash,
+ :type => options[:type],
+ :with_column_of_class => options[:with_column_of_class]}
end
end
@@ -481,6 +484,11 @@
end
def show_errors(*args)
+ if args[-1].is_a?(Hash)
+ options = args.pop
+ else
+ options = {}
+ end
error_object_name = nil
args.each do |object_name|
object = instance_variable_get("@#{object_name}")
@@ -491,7 +499,9 @@
end
if error_object_name
render :partial => 'application/errors',
- :locals => { :object_name => error_object_name }
+ :locals => {
+ :object_name => error_object_name,
+ :with_column_of_class => options[:with_column_of_class]}
end
end
Modified: trunk/app/views/application/_errors.html.erb
===================================================================
--- trunk/app/views/application/_errors.html.erb 2009-08-22 14:08:41 UTC (rev 1550)
+++ trunk/app/views/application/_errors.html.erb 2009-08-24 16:55:26 UTC (rev 1551)
@@ -1,3 +1,10 @@
+<% if local_assigns[:with_column_of_class] %>
+ <div class="<%= local_assigns[:with_column_of_class] %>">
+<% end %>
<% render :layout => 'application/panel', :locals => { :id => "errors" } do %>
<%= error_messages_for(object_name) %>
<% end %>
+<% if local_assigns[:with_column_of_class] %>
+ </div>
+ <div class="spacer"></div>
+<% end %>
Modified: trunk/app/views/application/_flash.html.erb
===================================================================
--- trunk/app/views/application/_flash.html.erb 2009-08-22 14:08:41 UTC (rev 1550)
+++ trunk/app/views/application/_flash.html.erb 2009-08-24 16:55:26 UTC (rev 1551)
@@ -1,3 +1,10 @@
+<% if local_assigns[:with_column_of_class] %>
+ <div class="<%= local_assigns[:with_column_of_class] %>">
+<% end %>
<% render :layout => 'application/panel', :locals => { :id => 'flash', :type => type } do %>
<%= display_standard_flashes %>
<% end %>
+<% if local_assigns[:with_column_of_class] %>
+ </div>
+ <div class="spacer"></div>
+<% end %>
Modified: trunk/app/views/layouts/main.html.erb
===================================================================
--- trunk/app/views/layouts/main.html.erb 2009-08-22 14:08:41 UTC (rev 1550)
+++ trunk/app/views/layouts/main.html.erb 2009-08-24 16:55:26 UTC (rev 1551)
@@ -4,7 +4,7 @@
<%= render :partial => 'layouts/title_bar' %>
<%= yield :top_body %>
- <%= show_flash('exposed') %>
+ <%= show_flash(:type => 'exposed') %>
<div class="main_column">
<%= yield %>
Modified: trunk/app/views/logis/_edit_with_tags.html.erb
===================================================================
--- trunk/app/views/logis/_edit_with_tags.html.erb 2009-08-22 14:08:41 UTC (rev 1550)
+++ trunk/app/views/logis/_edit_with_tags.html.erb 2009-08-24 16:55:26 UTC (rev 1551)
@@ -1,8 +1,5 @@
-<div class="main_column">
- <%= show_flash %>
- <%= show_errors 'logi_version','logi' %>
-</div>
-<div class="spacer"></div>
+<%= show_flash :with_column_of_class => 'main_column' %>
+<%= show_errors 'logi_version','logi', :with_column_of_class => 'main_column' %>
<div id="edit_tags_area">
<% if !@logi.untagged? or @selected == "edit_tags" %>
Modified: trunk/app/views/logis/_tag_list.html.erb
===================================================================
--- trunk/app/views/logis/_tag_list.html.erb 2009-08-22 14:08:41 UTC (rev 1550)
+++ trunk/app/views/logis/_tag_list.html.erb 2009-08-24 16:55:26 UTC (rev 1551)
@@ -1,6 +1,7 @@
<div id="<%= name %>" class="tags_container transparent_corner">
<!-- Filled via js -->
</div>
+<div class="spacer"></div>
<% if !local_assigns[:without_form] %>
<%= form_tag("#", :method => :put) %>
<% end %>
@@ -13,6 +14,6 @@
<%= end_form_tag() %>
<% end %>
<% javascript_tag do %>
- <%= name %> = new TagList('<%= name %>', '<%= url %>',
+ var <%= name %> = new TagList('<%= name %>', '<%= url %>',
'<%= param_name %>', '<%= Tag.replace.to_s %>');
<% end %>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wy...@us...> - 2009-08-22 14:08:51
|
Revision: 1550
http://logilogi.svn.sourceforge.net/logilogi/?rev=1550&view=rev
Author: wybow
Date: 2009-08-22 14:08:41 +0000 (Sat, 22 Aug 2009)
Log Message:
-----------
Fixed IE-bug with missing body of comments in IE
Modified Paths:
--------------
trunk/app/controllers/logis_controller.rb
trunk/app/views/comments/_new.html.erb
trunk/app/views/logis/_edit.html.erb
trunk/app/views/logis/_side_menu.html.erb
trunk/app/views/votes/create.js.rjs
trunk/config/initializers/action_view.rb
trunk/lib/tasks/server.rake
trunk/public/javascripts/application.js
Modified: trunk/app/controllers/logis_controller.rb
===================================================================
--- trunk/app/controllers/logis_controller.rb 2009-08-21 13:45:50 UTC (rev 1549)
+++ trunk/app/controllers/logis_controller.rb 2009-08-22 14:08:41 UTC (rev 1550)
@@ -314,7 +314,7 @@
def side_menu
if !@selected
- if @logi.untagged?
+ if @logi.untagged? and @logi.comments_on_logis.size > 0
@selected = "comments_on"
elsif @logi.home_page?
@selected = "home_page"
Modified: trunk/app/views/comments/_new.html.erb
===================================================================
--- trunk/app/views/comments/_new.html.erb 2009-08-21 13:45:50 UTC (rev 1549)
+++ trunk/app/views/comments/_new.html.erb 2009-08-22 14:08:41 UTC (rev 1550)
@@ -30,7 +30,10 @@
<%= render :partial => 'logis/check', :locals => {:name => 'comment'} %>
<% end -%>
- <%= render :partial => 'application/submit', :locals => {:form => form} %>
+ <% render :layout => 'application/panel', :locals => {:id => "submit"} do %>
+ <label><%= _('Submit') %></label>
+ <%= form.submit _('Submit'), : "$('logi_form').submit()" %>
+ <% end %>
<% end %>
<% javascript_tag do -%>
@@ -39,7 +42,7 @@
<% if selected == "new_logi" %>
<% javascript_tag do -%>
- logi_editor.initialize_tiny_mce_now();
+ logi_editor.initialize_tiny_mce_now_in_ff();
<% end -%>
<% end %>
</div>
Modified: trunk/app/views/logis/_edit.html.erb
===================================================================
--- trunk/app/views/logis/_edit.html.erb 2009-08-21 13:45:50 UTC (rev 1549)
+++ trunk/app/views/logis/_edit.html.erb 2009-08-22 14:08:41 UTC (rev 1550)
@@ -2,18 +2,18 @@
<label class="for_title">Title:</label>
<%= hidden_field_tag 'logi[link_string]', '' %>
<%= text_field_tag 'logi[title]', (logi_version.nil? ? nil : logi_version.title),
- :class => "logi_title",
- : "logiLogisOnChange(tinyMCE.getInstanceById('logi_body')," +
- " $('logi_title'), #{GlobalConfig.maximum_logi_version_size})" %>
+ :class => "logi_title", :id => "logi_edit_title",
+ : "logiLogisOnChange(tinyMCE.getInstanceById('logi_edit_body')," +
+ " $('logi_edit_title'), #{GlobalConfig.maximum_logi_version_size})" %>
<div id="EditorDiv" style="visibility: hidden;">
<%= text_area_tag 'logi[body]',
(logi_version.nil? ? nil : h(logi_version.body)),
- :class => 'editable', :id => 'logi_body' %>
+ :class => 'editable', :id => 'logi_edit_body' %>
</div>
<% javascript_tag do -%>
- logi_editor = new LogiEditor('logi_body','EditorDiv','logi_title',
+ logi_editor = new LogiEditor('logi_edit_body','EditorDiv','logi_edit_title',
<%= GlobalConfig.maximum_logi_version_size %>,
<%= (local_assigns[:defer] ? 'true' : 'false') %>);
<% end -%>
Modified: trunk/app/views/logis/_side_menu.html.erb
===================================================================
--- trunk/app/views/logis/_side_menu.html.erb 2009-08-21 13:45:50 UTC (rev 1549)
+++ trunk/app/views/logis/_side_menu.html.erb 2009-08-22 14:08:41 UTC (rev 1550)
@@ -22,7 +22,8 @@
<% end %>
<% end %>
<% if selected == "comments_on" %>
- <%= render :partial => 'snippets_list', :locals => {:logis => @logi.comments_on_logis} %>
+ <%= render :partial => 'snippets_list',
+ :locals => {:logis => @logi.comments_on_logis} %>
<% end %>
<% javascript_tag do -%>
mcorners.run();
Modified: trunk/app/views/votes/create.js.rjs
===================================================================
--- trunk/app/views/votes/create.js.rjs 2009-08-21 13:45:50 UTC (rev 1549)
+++ trunk/app/views/votes/create.js.rjs 2009-08-22 14:08:41 UTC (rev 1550)
@@ -1,3 +1,3 @@
page.replace_html 'ratings', :partial => 'votes/show', :locals => {:vote => @vote, :rating => @rating}
page.replace_html 'votes', :partial => "logis/recent_votes", :locals => {:votes => @votes}
-page.replace_html 'rating_current', :partial => "logis/rating_current", :locals => {:rating => @rating}
+page.replace_html_if_exists 'rating_current', :partial => "logis/rating_current", :locals => {:rating => @rating}
Modified: trunk/config/initializers/action_view.rb
===================================================================
--- trunk/config/initializers/action_view.rb 2009-08-21 13:45:50 UTC (rev 1549)
+++ trunk/config/initializers/action_view.rb 2009-08-22 14:08:41 UTC (rev 1550)
@@ -71,6 +71,16 @@
end
end
+ module PrototypeHelper
+ class JavaScriptGenerator #:nodoc:
+ module GeneratorMethods
+ def replace_html_if_exists(id, *options_for_render)
+ call "if($('#{id}')) Element.update", id, render(*options_for_render)
+ end
+ end
+ end
+ end
+
module JavaScriptHelper
def button_to_function(name, *args, &block)
html_options = args.extract_options!.symbolize_keys
Modified: trunk/lib/tasks/server.rake
===================================================================
--- trunk/lib/tasks/server.rake 2009-08-21 13:45:50 UTC (rev 1549)
+++ trunk/lib/tasks/server.rake 2009-08-22 14:08:41 UTC (rev 1550)
@@ -14,7 +14,7 @@
desc "Restarts the edge-server"
task :restart do
- sh "cap logilogi:server:restart -S stage=production"
+ sh "cap logilogi:server:restart -S stage=edge"
end
end
Modified: trunk/public/javascripts/application.js
===================================================================
--- trunk/public/javascripts/application.js 2009-08-21 13:45:50 UTC (rev 1549)
+++ trunk/public/javascripts/application.js 2009-08-22 14:08:41 UTC (rev 1550)
@@ -165,6 +165,12 @@
}
},
+ initialize_tiny_mce_now_in_ff: function() {
+ if (!Prototype.Browser.IE && !OSystem.MacOS) {
+ this.initialize_tiny_mce_now();
+ }
+ },
+
initialize_tiny_mce_now: function() {
tinyMCE.init({
mode: "textareas",
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wy...@us...> - 2009-08-21 13:45:59
|
Revision: 1549
http://logilogi.svn.sourceforge.net/logilogi/?rev=1549&view=rev
Author: wybow
Date: 2009-08-21 13:45:50 +0000 (Fri, 21 Aug 2009)
Log Message:
-----------
Fixed bug in tag-browsing and editing untagged logis
Modified Paths:
--------------
trunk/app/views/links/_new.html.erb
trunk/app/views/logi_tags/_edit.html.erb
trunk/app/views/logis/_edit.html.erb
trunk/app/views/logis/_tag_list.html.erb
trunk/app/views/tags/_edit.html.erb
trunk/public/javascripts/application.js
trunk/public/javascripts/taglist.js
Modified: trunk/app/views/links/_new.html.erb
===================================================================
--- trunk/app/views/links/_new.html.erb 2009-08-20 11:09:08 UTC (rev 1548)
+++ trunk/app/views/links/_new.html.erb 2009-08-21 13:45:50 UTC (rev 1549)
@@ -1 +1,2 @@
-<%= render :partial => 'tags/edit', :locals => {:name => 'tags_edit'} %>
+<%= render :partial => 'tags/edit', :locals => {
+ :name => 'tags_edit', :link => current_context.link} %>
Modified: trunk/app/views/logi_tags/_edit.html.erb
===================================================================
--- trunk/app/views/logi_tags/_edit.html.erb 2009-08-20 11:09:08 UTC (rev 1548)
+++ trunk/app/views/logi_tags/_edit.html.erb 2009-08-21 13:45:50 UTC (rev 1549)
@@ -1,7 +1,6 @@
<div class="main_column">
- <%= render :partial => 'tags/edit', :locals => {:name => 'logi_tags_edit'} %>
-
- <%= hidden_field_tag 'logi[link_string]', '' %>
+ <%= render :partial => 'tags/edit', :locals => {:name => 'logi_tags_edit',
+ :link => (@logi.new_record? ? current_context.link : (@logi.untagged? ? nil : @logi.link))} %>
</div>
<div class="side_column">
Modified: trunk/app/views/logis/_edit.html.erb
===================================================================
--- trunk/app/views/logis/_edit.html.erb 2009-08-20 11:09:08 UTC (rev 1548)
+++ trunk/app/views/logis/_edit.html.erb 2009-08-21 13:45:50 UTC (rev 1549)
@@ -1,5 +1,6 @@
<% render :layout => 'logis/logi', :locals => {:id => "logi_edit"} do %>
<label class="for_title">Title:</label>
+ <%= hidden_field_tag 'logi[link_string]', '' %>
<%= text_field_tag 'logi[title]', (logi_version.nil? ? nil : logi_version.title),
:class => "logi_title",
: "logiLogisOnChange(tinyMCE.getInstanceById('logi_body')," +
Modified: trunk/app/views/logis/_tag_list.html.erb
===================================================================
--- trunk/app/views/logis/_tag_list.html.erb 2009-08-20 11:09:08 UTC (rev 1548)
+++ trunk/app/views/logis/_tag_list.html.erb 2009-08-21 13:45:50 UTC (rev 1549)
@@ -12,8 +12,7 @@
<% if !local_assigns[:without_form] %>
<%= end_form_tag() %>
<% end %>
-<% javascript_tag do -%>
- var <%= name %> = new TagList('<%= name %>', '<%= url %>',
- '<%= param_name %>', '<%= Tag.replace.to_s %>',
- '<%= Tag.untagged.to_s %>');
-<% end -%>
+<% javascript_tag do %>
+ <%= name %> = new TagList('<%= name %>', '<%= url %>',
+ '<%= param_name %>', '<%= Tag.replace.to_s %>');
+<% end %>
Modified: trunk/app/views/tags/_edit.html.erb
===================================================================
--- trunk/app/views/tags/_edit.html.erb 2009-08-20 11:09:08 UTC (rev 1548)
+++ trunk/app/views/tags/_edit.html.erb 2009-08-21 13:45:50 UTC (rev 1549)
@@ -1,9 +1,11 @@
<% render :layout => 'application/panel', :locals => {:id => name} do %>
<label>Tags</label>
- <%= button_to_function _('Clear all tags'), name + '_list.remove_all_tags(); link_list.submit()', :class => 'cancel_button' %>
+ <%= button_to_function _('Clear all tags'),
+ name + '_list.remove_all_tags(); ' + name + '_list.submit()',
+ :class => 'cancel_button' %>
<div class="spacer"></div>
<%= render :partial => 'logis/tag_list', :locals => {:name => name + '_list',
- :link => current_context.link,
+ :link => link,
:url => check_logi_url(:controller => 'logis', :action => 'check', :name => name),
:param_name => 'check_ll_link_string', :without_form => true} %>
<div class="spacer"></div>
Modified: trunk/public/javascripts/application.js
===================================================================
--- trunk/public/javascripts/application.js 2009-08-20 11:09:08 UTC (rev 1548)
+++ trunk/public/javascripts/application.js 2009-08-21 13:45:50 UTC (rev 1549)
@@ -263,9 +263,9 @@
// For editing and new
function logiEditPrepareLink() {
- var form = $('edit_form');
- var link_string = $F("logi_tags_edit_list_string");
- $('logi_link_string').value = link_string;
+ if (typeof(logi_tags_edit_list) != "undefined") {
+ $('logi_link_string').value = logi_tags_edit_list.hidden_tags_string();
+ }
}
// For link removal
Modified: trunk/public/javascripts/taglist.js
===================================================================
--- trunk/public/javascripts/taglist.js 2009-08-20 11:09:08 UTC (rev 1548)
+++ trunk/public/javascripts/taglist.js 2009-08-21 13:45:50 UTC (rev 1549)
@@ -16,7 +16,7 @@
var TagList = Class.create({
// Constructors
- initialize: function(list_id, url, param_name, replace_string, untagged_string) {
+ initialize: function(list_id, url, param_name, replace_string) {
this.list_id = list_id;
this.list = $(list_id);
this.add_field = $(list_id + '_input');
@@ -25,7 +25,6 @@
this.param_name = param_name;
this.replace_string = this.empty_default(replace_string);
this.empty_string = this.replace_string;
- this.untagged_string = this.empty_default(untagged_string);
this.register_button();
this.render_tags();
},
@@ -47,9 +46,18 @@
// Getters
+ hidden_tags_string: function() {
+ if (this.hidden_field != null) {
+ tag_str = this.hidden_field.getValue();
+ return tag_str;
+ } else {
+ return ""
+ }
+ },
+
tags_string: function() {
- tag_str = this.hidden_field.getValue();
- if (tag_str == "" || tag_str == this.untagged_string) {
+ tag_str = this.hidden_tags_string();
+ if (tag_str == "") {
return this.empty_string;
} else {
return tag_str;
@@ -68,8 +76,9 @@
// Setters
set_tag_strings: function(tags) {
- this.hidden_field.value = tags.without(
- this.replace_string, this.untagged_string).join('/');
+ if (this.hidden_field != null) {
+ this.hidden_field.value = tags.without(this.replace_string).join('/');
+ }
},
// Adding and removing
@@ -109,8 +118,7 @@
// reset empty string
this.empty_string = this.replace_string;
- tag_strs = this.tag_strings();
- this.hidden_field.value = '';
+ this.set_tag_strings([])
this.render_tags();
},
@@ -133,7 +141,8 @@
submit: function() {
new Ajax.Request(this.url, {
asynchronous: true, evalScripts: true, method: 'get',
- parameters: this.param_name + '=' + this.tags_string()}); return false;
+ parameters: this.param_name + '=' +
+ this.hidden_tags_string()}); return false;
},
// Rendering
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wy...@us...> - 2009-08-20 11:09:21
|
Revision: 1548
http://logilogi.svn.sourceforge.net/logilogi/?rev=1548&view=rev
Author: wybow
Date: 2009-08-20 11:09:08 +0000 (Thu, 20 Aug 2009)
Log Message:
-----------
Fixed logi as reply bug, and added title-line to header
Modified Paths:
--------------
trunk/app/views/layouts/_title_bar.html.erb
trunk/public/javascripts/body_inserter.js
trunk/public/stylesheets/logilogi.css
Modified: trunk/app/views/layouts/_title_bar.html.erb
===================================================================
--- trunk/app/views/layouts/_title_bar.html.erb 2009-08-19 16:57:37 UTC (rev 1547)
+++ trunk/app/views/layouts/_title_bar.html.erb 2009-08-20 11:09:08 UTC (rev 1548)
@@ -16,13 +16,20 @@
<div style="float:left">
<img src="/images/header_background.png" width="6" height="68"/>
</div>
- <div id="logo">
+ <div id="header_content">
<a href="/"><img src="/images/logo.png" alt="LogiLogi book logo" />
- <%= site_link(:length => 15) %>
+ <div id="header_text">
+ <div id="site_link">
+ <%= site_link(:length => 18) %>
+ </div>
+ <div id="version" title="The second version of LogiLogi, now in public beta">
+ version Manta
+ </div>
+ <div id="title_line">
+ <%= GlobalConfig.title_line %>
+ </div>
+ </div>
</div>
- <div id="version" title="The second version of LogiLogi, now in public beta">
- Manta
- </div>
<div id="sessions">
<% if current_user.anonymous? %>
<%= link_to "Login to your account", new_user_session_url %> |
Modified: trunk/public/javascripts/body_inserter.js
===================================================================
--- trunk/public/javascripts/body_inserter.js 2009-08-19 16:57:37 UTC (rev 1547)
+++ trunk/public/javascripts/body_inserter.js 2009-08-20 11:09:08 UTC (rev 1548)
@@ -123,7 +123,7 @@
insert_comment: function() {
// keeps default insert string
- this.insert('');
+ this.insert(this.insert_place_holder_string);
},
insert_tags_link: function() {
Modified: trunk/public/stylesheets/logilogi.css
===================================================================
--- trunk/public/stylesheets/logilogi.css 2009-08-19 16:57:37 UTC (rev 1547)
+++ trunk/public/stylesheets/logilogi.css 2009-08-20 11:09:08 UTC (rev 1548)
@@ -453,22 +453,42 @@
/* header */
-#logo {
+#header_content {
float: left;
- padding-top: 1em;
+ padding-top: 0em;
}
-#logo img {
+#header_content img {
float: left;
- padding: 0em 0 0 1.4em;
- margin: -0.5em 1.5em 0 0.5em;
+ padding: 1em 0 0 1.4em;
+ margin: -0.5em 0.8em 0em 0.2em;
}
-#header a.sitename {
+#header_text {
+ float: left;
+}
+#site_link {
+ float: left;
+ margin-top: -0.1em;
+ margin-bottom: -0.2em;
+}
+#site_link a.sitename {
font-size: 3.5em;
+ padding-bottom: 0em;
+ margin-bottom: 0em;
color: white;
}
+#title_line {
+ float: left;
+ clear: left;
+ font-size: 1.3em;
+ margin-bottom: -1em;
+ word-spacing: 0.2em;
+ letter-spacing: 0.2em;
+ font-variant: small-caps;
+ color: white;
+}
#version {
float: left;
- margin: 0.1em 0em 0em -1em;
+ margin-top: 01em 0em 0em 0em;
padding: 0.1em;
font-size: 1.4em;
font-style: italic;
@@ -1537,7 +1557,7 @@
#site_description {
font-size: 15px;
border: 0px;
- margin: 0.5em 0em 0em 0.5em;
+ margin: 0.2em 0em 0em 0.5em;
}
/* recent changes */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wy...@us...> - 2009-08-19 16:57:45
|
Revision: 1547
http://logilogi.svn.sourceforge.net/logilogi/?rev=1547&view=rev
Author: wybow
Date: 2009-08-19 16:57:37 +0000 (Wed, 19 Aug 2009)
Log Message:
-----------
Fixed R_adding, R_box, & R_tag bugs
Modified Paths:
--------------
trunk/app/controllers/remarks_controller.rb
trunk/app/helpers/application_helper.rb
trunk/app/models/const/logi.rb
trunk/app/views/logis/_contending_logis.html.erb
trunk/app/views/logis/_remarks.html.erb
trunk/app/views/logis/show.html.erb
trunk/public/javascripts/body_inserter.js
trunk/public/stylesheets/logilogi.css
Removed Paths:
-------------
trunk/app/helpers/logis_helper.rb
Modified: trunk/app/controllers/remarks_controller.rb
===================================================================
--- trunk/app/controllers/remarks_controller.rb 2009-08-03 21:53:06 UTC (rev 1546)
+++ trunk/app/controllers/remarks_controller.rb 2009-08-19 16:57:37 UTC (rev 1547)
@@ -55,14 +55,19 @@
flash[:notice] = "Successfully added remark"
redirect_to logi_url(@logi)
else
+ self.get_remarks
@remark = Remark.new
- @remarks = @logi.remarks.find(:all, :limit => 10, :order => ["created_at DESC"])
render :partial => 'logis/remarks'
end
else
- flash[:error] = "Problem adding remark"
- @selected = 'remark'
- render :template => 'logi_inserts/new'
+ 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
end
end
@@ -105,4 +110,8 @@
end
return remark_pos_ranges
end
+
+ def get_remarks
+ @remarks = @logi.remarks.find(:all, :limit => 10, :order => ["created_at DESC"])
+ end
end
Modified: trunk/app/helpers/application_helper.rb
===================================================================
--- trunk/app/helpers/application_helper.rb 2009-08-03 21:53:06 UTC (rev 1546)
+++ trunk/app/helpers/application_helper.rb 2009-08-19 16:57:37 UTC (rev 1547)
@@ -60,6 +60,52 @@
return tab_indices[selected]
end
+ ### Perma-links
+
+ def perma_links(logi, logi_version)
+ return '<div class="perma_link">' +
+ link_to(image_tag('perma.png') + ' Copy permanent link ',
+ logi_ll_url(logi),
+ : "copyPerma('" + logi_ll_url(logi) + "'," +
+ "'The following is the permalink of this logi." +
+ " Hit Ctrl A followed by Ctrl C on your keyboard to" +
+ " copy to your clipboard:'); return false;") +
+ link_to('(to version)',
+ logi_version_ll_url(logi_version),
+ : "copyPerma('" + logi_version_ll_url(logi_version) + "'," +
+ "'The following is the versioned permalink of this logi." +
+ " Hit Ctrl A followed by Ctrl C on your keyboard to" +
+ " copy to your clipboard:'); return false;") +
+ '</div>'
+ end
+
+ ### Tabs
+
+ def side_menu_tabs
+ logi = current_context.link.volatile_to_logi
+ tabs = []
+
+ if logi.home_page?
+ tabs.concat([
+ {:text => _("Home Logi"), :name => "home_page",
+ :description => _("Logi that is a home page")}])
+ else
+ 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"),
+ :disabled => logi.comments_on_logis.empty?}])
+ end
+
+ tabs.concat([
+ {:text => _("Incoming"), :name => "incoming_links",
+ :description => _("Links to this logi"),
+ :disabled => current_context.incoming_links_to_logi.empty?}])
+
+ return tabs
+ end
+
def navigation_tabs
tabs = [{:text => _("Search"), :name => "navigation_search",
:url => searches_url(),
@@ -148,7 +194,19 @@
return tabs
end
+ ### Contending logis
+ def band_of_contender_logis(logi, contender_logis)
+ i = contender_logis.index(logi)
+ if i > 1 and contender_logis.size > 3
+ endi = [(contender_logis.size - 1), i + 1].min
+ begi = endi - 2
+ return contender_logis[begi..endi]
+ else
+ return contender_logis
+ end
+ end
+
### Weaving
# Parses in the links, returns the logi_version.text with links
Deleted: trunk/app/helpers/logis_helper.rb
===================================================================
--- trunk/app/helpers/logis_helper.rb 2009-08-03 21:53:06 UTC (rev 1546)
+++ trunk/app/helpers/logis_helper.rb 2009-08-19 16:57:37 UTC (rev 1547)
@@ -1,56 +0,0 @@
-#--#
-# 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).
-#++#
-
-module LogisHelper
- def perma_links(logi, logi_version)
- return '<div class="perma_link">' +
- link_to(image_tag('perma.png') + ' Copy permanent link ',
- logi_ll_url(logi),
- : "copyPerma('" + logi_ll_url(logi) + "'," +
- "'The following is the permalink of this logi." +
- " Hit Ctrl A followed by Ctrl C on your keyboard to" +
- " copy to your clipboard:'); return false;") +
- link_to('(to version)',
- logi_version_ll_url(logi_version),
- : "copyPerma('" + logi_version_ll_url(logi_version) + "'," +
- "'The following is the versioned permalink of this logi." +
- " Hit Ctrl A followed by Ctrl C on your keyboard to" +
- " copy to your clipboard:'); return false;") +
- '</div>'
- end
-
- def side_menu_tabs
- logi = current_context.link.volatile_to_logi
- tabs = []
-
- if logi.home_page?
- tabs.concat([
- {:text => _("Home Logi"), :name => "home_page",
- :description => _("Logi that is a home page")}])
- else
- 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"),
- :disabled => logi.comments_on_logis.empty?}])
- end
-
- tabs.concat([
- {:text => _("Incoming"), :name => "incoming_links",
- :description => _("Links to this logi"),
- :disabled => current_context.incoming_links_to_logi.empty?}])
-
- return tabs
- end
-end
Modified: trunk/app/models/const/logi.rb
===================================================================
--- trunk/app/models/const/logi.rb 2009-08-03 21:53:06 UTC (rev 1546)
+++ trunk/app/models/const/logi.rb 2009-08-19 16:57:37 UTC (rev 1547)
@@ -31,7 +31,7 @@
### Inserting
# Blocks
- BLOCK_INSERT_TAG = '<a title="[^"]+">[^<]+<\/a>'
+ BLOCK_INSERT_TAG = '<a title="[^"]*">[^<]+<\/a>'
# Recognizing
RECOGNIZE_INSERT_TAG_RE = /#{BLOCK_INSERT_TAG}/
@@ -40,7 +40,7 @@
CHECK_INSERT_TAG_RE = /^#{BLOCK_INSERT_TAG}$/
# Dissecting
- DISSECT_INSERT_TAG_RE = /<a title="([^"]+)">([^<]+)<\/a>/
+ DISSECT_INSERT_TAG_RE = /<a title="([^"]*)">([^<]+)<\/a>/
# String
INSERT_STRING = '__LL__INSERT__LL__'
Modified: trunk/app/views/logis/_contending_logis.html.erb
===================================================================
--- trunk/app/views/logis/_contending_logis.html.erb 2009-08-03 21:53:06 UTC (rev 1546)
+++ trunk/app/views/logis/_contending_logis.html.erb 2009-08-19 16:57:37 UTC (rev 1547)
@@ -1,3 +1,4 @@
+<% local_contender_logis = band_of_contender_logis(@logi, contender_logis) %>
<% if @logi.untagged? %>
<div id="contenders_padding">
<% if @logi.edit_rights?(current_user) %>
@@ -27,12 +28,13 @@
<div class="spacer"></div>
</div>
- <%= render :partial => 'list', :locals => {:logis => contender_logis,
+ <%= render :partial => 'list', :locals => {:logis => local_contender_logis,
:current_logi => @logi} %>
- <% if contender_logis.size > 0 %>.
+ <% if contender_logis.size > 3 %>.
<div class="browse_all">
- <p><%= link_to _('Browse all'), browse_ll_url(current_context.link) %></p>
+ <%= button_to 'Browse all', browse_logis_url(), :class => 'back_button' %>
+ <div class="spacer"></div>
</div>
<% end %>
<% end %>
Modified: trunk/app/views/logis/_remarks.html.erb
===================================================================
--- trunk/app/views/logis/_remarks.html.erb 2009-08-03 21:53:06 UTC (rev 1546)
+++ trunk/app/views/logis/_remarks.html.erb 2009-08-19 16:57:37 UTC (rev 1547)
@@ -1,6 +1,5 @@
<% render :layout => 'application/panel_with_header', :locals => {:title => _("Remarks"), :id => "remarking"} do %>
<div class="notice_cloud"><%= _('Short remark to author ?') %></div>
- <div id="errors"></div>
<% remote_thorny_form_for([@logi, @remark], :update => {:success => 'remarks', :failure => 'errors'},
:html => {:id => "create_remark"}) do |form| %>
<%= text_area :remark, :message %>
@@ -8,6 +7,7 @@
<% end %>
<div class="spacer"></div>
<% end %>
+<%= show_errors 'remark' %>
<%= render :partial => 'remarks/list.html.erb', :locals => {:remarks => @remarks} %>
<% javascript_tag do -%>
Modified: trunk/app/views/logis/show.html.erb
===================================================================
--- trunk/app/views/logis/show.html.erb 2009-08-03 21:53:06 UTC (rev 1546)
+++ trunk/app/views/logis/show.html.erb 2009-08-19 16:57:37 UTC (rev 1547)
@@ -6,7 +6,7 @@
<% end %>
<% end %>
-<% render :layout => 'logi', :locals => {
+<% render :layout => 'logis/logi', :locals => {
:id => "logi", :action => :view} do %>
<h1><%= @logi_version.title %></h1>
<%= weave(@logi_version, :title => false) %>
Modified: trunk/public/javascripts/body_inserter.js
===================================================================
--- trunk/public/javascripts/body_inserter.js 2009-08-03 21:53:06 UTC (rev 1546)
+++ trunk/public/javascripts/body_inserter.js 2009-08-19 16:57:37 UTC (rev 1547)
@@ -83,10 +83,8 @@
str = str.gsub('"', '__DOUBLE_QUOTES__');
var editor = tinyMCE.get(this.textarea_id);
var body_with_selection = this.hidden_field.getValue();
- if (str != '') {
- body_with_selection = body_with_selection.gsub(
- this.insert_place_holder_string, str);
- }
+ body_with_selection = body_with_selection.gsub(
+ this.insert_place_holder_string, str);
editor.setContent(body_with_selection);
editor.save();
},
Modified: trunk/public/stylesheets/logilogi.css
===================================================================
--- trunk/public/stylesheets/logilogi.css 2009-08-03 21:53:06 UTC (rev 1546)
+++ trunk/public/stylesheets/logilogi.css 2009-08-19 16:57:37 UTC (rev 1547)
@@ -749,8 +749,7 @@
#contending_logis .browse_all {
float: right;
padding-top: 0;
- margin-top: -1.5em;
- margin-right: 0.5em;
+ margin: -1.5em 0em 1em 0em;
}
#contending_logis .browse_all .p {
padding-top: 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wy...@us...> - 2009-08-03 21:53:13
|
Revision: 1546
http://logilogi.svn.sourceforge.net/logilogi/?rev=1546&view=rev
Author: wybow
Date: 2009-08-03 21:53:06 +0000 (Mon, 03 Aug 2009)
Log Message:
-----------
Fixed bug #2829800
Modified Paths:
--------------
trunk/app/controllers/comments_controller.rb
trunk/app/helpers/application_helper.rb
trunk/app/helpers/logis_helper.rb
trunk/app/views/logi_inserts/new.html.erb
trunk/app/views/logis/_commenting_logis.html.erb
trunk/public/javascripts/body_inserter.js
Modified: trunk/app/controllers/comments_controller.rb
===================================================================
--- trunk/app/controllers/comments_controller.rb 2009-08-03 20:58:29 UTC (rev 1545)
+++ trunk/app/controllers/comments_controller.rb 2009-08-03 21:53:06 UTC (rev 1546)
@@ -34,7 +34,7 @@
end
def create
- if params[:perma_link]
+ if params[:perma_link] and !params[:perma_link].empty?
@link = Link.new_from_s(params[:perma_link])
@link.resolve
@@ -58,8 +58,17 @@
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 commenting_logi.errors.empty? and commenting_logi_version.valid? and
+ 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
commenting.valid? and self.thorny_form_free_of_spam?
# we can save as we know the link is valid on the logi
commenting_logi.save
@@ -67,17 +76,21 @@
if params[:positioned]
body_with_comment_link = self.insert_comment_link(
- params[:body_with_inserts], commenting_logi)
+ body_with_inserts, commenting_logi)
self.insert_links(@logi, @logi_version, body_with_comment_link)
end
- flash[:notice] = "Successfully created replying logi" +
- " #{commenting_logi.to_s(:for => :full_show)}"
- redirect_to logi_ll_url(@logi)
+ if @logi.errors.empty?
+ flash[:notice] = "Successfully created replying logi" +
+ " #{commenting_logi.to_s(:for => :full_show)}"
+ redirect_to logi_ll_url(@logi)
+ else
+ flash[:error] = "Problem creating replying logi"
+ @selected = 'comment'
+ render :template => 'logi_inserts/new'
+ end
else
- transfer_errors(commenting_logi, @logi)
transfer_errors(commenting_logi_version, @logi_version)
- transfer_errors(commenting, @logi)
flash[:error] = "Problem creating replying logi"
@selected = 'comment'
Modified: trunk/app/helpers/application_helper.rb
===================================================================
--- trunk/app/helpers/application_helper.rb 2009-08-03 20:58:29 UTC (rev 1545)
+++ trunk/app/helpers/application_helper.rb 2009-08-03 21:53:06 UTC (rev 1546)
@@ -115,7 +115,7 @@
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",
+ {: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",
Modified: trunk/app/helpers/logis_helper.rb
===================================================================
--- trunk/app/helpers/logis_helper.rb 2009-08-03 20:58:29 UTC (rev 1545)
+++ trunk/app/helpers/logis_helper.rb 2009-08-03 21:53:06 UTC (rev 1546)
@@ -41,7 +41,7 @@
tabs.concat([
{:text => _("Contenders"), :name => "contending_logis",
:description => _("Logis competing for the same tags")},
- {:text => _("In reply to"), :name => "comments_on",
+ {:text => _("In Reply to"), :name => "comments_on",
:description => _("This logi replies to the following logis"),
:disabled => logi.comments_on_logis.empty?}])
end
Modified: trunk/app/views/logi_inserts/new.html.erb
===================================================================
--- trunk/app/views/logi_inserts/new.html.erb 2009-08-03 20:58:29 UTC (rev 1545)
+++ trunk/app/views/logi_inserts/new.html.erb 2009-08-03 21:53:06 UTC (rev 1546)
@@ -68,7 +68,7 @@
<% @selected ||= "remark" %>
<% render :layout => 'application/panel_with_tabs_js', :locals => {
:tabs => [
- {:text => _("Logi as a reply"), :name => "comment",
+ {:text => _("Logi as a Reply"), :name => "comment",
:description => _("Insert a logi in reply"),
: 'logi_editor.initialize_tiny_mce_now()'},
{:text => _("Link"), :name => "link",
@@ -91,9 +91,9 @@
:tabs => [
{:text => _("Tags"), :name => "tags_link",
:description => _("Insert a link to a set of tags")},
- {:text => _("Specific logi"), :name => "perma_link",
+ {:text => _("Specific Logi"), :name => "perma_link",
:description => _("Paste (Ctrl V) a permanent link to a specific logi")},
- {:text => _("External link"), :name => "external_link",
+ {:text => _("External Link"), :name => "external_link",
:description => _("Insert a link to a different site")}],
:selected => @link_selected, :id => "link_insert_options"} do %>
Modified: trunk/app/views/logis/_commenting_logis.html.erb
===================================================================
--- trunk/app/views/logis/_commenting_logis.html.erb 2009-08-03 20:58:29 UTC (rev 1545)
+++ trunk/app/views/logis/_commenting_logis.html.erb 2009-08-03 21:53:06 UTC (rev 1546)
@@ -1,4 +1,4 @@
-<% render :layout => 'application/panel_with_header', :locals => {:title => _("Replying logis"), :id => "commenting"} do %>
+<% render :layout => 'application/panel_with_header', :locals => {:title => _("Replying Logis"), :id => "commenting"} do %>
<div class="mirrored_notice_cloud"><%= _('Want to give a more in-depth response ?') %></div>
<div class="description">
<p><%= _('There are %{nr} logis replying') % {:nr => logis.size} %></p>
Modified: trunk/public/javascripts/body_inserter.js
===================================================================
--- trunk/public/javascripts/body_inserter.js 2009-08-03 20:58:29 UTC (rev 1545)
+++ trunk/public/javascripts/body_inserter.js 2009-08-03 21:53:06 UTC (rev 1546)
@@ -82,12 +82,12 @@
insert: function(str) {
str = str.gsub('"', '__DOUBLE_QUOTES__');
var editor = tinyMCE.get(this.textarea_id);
+ var body_with_selection = this.hidden_field.getValue();
if (str != '') {
- var body_with_selection = this.hidden_field.getValue();
body_with_selection = body_with_selection.gsub(
this.insert_place_holder_string, str);
- editor.setContent(body_with_selection);
}
+ editor.setContent(body_with_selection);
editor.save();
},
@@ -125,6 +125,7 @@
insert_comment: function() {
// keeps default insert string
+ this.insert('');
},
insert_tags_link: function() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wy...@us...> - 2009-08-03 20:58:36
|
Revision: 1545
http://logilogi.svn.sourceforge.net/logilogi/?rev=1545&view=rev
Author: wybow
Date: 2009-08-03 20:58:29 +0000 (Mon, 03 Aug 2009)
Log Message:
-----------
Small rephrasing
Modified Paths:
--------------
trunk/app/views/logis/_commenting_logis.html.erb
Modified: trunk/app/views/logis/_commenting_logis.html.erb
===================================================================
--- trunk/app/views/logis/_commenting_logis.html.erb 2009-08-03 20:55:53 UTC (rev 1544)
+++ trunk/app/views/logis/_commenting_logis.html.erb 2009-08-03 20:58:29 UTC (rev 1545)
@@ -1,4 +1,4 @@
-<% render :layout => 'application/panel_with_header', :locals => {:title => _("Logis as replies"), :id => "commenting"} do %>
+<% render :layout => 'application/panel_with_header', :locals => {:title => _("Replying logis"), :id => "commenting"} do %>
<div class="mirrored_notice_cloud"><%= _('Want to give a more in-depth response ?') %></div>
<div class="description">
<p><%= _('There are %{nr} logis replying') % {:nr => logis.size} %></p>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wy...@us...> - 2009-08-03 20:56:04
|
Revision: 1544
http://logilogi.svn.sourceforge.net/logilogi/?rev=1544&view=rev
Author: wybow
Date: 2009-08-03 20:55:53 +0000 (Mon, 03 Aug 2009)
Log Message:
-----------
Moved link to browse all down, allow adding of existing logis as
comments & more
Modified Paths:
--------------
trunk/app/controllers/application_controller.rb
trunk/app/controllers/comments_controller.rb
trunk/app/controllers/logis_controller.rb
trunk/app/helpers/application_helper.rb
trunk/app/helpers/logis_helper.rb
trunk/app/models/link.rb
trunk/app/views/comments/_new.html.erb
trunk/app/views/layouts/_foot.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/_contending_logis.html.erb
trunk/app/views/peer_groups/_activity.html.erb
trunk/app/views/user_sessions/_method.html.erb
trunk/app/views/users/_activity.html.erb
trunk/public/stylesheets/logilogi.css
trunk/test/functional/comments_controller_test.rb
trunk/test/unit/link_test.rb
Added Paths:
-----------
trunk/public/images/mirrored_notice_cloud.svg
Modified: trunk/app/controllers/application_controller.rb
===================================================================
--- trunk/app/controllers/application_controller.rb 2009-07-29 05:52:09 UTC (rev 1543)
+++ trunk/app/controllers/application_controller.rb 2009-08-03 20:55:53 UTC (rev 1544)
@@ -45,8 +45,9 @@
### Methods
- def transfer_errors(source, target)
+ def transfer_errors(source, target, options = {})
source.errors.each do |attribute, msg|
+ attribute = options[:attribute] if options[:attribute]
target.errors.add(attribute, msg)
end
end
@@ -409,16 +410,9 @@
added_link_list.each {|added_link|
added_link.user = self.current_user
added_link.from_logi = logi
- begin
- added_link.resolve
- rescue LinkError => error
- logi.errors.add(:link, 'Unresolvable link: ' + error.link_string +
- ' Problem: ' + error.message)
- rescue => error
- logi.errors.add(:link, 'Error with link: ' + error.message)
- end
+ added_link.resolve
added_link.quick_validate
- transfer_errors(added_link, logi)
+ transfer_errors(added_link, logi, :link)
}
absolute_added_link_p_r_list =
@@ -437,13 +431,8 @@
return
end
- begin
- link = Link.new_from_s(link_string)
- rescue LinkError => error
- logi.errors.add(:tags, 'invalid link: ' + error.link_string + ' Problem: ' + error.message)
- rescue => error
- logi.errors.add(:tags, 'bad link: ' + error.message)
- end
+ link = Link.new_from_s(link_string)
+ transfer_errors(link, logi, :tags)
if logi.errors.empty?
logi.tag_with_link(link)
@@ -455,14 +444,9 @@
def weave_out_links(body_with_links, logi_version, logi)
link_pos_ranges = PositionRange::List.new
self.weave_out(body_with_links, logi_version, logi) do |pos_range, inserted_string|
- begin
- cluster_array = self.link_cluster_from_s(inserted_string)
- rescue LinkClusterError => error
- logi.errors.add(:text, 'Invalid link-cluster: ' + error.link_string + ' Problem: ' + error.message)
- rescue LinkError => error
- logi.errors.add(:text, 'Invalid link: ' + error.link_string + ' Problem: ' + error.message)
- rescue => error
- logi.errors.add(:text, 'Invalid link: ' + error.message)
+ cluster_array = self.link_cluster_from_s(inserted_string)
+ cluster_array.each do |link|
+ transfer_errors(link, logi, :link)
end
if logi.errors.empty?
cluster_array.each {|link|
Modified: trunk/app/controllers/comments_controller.rb
===================================================================
--- trunk/app/controllers/comments_controller.rb 2009-07-29 05:52:09 UTC (rev 1543)
+++ trunk/app/controllers/comments_controller.rb 2009-08-03 20:55:53 UTC (rev 1544)
@@ -25,44 +25,64 @@
### REST-methods
def new
+ @selected = params[:selected] || 'new_logi'
@logi = Logi.new_with(:creator => current_user,
:user_group => current_prefs.user_group)
@logi_version = @logi.current_logi_version
- respond_to do |format|
- format.js do
- render :partial => 'new.html.erb'
- end
- end
+ render :partial => 'new.html.erb', :locals => {
+ :selected => @selected}
end
def create
- 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)
+ if params[:perma_link]
+ @link = Link.new_from_s(params[:perma_link])
+ @link.resolve
- if commenting_logi.errors.empty? and commenting_logi_version.valid? and commenting.valid? and
- self.thorny_form_free_of_spam?
- # we can save as we know the link is valid on the logi
- commenting_logi.save
- commenting.save
+ if @link.errors.empty? and @link.to_logi and
+ self.thorny_form_free_of_spam?
+ commenting = Commenting.new(:from_logi => @logi,
+ :to_logi => @link.volatile_to_logi, :user => current_user)
+ commenting.save
- if params[:positioned]
- body_with_comment_link = self.insert_comment_link(params[:body_with_inserts],
- commenting_logi)
- self.insert_links(@logi, @logi_version, body_with_comment_link)
+ flash[:notice] = "Successfully added replying logi" +
+ " #{@link.volatile_to_logi.to_s(:for => :full_show)}"
+ redirect_to logi_ll_url(@logi)
+ else
+ transfer_errors(@link, @logi, :comment_link)
+ flash[:error] = "Problem connecting replying logi"
+ @selected = 'existing_logi'
+ render :template => 'logis/show'
end
-
- flash[:notice] = "Successfully created commenting logi #{commenting_logi.to_s(:for => :full_show)}"
- redirect_to logi_ll_url(commenting_logi)
else
- transfer_errors(commenting_logi, @logi)
- transfer_errors(commenting_logi_version, @logi_version)
- transfer_errors(commenting, @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)
- flash[:error] = "Problem creating commenting logi"
- @selected = 'comment'
- render :template => 'logi_inserts/new'
+ if commenting_logi.errors.empty? and commenting_logi_version.valid? and
+ commenting.valid? and self.thorny_form_free_of_spam?
+ # we can save as we know the link is valid on the logi
+ commenting_logi.save
+ commenting.save
+
+ if params[:positioned]
+ body_with_comment_link = self.insert_comment_link(
+ params[:body_with_inserts], commenting_logi)
+ self.insert_links(@logi, @logi_version, body_with_comment_link)
+ end
+
+ flash[:notice] = "Successfully created replying logi" +
+ " #{commenting_logi.to_s(:for => :full_show)}"
+ redirect_to logi_ll_url(@logi)
+ else
+ transfer_errors(commenting_logi, @logi)
+ transfer_errors(commenting_logi_version, @logi_version)
+ transfer_errors(commenting, @logi)
+
+ flash[:error] = "Problem creating replying logi"
+ @selected = 'comment'
+ render :template => 'logi_inserts/new'
+ end
end
end
Modified: trunk/app/controllers/logis_controller.rb
===================================================================
--- trunk/app/controllers/logis_controller.rb 2009-07-29 05:52:09 UTC (rev 1543)
+++ trunk/app/controllers/logis_controller.rb 2009-08-03 20:55:53 UTC (rev 1544)
@@ -211,11 +211,15 @@
def check
@check_link = Link.new_from_s(params[:check_ll_link_string])
@check_link.resolve
- respond_to do |format|
- format.js do
- render :template => 'logis/check.js.rjs', :locals => {
- :name => params[:name]}
+ if @check_link.errors.empty?
+ respond_to do |format|
+ format.js do
+ render :template => 'logis/check.js.rjs', :locals => {
+ :name => params[:name]}
+ end
end
+ else
+ render :nothing => true
end
end
Modified: trunk/app/helpers/application_helper.rb
===================================================================
--- trunk/app/helpers/application_helper.rb 2009-07-29 05:52:09 UTC (rev 1543)
+++ trunk/app/helpers/application_helper.rb 2009-08-03 20:55:53 UTC (rev 1544)
@@ -115,7 +115,7 @@
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",
+ {: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",
Modified: trunk/app/helpers/logis_helper.rb
===================================================================
--- trunk/app/helpers/logis_helper.rb 2009-07-29 05:52:09 UTC (rev 1543)
+++ trunk/app/helpers/logis_helper.rb 2009-08-03 20:55:53 UTC (rev 1544)
@@ -41,8 +41,8 @@
tabs.concat([
{:text => _("Contenders"), :name => "contending_logis",
:description => _("Logis competing for the same tags")},
- {:text => _("Comments On"), :name => "comments_on",
- :description => _("Logis this logi comments on"),
+ {:text => _("In reply to"), :name => "comments_on",
+ :description => _("This logi replies to the following logis"),
:disabled => logi.comments_on_logis.empty?}])
end
Modified: trunk/app/models/link.rb
===================================================================
--- trunk/app/models/link.rb 2009-07-29 05:52:09 UTC (rev 1543)
+++ trunk/app/models/link.rb 2009-08-03 20:55:53 UTC (rev 1544)
@@ -130,7 +130,9 @@
begin
return Link.new_from_h(Link.hash_from_s(link_string))
rescue => error
- raise LinkError.new(link_string), error.message
+ l = Link.new
+ l.errors.add_to_base(error.message)
+ return l
end
end
Modified: trunk/app/views/comments/_new.html.erb
===================================================================
--- trunk/app/views/comments/_new.html.erb 2009-07-29 05:52:09 UTC (rev 1543)
+++ trunk/app/views/comments/_new.html.erb 2009-08-03 20:55:53 UTC (rev 1544)
@@ -1,17 +1,45 @@
+<div id="<%= selected %>">
<%= render :partial => 'logis/commenting_logis', :locals => {
:logis => @logi.commenting_logis, :unfold_disabled => true} %>
+<% render :layout => 'application/panel_with_tabs_ajax', :locals => {:tabs => [
+ {:text => _("New Logi"), :name => "new_logi",
+ :description => _("Create a new logi in reply")},
+ {: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 %>
+<% end %>
+
<% thorny_form_for(@logi, :url => logi_comments_path(:force => true),
- :method => :post, :html => {:id => "logi_form"}) do |form| %>
+ :method => :post, :html => {:id => "logi_form"}) do |form| %>
- <%= show_errors 'logi_version','logi' %>
+ <% if selected == "new_logi" %>
- <%= render :partial => 'logis/edit', :locals => {
- :name => 'logi', :logi_version => @logi_version} %>
+ <%= show_errors 'logi_version','logi' %>
+ <%= render :partial => 'logis/edit', :locals => {
+ :name => 'logi', :logi_version => @logi_version} %>
+ <% else %>
+ <% render :layout => 'application/panel', :locals => {:id => 'link_perma_id'} do %>
+ <label id="perma_link_label">Permanent Link</label>
+ <%= text_field_tag 'perma_link', nil, :id => "perma_link", :autocomplete => "off" %>
+ <%= observe_field 'perma_link', :url => {:controller => 'logis', :action => 'check', :name => 'comment'},
+ :method => "get", :with => "check_ll_link_string" %>
+ <% end %>
+
+ <%= render :partial => 'logis/check', :locals => {:name => 'comment'} %>
+ <% end -%>
+
<%= render :partial => 'application/submit', :locals => {:form => form} %>
-<% end -%>
+<% end %>
+
<% javascript_tag do -%>
mcorners.run();
- logi_editor.initialize_tiny_mce_now();
<% end -%>
+
+<% if selected == "new_logi" %>
+ <% javascript_tag do -%>
+ logi_editor.initialize_tiny_mce_now();
+ <% end -%>
+<% end %>
+</div>
Modified: trunk/app/views/layouts/_foot.html.erb
===================================================================
--- trunk/app/views/layouts/_foot.html.erb 2009-07-29 05:52:09 UTC (rev 1543)
+++ trunk/app/views/layouts/_foot.html.erb 2009-08-03 20:55:53 UTC (rev 1544)
@@ -2,6 +2,9 @@
mcorners.add('div.notice_cloud', {
'image' : 'notice_cloud.svg', 'corner_size' : 10,
'image_start_corner' : 'south_east', 'stretch_side' : 'left'});
+ mcorners.add('div.mirrored_notice_cloud', {
+ 'image' : 'mirrored_notice_cloud.svg', 'corner_size' : 10,
+ 'image_start_corner' : 'south_west', 'stretch_side' : 'right'});
mcorners.add('div.wizzard_cloud_panel', {
'image' : 'wizzard_cloud.svg'});
mcorners.add('div.wizzard_step_cloud_panel', {
Modified: trunk/app/views/logi_inserts/new.html.erb
===================================================================
--- trunk/app/views/logi_inserts/new.html.erb 2009-07-29 05:52:09 UTC (rev 1543)
+++ trunk/app/views/logi_inserts/new.html.erb 2009-08-03 20:55:53 UTC (rev 1544)
@@ -68,8 +68,8 @@
<% @selected ||= "remark" %>
<% render :layout => 'application/panel_with_tabs_js', :locals => {
:tabs => [
- {:text => _("Commenting Logi"), :name => "comment",
- :description => _("Insert a commenting logi"),
+ {: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")},
@@ -91,9 +91,9 @@
:tabs => [
{:text => _("Tags"), :name => "tags_link",
:description => _("Insert a link to a set of tags")},
- {:text => _("Specific Logi"), :name => "perma_link",
+ {:text => _("Specific logi"), :name => "perma_link",
:description => _("Paste (Ctrl V) a permanent link to a specific logi")},
- {:text => _("External Link"), :name => "external_link",
+ {:text => _("External link"), :name => "external_link",
:description => _("Insert a link to a different site")}],
:selected => @link_selected, :id => "link_insert_options"} do %>
Modified: trunk/app/views/logis/_commenting_logis.html.erb
===================================================================
--- trunk/app/views/logis/_commenting_logis.html.erb 2009-07-29 05:52:09 UTC (rev 1543)
+++ trunk/app/views/logis/_commenting_logis.html.erb 2009-08-03 20:55:53 UTC (rev 1544)
@@ -1,12 +1,12 @@
-<% render :layout => 'application/panel_with_header', :locals => {:title => _("Commenting logis"), :id => "commenting"} do %>
- <div class="notice_cloud"><%= _('Want to give a more in-depth response ?') %></div>
+<% render :layout => 'application/panel_with_header', :locals => {:title => _("Logis as replies"), :id => "commenting"} do %>
+ <div class="mirrored_notice_cloud"><%= _('Want to give a more in-depth response ?') %></div>
<div class="description">
- <p><%= _('There are %{nr} comments') % {:nr => logis.size} %></p>
+ <p><%= _('There are %{nr} logis replying') % {:nr => logis.size} %></p>
</div>
<div class="spacer"></div>
- <%= toggle_button_to_remote 'or add commenting logi', {:update => "comment_area",
+ <%= 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 commenting logi', new_logi_logi_inserts_url(@logi,
+ <%= button_to 'insert a logi as a reply', new_logi_logi_inserts_url(@logi,
:selected => 'comment'), :class => 'insert_button' %>
<% end %>
Modified: trunk/app/views/logis/_comments_on.html.erb
===================================================================
--- trunk/app/views/logis/_comments_on.html.erb 2009-07-29 05:52:09 UTC (rev 1543)
+++ trunk/app/views/logis/_comments_on.html.erb 2009-08-03 20:55:53 UTC (rev 1544)
@@ -1,7 +1,7 @@
<div id="contenders_padding">
<div class="description">
<p>
- <%= _('This logi comments on %{nr} logis') % {
+ <%= _('This logi replies to %{nr} logis') % {
:nr => @logi.comments_on_logis.size} %>
</p>
</div>
Modified: trunk/app/views/logis/_contending_logis.html.erb
===================================================================
--- trunk/app/views/logis/_contending_logis.html.erb 2009-07-29 05:52:09 UTC (rev 1543)
+++ trunk/app/views/logis/_contending_logis.html.erb 2009-08-03 20:55:53 UTC (rev 1544)
@@ -20,9 +20,8 @@
<div class="description">
<p>
<%= _('There are %{nr} logis contending') % {
- :nr => contender_logis.size} %><% if contender_logis.size > 3 %>.
- <%= link_to _('Browse all'), browse_ll_url(current_context.link) %>
- <% end %>
+ :nr => contender_logis.size} %>
+
</p>
</div>
<div class="spacer"></div>
@@ -30,4 +29,10 @@
<%= render :partial => 'list', :locals => {:logis => contender_logis,
:current_logi => @logi} %>
+
+ <% if contender_logis.size > 0 %>.
+ <div class="browse_all">
+ <p><%= link_to _('Browse all'), browse_ll_url(current_context.link) %></p>
+ </div>
+ <% end %>
<% end %>
Modified: trunk/app/views/peer_groups/_activity.html.erb
===================================================================
--- trunk/app/views/peer_groups/_activity.html.erb 2009-07-29 05:52:09 UTC (rev 1543)
+++ trunk/app/views/peer_groups/_activity.html.erb 2009-08-03 20:55:53 UTC (rev 1544)
@@ -12,7 +12,7 @@
<% peer_group.memberships.best.all(:limit => 10).each do |membership| %>
<tr>
<td class="user"><%= user_ll_link(membership.user, :length => 15) %></td>
- <td class="percentile"><%= number_to_percentage(membership.percentile, :precision => 1) %></td>
+ <td class="percentile"><%= number_to_percentage(membership.percentile, :precision => 0) %></td>
</tr>
<% end %>
</table>
Modified: trunk/app/views/user_sessions/_method.html.erb
===================================================================
--- trunk/app/views/user_sessions/_method.html.erb 2009-07-29 05:52:09 UTC (rev 1543)
+++ trunk/app/views/user_sessions/_method.html.erb 2009-08-03 20:55:53 UTC (rev 1544)
@@ -1,8 +1,10 @@
<% selected ||= "normal" %>
<div id="<%= selected %>">
<% render :layout => 'application/panel_with_tabs_ajax', :locals => {:tabs => [
- {:text => _("Login"), :name => "normal", :description => _("Login to your account")},
- {:text => _("With OpenID"), :name => "openid", :description => _("Login with your OpenID")}],
+ {:text => _("Login"), :name => "normal",
+ :description => _("Login to your account")},
+ {:text => _("With OpenID"), :name => "openid",
+ :description => _("Login with your OpenID")}],
:selected => selected, :id => "method", :update_selected => true} do %>
<% if selected == "normal" %>
Modified: trunk/app/views/users/_activity.html.erb
===================================================================
--- trunk/app/views/users/_activity.html.erb 2009-07-29 05:52:09 UTC (rev 1543)
+++ trunk/app/views/users/_activity.html.erb 2009-08-03 20:55:53 UTC (rev 1544)
@@ -12,7 +12,7 @@
<% user.peer_group_memberships.order_by_percentile.each do |membership| %>
<tr>
<td class="group"><%= peer_group_ll_link(membership.peer_group) %></td>
- <td class="percentile"><%= number_to_percentage(membership.percentile, :precision => 1) %></td>
+ <td class="percentile"><%= number_to_percentage(membership.percentile, :precision => 0) %></td>
</tr>
<% end %>
</table>
Added: trunk/public/images/mirrored_notice_cloud.svg
===================================================================
--- trunk/public/images/mirrored_notice_cloud.svg (rev 0)
+++ trunk/public/images/mirrored_notice_cloud.svg 2009-08-03 20:55:53 UTC (rev 1544)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="400"
+ height="100"
+ id="svg3408"
+ sodipodi:version="0.32"
+ inkscape:version="0.46"
+ sodipodi:docname="mirrored_notice_cloud.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape"
+ version="1.0"
+ inkscape:export-filename="/home/wybo/logilogi/trunk/inspect.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs3410">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective3416" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="1.979899"
+ inkscape:cx="248.52722"
+ inkscape:cy="14.621937"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1270"
+ inkscape:window-height="949"
+ inkscape:window-x="0"
+ inkscape:window-y="25" />
+ <metadata
+ id="metadata3413">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <path
+ sodipodi:nodetypes="cccccccccccc"
+ id="path5660"
+ d="M 8.7616898,90.440672 L 40.27822,90.440672 L 28.50454,98.999998 L 58.32974,90.440672 L 391.23835,90.440672 C 395.53832,90.440672 398.99999,86.744528 398.99999,82.153417 L 398.99999,9.2871538 C 398.99999,4.696043 395.53832,0.99999974 391.23835,0.99999974 L 8.7616898,0.99999974 C 4.4616998,0.99999974 0.99999984,4.696043 0.99999984,9.2871538 L 0.99999984,82.153417 C 0.99999984,86.744528 4.4616998,90.440672 8.7616898,90.440672 z"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#808080;stroke-width:1.99999964;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dashoffset:2.0299999;stroke-opacity:1;display:inline" />
+ </g>
+</svg>
Modified: trunk/public/stylesheets/logilogi.css
===================================================================
--- trunk/public/stylesheets/logilogi.css 2009-07-29 05:52:09 UTC (rev 1543)
+++ trunk/public/stylesheets/logilogi.css 2009-08-03 20:55:53 UTC (rev 1544)
@@ -314,6 +314,7 @@
/* small elements */
+.mirrored_notice_cloud,
.notice_cloud {
float: right;
padding: 0.5em 1em 1.2em 1em;
@@ -591,7 +592,7 @@
float: right;
width: 25em;
}
-#insert_form input#perma_link {
+input#perma_link { /* also used for comments */
margin: 0.5em 0 0.5em 0;
float: left;
width: 33.7em;
@@ -737,7 +738,6 @@
#contending_logis .logi_current .panel_content_padding {
padding-right: 1.2em;
}
-
#home_page .logi .author,
#contending_logis .logi .author {
padding: 0 0 0 0;
@@ -746,6 +746,16 @@
#contending_logis .rating_label {
right: 12em;
}
+#contending_logis .browse_all {
+ float: right;
+ padding-top: 0;
+ margin-top: -1.5em;
+ margin-right: 0.5em;
+}
+#contending_logis .browse_all .p {
+ padding-top: 0;
+ margin-top: 0;
+}
/* achievements */
Modified: trunk/test/functional/comments_controller_test.rb
===================================================================
--- trunk/test/functional/comments_controller_test.rb 2009-07-29 05:52:09 UTC (rev 1543)
+++ trunk/test/functional/comments_controller_test.rb 2009-08-03 20:55:53 UTC (rev 1544)
@@ -26,26 +26,39 @@
# REST-methods
- def test_create
+ def test_create_existing
l = logis(:logi_logi)
+ l2 = logis(:united_states)
nr_of_c_l = l.commenting_logis.size
- l_v = l.current_logi_version
post :create, {:ll_link_string => l.link.to_s,
+ :perma_link => "http://en.edge.logilogi.org/" +
+ l2.link.to_s}.merge(self.thorny_ok_hash)
+
+ assert_redirected_to @controller.logi_ll_url(l)
+ l.reload
+ assert_equal l.commenting_logis.size, nr_of_c_l + 1
+ end
+
+ def test_create_new_logi
+ l = logis(:logi_logi)
+ nr_of_c_l = l.commenting_logis.size
+
+ post :create, {:ll_link_string => l.link.to_s,
:logi => {:title => 'K',
:body => '<p>akatu</p>'}}.merge(self.thorny_ok_hash)
+ assert_redirected_to @controller.logi_ll_url(l)
l.reload
+ assert_equal l.commenting_logis.size, nr_of_c_l + 1
c_ls = Logi.find_all_by_text_stack('<h1>K</h1> <p>akatu</p>')
assert_equal 1, c_ls.size
c_l = c_ls.first
assert c_l
- assert_redirected_to @controller.logi_ll_url(c_l)
assert_equal [Tag.untagged], c_l.tags
- assert_equal l.commenting_logis.size, nr_of_c_l + 1
end
- def test_create_positioned
+ def test_create_positioned_new_logi
l = logis(:logi_logi)
nr_of_c_l = l.commenting_logis.size
l_v = l.current_logi_version
@@ -58,14 +71,14 @@
:logi => {:title => 'K',
:body => '<p>akatu</p>'}}.merge(self.thorny_ok_hash)
+ assert_redirected_to @controller.logi_ll_url(l)
l.reload
+ assert_equal l.commenting_logis.size, nr_of_c_l + 1
c_ls = Logi.find_all_by_text_stack('<h1>K</h1> <p>akatu</p>')
assert_equal 1, c_ls.size
c_l = c_ls.first
assert c_l
- assert_redirected_to @controller.logi_ll_url(c_l)
assert_equal [Tag.untagged], c_l.tags
assert l.from_links.find_by_to_logi_id(c_l.id)
- assert_equal l.commenting_logis.size, nr_of_c_l + 1
end
end
Modified: trunk/test/unit/link_test.rb
===================================================================
--- trunk/test/unit/link_test.rb 2009-07-29 05:52:09 UTC (rev 1543)
+++ trunk/test/unit/link_test.rb 2009-08-03 20:55:53 UTC (rev 1544)
@@ -135,10 +135,9 @@
end
def test_parsing_new_from_s_exceptions
- assert_raise(LinkError) {
- link = Link.new_from_s(
- 'A_Word1/A_Word2/A_Word3/A_Word4/A_Word5/A_Word6/A_Word7/A_Word_8')
- }
+ link = Link.new_from_s(
+ 'A_Word1/A_Word2/A_Word3/A_Word4/A_Word5/A_Word6/A_Word7/A_Word_8')
+ assert !link.errors.empty?
end
### Re-resolves
@@ -345,9 +344,9 @@
def test_resolve_exceptions
# No not (yet) existing to_logi_version_nr's
- assert_raise(LinkError) {
- link = Link.new_from_s('Peter_Abelard' + logis(:peter_abelard).to_s + '=v90')
- }
+ link = Link.new_from_s('Peter_Abelard' + logis(:peter_abelard).to_s +
+ '=v90')
+ assert !link.errors.empty?
end
### Volatiles
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wy...@us...> - 2009-07-29 05:52:21
|
Revision: 1543
http://logilogi.svn.sourceforge.net/logilogi/?rev=1543&view=rev
Author: wybow
Date: 2009-07-29 05:52:09 +0000 (Wed, 29 Jul 2009)
Log Message:
-----------
Missing method fixed in edge deploy cap task
Modified Paths:
--------------
trunk/lib/capistrano/logilogi.rb
Modified: trunk/lib/capistrano/logilogi.rb
===================================================================
--- trunk/lib/capistrano/logilogi.rb 2009-07-28 22:27:31 UTC (rev 1542)
+++ trunk/lib/capistrano/logilogi.rb 2009-07-29 05:52:09 UTC (rev 1543)
@@ -53,7 +53,7 @@
namespace :deploy do
desc "Updates controllers and views and restarts"
task :default do
- find_and_execute_task("logilogi:deploy:default_no_server_restart")
+ find_and_execute_task("logilogi:deploy:default_no_webserver_restart")
find_and_execute_task("logilogi:server:restart")
end
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wy...@us...> - 2009-07-28 22:27:39
|
Revision: 1542
http://logilogi.svn.sourceforge.net/logilogi/?rev=1542&view=rev
Author: wybow
Date: 2009-07-28 22:27:31 +0000 (Tue, 28 Jul 2009)
Log Message:
-----------
Added pema-links to versions
Modified Paths:
--------------
trunk/app/helpers/logis_helper.rb
trunk/app/models/const/logi_version.rb
trunk/app/models/link.rb
trunk/app/models/logi_version.rb
trunk/app/views/changes/_changes_pagination.html.erb
trunk/app/views/logis/_logi.html.erb
trunk/app/views/logis/check.js.rjs
trunk/app/views/perma_links/_new.html.erb
trunk/public/javascripts/application.js
trunk/public/javascripts/body_inserter.js
trunk/public/stylesheets/logilogi.css
trunk/test/unit/link_test.rb
trunk/test/unit/logi_version_test.rb
Modified: trunk/app/helpers/logis_helper.rb
===================================================================
--- trunk/app/helpers/logis_helper.rb 2009-07-26 22:15:12 UTC (rev 1541)
+++ trunk/app/helpers/logis_helper.rb 2009-07-28 22:27:31 UTC (rev 1542)
@@ -12,14 +12,20 @@
#++#
module LogisHelper
- def perma_link(logi)
+ def perma_links(logi, logi_version)
return '<div class="perma_link">' +
- link_to(image_tag('perma.png') + ' Copy permanent link',
+ link_to(image_tag('perma.png') + ' Copy permanent link ',
logi_ll_url(logi),
: "copyPerma('" + logi_ll_url(logi) + "'," +
"'The following is the permalink of this logi." +
" Hit Ctrl A followed by Ctrl C on your keyboard to" +
" copy to your clipboard:'); return false;") +
+ link_to('(to version)',
+ logi_version_ll_url(logi_version),
+ : "copyPerma('" + logi_version_ll_url(logi_version) + "'," +
+ "'The following is the versioned permalink of this logi." +
+ " Hit Ctrl A followed by Ctrl C on your keyboard to" +
+ " copy to your clipboard:'); return false;") +
'</div>'
end
Modified: trunk/app/models/const/logi_version.rb
===================================================================
--- trunk/app/models/const/logi_version.rb 2009-07-26 22:15:12 UTC (rev 1541)
+++ trunk/app/models/const/logi_version.rb 2009-07-28 22:27:31 UTC (rev 1542)
@@ -7,13 +7,13 @@
### Regular expressions
# Regexp building blocks
- BLOCK_LOGI_VERSION = '(?:\=v\d+)'
+ BLOCK_LOGI_VERSION = '(?:\=v(c|\d+))'
# Check-regexps
CHECK_LOGI_VERSION_RE = /^#{BLOCK_LOGI_VERSION}$/
# Dissection-regexps
- MATCH_LOGI_VERSION_RE = /=v(\d+)/
+ MATCH_LOGI_VERSION_RE = /=v(c|\d+)/
# Get HTML tags
HTML_TAGS = /<([^>\s\/]+)[^>]*>/
Modified: trunk/app/models/link.rb
===================================================================
--- trunk/app/models/link.rb 2009-07-26 22:15:12 UTC (rev 1541)
+++ trunk/app/models/link.rb 2009-07-28 22:27:31 UTC (rev 1542)
@@ -186,9 +186,13 @@
if link_hash[:to_logi_perma_id]
to_logi = Logi.from_h(:perma_id => link_hash[:to_logi_perma_id])
end
+ if link_hash[:to_logi_version_nr]
+ to_logi_version_nr = LogiVersion.from_h(to_logi,
+ :logi_version_nr => link_hash[:to_logi_version_nr]).nr
+ end
link = Link.new(:requested_tags => link_hash[:requested_tags],
:to_logi => to_logi,
- :to_logi_version_nr => link_hash[:to_logi_version_nr],
+ :to_logi_version_nr => to_logi_version_nr,
:stance => link_hash[:stance]
)
return link
@@ -411,10 +415,6 @@
else
# resolve logi-link
self.resolve_tags_for_to_logi
- if self.to_logi_version_nr
- # resolve logi-version
- self.resolve_to_logi_version
- end
end
return self
end
@@ -746,17 +746,6 @@
self.link_matches.build(:logi => self.to_logi)
end
- # Sub-function for resolve.
- #
- # Resolves upto the to_logi_version_nr.
- #
- def resolve_to_logi_version # assumes resolved to logi
- if self.to_logi.current_logi_version.nr < self.to_logi_version_nr
- raise ExistenceError.new(self.to_logi_version_nr),
- 'Requested to_logi_version_nr does not exist for the to_logi'
- end
- end
-
### Link parts for use and show
# Sub-function for the different *_to_s functions that turns a tag-
Modified: trunk/app/models/logi_version.rb
===================================================================
--- trunk/app/models/logi_version.rb 2009-07-26 22:15:12 UTC (rev 1541)
+++ trunk/app/models/logi_version.rb 2009-07-28 22:27:31 UTC (rev 1542)
@@ -75,7 +75,11 @@
end
logi_version_string =~ Const::LogiVersion::MATCH_LOGI_VERSION_RE
match = $~
- return {:logi_version_nr => match[1].to_i}
+ nr = match[1]
+ if nr != "c"
+ nr = nr.to_i
+ end
+ return {:logi_version_nr => nr}
end
# Creates a new LogiVersion from a logi_version_hash.
@@ -87,7 +91,11 @@
if logi_version_hash[:logi_version_nr].nil?
raise HashError.new(logi_version_hash), 'Invalid logi_version hash given'
end
- logi_version = LogiVersion.find_by_logi_id_and_nr(logi.id, logi_version_hash[:logi_version_nr])
+ if logi_version_hash[:logi_version_nr] == "c"
+ logi_version = logi.current_logi_version
+ else
+ logi_version = LogiVersion.find_by_logi_id_and_nr(logi.id, logi_version_hash[:logi_version_nr])
+ end
if logi_version.nil?
raise ExistenceError.new(logi_version_hash), 'Nonexisting logi_version requested for logi ' +
logi.id.to_s
Modified: trunk/app/views/changes/_changes_pagination.html.erb
===================================================================
--- trunk/app/views/changes/_changes_pagination.html.erb 2009-07-26 22:15:12 UTC (rev 1541)
+++ trunk/app/views/changes/_changes_pagination.html.erb 2009-07-28 22:27:31 UTC (rev 1542)
@@ -2,6 +2,7 @@
<% render :layout => 'application/panel', :locals => {:id => "recent_changes"} do %>
<div class="index_list">
+ <!-- <%= link_to 'Jump', 'http://logi-manta.org:3001/?user_id=' + current_user.id.to_s + '&perishable_token=' + current_user.perishable_token %> -->
<%= render :partial => 'list', :locals => {:logis => logis} %>
</div>
<% end %>
Modified: trunk/app/views/logis/_logi.html.erb
===================================================================
--- trunk/app/views/logis/_logi.html.erb 2009-07-26 22:15:12 UTC (rev 1541)
+++ trunk/app/views/logis/_logi.html.erb 2009-07-28 22:27:31 UTC (rev 1542)
@@ -2,7 +2,7 @@
<%= (local_assigns[:action] == :view ?
button_to('Insert into logi',
new_logi_logi_inserts_url(@logi), :class => 'insert_button') +
- perma_link(@logi) : '' )%>
+ perma_links(@logi, @logi_version) : '' )%>
<div class="panel_content_padding">
<div id="logi_min_height"></div>
<%= yield %>
Modified: trunk/app/views/logis/check.js.rjs
===================================================================
--- trunk/app/views/logis/check.js.rjs 2009-07-26 22:15:12 UTC (rev 1541)
+++ trunk/app/views/logis/check.js.rjs 2009-07-28 22:27:31 UTC (rev 1542)
@@ -1,2 +1,5 @@
page.replace 'check' + (local_assigns[:name] ? '_' + local_assigns[:name] : ''),
:partial => 'check', :locals => {:name => local_assigns[:name]}
+if local_assigns[:name] == 'perma'
+ page.call('selectPermaRadio')
+end
Modified: trunk/app/views/perma_links/_new.html.erb
===================================================================
--- trunk/app/views/perma_links/_new.html.erb 2009-07-26 22:15:12 UTC (rev 1541)
+++ trunk/app/views/perma_links/_new.html.erb 2009-07-28 22:27:31 UTC (rev 1542)
@@ -6,3 +6,12 @@
<% end %>
<%= render :partial => 'logis/check', :locals => {:name => 'perma'} %>
+
+<% render :layout => 'application/panel', :locals => {:id => 'link_perma_lock'} do %>
+ <label>Lock to version</label>
+ <div id="perma_lock">
+ <p><%= radio_button_tag 'lock_version', "no", true, :id => 'lock_version_no' %> No, always link to the most recent version</p>
+ <p><%= radio_button_tag 'lock_version', "yes", false, :id => 'lock_version_yes' %> Yes, lock to the current/provided version</p>
+ </div>
+ <div class="spacer"></div>
+<% end %>
Modified: trunk/public/javascripts/application.js
===================================================================
--- trunk/public/javascripts/application.js 2009-07-26 22:15:12 UTC (rev 1541)
+++ trunk/public/javascripts/application.js 2009-07-28 22:27:31 UTC (rev 1542)
@@ -122,13 +122,23 @@
// For permalinks
function copyPerma(link, ff_text) {
- if( window.clipboardData && clipboardData.setData ) {
+ if(window.clipboardData && clipboardData.setData) {
clipboardData.setData("Text", link);
} else {
prompt(ff_text, link);
}
}
+function selectPermaRadio() {
+ if ($F("perma_link").match(/=v/)) {
+ $('lock_version_no').checked = false;
+ $('lock_version_yes').checked = true;
+ } else {
+ $('lock_version_no').checked = true;
+ $('lock_version_yes').checked = false;
+ }
+}
+
// For the editor
var LogiEditor = Class.create({
Modified: trunk/public/javascripts/body_inserter.js
===================================================================
--- trunk/public/javascripts/body_inserter.js 2009-07-26 22:15:12 UTC (rev 1541)
+++ trunk/public/javascripts/body_inserter.js 2009-07-28 22:27:31 UTC (rev 1542)
@@ -132,7 +132,15 @@
},
insert_perma_link: function() {
- this.insert($F("perma_link"));
+ perma_link = $F("perma_link");
+ if ($$('input:checked[type="radio"][name="lock_version"]').pluck('value') == "yes") {
+ if (!perma_link.match(/=v/)) {
+ perma_link += '=vc';
+ }
+ } else if (perma_link.match(/=v(c|\d+)$/)) {
+ perma_link = perma_link.gsub(/=v\d+$/,'');
+ }
+ this.insert(perma_link);
},
insert_external_link: function() {
Modified: trunk/public/stylesheets/logilogi.css
===================================================================
--- trunk/public/stylesheets/logilogi.css 2009-07-26 22:15:12 UTC (rev 1541)
+++ trunk/public/stylesheets/logilogi.css 2009-07-28 22:27:31 UTC (rev 1542)
@@ -767,6 +767,10 @@
float: right;
padding: 1em 1em 0 0;
}
+#perma_lock {
+ float: right;
+ width: 28em;
+}
.logi {
background-color: white;
padding: 0;
Modified: trunk/test/unit/link_test.rb
===================================================================
--- trunk/test/unit/link_test.rb 2009-07-26 22:15:12 UTC (rev 1541)
+++ trunk/test/unit/link_test.rb 2009-07-28 22:27:31 UTC (rev 1542)
@@ -345,9 +345,8 @@
def test_resolve_exceptions
# No not (yet) existing to_logi_version_nr's
- link = Link.new_from_s('Peter_Abelard' + logis(:peter_abelard).to_s + '=v90')
- assert_raise(ExistenceError) {
- link.resolve
+ assert_raise(LinkError) {
+ link = Link.new_from_s('Peter_Abelard' + logis(:peter_abelard).to_s + '=v90')
}
end
@@ -469,8 +468,11 @@
### Parsing to string
def test_parsing_to_s_for_edit
- assert_equal_string_parsing_for_hashes(self.get_link_string_hash,
- self.get_link_string_hash, :for => :edit)
+ link_string_hash = self.get_link_string_hash
+ link_string_hash.delete(:tag_current_logi_version)
+
+ assert_equal_string_parsing_for_hashes(link_string_hash,
+ link_string_hash, :for => :edit)
end
def test_parsing_to_s_for_show
@@ -649,6 +651,8 @@
'Logi_Logi' + logis(:logi_logi).to_s,
:tag_logi_version =>
'Logi_Logi' + logis(:logi_logi).to_s + '=v2',
+ :tag_current_logi_version =>
+ 'Logi_Logi' + logis(:logi_logi).to_s + '=vc',
:tags =>
'Peter_Abelard/Botanics',
:tags_logi =>
@@ -679,6 +683,9 @@
:tag_logi_version =>
[test_link_string_hash[:tag_logi_version],
'Logi_Logi', logis(:logi_logi).to_s + '=v2', nil],
+ :tag_current_logi_version =>
+ [test_link_string_hash[:tag_current_logi_version],
+ 'Logi_Logi', logis(:logi_logi).to_s + '=vc', nil],
:tags =>
[test_link_string_hash[:tags],
'Peter_Abelard/Botanics', nil, nil],
@@ -727,6 +734,11 @@
:to_logi_perma_id => logis(:logi_logi).perma_id,
:to_logi_version_nr => 2
},
+ :tag_current_logi_version =>
+ {:requested_tags => [Tag.from_s('Logi_Logi')],
+ :to_logi_perma_id => logis(:logi_logi).perma_id,
+ :to_logi_version_nr => 'c'
+ },
:tags =>
{:requested_tags => [Tag.from_s('Peter_Abelard'),Tag.from_s('Botanics')]
},
@@ -774,6 +786,9 @@
:tag_logi_version =>
{:to_logi_version_nr => 2
},
+ :tag_current_logi_version =>
+ {:to_logi_version_nr => logis(:logi_logi).current_logi_version.nr
+ },
:tags =>
{:requested_tags => [Tag.from_s('Peter_Abelard'),Tag.from_s('Botanics')]
},
@@ -824,15 +839,11 @@
:tag_logi =>
{:to_logi => logis(:logi_logi),
},
- :tag_logi_version =>
- {},
:tags =>
{:received_tags => [Tag.from_s('Peter_Abelard'),Tag.from_s('Botanics')]
},
:tags_logi =>
{},
- :tag_logi_version =>
- {},
:received_link_tags_to_be_reduced =>
{:received_tags => [Tag.from_s('Peter_Abelard'),Tag.from_s('Economics')]
},
Modified: trunk/test/unit/logi_version_test.rb
===================================================================
--- trunk/test/unit/logi_version_test.rb 2009-07-26 22:15:12 UTC (rev 1541)
+++ trunk/test/unit/logi_version_test.rb 2009-07-28 22:27:31 UTC (rev 1542)
@@ -167,15 +167,27 @@
logi_version = logi_versions(:logi_logi_v2)
logi_version_hash = {:logi_version_nr => 2}
+
+ current_logi_version_hash = {:logi_version_nr => 'c'}
logi_version_string = '=v2'
+
+ current_logi_version_string = '=vc'
assert_equal logi_version_hash, LogiVersion.hash_from_s(logi_version_string)
+
+ assert_equal current_logi_version_hash,
+ LogiVersion.hash_from_s(current_logi_version_string)
+
assert_raise(ParsingError) {
LogiVersion.hash_from_s(',v2')
}
assert_equal logi_version, LogiVersion.from_h(logi, logi_version_hash)
+
+ assert_equal logi.current_logi_version,
+ LogiVersion.from_h(logi, current_logi_version_hash)
+
assert_raise(HashError) {
LogiVersion.from_h(logi, :bull => 'shit')
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wy...@us...> - 2009-07-26 22:15:20
|
Revision: 1541
http://logilogi.svn.sourceforge.net/logilogi/?rev=1541&view=rev
Author: wybow
Date: 2009-07-26 22:15:12 +0000 (Sun, 26 Jul 2009)
Log Message:
-----------
Added update for settings
Modified Paths:
--------------
trunk/db/migrate/20090726214545_global_config_host.rb
Modified: trunk/db/migrate/20090726214545_global_config_host.rb
===================================================================
--- trunk/db/migrate/20090726214545_global_config_host.rb 2009-07-26 22:12:40 UTC (rev 1540)
+++ trunk/db/migrate/20090726214545_global_config_host.rb 2009-07-26 22:15:12 UTC (rev 1541)
@@ -2,6 +2,13 @@
def self.up
add_column :global_configs, :language_code, :string, :limit => 5, :null => false
add_column :global_configs, :protocol, :string, :limit => 8, :null => false
+
+ if GlobalConfig.count != 0
+ g_c = GlobalConfig.find(:first)
+ g_c.protocol = 'http'
+ g_c.language_code = 'en'
+ g_c.save
+ end
end
def self.down
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wy...@us...> - 2009-07-26 22:12:50
|
Revision: 1540
http://logilogi.svn.sourceforge.net/logilogi/?rev=1540&view=rev
Author: wybow
Date: 2009-07-26 22:12:40 +0000 (Sun, 26 Jul 2009)
Log Message:
-----------
Fixed browse bug, working towards loglog, updated some bits of rails
Modified Paths:
--------------
trunk/app/controllers/application_controller.rb
trunk/app/controllers/invitations_controller.rb
trunk/app/controllers/password_resets_controller.rb
trunk/app/controllers/users_controller.rb
trunk/app/helpers/application_helper.rb
trunk/app/models/global_config.rb
trunk/app/models/invitation.rb
trunk/app/models/log_log_message.rb
trunk/app/models/logi.rb
trunk/app/models/notifier.rb
trunk/app/models/used_tag.rb
trunk/app/models/user.rb
trunk/app/views/layouts/_head.html.erb
trunk/app/views/layouts/_title_bar.html.erb
trunk/app/views/logis/_list.html.erb
trunk/app/views/logis/_navigation_bar_browse_header.html.erb
trunk/app/views/logis/_snippet.html.erb
trunk/app/views/logis/_tag_list.html.erb
trunk/app/views/tags/_edit.html.erb
trunk/app/views/users/new.html.erb
trunk/config/config.rb.tmpl
trunk/config/routes.rb
trunk/db/schema.rb
trunk/doc/README_FOR_APP
trunk/lib/tasks/config.rake
trunk/public/dispatch.cgi
trunk/public/dispatch.fcgi
trunk/public/dispatch.rb
trunk/public/javascripts/taglist.js
trunk/test/unit/notifier_test.rb
trunk/test/unit/user_test.rb
Added Paths:
-----------
trunk/app/controllers/remote_users_controller.rb
trunk/app/views/remote_users/
trunk/app/views/remote_users/show.erb
trunk/config.ru
trunk/db/migrate/20090726214545_global_config_host.rb
Modified: trunk/app/controllers/application_controller.rb
===================================================================
--- trunk/app/controllers/application_controller.rb 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/app/controllers/application_controller.rb 2009-07-26 22:12:40 UTC (rev 1540)
@@ -23,13 +23,13 @@
### Attributes
- attr_accessor :current_context, :site_language_code
+ attr_accessor :current_context
### Filters
filter_parameter_logging :password, :password_confirmation
helper_method :current_user_session, :current_user
- before_filter :append_return_url, :define_locale_or_redirect,
+ before_filter :append_return_url, :redirect_if_wrong_subdomain,
:current_prefs, :page_id_and_class
### Bodies
@@ -253,17 +253,6 @@
logi_url(peer_group.home_page_link.to_s, options)
end
- ### Names
-
- def language_site_name(options = {})
- if options[:language]
- language = options[:language]
- else
- language = self.site_language_code
- end
- return language + '.' + GlobalConfig.domain
- end
-
### Current
# Returns the current user session, see authlogic.
@@ -580,26 +569,22 @@
return @page_id.tr('_',' ').gsub(/(^|\s)(.)/) { $1 + $2.upcase }
end
- def define_locale_or_redirect
+ def redirect_if_wrong_subdomain
if GlobalConfig.use_language_subdomains?
sub_domain = request.subdomains.first.to_s
if sub_domain == 'www' or sub_domain.empty?
- language = assure_language(::BrowserLanguageCode.detect(request.env['HTTP_ACCEPT_LANGUAGE']))
- else
- language = assure_language(sub_domain)
- end
- if sub_domain != language
- # Redirecting from the main site
+ # detect browser language
+ language = ::BrowserLanguageCode.detect(request.env['HTTP_ACCEPT_LANGUAGE'])
+ if !GlobalConfig.available_language_codes.include?(language)
+ # set current site if it does not exist
+ language = GlobalConfig.language_code
+ end
+ # redirecting
domain = language + '.' + GlobalConfig.domain.downcase
host = (request.port == request.standard_port ? "#{domain}" : "#{domain}:#{request.port}")
redirect_to url_for(params.merge(:host => host))
return false
- else
- self.site_language_code = language
end
- else
- self.site_language_code =
- assure_language(::BrowserLanguageCode.detect(request.env['HTTP_ACCEPT_LANGUAGE']))
end
return true
end
@@ -675,18 +660,4 @@
def navigation_bar_edit
render_body 'logis/navigation_bar_edit'
end
-
- ### Sub-methods
-
- protected
-
- # Makes sure the language is available, otherwise chooses english
- #
- def assure_language(language)
- if GlobalConfig.available_language_codes.include?(language)
- return language
- else
- return 'en'
- end
- end
end
Modified: trunk/app/controllers/invitations_controller.rb
===================================================================
--- trunk/app/controllers/invitations_controller.rb 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/app/controllers/invitations_controller.rb 2009-07-26 22:12:40 UTC (rev 1540)
@@ -33,7 +33,7 @@
@invitation = Invitation.new({:peer_group => @peer_group,
:creator_user => current_user}.merge(params[:invitation]))
if @invitation.save
- @invitation.deliver_invitation!(self.language_site_name)
+ @invitation.deliver_invitation!
if @invitation.user.nil?
flash[:notice] = "The invitation has been sent to " + @invitation.email
else
Modified: trunk/app/controllers/password_resets_controller.rb
===================================================================
--- trunk/app/controllers/password_resets_controller.rb 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/app/controllers/password_resets_controller.rb 2009-07-26 22:12:40 UTC (rev 1540)
@@ -31,7 +31,7 @@
def create
@user = User.find_by_email(params[:user][:email])
if @user
- @user.deliver_password_reset_instructions!(self.language_site_name)
+ @user.deliver_password_reset_instructions!
flash[:notice] = "Instructions to reset your password have been emailed to you. " +
"Please check your email."
redirect_to return_url_or_default
Added: trunk/app/controllers/remote_users_controller.rb
===================================================================
--- trunk/app/controllers/remote_users_controller.rb (rev 0)
+++ trunk/app/controllers/remote_users_controller.rb 2009-07-26 22:12:40 UTC (rev 1540)
@@ -0,0 +1,25 @@
+#--#
+# 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 RemoteUsersController < ApplicationController
+ ### Methods
+
+ def show
+ @user = User.find_by_id_and_perishable_token(params[:id],
+ params[:perishable_token])
+
+ respond_to do |format|
+ format.xml { render :xml => @user.to_xml(: [:id, :name]) }
+ end
+ end
+end
Modified: trunk/app/controllers/users_controller.rb
===================================================================
--- trunk/app/controllers/users_controller.rb 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/app/controllers/users_controller.rb 2009-07-26 22:12:40 UTC (rev 1540)
@@ -46,7 +46,7 @@
@user = User.new(params[:user])
@user.save do |result|
if result
- @user.deliver_welcome!(self.language_site_name)
+ @user.deliver_welcome!
if session[:invitation].nil?
flash[:notice] = "You just received an account!"
shift_return_url
Modified: trunk/app/helpers/application_helper.rb
===================================================================
--- trunk/app/helpers/application_helper.rb 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/app/helpers/application_helper.rb 2009-07-26 22:12:40 UTC (rev 1540)
@@ -477,36 +477,16 @@
'</span>'
end
- def site_language_code
- return @controller.site_language_code
- end
-
- def language_site_name_link(options = {})
+ def site_link(options = {})
if options[:text]
text = options[:text]
else
- text = self.language_site_name(options)
+ text = GlobalConfig.site_host(options)
end
- if options[:language]
- url = "http://" + self.language_site_name(options)
- else
- url = root_url
- end
- return link_to(text, url, :class => 'sitename')
- end
-
- def language_site_name(options = {})
if options[:length]
- if options[:language]
- language = options[:language]
- else
- language = self.site_language_code
- end
- return language + '.' + self.pre_truncate(GlobalConfig.domain,
- :length => options[:length] - 3)
- else
- return @controller.language_site_name(options)
+ text = self.pre_truncate(text, :length => options[:length])
end
+ return link_to(text, GlobalConfig.site_url(options), :class => 'sitename')
end
# Assumed width 63.
Modified: trunk/app/models/global_config.rb
===================================================================
--- trunk/app/models/global_config.rb 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/app/models/global_config.rb 2009-07-26 22:12:40 UTC (rev 1540)
@@ -73,14 +73,27 @@
### Administrative methods
+ def self.update_to_db
+ g_c = GlobalConfig.find(:first)
+
+ g_c.set_updatable_settings(InitialGlobalConfig::HASH)
+
+ g_c.resolve_indirect_settings
+
+ g_c.save
+ end
+
# Fills the database with the initial settings
#
def self.initial_to_db
g_c = GlobalConfig.new
- # the basic settings
+ # the basic settings that can be changed
+ g_c.set_updatable_settings(InitialGlobalConfig::HASH)
+
+ # the basic settings that cannot; tag strings
InitialGlobalConfig::HASH.each_pair do |key, value|
- if key.to_s !~ /^admin_settings|users|user_groups|peer_groups$/
+ if key.to_s =~ /^.*tag_string$/
g_c.send(key.to_s + '=', value)
end
end
@@ -157,6 +170,16 @@
###### Methods
+ ### Administrative methods
+
+ def set_updatable_settings(hash)
+ hash.each_pair do |key, value|
+ if key.to_s !~ /^admin_settings|users|user_groups|peer_groups|.*tag_string$/
+ self.send(key.to_s + '=', value)
+ end
+ end
+ end
+
### Creators
['main_page','user','user_group','peer_group','replace','untagged',
@@ -288,6 +311,24 @@
return self.progress == Const::GlobalConfig::DONE
end
+ ### Composites
+
+ def site_url(options = {})
+ return self.protocol + '://' + self.site_host(options) + '/'
+ end
+
+ def site_host(options = {})
+ if self.use_language_subdomains?
+ if options[:language]
+ return options[:language] + '.' + self.domain
+ else
+ return self.language_code + '.' + self.domain
+ end
+ else
+ return self.domain
+ end
+ end
+
###### Filter-functions
protected
Modified: trunk/app/models/invitation.rb
===================================================================
--- trunk/app/models/invitation.rb 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/app/models/invitation.rb 2009-07-26 22:12:40 UTC (rev 1540)
@@ -41,8 +41,8 @@
# Sends out the invitation. Must be called after the invitation is
# saved.
#
- def deliver_invitation!(host)
- Notifier.deliver_invitation(self, host)
+ def deliver_invitation!
+ Notifier.deliver_invitation(self)
end
# Admits the given user to the peergroup.
Modified: trunk/app/models/log_log_message.rb
===================================================================
--- trunk/app/models/log_log_message.rb 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/app/models/log_log_message.rb 2009-07-26 22:12:40 UTC (rev 1540)
@@ -15,5 +15,6 @@
if GlobalConfig.done_with_basics? and GlobalConfig.use_log_log
self.site = GlobalConfig.log_log_site
self.user = GlobalConfig.log_log_api_key
+ self.element_name = "message"
end
end
Modified: trunk/app/models/logi.rb
===================================================================
--- trunk/app/models/logi.rb 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/app/models/logi.rb 2009-07-26 22:12:40 UTC (rev 1540)
@@ -102,7 +102,7 @@
before_validation :tags_strings_before_validation # see TagsStringsModule
before_save :use_or_release_tags
after_save :set_re_resolve_on_to_links
- after_create :loglog
+ after_create :log_to_log_log
after_destroy :set_re_resolve_on_matchless_links, :release_used_tags
###### Validations
@@ -493,16 +493,20 @@
# Logs to log.logilogi.org
#
- def loglog
+ def log_to_log_log
if GlobalConfig.use_log_log
- LogLogMessage.new(
- :kind => "Logi",
- :channels => [self.loglog_channel,
- self.creator.log_log_channel].join(','),
- :title => self.current_title,
- :author => self.creator.name,
- :text => self.current_snippet,
- :url => self.link.to_s)
+# begin
+ m = LogLogMessage.new(
+ :kind => "Logi",
+ :channel_names => ['logis',
+ 'u_' + self.creator.unix_name].join(','),
+ :title => self.current_title,
+ :author => self.creator.name,
+ :text => self.current_snippet,
+ :url => GlobalConfig.site_url + self.link.to_s)
+ m.save
+# rescue
+# end
end
end
Modified: trunk/app/models/notifier.rb
===================================================================
--- trunk/app/models/notifier.rb 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/app/models/notifier.rb 2009-07-26 22:12:40 UTC (rev 1540)
@@ -14,33 +14,45 @@
class Notifier < ActionMailer::Base
### Mailers
- def welcome(user, host)
+ def welcome(user)
subject "Welcome to LogiLogi.org " + user.name
from "LogiLogi Notifier <no...@lo...>"
recipients user.email
sent_on Time.now
- body :home_page_url => _hidden_logi_url(:ll_link_string => user.home_page_link.to_s, :host => host),
- :info_url => _hidden_logi_url(:ll_link_string => Tag.main_page, :host => host),
+ body :home_page_url => _hidden_logi_url(
+ :ll_link_string => user.home_page_link.to_s,
+ :host => GlobalConfig.site_host),
+ :info_url => _hidden_logi_url(
+ :ll_link_string => Tag.main_page,
+ :host => GlobalConfig.site_host),
:user_name => user.name,
:user => user
end
- def password_reset_instructions(user, host)
+ def password_reset_instructions(user)
subject "Password Reset Instructions"
from "LogiLogi Notifier <no...@lo...>"
recipients user.email
sent_on Time.now
- body :edit_password_reset_url => edit_password_reset_url(user.perishable_token, :host => host)
+ body :edit_password_reset_url => edit_password_reset_url(
+ user.perishable_token,
+ :host => GlobalConfig.site_host)
end
- def invitation(invitation, host)
- subject invitation.creator_user.name + " invites you to " + (invitation.role == Const::PeerGroupMembership::ADMIN ?
- "to become co-founder of" : "to join") + " the " + invitation.peer_group.name + " peergroup on LogiLogi.org"
+ def invitation(invitation)
+ subject invitation.creator_user.name + " invites you to " +
+ (invitation.role == Const::PeerGroupMembership::ADMIN ?
+ "to become co-founder of" : "to join") + " the " +
+ invitation.peer_group.name + " peergroup on LogiLogi.org"
from "LogiLogi Notifier <no...@lo...>"
recipients invitation.email
sent_on Time.now
- body :edit_invitation_url => edit_invitation_url(invitation.token, :host => host),
- :peer_group_url => _hidden_logi_url(:ll_link_string => invitation.peer_group.home_page_link.to_s, :host => host),
+ body :edit_invitation_url => edit_invitation_url(
+ invitation.token,
+ :host => GlobalConfig.site_host),
+ :peer_group_url => _hidden_logi_url(
+ :ll_link_string => invitation.peer_group.home_page_link.to_s,
+ :host => GlobalConfig.site_host),
:peer_group_name => invitation.peer_group.name,
:creator_user_name => invitation.creator_user.name,
:invitation => invitation
Modified: trunk/app/models/used_tag.rb
===================================================================
--- trunk/app/models/used_tag.rb 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/app/models/used_tag.rb 2009-07-26 22:12:40 UTC (rev 1540)
@@ -11,9 +11,6 @@
# (doc/LICENSE contains the full text of the legally binding license).
#++#
#
-# A difference is made between from_s and or_new_from_s to differentiate between
-# existing and non-existing words in the context of viewing details about a word.
-#
# Tags are never created or deleted directly by users.
class UsedTag < ActiveRecord::Base
@@ -76,7 +73,7 @@
end
end
- # Same as or_new_from_s, but raises an error if it does not exist.
+ # Same as or_new_from_tag, but raises an error if it does not exist.
#
def self.from_tag(tag)
u_t = UsedTag.or_nil_from_tag(tag)
@@ -87,7 +84,7 @@
end
end
- # Same as or_new_from_s, but returns nil if it does not exist.
+ # Same as or_new_from_tag, but returns nil if it does not exist.
#
def self.or_nil_from_tag(tag)
u_t = UsedTag.find_by_string(tag.to_s)
Modified: trunk/app/models/user.rb
===================================================================
--- trunk/app/models/user.rb 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/app/models/user.rb 2009-07-26 22:12:40 UTC (rev 1540)
@@ -136,25 +136,25 @@
### Methods
- def deliver_welcome!(host)
- Notifier.deliver_welcome(self, host)
+ def deliver_welcome!
+ Notifier.deliver_welcome(self)
end
# Getting
- # Used for abstraction & use with cloud helper
+ # Used for abstraction & use with cloud helper.
#
def use_count
return self.created_logis_count
end
- # Returns true if this user is the Anonymous user
+ # Returns true if this user is the Anonymous user.
#
def anonymous?
return self == User.anonymous
end
- # Returns true if this user is the Admin user
+ # Returns true if this user is the Admin user.
#
def admin?
return self == User.admin
@@ -166,11 +166,17 @@
return self.home_page_link_for(Tag.user)
end
+ # Returns the name of the user, but reduced and all lowercase.
+ #
+ def unix_name
+ self.name.downcase.gsub(/[\ .-]/,'_')
+ end
+
# Sending out e-mail
- def deliver_password_reset_instructions!(host)
+ def deliver_password_reset_instructions!
reset_perishable_token!
- Notifier.deliver_password_reset_instructions(self, host)
+ Notifier.deliver_password_reset_instructions(self)
end
### Filter-functions (some are public)
Modified: trunk/app/views/layouts/_head.html.erb
===================================================================
--- trunk/app/views/layouts/_head.html.erb 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/app/views/layouts/_head.html.erb 2009-07-26 22:12:40 UTC (rev 1540)
@@ -26,7 +26,7 @@
<body id="<%= @page_id %>" class="<%= @page_class %>">
<div id="reqs_notice">
<div class="description">
- <%= language_site_name_link + ' ' + _('needs Javascript enabled, and only works in %{url_pre}Firefox 3%{url_post}, and in Internet Explorer 7.<br />
+ <%= site_link + ' ' + _('needs Javascript enabled, and only works in %{url_pre}Firefox 3%{url_post}, and in Internet Explorer 7.<br />
So please enable javascript and/or %{url_pre}get Firefox%{url_post}.') % {:url_pre => '<a href="http://www.mozilla.com/firefox/">', :url_post => '</a>'} %>
</div>
<div class="soon">
Modified: trunk/app/views/layouts/_title_bar.html.erb
===================================================================
--- trunk/app/views/layouts/_title_bar.html.erb 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/app/views/layouts/_title_bar.html.erb 2009-07-26 22:12:40 UTC (rev 1540)
@@ -4,10 +4,10 @@
<a href="http://foundation.logilogi.org">The LogiLogi Foundation</a>
- <b>LogiLogi.org</b>
<% GlobalConfig.available_language_codes.each do |l_code| %>
- <% if l_code == site_language_code %>
+ <% if l_code == GlobalConfig.language_code %>
<b>[<%= l_code.camelcase %>]</b>
<% else %>
- <%= language_site_name_link(:text => '[' + l_code.camelcase + ']', :language => l_code) %>
+ <%= site_link(:text => '[' + l_code.camelcase + ']', :language => l_code) %>
<% end %>
<% end %>
</div>
@@ -18,7 +18,7 @@
</div>
<div id="logo">
<a href="/"><img src="/images/logo.png" alt="LogiLogi book logo" />
- <%= language_site_name_link(:length => 15) %>
+ <%= site_link(:length => 15) %>
</div>
<div id="version" title="The second version of LogiLogi, now in public beta">
Manta
Modified: trunk/app/views/logis/_list.html.erb
===================================================================
--- trunk/app/views/logis/_list.html.erb 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/app/views/logis/_list.html.erb 2009-07-26 22:12:40 UTC (rev 1540)
@@ -7,7 +7,7 @@
<div id="rating_current" class="rating">
<%= render :partial => 'rating_current', :locals => { :rating => logi.rating_for(current_prefs.peer_group) } %>
</div>
- <h1><%= logi_ll_link(logi, :show => :title, :length => 22) %></h1>
+ <h1><%= logi_ll_link(logi, :show => :title, :length => 28) %></h1>
<%= by_author(logi.creator) %>
<div class="spacer"></div>
</div>
@@ -20,7 +20,7 @@
<span class="rating_label"><%= _('Rating') %>:</span>
<%= render :partial => 'votes/score_bar', :locals => { :score => logi.rating_for(current_prefs.peer_group).score } %>
</div>
- <h1><%= logi_ll_link(logi, :show => :title, :length => 22) %></h1>
+ <h1><%= logi_ll_link(logi, :show => :title, :length => 28) %></h1>
<%= by_author(logi.creator) %>
<div class="spacer"></div>
</div>
Modified: trunk/app/views/logis/_navigation_bar_browse_header.html.erb
===================================================================
--- trunk/app/views/logis/_navigation_bar_browse_header.html.erb 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/app/views/logis/_navigation_bar_browse_header.html.erb 2009-07-26 22:12:40 UTC (rev 1540)
@@ -5,5 +5,6 @@
<%= render :partial => 'tag_list', :locals => {:name => 'browse_list',
:link => (current_context.nil? ? nil : current_context.link),
:url => browse_logis_url(:ll_link_string => ''),
+ :param_name => 'll_link_string',
:replace_string => ''} %>
<div class="spacer"></div>
Modified: trunk/app/views/logis/_snippet.html.erb
===================================================================
--- trunk/app/views/logis/_snippet.html.erb 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/app/views/logis/_snippet.html.erb 2009-07-26 22:12:40 UTC (rev 1540)
@@ -8,7 +8,7 @@
<span class="rating_label"><%= _('Rating') %>:</span>
<%= render :partial => 'votes/score_bar', :locals => { :score => logi.rating_for(current_prefs.peer_group).score } %>
</div>
- <h1><%= logi_ll_link(logi, :show => :title, :length => 40) %></h1>
+ <h1><%= logi_ll_link(logi, :show => :title, :length => 35) %></h1>
<%= by_author(logi.creator) %>
<div class="spacer"></div>
<p><%= logi.current_snippet %> <%= link_to _("...read on"), logi_url(logi.link) %></p>
Modified: trunk/app/views/logis/_tag_list.html.erb
===================================================================
--- trunk/app/views/logis/_tag_list.html.erb 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/app/views/logis/_tag_list.html.erb 2009-07-26 22:12:40 UTC (rev 1540)
@@ -14,5 +14,6 @@
<% end %>
<% javascript_tag do -%>
var <%= name %> = new TagList('<%= name %>', '<%= url %>',
- '<%= Tag.replace.to_s %>', '<%= Tag.untagged.to_s %>');
+ '<%= param_name %>', '<%= Tag.replace.to_s %>',
+ '<%= Tag.untagged.to_s %>');
<% end -%>
Modified: trunk/app/views/tags/_edit.html.erb
===================================================================
--- trunk/app/views/tags/_edit.html.erb 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/app/views/tags/_edit.html.erb 2009-07-26 22:12:40 UTC (rev 1540)
@@ -4,7 +4,8 @@
<div class="spacer"></div>
<%= render :partial => 'logis/tag_list', :locals => {:name => name + '_list',
:link => current_context.link,
- :url => check_logi_url(:controller => 'logis', :action => 'check', :name => name), :without_form => true} %>
+ :url => check_logi_url(:controller => 'logis', :action => 'check', :name => name),
+ :param_name => 'check_ll_link_string', :without_form => true} %>
<div class="spacer"></div>
<% end %><!-- end tags -->
<%= render :partial => 'logis/check', :locals => {:name => name} %>
Modified: trunk/app/views/users/new.html.erb
===================================================================
--- trunk/app/views/users/new.html.erb 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/app/views/users/new.html.erb 2009-07-26 22:12:40 UTC (rev 1540)
@@ -1,6 +1,6 @@
<div class="center_column">
<% render :layout => 'application/panel_with_header',
- :locals => {:title => _('Your account on') + ' ' + self.language_site_name } do %>
+ :locals => {:title => _('Your account on') + ' ' + GlobalConfig.site_host} do %>
<ul>
<li><%= _("Enter your full name, your email and a password") %></li>
<li><%= _("Or signup with OpenID") %></li>
Modified: trunk/config/config.rb.tmpl
===================================================================
--- trunk/config/config.rb.tmpl 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/config/config.rb.tmpl 2009-07-26 22:12:40 UTC (rev 1540)
@@ -2,22 +2,11 @@
HASH = {
###### Notice:
#
- # These settings are written to the Settings table in the database
- # the moment the database is created. Do NOT expect them to change
- # if you change them here after the db has been created.
+ # All settings are loaded into the database when it is created
+ # with db:initialize.
#
- ### The settings below are to be modified for most uses.
-
- # Affiliate id for MyOpenID
- #
- :my_openid_affiliate_id => 108,
+ ### The following settings can't be changed once the database is created.
- # LogLog, for logging events and RSS-feeds.
- #
- :use_log_log => false,
- :log_log_site => 'http://logi-manta.org:3001/app/enll',
- :log_log_api_key => 'Hidden',
-
# The admin-account
#
:admin_settings => {
@@ -26,16 +15,44 @@
:name => 'Admin User'
},
- # Sets the main_tag, e.g. the main-page.
+ # The tags
#
:main_page_tag_string => 'Logi_Logi',
+ :user_tag_string => 'User',
+ :user_group_tag_string => 'User_Group',
+ :peer_group_tag_string => 'Peer_Group',
+ :replace_tag_string => 'Replace_This_Tag',
+ :untagged_tag_string => 'Untagged',
+ :sandbox_tag_string => 'Sandbox',
+ :trash_can_tag_string => 'Trash_Can',
- # The Url-bar domain.
+ ### The settings below are to be modified for most uses. They can be
+ # updated in the database with 'rake config:update'
+
+ # Affiliate id for MyOpenID
#
+ :my_openid_affiliate_id => 108,
+
+ # LogLog, for logging events and RSS-feeds.
+ #
+ :use_log_log => false,
+ :log_log_site => 'http://logi-manta.org:3001/apps/enll',
+ :log_log_api_key => 'prBFU_oAhoG5eu6zlY2O',
+
+ # The protocol that should be used in links.
+ #
+ :protocol => 'http',
+
+ # The domain.
+ #
# The domain_levels setting is derived from this one.
#
:site_domain => 'edge.LogiLogi.org',
+ # The language this site is in.
+ #
+ :language_code => 'en',
+
# If you don't use en.domain.org style language-sub-domains
# set this to false.
#
@@ -101,17 +118,9 @@
:admin_power => 3.0,
### Don't change the settings below unless you know what you do.
+ # They don't need to be modified for normal use and they cannot be
+ # changed once the database is created.
- # The tags
- #
- :user_tag_string => 'User',
- :user_group_tag_string => 'User_Group',
- :peer_group_tag_string => 'Peer_Group',
- :replace_tag_string => 'Replace_This_Tag',
- :untagged_tag_string => 'Untagged',
- :sandbox_tag_string => 'Sandbox',
- :trash_can_tag_string => 'Trash_Can',
-
# The system-users (for more user-settings see LoginEngine below and
# the admin-settings above).
#
Modified: trunk/config/routes.rb
===================================================================
--- trunk/config/routes.rb 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/config/routes.rb 2009-07-26 22:12:40 UTC (rev 1540)
@@ -15,7 +15,7 @@
# For OpenID logins
map.resource :user_session,
:path_prefix => 'do'
- map.resources :changes, :searches, :password_resets,
+ map.resources :changes, :searches, :password_resets, :remote_users,
:path_prefix => 'do'
# Most logis-routes are derouted in application.rb
Added: trunk/config.ru
===================================================================
--- trunk/config.ru (rev 0)
+++ trunk/config.ru 2009-07-26 22:12:40 UTC (rev 1540)
@@ -0,0 +1,7 @@
+# Rack Dispatcher
+
+# Require your environment file to bootstrap Rails
+require File.dirname(__FILE__) + '/config/environment'
+
+# Dispatch the request
+run ActionController::Dispatcher.new
Added: trunk/db/migrate/20090726214545_global_config_host.rb
===================================================================
--- trunk/db/migrate/20090726214545_global_config_host.rb (rev 0)
+++ trunk/db/migrate/20090726214545_global_config_host.rb 2009-07-26 22:12:40 UTC (rev 1540)
@@ -0,0 +1,11 @@
+class GlobalConfigHost < ActiveRecord::Migration
+ def self.up
+ add_column :global_configs, :language_code, :string, :limit => 5, :null => false
+ add_column :global_configs, :protocol, :string, :limit => 8, :null => false
+ end
+
+ def self.down
+ remove_column :global_configs, :language_code
+ remove_column :global_configs, :protocol
+ end
+end
Modified: trunk/db/schema.rb
===================================================================
--- trunk/db/schema.rb 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/db/schema.rb 2009-07-26 22:12:40 UTC (rev 1540)
@@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20090718203605) do
+ActiveRecord::Schema.define(:version => 20090726214545) do
create_table "acts_as_xapian_jobs", :force => true do |t|
t.string "model", :null => false
@@ -35,41 +35,43 @@
end
create_table "global_configs", :force => true do |t|
- t.integer "progress", :default => 0, :null => false
- t.string "domain", :null => false
- t.integer "domain_levels", :null => false
- t.boolean "use_language_subdomains", :null => false
- t.integer "my_openid_affiliate_id", :null => false
- t.string "title_line", :null => false
- t.string "header_keywords", :null => false
- t.string "header_description", :null => false
- t.string "available_language_codes_string", :null => false
- t.integer "minimum_diff_size", :null => false
- t.integer "maximum_logi_size", :null => false
- t.integer "maximum_logi_version_size", :null => false
- t.integer "half_life", :null => false
+ t.integer "progress", :default => 0, :null => false
+ t.string "domain", :null => false
+ t.integer "domain_levels", :null => false
+ t.boolean "use_language_subdomains", :null => false
+ t.integer "my_openid_affiliate_id", :null => false
+ t.string "title_line", :null => false
+ t.string "header_keywords", :null => false
+ t.string "header_description", :null => false
+ t.string "available_language_codes_string", :null => false
+ t.integer "minimum_diff_size", :null => false
+ t.integer "maximum_logi_size", :null => false
+ t.integer "maximum_logi_version_size", :null => false
+ t.integer "half_life", :null => false
t.float "daily_fraction"
t.float "float"
- t.integer "powerless_age", :null => false
- t.float "anonymous_power", :null => false
- t.float "member_power", :null => false
- t.float "admin_power", :null => false
+ t.integer "powerless_age", :null => false
+ t.float "anonymous_power", :null => false
+ t.float "member_power", :null => false
+ t.float "admin_power", :null => false
t.integer "anonymous_user_id"
t.integer "admin_user_id"
t.integer "system_user_group_id"
t.integer "public_user_group_id"
t.integer "public_peer_group_id"
- t.string "main_page_tag_string", :null => false
- t.string "user_tag_string", :null => false
- t.string "user_group_tag_string", :null => false
- t.string "peer_group_tag_string", :null => false
- t.string "replace_tag_string", :null => false
- t.string "sandbox_tag_string", :null => false
- t.string "trash_can_tag_string", :null => false
- t.string "untagged_tag_string", :null => false
- t.boolean "use_log_log", :default => false, :null => false
+ t.string "main_page_tag_string", :null => false
+ t.string "user_tag_string", :null => false
+ t.string "user_group_tag_string", :null => false
+ t.string "peer_group_tag_string", :null => false
+ t.string "replace_tag_string", :null => false
+ t.string "sandbox_tag_string", :null => false
+ t.string "trash_can_tag_string", :null => false
+ t.string "untagged_tag_string", :null => false
+ t.boolean "use_log_log", :default => false, :null => false
t.string "log_log_site"
t.string "log_log_api_key"
+ t.string "language_code", :limit => 5, :null => false
+ t.string "protocol", :limit => 8, :null => false
end
create_table "invitations", :force => true do |t|
Modified: trunk/doc/README_FOR_APP
===================================================================
--- trunk/doc/README_FOR_APP 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/doc/README_FOR_APP 2009-07-26 22:12:40 UTC (rev 1540)
@@ -118,9 +118,8 @@
Copy the config.rb.tmpl to config.rb in the config dir, and change
settings as you see fit (usually no changes are needed, and for
-development no changes are recommended. Note that after loading the
-database changes have to be made to the GlobalConfig instance via
-the script/console, as the configuration is stored in the database).
+development no changes are recommended. Note that after initializing
+the database some settings cannot be changed anymore).
Copy the template database.yml.tmpl in the config dir to database.yml,
and add your database-username and -password. Making changes is only
Modified: trunk/lib/tasks/config.rake
===================================================================
--- trunk/lib/tasks/config.rake 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/lib/tasks/config.rake 2009-07-26 22:12:40 UTC (rev 1540)
@@ -3,9 +3,21 @@
task :initialize => :environment do
if GlobalConfig.find(:first).nil?
GlobalConfig.initial_to_db
+ else
+ raise 'Already initialized, now only some settings can be updated' +
+ ' with config:update'
end
end
+ desc "Updates the settings that can be updated to the database"
+ task :update => :environment do
+ if GlobalConfig.find(:first)
+ GlobalConfig.update_to_db
+ else
+ raise 'No config yet, use config:initialize instead'
+ end
+ end
+
desc "Dumps the global_configs database to yaml in test/fixtures"
task :dump => :environment do
path = ENV['DEST'] || "#{RAILS_ROOT}/test/fixtures"
Modified: trunk/public/dispatch.cgi
===================================================================
--- trunk/public/dispatch.cgi 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/public/dispatch.cgi 2009-07-26 22:12:40 UTC (rev 1540)
@@ -1,4 +1,4 @@
-#!/usr/bin/ruby1.8
+#!/usr/bin/env ruby
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
@@ -7,4 +7,4 @@
require "dispatcher"
ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
-Dispatcher.dispatch
\ No newline at end of file
+Dispatcher.dispatch
Modified: trunk/public/dispatch.fcgi
===================================================================
--- trunk/public/dispatch.fcgi 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/public/dispatch.fcgi 2009-07-26 22:12:40 UTC (rev 1540)
@@ -1,4 +1,4 @@
-#!/usr/bin/ruby1.8
+#!/usr/bin/env ruby
#
# You may specify the path to the FastCGI crash log (a log of unhandled
# exceptions which forced the FastCGI instance to exit, great for debugging)
Modified: trunk/public/dispatch.rb
===================================================================
--- trunk/public/dispatch.rb 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/public/dispatch.rb 2009-07-26 22:12:40 UTC (rev 1540)
@@ -1,4 +1,4 @@
-#!/usr/bin/ruby1.8
+#!/usr/bin/env ruby
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
@@ -7,4 +7,4 @@
require "dispatcher"
ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
-Dispatcher.dispatch
\ No newline at end of file
+Dispatcher.dispatch
Modified: trunk/public/javascripts/taglist.js
===================================================================
--- trunk/public/javascripts/taglist.js 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/public/javascripts/taglist.js 2009-07-26 22:12:40 UTC (rev 1540)
@@ -16,15 +16,16 @@
var TagList = Class.create({
// Constructors
- initialize: function(list_id, url, replace_string, untagged_string) {
+ initialize: function(list_id, url, param_name, replace_string, untagged_string) {
this.list_id = list_id;
this.list = $(list_id);
this.add_field = $(list_id + '_input');
this.hidden_field = $(list_id + '_string');
- this.url = url
- this.replace_string = this.empty_default(replace_string)
- this.empty_string = this.replace_string
- this.untagged_string = this.empty_default(untagged_string)
+ this.url = url;
+ this.param_name = param_name;
+ this.replace_string = this.empty_default(replace_string);
+ this.empty_string = this.replace_string;
+ this.untagged_string = this.empty_default(untagged_string);
this.register_button();
this.render_tags();
},
@@ -131,8 +132,8 @@
submit: function() {
new Ajax.Request(this.url, {
- asynchronous:true, evalScripts:true, method:'get',
- parameters:'check_ll_link_string=' + this.tags_string()}); return false;
+ asynchronous: true, evalScripts: true, method: 'get',
+ parameters: this.param_name + '=' + this.tags_string()}); return false;
},
// Rendering
Modified: trunk/test/unit/notifier_test.rb
===================================================================
--- trunk/test/unit/notifier_test.rb 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/test/unit/notifier_test.rb 2009-07-26 22:12:40 UTC (rev 1540)
@@ -26,15 +26,13 @@
def test_password_reset_instructions
u = users(:eduard_edison)
- h = "groovy.com"
- assert Notifier.create_password_reset_instructions(u, h)
+ assert Notifier.create_password_reset_instructions(u)
end
def test_invitation
i = invitations(:eduard_edison_biologers)
- h = "groovy.com"
- assert Notifier.create_invitation(i, h)
+ assert Notifier.create_invitation(i)
end
end
Modified: trunk/test/unit/user_test.rb
===================================================================
--- trunk/test/unit/user_test.rb 2009-07-21 14:28:44 UTC (rev 1539)
+++ trunk/test/unit/user_test.rb 2009-07-26 22:12:40 UTC (rev 1540)
@@ -143,6 +143,12 @@
assert_equal "Eduard_Edison/User", u.home_page_link.to_s
end
+ def test_reduced_name
+ u = User.new(:openid_identifier => 'http://the.pond.com',
+ :name => 'Kermit T.h.e F-rog', :email => 'le...@th...')
+ assert_equal 'kermit_t_h_e_f_rog', u.unix_name
+ end
+
def test_order_created_logis
u = users(:eduard_edison)
created_logis = u.created_logis.order_by_created_at(:limit => 2)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wy...@us...> - 2009-07-21 14:28:50
|
Revision: 1539
http://logilogi.svn.sourceforge.net/logilogi/?rev=1539&view=rev
Author: wybow
Date: 2009-07-21 14:28:44 +0000 (Tue, 21 Jul 2009)
Log Message:
-----------
Session store now daily cleaned, general maintenance task now
Modified Paths:
--------------
trunk/app/views/user_sessions/_method.html.erb
trunk/lib/tasks/db.rake
trunk/lib/tasks/server.rake
Modified: trunk/app/views/user_sessions/_method.html.erb
===================================================================
--- trunk/app/views/user_sessions/_method.html.erb 2009-07-21 13:33:31 UTC (rev 1538)
+++ trunk/app/views/user_sessions/_method.html.erb 2009-07-21 14:28:44 UTC (rev 1539)
@@ -17,7 +17,7 @@
<% else %>
<%= f.text_field :openid_identifier %>
<% end %>
- <%= f.check_box :remember_me, :label_class => 'behind' %>
+ <%= f.check_box :remember_me, :checked => true, :label_class => 'behind' %>
<%= f.submit _('Login') %>
<% end -%>
Modified: trunk/lib/tasks/db.rake
===================================================================
--- trunk/lib/tasks/db.rake 2009-07-21 13:33:31 UTC (rev 1538)
+++ trunk/lib/tasks/db.rake 2009-07-21 14:28:44 UTC (rev 1539)
@@ -124,6 +124,15 @@
end
end
+ namespace :sessions do
+ desc "Cleans out sessions older than 10 days"
+ task :clean => :environment do
+ ActiveRecord::Base.connection.execute(
+ "DELETE FROM #{session_table_name}" +
+ " WHERE updated_at < '#{10.days.ago.to_s(:db)}'")
+ end
+ end
+
### Helper functions
def insert_stuff(logi_data, kind)
Modified: trunk/lib/tasks/server.rake
===================================================================
--- trunk/lib/tasks/server.rake 2009-07-21 13:33:31 UTC (rev 1538)
+++ trunk/lib/tasks/server.rake 2009-07-21 14:28:44 UTC (rev 1539)
@@ -76,6 +76,16 @@
end
end
+ namespace :maintenance do
+ desc "Runs daily maintenance tasks, like backups, cleaning cache and" +
+ " sessions. Pass in options for sub-tasks"
+ task :daily do
+ Rake::Task["server:db:backup"].invoke
+ Rake::Task["pub:cache:clear"].invoke
+ Rake::Task["db:sessions:clean"].invoke
+ end
+ end
+
namespace :db do
desc "Backups the database, to be ran on the server"
task :backup => :environment do
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wy...@us...> - 2009-07-21 13:33:32
|
Revision: 1538
http://logilogi.svn.sourceforge.net/logilogi/?rev=1538&view=rev
Author: wybow
Date: 2009-07-21 13:33:31 +0000 (Tue, 21 Jul 2009)
Log Message:
-----------
Added backupdir for dbs and updated install scripts
Modified Paths:
--------------
trunk/config/config.rb.tmpl
trunk/lib/capistrano/logilogi.rb
trunk/lib/tasks/server.rake
Added Paths:
-----------
trunk/db/backup/
Modified: trunk/config/config.rb.tmpl
===================================================================
--- trunk/config/config.rb.tmpl 2009-07-20 21:01:49 UTC (rev 1537)
+++ trunk/config/config.rb.tmpl 2009-07-21 13:33:31 UTC (rev 1538)
@@ -15,8 +15,8 @@
# LogLog, for logging events and RSS-feeds.
#
:use_log_log => false,
- :log_log_site => 'http://logi-manta.org:3001/app/ll',
- :log_log_api_key => 'Bozzz',
+ :log_log_site => 'http://logi-manta.org:3001/app/enll',
+ :log_log_api_key => 'Hidden',
# The admin-account
#
Modified: trunk/lib/capistrano/logilogi.rb
===================================================================
--- trunk/lib/capistrano/logilogi.rb 2009-07-20 21:01:49 UTC (rev 1537)
+++ trunk/lib/capistrano/logilogi.rb 2009-07-21 13:33:31 UTC (rev 1538)
@@ -12,6 +12,7 @@
EXTRA_SHARED_DIRS = [
"tmp/sockets",
"db/search_index",
+ "db/backup",
"public/pub"
]
Modified: trunk/lib/tasks/server.rake
===================================================================
--- trunk/lib/tasks/server.rake 2009-07-20 21:01:49 UTC (rev 1537)
+++ trunk/lib/tasks/server.rake 2009-07-21 13:33:31 UTC (rev 1538)
@@ -78,15 +78,8 @@
namespace :db do
desc "Backups the database, to be ran on the server"
- task :backup_to_shared => :environment do
- Rake::Task["server:db:backup"].invoke
- Dir.chdir(File.join(RAILS_ROOT,"db"))
- sh "mv logilogi.sql ../../shared/db/logilogi.sql"
- end
-
- desc "Backups the database, to be ran on the server"
task :backup => :environment do
- Dir.chdir(File.join(RAILS_ROOT,"db"))
+ Dir.chdir(File.join(RAILS_ROOT,"db","backup"))
raise 'USER and PASSWORD must be set' if ENV['USER'].nil? or ENV['PASSWORD'].nil?
database = Rails::Configuration.new.database_configuration[RAILS_ENV]["database"]
sh "rm -f logilogi.sql"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wy...@us...> - 2009-07-20 21:01:54
|
Revision: 1537
http://logilogi.svn.sourceforge.net/logilogi/?rev=1537&view=rev
Author: wybow
Date: 2009-07-20 21:01:49 +0000 (Mon, 20 Jul 2009)
Log Message:
-----------
Another small bug fixed
Modified Paths:
--------------
trunk/app/models/global_config.rb
Modified: trunk/app/models/global_config.rb
===================================================================
--- trunk/app/models/global_config.rb 2009-07-20 20:54:09 UTC (rev 1536)
+++ trunk/app/models/global_config.rb 2009-07-20 21:01:49 UTC (rev 1537)
@@ -147,7 +147,12 @@
# Passes requests on to the object below
#
def self.method_missing(method, *args)
- GlobalConfig.find(:first).send(method, *args)
+ g_c = GlobalConfig.find(:first)
+ if g_c.nil?
+ return nil
+ else
+ return g_c.send(method, *args)
+ end
end
###### Methods
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wy...@us...> - 2009-07-20 20:54:16
|
Revision: 1536
http://logilogi.svn.sourceforge.net/logilogi/?rev=1536&view=rev
Author: wybow
Date: 2009-07-20 20:54:09 +0000 (Mon, 20 Jul 2009)
Log Message:
-----------
Fixed small bug causing the removal of stuff before ll marking
Modified Paths:
--------------
tools/t-llre/t-llre
Modified: tools/t-llre/t-llre
===================================================================
--- tools/t-llre/t-llre 2009-07-20 20:53:03 UTC (rev 1535)
+++ tools/t-llre/t-llre 2009-07-20 20:54:09 UTC (rev 1536)
@@ -75,7 +75,6 @@
VERSION = '0.5.0'
SPLITTER = "%ll:/"
- BASE_PATH = '.'
CONFIG_FILE = File.expand_path('~/.ll_remote')
attr_accessor :errors, :options
@@ -162,56 +161,59 @@
def run_app
puts "### Parsing" if @options.verbose
- absolute_tex_file = File.join(BASE_PATH, @options.filename)
contents = ''
- File.open(absolute_tex_file) do |f|
+ File.open(@options.filename) do |f|
contents = f.read
end
- parsed_logis, texts = self.parse_contents(contents)
+ parsed_logis, part_lines = self.parse_contents(contents)
check_errors("Not saved any logi")
puts "# Parsed all logis successfully" if @options.verbose
puts "### Processing" if @options.verbose
- texts = self.process_logis(parsed_logis, texts)
+ part_lines = self.process_logis(parsed_logis, part_lines)
puts "# Processed all logis successfully" if @options.verbose
- update_file(absolute_tex_file, texts)
+ update_file(@options.filename, part_lines)
end
def parse_contents(contents)
parts = contents.split(/^#{SPLITTER}/)
parsed_logis = []
- texts = []
+ part_lines = [parts[0].split("\n")]
parts[1..-1].each do |part|
- texts << part.split("\n")
+ part_lines << part.split("\n")
link, title, body = parse_part(part.dup)
parsed_logis << {:link => link,
:title => replace_latex(title, link),
:body => replace_latex(body, link)}
end
- return parsed_logis, texts
+ return parsed_logis, part_lines
end
- def process_logis(parsed_logis, texts)
+ def process_logis(parsed_logis, part_lines)
LLRemote.setup(:access_token => @options.api_token, :server_url => @options.server_url)
parsed_logis.each_with_index do |parsed, index|
l = LLRemote::Logi.new(parsed)
l.save
- texts[index][0] = SPLITTER + l.link
+ part_lines[index + 1][0] = SPLITTER + l.link
puts '# Processed: ' + l.link if @options.verbose
end
- return texts
+ return part_lines
end
- def update_file(absolute_tex_file, texts)
- contents = texts.collect {|t| t.join("\n")}.join("\n\n")
- File.open(absolute_tex_file, 'w') do |f|
+ def update_file(filename, part_lines)
+ if part_lines[0].join.empty?
+ # for cases with nothing before the ll
+ part_lines.shift
+ end
+ contents = part_lines.collect {|t| t.join("\n")}.join("\n\n").chomp
+ File.open(filename, 'w') do |f|
f.write(contents)
end
end
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wy...@us...> - 2009-07-20 20:53:05
|
Revision: 1535
http://logilogi.svn.sourceforge.net/logilogi/?rev=1535&view=rev
Author: wybow
Date: 2009-07-20 20:53:03 +0000 (Mon, 20 Jul 2009)
Log Message:
-----------
Removed stray puts
Modified Paths:
--------------
trunk/app/controllers/logis_controller.rb
Modified: trunk/app/controllers/logis_controller.rb
===================================================================
--- trunk/app/controllers/logis_controller.rb 2009-07-20 20:45:45 UTC (rev 1534)
+++ trunk/app/controllers/logis_controller.rb 2009-07-20 20:53:03 UTC (rev 1535)
@@ -113,7 +113,6 @@
end
def create
- puts request.headers
respond_to do |format|
format.html do
@logi, @logi_version = self.create_logi(params[:logi])
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|