[Logilogi-svn] SF.net SVN: logilogi:[1622] trunk
Status: Beta
Brought to you by:
wybow
|
From: <wy...@us...> - 2009-10-23 22:36:28
|
Revision: 1622
http://logilogi.svn.sourceforge.net/logilogi/?rev=1622&view=rev
Author: wybow
Date: 2009-10-23 22:36:19 +0000 (Fri, 23 Oct 2009)
Log Message:
-----------
Added preliminary paths, updatable via API
Modified Paths:
--------------
trunk/app/controllers/logis_controller.rb
trunk/app/helpers/application_helper.rb
trunk/app/models/logi.rb
trunk/app/views/layouts/_foot.html.erb
trunk/app/views/logis/_list.html.erb
trunk/app/views/logis/_side_menu.html.erb
trunk/config/routes.rb
trunk/public/images/logi_current.svg
trunk/public/stylesheets/logilogi.css
Added Paths:
-----------
trunk/app/controllers/paths_controller.rb
trunk/app/controllers/steps_controller.rb
trunk/app/views/logis/_paths.html.erb
trunk/app/views/logis/_steps.html.erb
trunk/app/views/paths/
trunk/app/views/paths/create.erb
trunk/app/views/paths/show.erb
Modified: trunk/app/controllers/logis_controller.rb
===================================================================
--- trunk/app/controllers/logis_controller.rb 2009-10-21 21:55:28 UTC (rev 1621)
+++ trunk/app/controllers/logis_controller.rb 2009-10-23 22:36:19 UTC (rev 1622)
@@ -21,7 +21,7 @@
before_filter :resolve_context, :page_name,
:except => [:check]
before_filter :find_logi_and_logi_version,
- : [:show, :edit, :remove, :update, :destroy, :toolbar_help]
+ : [:show, :edit, :update, :destroy]
### Constants
@@ -332,21 +332,28 @@
@selected = "comments_on"
elsif @logi.home_page?
@selected = "home_page"
+ elsif !@logi.steps.empty?
+ @selected = "paths"
else
@selected = "contending_logis"
end
end
- self.contending_logis
+ self.side_menu_selected
end
- def contending_logis
+ def side_menu_selected
+ if @selected == "paths"
+ @path = @logi.steps.first.path
+ end
render_ajax_body :partial => 'side_menu.html.erb', :locals => {
:selected => @selected}
end
- alias :home_page :contending_logis
- alias :comments_on :contending_logis
- alias :incoming_links :contending_logis
+ alias :contending_logis :side_menu_selected
+ alias :home_page :side_menu_selected
+ alias :comments_on :side_menu_selected
+ alias :incoming_links :side_menu_selected
+ alias :paths :side_menu_selected
def activity
case @logi.kind
Added: trunk/app/controllers/paths_controller.rb
===================================================================
--- trunk/app/controllers/paths_controller.rb (rev 0)
+++ trunk/app/controllers/paths_controller.rb 2009-10-23 22:36:19 UTC (rev 1622)
@@ -0,0 +1,50 @@
+#--#
+# 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 PathsController < ApplicationController
+ ### Filters
+
+ before_filter :find,
+ : [:show, :destroy]
+
+ ### REST-methods
+
+ def show
+ respond_to do |format|
+ format.xml { render :xml => @path }
+ end
+ end
+
+ def create
+ path = Path.new(:user => current_user)
+
+ if !current_user.anonymous? and path.save
+ render :xml => path, :status => :created,
+ :location => path
+ else
+ render :xml => path.errors, :status => :unprocessable_entity
+ end
+ end
+
+ def destroy
+ @path.destroy
+
+ head :ok
+ end
+
+ ### Filter-functions
+
+ def find
+ @path = Path.find_by_id(params[:id])
+ end
+end
Added: trunk/app/controllers/steps_controller.rb
===================================================================
--- trunk/app/controllers/steps_controller.rb (rev 0)
+++ trunk/app/controllers/steps_controller.rb 2009-10-23 22:36:19 UTC (rev 1622)
@@ -0,0 +1,35 @@
+#--#
+# 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 StepsController < ApplicationController
+ ### REST-methods
+
+ def create
+ s_params = params[:step].dup
+ if s_params[:logi_link]
+ l = Link.new_from_s(s_params.delete(:logi_link))
+ l.resolve
+ s_params[:logi] = l.to_logi
+ end
+ s_params[:path] = Path.find_by_id(s_params[:path][:id])
+
+ step = Step.new(s_params)
+
+ if !current_user.anonymous? and step.save
+ render :xml => step, :status => :created,
+ :location => step
+ else
+ render :xml => step.errors, :status => :unprocessable_entity
+ end
+ end
+end
Modified: trunk/app/helpers/application_helper.rb
===================================================================
--- trunk/app/helpers/application_helper.rb 2009-10-21 21:55:28 UTC (rev 1621)
+++ trunk/app/helpers/application_helper.rb 2009-10-23 22:36:19 UTC (rev 1622)
@@ -95,7 +95,10 @@
: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?}])
+ :disabled => logi.comments_on_logis.empty?},
+ {:text => _("Path"), :name => "paths",
+ :description => _("This logi is part of a read-path"),
+ :disabled => logi.steps.empty?}])
end
tabs.concat([
Modified: trunk/app/models/logi.rb
===================================================================
--- trunk/app/models/logi.rb 2009-10-21 21:55:28 UTC (rev 1621)
+++ trunk/app/models/logi.rb 2009-10-23 22:36:19 UTC (rev 1622)
@@ -331,7 +331,7 @@
# Returns a smaller version of the current snippet.
#
def current_tiny_snippet
- return self.current_snippet[0..150]
+ return LogiVersion.chop_body(self.current_snippet, 150)
end
# Returns all things that are inserted in this logi.
Modified: trunk/app/views/layouts/_foot.html.erb
===================================================================
--- trunk/app/views/layouts/_foot.html.erb 2009-10-21 21:55:28 UTC (rev 1621)
+++ trunk/app/views/layouts/_foot.html.erb 2009-10-23 22:36:19 UTC (rev 1622)
@@ -13,6 +13,8 @@
'corner_size' : 16});
mcorners.add('div.side_column div.logi_current', {
'image' : 'logi_current.svg', 'corner_size' : 32});
+ mcorners.add('div.side_column div.step_current', {
+ 'image' : 'logi_current.svg', 'corner_size' : 32});
mcorners.add('div.border_panel', {
'corner_size' : 16});
mcorners.add('div.secondary_border_panel', {
Modified: trunk/app/views/logis/_list.html.erb
===================================================================
--- trunk/app/views/logis/_list.html.erb 2009-10-21 21:55:28 UTC (rev 1621)
+++ trunk/app/views/logis/_list.html.erb 2009-10-23 22:36:19 UTC (rev 1622)
@@ -1,5 +1,4 @@
<% logis[0...3].each do |logi| %>
- <% logi_version = logi.current_logi_version %>
<% if current_logi == logi %>
<div class="logi logi_current snippet">
<div class="panel_content_padding">
Added: trunk/app/views/logis/_paths.html.erb
===================================================================
--- trunk/app/views/logis/_paths.html.erb (rev 0)
+++ trunk/app/views/logis/_paths.html.erb 2009-10-23 22:36:19 UTC (rev 1622)
@@ -0,0 +1,7 @@
+<div id="contenders_padding">
+ <div class="path">
+ <%= render :partial => 'steps', :locals => {:steps => @path.steps,
+ :current_logi => @logi} %>
+ </div>
+ <div class="spacer"></div>
+</div>
Modified: trunk/app/views/logis/_side_menu.html.erb
===================================================================
--- trunk/app/views/logis/_side_menu.html.erb 2009-10-21 21:55:28 UTC (rev 1621)
+++ trunk/app/views/logis/_side_menu.html.erb 2009-10-23 22:36:19 UTC (rev 1622)
@@ -6,14 +6,17 @@
<% render :layout => 'application/panel_with_tabs_ajax', :locals => {
:tabs => tabs, :selected => selected, :id => "contenders",
:update_selected => true} do %>
- <% if selected == "home_page" %>
+ <% case selected
+ when "home_page" %>
<%= render :partial => 'home_page', :locals => {
:contender_logis => current_context.contending_logis} %>
- <% elsif selected == "contending_logis"%>
+ <% when "contending_logis"%>
<%= render :partial => 'contending_logis', :locals => {
:contender_logis => current_context.contending_logis} %>
- <% elsif selected == "comments_on"%>
+ <% when "comments_on"%>
<%= render :partial => 'comments_on' %>
+ <% when "paths"%>
+ <%= render :partial => 'paths' %>
<% else %>
<div class="panel_content_padding">
<%= render :partial => "incoming_links", :locals => {
Added: trunk/app/views/logis/_steps.html.erb
===================================================================
--- trunk/app/views/logis/_steps.html.erb (rev 0)
+++ trunk/app/views/logis/_steps.html.erb 2009-10-23 22:36:19 UTC (rev 1622)
@@ -0,0 +1,18 @@
+<% steps.each do |step| %>
+ <% if current_logi == step.logi %>
+ <div class="step step_current">
+ <div class="panel_content_padding">
+ <div class="level<%= step.level %>">
+ <%= logi_ll_link(step.logi, :show => :title, :length => 28) %>
+ </div>
+ <div class="spacer"></div>
+ </div>
+ </div>
+ <% else %>
+ <div class="step">
+ <div class="level<%= step.level %>">
+ <%= logi_ll_link(step.logi, :show => :title, :length => 28) %>
+ </div>
+ </div>
+ <% end %>
+<% end %>
Modified: trunk/config/routes.rb
===================================================================
--- trunk/config/routes.rb 2009-10-21 21:55:28 UTC (rev 1621)
+++ trunk/config/routes.rb 2009-10-23 22:36:19 UTC (rev 1622)
@@ -40,7 +40,7 @@
:requirements => { :ll_link_string => /.*/ }
map.resources :users, :peer_group_admin_memberships, :peer_group_memberships,
:user_groups, :prefs_profiles, :invitations, :votes, :remarks, :comments, :links,
- :ratings,
+ :ratings, :paths, :steps,
:path_prefix => 'do'
map.resources :peer_groups,
:path_prefix => 'do', :has_many => :invitations, :shallow => true
Modified: trunk/public/images/logi_current.svg
===================================================================
--- trunk/public/images/logi_current.svg 2009-10-21 21:55:28 UTC (rev 1621)
+++ trunk/public/images/logi_current.svg 2009-10-23 22:36:19 UTC (rev 1622)
@@ -9,7 +9,7 @@
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="600"
- height="250"
+ height="400"
id="svg3408"
sodipodi:version="0.32"
inkscape:version="0.46"
@@ -36,16 +36,16 @@
objecttolerance="10"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="2.8"
- inkscape:cx="7.4994602"
- inkscape:cy="59.137498"
+ inkscape:zoom="0.49497475"
+ inkscape:cx="378.51359"
+ inkscape:cy="-4.3343864"
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="21" />
+ inkscape:window-height="689"
+ inkscape:window-x="50"
+ inkscape:window-y="27" />
<metadata
id="metadata3413">
<rdf:RDF>
@@ -63,23 +63,23 @@
id="layer1">
<path
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1"
- d="M 22.223355,20.027858 L 20.20305,231.47461 C 3.4092641,233.76003 3.5412179,251.18367 3.3903409,251.19364 L -5.3033015,251.76777 L -7.8286825,-0.93280778 L 2.7112706,-1.1285743 C 3.0846784,-1.1355099 0.47131877,13.672814 22.223355,20.027858 z"
+ d="M 22.223355,20.027858 L 20.20305,381.47461 C 3.4092641,383.76003 3.5412183,401.18368 3.3903409,401.19364 L -5.3033015,401.76777 L -7.8286825,-0.93280778 L 2.7112706,-1.1285743 C 3.0846784,-1.1355099 0.47131877,13.672814 22.223355,20.027858 z"
id="rect4229"
sodipodi:nodetypes="ccsccsc" />
<path
style="fill:#ffffff;fill-opacity:1;stroke:#55679e;stroke-width:3.99999952;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1"
- d="M 17.999999,18 L 582,18 C 590.864,18 598,25.136001 598,34.000002 L 598,216 C 598,224.864 590.864,232 582,232 L 17.999999,232"
+ d="M 17.999999,18 L 582,18 C 590.864,18 598,25.136001 598,34.000002 L 598,366 C 598,374.864 590.864,382 582,382 L 17.999999,382"
id="rect4199"
sodipodi:nodetypes="cccccc" />
<path
- style="fill:none;fill-opacity:1;stroke:#55679e;stroke-width:3.99999951999999981;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1"
- d="M 3.0714284,251.01015 L 3.0714284,248 C 3.0714284,239.136 10.207428,232 19.071428,232 L 482,232"
+ style="fill:none;fill-opacity:1;stroke:#55679e;stroke-width:3.99999952;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 3.0714284,401.01 L 3.0714284,397.99985 C 3.0714284,389.13585 10.207428,381.99985 19.071428,381.99985 L 482,381.99985"
id="rect4201"
sodipodi:nodetypes="cccc" />
<path
sodipodi:nodetypes="cccc"
id="path4207"
d="M 3.0714284,-1.5152288 L 3.0714284,2 C 3.0714284,10.864 10.207428,18 19.071428,18 L 482,18"
- style="fill:none;fill-opacity:1;stroke:#55679e;stroke-width:3.99999951999999981;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1" />
+ style="fill:none;fill-opacity:1;stroke:#55679e;stroke-width:3.99999952;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1" />
</g>
</svg>
Modified: trunk/public/stylesheets/logilogi.css
===================================================================
--- trunk/public/stylesheets/logilogi.css 2009-10-21 21:55:28 UTC (rev 1621)
+++ trunk/public/stylesheets/logilogi.css 2009-10-23 22:36:19 UTC (rev 1622)
@@ -201,7 +201,8 @@
white-space: nowrap;
display: block;
}
-.logi_current .content_padding {
+.logi_current .content_padding,
+.step_current .content_padding {
display: block;
}
.border_panel .panel_content_padding,
@@ -253,6 +254,23 @@
padding-left: 0.2em;
list-style: none;
}
+.panel div.step div.level1,
+.panel div.step div.level2 {
+ font-family: "Times New Roman", Times, serif;
+ line-height: 1em;
+}
+.panel div.step div.level1 {
+ padding-left: 0.5em;
+ font-size: 1.8em;
+ padding-top: 0.3em;
+ padding-bottom: 0.3em;
+}
+.panel div.step div.level2 {
+ padding-left: 1.5em;
+ font-size: 1.4em;
+ padding-top: 0.5em;
+ padding-bottom: 0.5em;
+}
/* panels with tabs */
@@ -754,10 +772,20 @@
height: 7em;
margin: -16px 0px -0.4em -18px;
}
+#paths .step_current {
+ padding: 20px 0 20px 2.6em;
+ height: 2.6em;
+ margin: -20px 0px -18px -30px;
+}
#home_page .logi_current .panel_content_padding,
#contending_logis .logi_current .panel_content_padding {
padding-right: 1.2em;
}
+#paths .step .panel_content_padding {
+ padding-top: 0em;
+ padding-bottom: 0.3em;
+ padding-left: 0em;
+}
#home_page .logi .author,
#contending_logis .logi .author {
padding: 0 0 0 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|