Merge branch 'master' into user_openid_management

This commit is contained in:
Stella Rouzi 2017-06-13 10:25:08 +03:00 committed by GitHub
commit 2e922650a7
22 changed files with 426 additions and 30 deletions

View file

@ -0,0 +1,13 @@
= semantic_form_for(@organization, url: (@organization.new_record? ? admin_organizations_path : admin_organization_path(@organization))) do |f|
= f.inputs name: 'Organization details' do
= f.input :name, as: :string, required: true
= f.input :description, as: :text, input_html: { rows: 10 }, 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 'Create 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_admin_organization_path(organization),
method: :get, class: 'btn btn-primary'
= link_to 'Delete', admin_organization_path(organization),
method: :delete, class: 'btn btn-danger', data: { confirm: "Warning: This will delete #{organization.name} and all its data which includes data for all conferences within #{organization.name}. Do you really want to continue?" }

View file

@ -32,3 +32,8 @@
= link_to(admin_revision_history_path) do
%span.fa.fa-history
Revision History
- if ENV['ORGANIZATIONS_ENABLED'] == 'true'
%li
= link_to(admin_organizations_path) do
%span.fa.fa-group
Organizations

View file

@ -49,3 +49,8 @@
= link_to(admin_revision_history_path) do
%span.fa.fa-history
Revision History
- if ENV['ORGANIZATIONS_ENABLED'] == 'true'
%li
= link_to(admin_organizations_path) do
%span.fa.fa-group
Organizations

View file

@ -0,0 +1,16 @@
.container
.row
.col-md-12.page-header
%h1
Organizations
.btn-group.pull-right
/ = link_to 'Add new', new_organization_path, class: 'btn btn-mini btn-success'
- @organizations.each do |organization|
.col-md-4
.thumbnail
= image_tag(organization.picture.thumb.url, width: '20%')
.caption
%h4
= organization.name
%button.btn.btn-success Conferences
/ = link_to 'Edit', edit_organization_path(organization), class: 'btn btn-mini btn-default'