<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>db/migrate/20080930171605_prepare_for_kansai01.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -18,7 +18,7 @@ class Admin::EventsController &lt; AdminController
 
   def new
     @event = Event.new
-
+    @event.capacity = 0
     respond_to do |format|
       format.html
     end</diff>
      <filename>app/controllers/admin/events_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,17 @@
 # -*- coding: utf-8 -*-
 module EventsHelper
   def render_registration_link
+    if @event.single_day?
       content_tag :div, :class =&gt; &quot;registration_link&quot; do
-      if @event.registration_enabled?
-        link_to('&#12501;&#12457;&#12540;&#12512;&#12363;&#12425;&#21442;&#21152;&#30331;&#37682;&#12434;&#12377;&#12427;', :action =&gt; 'registration')
-      else
-        message_for_retgistration_is_closed
+        if @event.registration_enabled?
+          link_to('&#12501;&#12457;&#12540;&#12512;&#12363;&#12425;&#21442;&#21152;&#30331;&#37682;&#12434;&#12377;&#12427;', :action =&gt; 'registration')
+        else
+          message_for_retgistration_is_closed
+        end
+      end
+    else
+      content_tag :div, :class =&gt; &quot;registration_external&quot; do
+        render_hiki(@event.register_information)
       end
     end
   end
@@ -15,4 +21,12 @@ module EventsHelper
       &quot;&#21442;&#21152;&#30331;&#37682;&#12398;&#21463;&#20184;&#12399;&#32066;&#20102;&#12375;&#12414;&#12375;&#12383;&quot;
     end
   end
