Fixed messages. New styling for token input plugin.

This commit is contained in:
benni 2012-10-08 18:19:15 +02:00
parent c0c41a7752
commit 52e62f8ddb
14 changed files with 359 additions and 412 deletions

View file

@ -1,3 +1,7 @@
- if Message.public.count > 20
= items_per_page
= pagination_links_remote messages
- unless messages.empty?
%table.table.table-striped
%tbody

View file

@ -1,8 +1,5 @@
- title "Nachrichten im Überblick"
%p= link_to('Neue Nachricht', :action => 'new')
%div{:style => "text-align:right"}= will_paginate @messages
- title "Nachrichten"
= link_to 'Neue Nachricht', new_message_path, class: 'btn btn-primary'
#messages
= render :partial => 'messages', :locals => { :messages => @messages, :subject_length => 130 }

View file

@ -1,4 +1,4 @@
- content_for :head do
- content_for :javascript do
:javascript
$(function() {
$('#message_recipient_tokens').tokenInput("#{users_path(:format => :json)}", {
@ -6,7 +6,8 @@
prePopulate: $('#message_recipient_tokens').data('pre'),
hintText: 'Nach Nutzerin suchen',
noResultText: 'Keine Nutzerin gefunden',
searchingText: 'Suche ...'
searchingText: 'Suche ...',
theme: 'facebook'
});
$('#message_sent_to_all').click(function() {
@ -38,6 +39,8 @@
= f.input :recipient_tokens, :input_html => { 'data-pre' => User.find_all_by_id(@message.recipients_ids).map { |u| u.token_attributes }.to_json }
= f.input :group_id, :as => :select, :collection => Group.order('type DESC, name DESC').all.reject { |g| g.memberships.empty? }
= f.input :private
= f.input :subject
= f.input :body
= f.submit
= f.input :subject, input_html: {class: 'input-xxlarge'}
= f.input :body, input_html: {class: 'input-xxlarge'}
.form-actions
= f.submit
= link_to 'oder abbrechen', :back

View file

@ -16,6 +16,6 @@
%p= simple_format(h(@message.body))
%hr/
%p
= link_to('Antworten', new_message_path(:message => {:reply_to => @message.id}))
= link_to 'Antworten', new_message_path(:message => {:reply_to => @message.id}), class: 'btn'
|
= link_to 'Nachricht im Überblick', messages_path