Add activity_type and participation_status fields
This commit is contained in:
parent
0a2c393e62
commit
26ab9b9f08
|
|
@ -13,6 +13,8 @@ class Activity
|
|||
field :activity_name, as: :slug_title, type: String, localize: true
|
||||
field :activity_organizer, type: String, localize: true
|
||||
field :activity_area, type: String, localize: true
|
||||
field :activity_type, type: String, localize: true
|
||||
field :participation_status, type: String, localize: true
|
||||
|
||||
# Basic
|
||||
field :year, type: String
|
||||
|
|
@ -44,7 +46,9 @@ class Activity
|
|||
fields_to_show = [
|
||||
"attendee",
|
||||
"activity_name",
|
||||
"activity_type",
|
||||
"activity_organizer",
|
||||
"participation_status",
|
||||
"activity_area",
|
||||
"activity_start_date",
|
||||
"activity_end_date"
|
||||
|
|
@ -104,6 +108,10 @@ class Activity
|
|||
value = self.activity_end_date.strftime('%Y-%m-%d') rescue ''
|
||||
when 'year'
|
||||
value = self.year rescue ''
|
||||
when 'activity_type'
|
||||
value = self.activity_type rescue ''
|
||||
when 'participation_status'
|
||||
value = self.participation_status rescue ''
|
||||
when 'note'
|
||||
value = self.note rescue ''
|
||||
when "file"
|
||||
|
|
|
|||
|
|
@ -64,6 +64,26 @@
|
|||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- activity_type -->
|
||||
<div class="control-group input-title">
|
||||
<label class="control-label muted"><%= t("personal_activity.activity_type") %></label>
|
||||
<div class="controls">
|
||||
<%= f.fields_for :activity_type_translations do |f| %>
|
||||
<%= f.text_field locale, class: "input-block-level", placeholder: t("personal_activity.activity_type"), value: (@activity.activity_type_translations[locale] rescue nil) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- participation_status -->
|
||||
<div class="control-group input-title">
|
||||
<label class="control-label muted"><%= t("personal_activity.participation_status") %></label>
|
||||
<div class="controls">
|
||||
<%= f.fields_for :participation_status_translations do |f| %>
|
||||
<%= f.text_field locale, class: "input-block-level", placeholder: t("personal_activity.participation_status"), value: (@activity.participation_status_translations[locale] rescue nil) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,9 @@ en:
|
|||
participant: "Participant"
|
||||
year: "Year"
|
||||
activity_name: "Activity Name"
|
||||
activity_type: "Activity Type"
|
||||
activity_organizer: "Organizer"
|
||||
participation_status: "Participation Status"
|
||||
activity_area: "Area"
|
||||
activity_start_date: "Start Date"
|
||||
activity_end_date: "End Date"
|
||||
|
|
|
|||
|
|
@ -7,7 +7,9 @@ zh_tw:
|
|||
participant: "參與人"
|
||||
year: "年度"
|
||||
activity_name: "活動名稱"
|
||||
activity_type: "活動類型"
|
||||
activity_organizer: "活動組織"
|
||||
participation_status: "參與情形"
|
||||
activity_area: "地點"
|
||||
activity_start_date: "開始時間"
|
||||
activity_end_date: "結束時間"
|
||||
|
|
|
|||
|
|
@ -4,18 +4,22 @@
|
|||
<tr>
|
||||
<th class="col-md-1">{{year}}</th>
|
||||
<th class="col-md-2">{{activity_name}}</th>
|
||||
<th class="col-md-1">{{activity_type}}</th>
|
||||
<th class="col-md-1">{{activity_organizer}}</th>
|
||||
<th class="col-md-1">{{participation_status}}</th>
|
||||
<th class="col-md-2 min-tablet">{{activity_area}}</th>
|
||||
<th class="col-md-2 min-tablet-l">{{activity_start_date}}</th>
|
||||
<th class="col-md-2 min-tablet-l">{{activity_end_date}}</th>
|
||||
<th class="col-md-2 min-tablet-l">{{note}}</th>
|
||||
<th class="col-md-1 min-tablet-l">{{note}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody data-level="0" data-list="activities">
|
||||
<tr>
|
||||
<td>{{year}}</td>
|
||||
<td><a href="{{link_to_show}}">{{activity_name}}</a></td>
|
||||
<td>{{activity_type}}</td>
|
||||
<td>{{activity_organizer}}</td>
|
||||
<td>{{participation_status}}</td>
|
||||
<td>{{activity_area}}</td>
|
||||
<td date-format="%Y-%m-%d">{{activity_start_date}}</td>
|
||||
<td date-format="%Y-%m-%d">{{activity_end_date}}</td>
|
||||
|
|
|
|||
Loading…
Reference in New Issue