+
+  def dates_of(event)
+    if event.single_day?
+      event.start_on.strftime(&quot;%Y-%m-%d(%a)&quot;)
+    else
+      &quot;#{event.start_on.strftime(&quot;%Y-%m-%d(%a)&quot;)}&#12316;#{event.end_on.strftime('%m-%d(%a)')}&quot;
+    end
+  end
 end</diff>
      <filename>app/helpers/events_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,19 +3,19 @@ class Event &lt; ActiveRecord::Base
   has_many :attendees
 
   named_scope :upcomings, lambda {
-    {:conditions =&gt; [&quot;force_disabled = ? and scheduled_on &gt; ?&quot;,
+    {:conditions =&gt; [&quot;force_disabled = ? and start_on &gt; ?&quot;,
         false, Date.today],
-      :order =&gt; &quot;scheduled_on DESC&quot;}
+      :order =&gt; &quot;start_on DESC&quot;}
   }
   named_scope :archives, lambda {
-    {:conditions =&gt; [&quot;force_disabled = ? and publish_at &lt;= ? and scheduled_on &lt; ?&quot;,
+    {:conditions =&gt; [&quot;force_disabled = ? and publish_at &lt;= ? and end_on &lt; ?&quot;,
         false, DateTime.now, Date.today],
-     :order =&gt; &quot;scheduled_on&quot;}
+     :order =&gt; &quot;end_on&quot;}
   }
 
   validates_uniqueness_of :name
   validates_format_of :name, :with =&gt; /[a-z]+\d+/, :message =&gt; &quot;&#12399;&#12289;&#38283;&#20652;&#22580;&#25152;&#12450;&#12523;&#12501;&#12449;&#12505;&#12483;&#12488;&#21517;&#12395;&#25968;&#23383;&#12434;&#21152;&#12360;&#12383;&#12418;&#12398;(&#20363;:tokyo01)&#12395;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;&quot;
-  validates_presence_of :title, :scheduled_on, :contact_email, :official_tag
+  validates_presence_of :name, :title, :start_on, :end_on, :contact_email, :official_tag
   validates_numericality_of :capacity, :only_integer =&gt; true
 
   def registration_enabled?
@@ -27,13 +27,17 @@ class Event &lt; ActiveRecord::Base
   end
 
   def expired?
-    scheduled_on &lt; Date.today
+    end_on &lt; Date.today
   end
 
   def published?
     publish_at &lt;= DateTime.now
   end
 
+  def single_day?
+    start_on == end_on
+  end
+
   private
   def attendees_count
     attendees.count</diff>
      <filename>app/models/event.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,12 @@
 URL&#12392;&#12375;&#12390;&#20351;&#12358;&#21517;&#21069;: &lt;%= form.text_field :name %&gt;&lt;br /&gt;
 (&#20363; http://regional.rubykaigi.org/&lt;strong&gt;tokyo01&lt;/strong&gt;)&lt;br /&gt;
 &#12452;&#12505;&#12531;&#12488;&#12398;&#12479;&#12452;&#12488;&#12523;: &lt;%= form.text_field :title %&gt;&lt;br /&gt;
-&#12452;&#12505;&#12531;&#12488;&#12398;&#38283;&#20652;&#26085;: &lt;%= form.text_field :scheduled_on %&gt;
+&lt;/p&gt;
+&lt;p&gt;
+&#12452;&#12505;&#12531;&#12488;&#12398;&#20250;&#26399;:&lt;br /&gt;
+&#38283;&#22987;&#26085;:&lt;%= form.text_field :start_on %&gt;&lt;br /&gt;
+&#32066;&#20102;&#26085;:&lt;%= form.text_field :end_on %&gt;&lt;br /&gt;
+(&#21336;&#26085;&#38283;&#20652;&#12398;&#22580;&#21512;&#12399;&#12289;&#38283;&#22987;&#26085;&#12392;&#32066;&#20102;&#26085;&#12434;&#21516;&#12376;&#26085;&#12395;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;)
 &lt;/p&gt;
 
 &lt;p&gt;
@@ -10,12 +15,36 @@ URL&#12392;&#12375;&#12390;&#20351;&#12358;&#21517;&#21069;: &lt;%= form.text_field :name %&gt;&lt;br /&gt;
 &#20844;&#24335;&#12479;&#12464;: &lt;%= form.text_field :official_tag %&gt;&lt;br /&gt;
 &lt;/p&gt;
 
+&lt;p&gt;
+&#12454;&#12455;&#12502;&#12506;&#12540;&#12472;&#12434;&#20844;&#38283;&#12377;&#12427;&#26085;&#26178;: &lt;%= form.datetime_select :publish_at, {:start_year =&gt; Date.today.year, :use_month_numbers =&gt; true, :minute_step =&gt; 15} %&gt;&lt;br /&gt;
+(&#12371;&#12371;&#12391;&#25351;&#23450;&#12375;&#12383;&#26085;&#26178;&#12434;&#36942;&#12366;&#12427;&#12392;&#12289;&#12488;&#12483;&#12503;&#12506;&#12540;&#12472;&#12363;&#12425;&#12452;&#12505;&#12531;&#12488;&#20491;&#21029;&#12398;&#12506;&#12540;&#12472;&#12408;&#12398;&#12522;&#12531;&#12463;&#12364;&#26377;&#21177;&#12395;&#12394;&#12426;&#12414;&#12377;)
+&lt;/p&gt;
+&lt;p&gt;
+&lt;%= form.label :force_disabled, '&#12452;&#12505;&#12531;&#12488;&#12434;&#28961;&#21177;&#12395;&#12377;&#12427;:&amp;nbsp;' %&gt;&lt;%= form.check_box :force_disabled %&gt;&lt;br /&gt;
+(&#12371;&#12398;&#12481;&#12455;&#12483;&#12463;&#12508;&#12483;&#12463;&#12473;&#12434;ON&#12395;&#12377;&#12427;&#12392;&#12289;&#19968;&#33324;&#12398;&#38322;&#35239;&#32773;&#12363;&#12425;&#12399;&#12452;&#12505;&#12531;&#12488;&#12398;&#23384;&#22312;&#12364;&#35211;&#12360;&#12394;&#12367;&#12394;&#12426;&#12414;&#12377;)
+&lt;/p&gt;
+
+
+&lt;p&gt;&#30003;&#12375;&#36796;&#12415;&#30331;&#37682;&#12398;&#35373;&#23450;:
+
+&lt;fieldset id=&quot;register_builtin&quot;&gt;
+&lt;legend&gt;&lt;%= form.radio_button :use_builtin_registration, true %&gt;&lt;label for=&quot;event_use_builtin_registration_true&quot;&gt;&amp;nbsp;regional.rubykaigi.org&#25552;&#20379;&#12398;&#30331;&#37682;&#12501;&#12457;&#12540;&#12512;&#12434;&#21033;&#29992;&#12377;&#12427;&lt;/label&gt;&lt;/legend&gt;
+&lt;p&gt;
 &#21442;&#21152;&#30331;&#37682;&#12398;&#23450;&#21729;: &lt;%= form.text_field :capacity, :size =&gt; 5 %&gt;&amp;nbsp; &lt;%= form.check_box :notify_email_enabled %&gt;&lt;%=form.label :notify_email_enabled, '&amp;nbsp;&#30331;&#37682;&#12373;&#12428;&#12383;&#12425;&#12513;&#12540;&#12523;&#12391;&#36890;&#30693;&#12377;&#12427;' %&gt;
 &lt;/p&gt;
+&lt;/fieldset&gt;
+
+&lt;/p&gt;
+
+
+&lt;fieldset id=&quot;register_external&quot;&gt;
+&lt;legend&gt;&lt;%= form.radio_button :use_builtin_registration, false %&gt;&lt;label for=&quot;event_use_builtin_registration_false&quot;&gt;&#22806;&#37096;&#12398;&#12469;&#12452;&#12488;&#12394;&#12393;&#12434;&#21033;&#29992;&#12377;&#12427;&lt;/legend&gt;
 &lt;p&gt;
-&#12454;&#12455;&#12502;&#12506;&#12540;&#12472;&#12434;&#20844;&#38283;&#12377;&#12427;&#26085;&#26178;: &lt;%= form.datetime_select :publish_at, {:start_year =&gt; Date.today.year, :use_month_numbers =&gt; true, :minute_step =&gt; 15} %&gt; &lt;br /&gt;
-&lt;%= form.label :force_disabled, '&#28961;&#21177;:&amp;nbsp;' %&gt;&lt;%= form.check_box :force_disabled %&gt;
+&#12452;&#12505;&#12531;&#12488;&#12395;&#30331;&#37682;&#12375;&#12383;&#12356;&#12518;&#12540;&#12470;&#12399;&#12393;&#12358;&#12377;&#12428;&#12400;&#12424;&#12356;&#12398;&#12363;&#12289;&#35500;&#26126;&#12434;&#26360;&#12356;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;&lt;br /&gt;
+&#20363;&#12360;&#12400;&#12289;&#30003;&#12375;&#36796;&#12415;&#12506;&#12540;&#12472;&#12398;URL&#12392;&#12381;&#12398;&#35500;&#26126;&#12394;&#12393;&#12364;&#12405;&#12373;&#12431;&#12375;&#12356;&#12391;&#12375;&#12423;&#12358;(&lt;%= link_to_hikidoc %&gt;):
+&lt;%= form.text_area :register_information, :cols =&gt; 75, :rows =&gt; 5 %&gt;
 &lt;/p&gt;
+&lt;/fieldset&gt;
 
 &lt;p&gt;
 &#12452;&#12505;&#12531;&#12488;&#38283;&#20652;&#32716;&#26085;&#20197;&#38477;&#12395;&#34920;&#31034;&#12377;&#12427;&#12513;&#12483;&#12475;&#12540;&#12472;(&lt;%= link_to_hikidoc %&gt;):&lt;br /&gt;
@@ -37,6 +66,7 @@ URL&#12392;&#12375;&#12390;&#20351;&#12358;&#21517;&#21069;: &lt;%= form.text_field :name %&gt;&lt;br /&gt;
       $.datepicker.parseDate('yy-mm-dd', $(id).val()));
       $(id).datepicker({dateFormat: 'yy-mm-dd'})
     };
-    initDatePicker(&quot;#event_scheduled_on&quot;);
+    initDatePicker(&quot;#event_start_on&quot;);
+    initDatePicker(&quot;#event_end_on&quot;);
   });
 &lt;/script&gt;</diff>
      <filename>app/views/admin/events/_form.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-&lt;h1&gt;Editing event&lt;/h1&gt;
+&lt;h2&gt;&#22320;&#22495;Ruby&#20250;&#35696;&#12398;&#24773;&#22577;&#12434;&#32232;&#38598;&#12377;&#12427;&lt;/h2&gt;
 
 &lt;p&gt;&lt;%= link_to '&#21442;&#21152;&#30331;&#37682;&#32773;&#12398;&#19968;&#35239;', admin_event_attendees_path(@event) %&gt;&lt;/p&gt;
 </diff>
      <filename>app/views/admin/events/edit.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-&lt;h1&gt;&#26032;&#35215;&#12452;&#12505;&#12531;&#12488;&lt;/h1&gt;
+&lt;h2&gt;&#26032;&#12375;&#12367;&#22320;&#22495;Ruby&#20250;&#35696;&#12434;&#38283;&#20652;&#12377;&#12427;&lt;/h2&gt;
 
 &lt;% form_for(@event, :url =&gt; {:action =&gt; &quot;create&quot;}) do |f| %&gt;
   &lt;%= f.error_messages %&gt;</diff>
      <filename>app/views/admin/events/new.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,7 @@
 &lt;ul&gt;
 &lt;% unless @upcomings.blank? -%&gt;
   &lt;% @upcomings.each do |event| -%&gt;
-    &lt;li&gt;&lt;%=h event.scheduled_on.to_s(:index) %&gt;:&amp;nbsp;&lt;span class=&quot;event_name&quot;&gt;&lt;%= link_to_if event.published?, h(event.title), event_path(:action =&gt; 'show', :name =&gt; event.name) %&gt;&lt;/span&gt;
+    &lt;li&gt;&lt;%=h(dates_of(event)) %&gt;:&amp;nbsp;&lt;span class=&quot;event_name&quot;&gt;&lt;%= link_to_if event.published?, h(event.title), event_path(:action =&gt; 'show', :name =&gt; event.name) %&gt;&lt;/span&gt;
 	  &lt;%# TODO duplicated %&gt;
 	  &lt;% if logged_in_as_admin? -%&gt;
 	  &amp;nbsp;&lt;span class=&quot;admin_event_edit&quot;&gt;&lt;%= link_to  '&#32232;&#38598;', edit_admin_event_path(event) %&gt;&lt;/span&gt;
@@ -20,7 +20,7 @@
 &lt;h2&gt;&#36942;&#21435;&#12398;&#22320;&#22495;Ruby&#20250;&#35696;&lt;/h2&gt;
 &lt;ul&gt;
 &lt;% @archives.each do |event| -%&gt;
-&lt;li&gt;&lt;%=h event.scheduled_on.to_s(:index) %&gt;:&amp;nbsp;&lt;%= link_to h(event.title), url_for(:action =&gt; 'show', :name =&gt; event.name) %&gt;
+&lt;li&gt;&lt;%=h(dates_of(event)) %&gt;:&amp;nbsp;&lt;%= link_to h(event.title), url_for(:action =&gt; 'show', :name =&gt; event.name) %&gt;
 	  &lt;%# TODO duplicated %&gt;
 	  &lt;% if logged_in_as_admin? -%&gt;
 	  &amp;nbsp;&lt;span class=&quot;admin_event_edit&quot;&gt;&lt;%= link_to  '&#32232;&#38598;', edit_admin_event_path(event) %&gt;&lt;/span&gt;
@@ -35,7 +35,7 @@
 &lt;li&gt;&lt;%= link_to '&#22320;&#22495;Ruby&#20250;&#35696;&#12434;&#26032;&#12375;&#12367;&#38283;&#20652;&#12377;&#12427;', new_admin_event_path %&gt;&lt;/li&gt;
 &lt;/ul&gt;
 &lt;ul&gt;
-&lt;li&gt;&lt;%= link_to '&#22320;&#22495;Ruby&#20250;&#35696;&#12398;&#31649;&#29702;&#29992;&#12513;&#12491;&#12517;&#12540;', admin_events_path %&gt;&lt;/li&gt;
+&lt;li&gt;&lt;%= link_to '&#22320;&#22495;Ruby&#20250;&#35696;&#12398;&#19968;&#35239;', admin_events_path %&gt;&lt;/li&gt;
 &lt;li&gt;&lt;%= link_to '&#12518;&#12540;&#12470;(&#12392;&#12356;&#12358;&#12363;&#31649;&#29702;&#32773;)&#12398;&#19968;&#35239;', admin_users_path %&gt;&lt;/li&gt;
 &lt;/ul&gt;
 &lt;% end -%&gt;</diff>
      <filename>app/views/events/index.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,16 @@
 Factory.define :tokyo01, :class =&gt; Event do |e|
   e.name 'tokyo01'
   e.title '&#26481;&#20140;Ruby&#20250;&#35696;01'
+  e.official_tag &quot;tokyorubykaigi01&quot;
+  e.contact_email &quot;tokyo01@rubykaigi.org&quot;
+  e.start_on Date.parse(&quot;2008-08-20&quot;)
+  e.end_on Date.parse(&quot;2008-08-20&quot;)
   e.capacity 100
-  e.scheduled_on Date.parse(&quot;2008-08-20&quot;)
   e.publish_at DateTime.parse(&quot;2008-08-13 12:00:00&quot;)
 end
+
+Factory.define :kansai01, :class =&gt; Event do |e|
+  e.name 'kansai01'
+  e.start_on Date.parse('2008-11-07')
+  e.end_on Date.parse('2008-11-08')
+end</diff>
      <filename>spec/factories.rb</filename>
    </modified>
    <modified>
      <diff>@@ -25,7 +25,7 @@ end
 
 describe Event, &quot;#expired?&quot; do
   before do
-    @event = Factory.build(:tokyo01, :scheduled_on =&gt; Date.parse(&quot;2008-08-01&quot;))
+    @event = Factory.build(:tokyo01, :end_on =&gt; Date.parse(&quot;2008-08-01&quot;))
   end
 
   describe &quot;when the day before&quot; do
@@ -96,27 +96,32 @@ describe Event, &quot;for toppage&quot; do
 
     Event.create_without_validation(:name =&gt; 'rubykaigi2008',
       :title =&gt; 'RubyKaigi2008', :capacity =&gt; 800,
-      :scheduled_on =&gt; Date.parse(&quot;2008-06-20&quot;),
+      :start_on =&gt; Date.parse(&quot;2008-06-20&quot;),
+      :end_on =&gt; Date.parse(&quot;2008-06-20&quot;),
       :publish_at =&gt; DateTime.parse(&quot;2008-03-01 12:00:00&quot;))
 
     Event.create_without_validation(:name =&gt; 'tokyo01',
       :title =&gt; '&#26481;&#20140;Ruby&#20250;&#35696;01', :capacity =&gt; 100,
-      :scheduled_on =&gt; Date.parse(&quot;2008-08-20&quot;),
+      :start_on =&gt; Date.parse(&quot;2008-08-20&quot;),
+      :end_on =&gt; Date.parse(&quot;2008-08-20&quot;),
       :publish_at =&gt; DateTime.parse(&quot;2008-08-13 12:00:00&quot;))
 
     Event.create_without_validation(:name =&gt; 'sapporo01',
       :title =&gt; '&#26413;&#24140;Ruby&#20250;&#35696;01', :capacity =&gt; 100,
-      :scheduled_on =&gt; Date.parse(&quot;2008-10-25&quot;),
+      :start_on =&gt; Date.parse(&quot;2008-10-25&quot;),
+      :end_on =&gt; Date.parse(&quot;2008-10-25&quot;),
       :publish_at =&gt; DateTime.parse(&quot;2008-09-16 12:00:00&quot;))
 
     Event.create_without_validation(:name =&gt; 'matsue01',
       :title =&gt; '&#26494;&#27743;Ruby&#20250;&#35696;01', :capacity =&gt; 100,
-      :scheduled_on =&gt; Date.parse(&quot;2008-10-18&quot;),
+      :start_on =&gt; Date.parse(&quot;2008-10-18&quot;),
+      :end_on =&gt; Date.parse(&quot;2008-10-18&quot;),
       :publish_at =&gt; DateTime.parse(&quot;2008-09-10 12:00:00&quot;))
 
     Event.create_without_validation(:name =&gt; 'kyushu01',
       :title =&gt; '&#20061;&#24030;Ruby&#20250;&#35696;01', :capacity =&gt; 80,
-      :scheduled_on =&gt; Date.parse(&quot;2008-12-14&quot;),
+      :start_on =&gt; Date.parse(&quot;2008-12-14&quot;),
+      :end_on =&gt; Date.parse(&quot;2008-12-14&quot;),
       :publish_at =&gt; DateTime.parse(&quot;2008-11-30 12:00:00&quot;))
   end
 
@@ -148,3 +153,8 @@ describe Event, &quot;for toppage&quot; do
     it { @archives[1].name.should == &quot;tokyo01&quot; }
   end
 end
+
+describe Event, &quot;#single_day?&quot; do
+#  it { Factory(:kansai01).should_not single_day? }
+  it { Factory.build(:tokyo01).should be_single_day }
+end</diff>
      <filename>spec/models/event_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>d2d273d6dbfbf62648f35d6ef02299b97db52879</id>
    </parent>
  </parents>
  <author>
    <name>KAKUTANI Shintaro</name>
    <email>shintaro@kakutani.com</email>
  </author>
  <url>http://github.com/kakutani/regional_rubykaigi/commit/dd34d4ef30e5fd9dc43c492bd0f525bc1d533e37</url>
  <id>dd34d4ef30e5fd9dc43c492bd0f525bc1d533e37</id>
  <committed-date>2008-09-30T12:02:40-07:00</committed-date>
  <authored-date>2008-09-30T12:02:40-07:00</authored-date>
  <message>ready for kansai01 naively.
- enabled event range of dates(start_on/end_on).
- allow choice builtin registration form or external registartion webpage or something.
- imporove events/index appearance.</message>
  <tree>4a8ae7e79ade90d020115e1f356ed806976f41d6</tree>
  <committer>
    <name>KAKUTANI Shintaro</name>
    <email>shintaro@kakutani.com</email>
  </committer>
</commit>
