Permalink
Browse files

events finished

  • Loading branch information...
1 parent d272f61 commit 07cafd4425fd1bcbf3314e121272394034e01f14 @liudangyi liudangyi committed Oct 28, 2012
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -184,4 +184,19 @@ h1 {
}
.actions {
margin-top: 9px;
+}
+
+i.img-finish {
+ display: block;
+ width: 28px;
+ height: 28px;
+ background-image: url(/assets/icon/finish.png);
+ background-repeat: no-repeat;
+}
+i.img-todo {
+ display: block;
+ width: 28px;
+ height: 28px;
+ background-image: url(/assets/icon/todo.png);
+ background-repeat: no-repeat;
}
@@ -1,18 +1,20 @@
-= form_for @event do |f|
+= form_for @event, html: { class: 'form-horizontal' } do |f|
- if @event.errors.any?
#error_explanation
h2 = "#{pluralize(@event.errors.count, "error")} prohibited this event from being saved:"
ul
- @event.errors.full_messages.each do |message|
li = message
-
- .field
- = f.label :time
- = f.text_field :time
- .field
- = f.label :place
- = f.text_field :place
- .field
- = f.label :content
- = f.text_field :content
- .actions = f.submit 'Save'
+ .control-group
+ = f.label :time , '时间', class: 'control-label'
+ .controls = f.text_field :time
+ .control-group
+ = f.label :place , '地点', class: 'control-label'
+ .controls = f.text_field :place
+ .control-group
+ = f.label :title , '标题', class: 'control-label'
+ .controls = f.text_field :title
+ .control-group
+ = f.label :content , '详情', class: 'control-label'
+ .controls = f.text_field :content
+ .form-actions = f.submit '保存', class: 'btn btn-primar-0-y'
@@ -1,8 +1,3 @@
-h1 Editing event
+h1 编辑活动
== render 'form'
-
-= link_to 'Show', @event
-'|
-= link_to 'Back', events_path
-
@@ -1,27 +1,36 @@
-h1 Listing events
+- content_for :style do
+ less:
+ dl {
+ position: relative;
+ i {
+ position: absolute;
+ left: 30px;
+ top: 20px;
+ }
+ }
-table
- tr
- th Time
- th Place
- th Title
- th Content
- th
- th
- th
- - @events.each do |event|
- tr
- td = event.time
- td = event.place
- td = event.title
- td = event.content
- td = link_to 'Show', event
- td = link_to 'Edit', edit_event_path(event)
- td = link_to 'Destroy', event, :confirm => '你确定要删除吗?', :method => :delete
+h1
+ | 近期活动
+ = link_to '创建活动', new_event_path, class: "btn btn-primar-0-y pull-right"
- = paginate @events
-br
+- @events.each do |event|
+ dl.dl-horizontal id="#{event.id}"
+ dt 时间:
+ dd = event.time
+ dt 地点:
+ dd = event.place
+ dt 标题:
+ dd = event.title
+ dt 详情:
+ dd = event.content
+ - if current_user and current_user.admin?
+ .pull-right
+ = link_to '[编辑]', edit_event_path(event)
+ = link_to '[删除]', event, :confirm => '你确定要删除吗?', :method => :delete
+ .clearboth
+ == 1 ? '<i class="img-finish"></i>' : '<i class="i.img-todo"></i>'
+ hr
-= link_to 'New Event', new_event_path
+ = paginate @events
@@ -1,5 +1,3 @@
-h1 New event
+h1 创建活动
-== render 'form'
-
-= link_to 'Back', events_path
+== render 'form'
@@ -1,4 +1,4 @@
-= form_for @mate, html: { multipart: true, class: 'form-horizontal'}, class: 'form-horizontal' do |f|
+= form_for @mate, html: { multipart: true, class: 'form-horizontal'} do |f|
- if @mate.errors.any?
#error_explanation
h2 = "#{pluralize(@mate.errors.count, "error")} prohibited this mate from being saved:"
@@ -7,25 +7,24 @@
- if notice
p#notice.alert.alert-success = notice
-.span4
- = image_tag(@mate.photo.big, height: 400, width: 400)
+.row
+ .span4
+ = image_tag(@mate.photo.big, height: 400, width: 400)
-.span4
- dl
- dt 姓名:
- dd: p = @mate.name
- dl
- dt 一句话描述:
- dd: p = @mate.tagline
- dl
- dt 简历:
- dd: p = @mate.description
- dl
- dt 联系方式:
- dd: p = @mate.contact
- dl
- = link_to '[编辑]', edit_mate_path(@mate)
- | &nbsp;|&nbsp;
- = link_to '[删除]', @mate, :confirm => '你确定要删除吗?', :method => :delete
+ .span5
+ dl.dl-horizontal
+ dt 姓名:
+ dd: p = @mate.name
+ dt 一句话描述:
+ dd: p = @mate.tagline
+ dt 简历:
+ dd: p = @mate.description
+ dt 联系方式:
+ dd: p = @mate.contact
+ br
+ dd
+ = link_to '[编辑]', edit_mate_path(@mate)
+ | &nbsp;|&nbsp;
+ = link_to '[删除]', @mate, :confirm => '你确定要删除吗?', :method => :delete

0 comments on commit 07cafd4

Please sign in to comment.