Skip to content
GitLab
Explorer
Connexion
S'inscrire
Navigation principale
Rechercher ou aller à…
Projet
P
parlote-facil
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneur
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
facil
parlote-facil
Validations
d50863cc
Valider
d50863cc
rédigé
il y a 14 ans
par
danielgrippi
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
added the ability to message someone from their profile page
parent
48fff29b
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
3
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
3 fichiers modifiés
app/controllers/conversations_controller.rb
+10
-2
10 ajouts, 2 suppressions
app/controllers/conversations_controller.rb
app/views/conversations/new.haml
+25
-14
25 ajouts, 14 suppressions
app/views/conversations/new.haml
app/views/people/show.html.haml
+6
-4
6 ajouts, 4 suppressions
app/views/people/show.html.haml
avec
41 ajouts
et
20 suppressions
app/controllers/conversations_controller.rb
+
10
−
2
Voir le fichier @
d50863cc
...
@@ -6,7 +6,9 @@ class ConversationsController < ApplicationController
...
@@ -6,7 +6,9 @@ class ConversationsController < ApplicationController
def
index
def
index
@conversations
=
Conversation
.
joins
(
:conversation_visibilities
).
where
(
@conversations
=
Conversation
.
joins
(
:conversation_visibilities
).
where
(
:conversation_visibilities
=>
{
:person_id
=>
current_user
.
person
.
id
}).
paginate
(
:conversation_visibilities
=>
{
:person_id
=>
current_user
.
person
.
id
}).
paginate
(
:page
=>
params
[
:page
],
:per_page
=>
7
,
:order
=>
'updated_at DESC'
)
:page
=>
params
[
:page
],
:per_page
=>
15
,
:order
=>
'updated_at DESC'
)
@authors
=
{}
@conversations
.
each
{
|
c
|
@authors
[
c
.
id
]
=
c
.
last_author
}
@conversation
=
Conversation
.
joins
(
:conversation_visibilities
).
where
(
@conversation
=
Conversation
.
joins
(
:conversation_visibilities
).
where
(
:conversation_visibilities
=>
{
:person_id
=>
current_user
.
person
.
id
,
:conversation_id
=>
params
[
:conversation_id
]}).
first
:conversation_visibilities
=>
{
:person_id
=>
current_user
.
person
.
id
,
:conversation_id
=>
params
[
:conversation_id
]}).
first
...
@@ -22,7 +24,12 @@ class ConversationsController < ApplicationController
...
@@ -22,7 +24,12 @@ class ConversationsController < ApplicationController
@conversation
=
Conversation
.
create
(
params
[
:conversation
])
@conversation
=
Conversation
.
create
(
params
[
:conversation
])
redirect_to
conversations_path
(
:conversation_id
=>
@conversation
.
id
)
flash
[
:notice
]
=
"Message sent"
if
params
[
:profile
]
redirect_to
person_path
(
params
[
:profile
])
else
redirect_to
conversations_path
(
:conversation_id
=>
@conversation
.
id
)
end
end
end
def
show
def
show
...
@@ -37,6 +44,7 @@ class ConversationsController < ApplicationController
...
@@ -37,6 +44,7 @@ class ConversationsController < ApplicationController
end
end
def
new
def
new
@contact
=
current_user
.
contacts
.
find
(
params
[
:contact_id
])
if
params
[
:contact_id
]
render
:layout
=>
false
render
:layout
=>
false
end
end
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
app/views/conversations/new.haml
+
25
−
14
Voir le fichier @
d50863cc
...
@@ -3,21 +3,32 @@
...
@@ -3,21 +3,32 @@
-# the COPYRIGHT file.
-# the COPYRIGHT file.
%h2
#new_message_pane
New Message
#facebox_header
%h4
New Message
=
form_for
Conversation
.
new
do
|
conversation
|
=
form_for
Conversation
.
new
do
|
conversation
|
%h4
to
=
text_field_tag
"conversation[contact_ids]"
%h4
-
if
@contact
subject
send a message to
=
con
versation
.
text_field
:subject
=
@
con
tact
.
person
.
name
%h4
=
hidden_field_tag
"conversation[contact_ids]"
,
@contact
.
id
message
=
hidden_field_tag
"profile"
,
@contact
.
person
.
id
=
text_area_tag
"conversation[text]"
,
''
,
:rows
=>
5
=
conversation
.
submit
:send
-
else
=
link_to
'cancel'
,
conversations_path
%h4
to
=
text_field_tag
"conversation[contact_ids]"
%h4
subject
=
conversation
.
text_field
:subject
%h4
message
=
text_area_tag
"conversation[text]"
,
''
,
:rows
=>
5
=
conversation
.
submit
:send
=
link_to
'cancel'
,
conversations_path
Ce diff est replié.
Cliquez pour l'agrandir.
app/views/people/show.html.haml
+
6
−
4
Voir le fichier @
d50863cc
...
@@ -42,10 +42,12 @@
...
@@ -42,10 +42,12 @@
-
else
-
else
.right
.right
-
if
@post_type
==
:photos
=
link_to
'Message'
,
new_conversation_path
(
:contact_id
=>
@contact
.
id
),
:class
=>
'button'
,
:rel
=>
'facebox'
=
link_to
t
(
'layouts.header.view_profile'
),
person_path
(
@person
)
-
else
/- if @post_type == :photos
=
link_to
t
(
'_photos'
),
person_photos_path
(
@person
)
/ = link_to t('layouts.header.view_profile'), person_path(@person)
/- else
/ = link_to t('_photos'), person_photos_path(@person)
%h3
%h3
=
@person
.
name
=
@person
.
name
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter