Implement consistent admin interface

* Consistent route/model/controller/view layout
* Get rid of unused photos, speakers, dietchoices, social_events controllers
* Drop unused :public from Rooms and :description from CallForPapers
This commit is contained in:
Henne Vogelsang 2014-11-25 10:47:18 +01:00
parent f6a87331be
commit 28063129c7
133 changed files with 1461 additions and 1461 deletions

View file

@ -0,0 +1,19 @@
.row
.col-md-12
.page-header
-if @sponsor.new_record?
New
%h1
Sponsor
= @sponsor.name
.row
.col-md-8
= semantic_form_for(@sponsor, :url => (@sponsor.new_record? ? admin_conference_sponsors_path : admin_conference_sponsor_path(@conference.short_title, @sponsor))) do |f|
= f.input :name
= f.input :description
= image_tag f.object.logo(:thumb) if !f.object.logo.blank?
= f.input :logo
= f.input :website_url
= f.input :sponsorship_level, collection: @conference.sponsorship_levels
%p.text-right
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }

View file

@ -1,11 +0,0 @@
<div class="nested-fields">
<%= f.inputs do %>
<%= f.input :name %>
<%= f.input :description %>
<%= image_tag f.object.logo(:thumb) if !f.object.logo.blank? %>
<%= f.input :logo %>
<%= f.input :website_url %>
<%= f.input :sponsorship_level, collection: @conference.sponsorship_levels %>
<%= remove_association_link :sponsor, f %>
<% end %>
</div>

View file

@ -1,5 +1,39 @@
.row
.col-md-8
= semantic_form_for(@conference, :url => admin_conference_sponsor_path(@conference.short_title, @conference.sponsors)) do |f|
= dynamic_association :sponsors, "Sponsors", f
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}
.col-md-12
.page-header
%h1 Sponsors
%p.text-muted
People supporting your conference
- if @conference.sponsors.any?
.row
.col-md-12
%table.table.table-hover#sponsors
%thead
%th Logo
%th Name
%th Description
%th URL
%th Level
%th Actions
%tbody
- @conference.sponsors.each do |sponsor|
%tr
%td
= image_tag(sponsor.logo(:thumb), width: '20%')
%td
= sponsor.name
%td
= truncate(sponsor.description)
%td
= sponsor.website_url
%td
= sponsor.sponsorship_level.title
%td
.btn-group
= link_to 'Edit', edit_admin_conference_sponsor_path(@conference.short_title, sponsor),
method: :get, class: 'btn btn-primary'
= link_to 'Delete', admin_conference_sponsor_path(@conference.short_title, sponsor),
method: :delete, class: 'btn btn-danger', data: { confirm: "Do you really want to delete the sponsor #{sponsor.name}?" }
.row
.col-md-12
= link_to 'Add Sponsor', new_admin_conference_sponsor_path(@conference.short_title), class: 'btn btn-primary pull-right'