introduce organizations

This commit is contained in:
shlok007 2017-05-31 18:42:52 +05:30
parent bf54487a19
commit 8edf896d86
21 changed files with 345 additions and 4 deletions

View file

@ -0,0 +1,13 @@
= semantic_form_for(@organization) do |f|
= f.inputs name: 'Organization details' do
= f.input :name, as: :string, required: true
= f.input :description, input_html: { rows: 5 }, placeholder: 'Decribe about your organization..'
= image_tag f.object.picture.thumb.url if f.object.picture?
- if @organization.picture
= image_tag(@organization.picture.thumb.url, width: '20%')
= f.input :picture
%p.text-right
- if @organization.new_record?
= f.submit 'Create Organization', class: 'btn btn-success'
- else
= f.submit 'Update Organization', class: 'btn btn-success'

View file

@ -0,0 +1,31 @@
.row
.col-md-12
.page-header
%h1 Organizations
.btn-group.pull-right
= link_to 'Add Organization', new_admin_organization_path, class: 'btn btn-success pull-right'
%p.text-muted
Manage organizations in OSEM
.row
.col-md-12
%table.table.table-hover.datatable
%thead
%th Name
%th Upcoming Conferences
%th Past Conferences
%th Actions
%tbody
- @organizations.each do |organization|
%tr
%td
= organization.name
%td
= organization.conferences.count
%td
= organization.conferences.count
%td
.btn-group
= link_to 'Edit', edit_organization_path(organization),
method: :get, class: 'btn btn-primary'
= link_to 'Delete', admin_organization_path(organization),
method: :delete, class: 'btn btn-danger'