Small message group improvements

This commit is contained in:
wvengen 2016-03-04 14:26:56 +01:00
parent 01cf6431a9
commit 179f442a87
9 changed files with 55 additions and 34 deletions

View File

@ -1,4 +1,9 @@
/ insert_before 'erb:contains("simple_fields_for :notify")'
/ insert_after 'erb:contains("notify.input \'upcoming_tasks\'")'
- if FoodsoftMessages.enabled?
= s.simple_fields_for :messages, defaults: { inline_label: true, label: false } do |messages|
= messages.input 'send_as_email', as: :boolean, input_html: { checked: f.object.settings.messages['send_as_email'] }
- if Messagegroup.any?
.controls
= link_to messagegroups_path do
= t('shared.user_form_fields.messagegroups')
%i.icon.icon-chevron-right

View File

@ -5,6 +5,7 @@
- content_for :sidebar do
%p= t('.first_paragraph', url: link_to(t('.new_messagegroups'), new_admin_messagegroup_path)).html_safe
%p= t '.second_paragraph'
.well.well-small
= form_tag admin_messagegroups_path, :method => :get, :remote => true,
'data-submit-onchange' => true, class: 'form-search' do

View File

@ -1,8 +1,6 @@
- title t('.title')
- content_for :actionbar do
= link_to t('.messages'), messages_path, class: 'btn'
= link_to t('.new'), new_message_path, class: 'btn btn-primary'
= render 'messages/actionbar', active: 'message_threads'
= render 'groupmessage_threads', group: nil, name: t('.other'), id: 0

View File

@ -1,5 +1,5 @@
- title t('.title')
= t('.body').html_safe
%p= t('.body')
= render :partial => "messagegroup", :collection => @messagegroups

View File

@ -0,0 +1,8 @@
- content_for :actionbar do
.btn-group
= link_to message_threads_path, class: "btn #{'active' if active == 'message_threads'}" do
%i.icon.icon-align-left{title: t('.message_threads')}
= link_to messages_path, class: "btn #{'active' if active == 'messages'}" do
%i.icon.icon-align-justify{title: t('.messages')}
= link_to t('.messagegroups'), messagegroups_path, class: 'btn'
= link_to t('.new'), new_message_path, class: 'btn btn-primary'

View File

@ -1,7 +1,6 @@
- title t('.title')
- content_for :actionbar do
= link_to t('.message_threads'), message_threads_path, class: 'btn'
= link_to t('.new'), new_message_path, class: 'btn btn-primary'
= render 'actionbar', active: 'messages'
#messages
= render 'messages', messages: @messages, pagination: true

View File

@ -18,6 +18,7 @@ de:
first_paragraph: Hier kannst du %{url} anlegen, Gruppen bearbeiten und löschen.
new_messagegroup: Neue Nachrichtengruppe anlegen
new_messagegroups: neue Nachrichtengruppe
second_paragraph: Eine Nachrichtengruppe ist wie ein Mail-Verteilen. Mitglieder können Verteiler in ihrem Profil abonnieren (und auch wieder abbestellen) an denen sie interessiert sind.
title: Nachrichtengruppen
new:
title: Nachrichtengruppe anlegen
@ -47,6 +48,12 @@ de:
join: Nachrichtengruppe beitreten
leave: Nachrichtengruppe verlassen
messages:
actionbar:
message_threads:
messagegroups:
messages:
create:
notice: Message is saved and will be sent.
index:
message_threads: Nachrichtenverläufe
thread:
@ -56,7 +63,6 @@ de:
groupmessage_threads:
show_message_threads: Alle Nachrichtenverläufe anzeigen
index:
messages: Nachrichten
new: Neue Nachricht
other: Allgemeine Nachrichten
title: Nachrichtenverläufe
@ -67,7 +73,7 @@ de:
started_by: Gestartet von
show:
other: Allgemeine Nachrichten
reply: Antworten
navigation:
admin:
messagegroups: Nachrichtengruppen
messagegroups: Nachrichtengruppen

View File

@ -14,26 +14,27 @@ en:
user_tokens: Members
models:
message: Message
messagegroup: Messagegroup
messagegroup: Message group
admin:
messagegroups:
destroy:
error: 'Messagegroup could not be deleted: %{error}'
notice: Messagegroup was deleted
error: 'Message group could not be deleted: %{error}'
notice: Message group was deleted
edit:
title: Edit messagegroup
title: Edit message group
index:
first_paragraph: Here you can create %{url}, edit and delete them.
new_messagegroup: Create new messagegroup
new_messagegroups: new messagegroups
title: Messagegroups
new_messagegroup: Create new message group
new_messagegroups: new message groups
second_paragraph: "A message group is like a mailing-list. Members can subscribe to (and unsubscribe from) the lists they're interested in, from their profile."
title: Message groups
new:
title: Create messagegroup
title: Create message group
show:
confirm: Are you sure?
edit: Edit group/members
send_message: Send message
title: Messagegroup %{name}
title: Message group %{name}
messagegroups:
members: Members
name: Name
@ -61,28 +62,31 @@ en:
home:
index:
messages:
title: Newest Messages
title: Newest messages
view_all: See all messages
start_nav:
write_message: Write message
messagegroups:
index:
body: You can join or leave any of the messagegroups.
title: Messagegroups
body: 'A message group is like a mailing-list: you can join (or leave) any of them to receive the updates sent to that group.'
title: Message groups
join:
error: 'Messagegroup could not be joined: %{error}'
notice: Messagegroup was joined
error: 'Could not join message group: %{error}'
notice: Joined message group
leave:
error: 'Messagegroup could not be left: %{error}'
notice: Messagegroup was left
notice: Left message group
messagegroup:
join: Join messagegroup
leave: Leave messagegroup
join: Join message group
leave: Leave message group
messages:
actionbar:
message_threads: Show as threads
messagegroups: Subscribe to groups
messages: Show as list
create:
notice: Message is saved and will be sent.
index:
message_threads: View as threads
new: New message
title: Messages
messages:
@ -116,11 +120,11 @@ en:
title: Show message
thread:
all_message_threads: All message threads
reply: Reply
message_threads:
groupmessage_threads:
show_message_threads: show all
index:
messages: View as messages
new: New message
other: General
title: Message threads
@ -139,6 +143,8 @@ en:
'
navigation:
admin:
messagegroups: Messagegroups
messagegroups: Messagegroups
messagegroups: Message groups
messages: Messages
shared:
user_form_fields:
messagegroups: Join or leave message groups

View File

@ -5,9 +5,7 @@ module FoodsoftMessages
unless primary[:foodcoop].nil?
sub_nav = primary[:foodcoop].sub_navigation
sub_nav.items <<
SimpleNavigation::Item.new(primary, :messagegroups, I18n.t('navigation.messagegroups'), context.messagegroups_path)
sub_nav.items <<
SimpleNavigation::Item.new(primary, :messages, I18n.t('navigation.messages'), context.messages_path)
SimpleNavigation::Item.new(primary, :messages, I18n.t('navigation.messages'), context.message_threads_path)
# move to right before tasks item
if i = sub_nav.items.index(sub_nav[:tasks])
sub_nav.items.insert(i, sub_nav.items.delete_at(-1))