Update changes
Dieser Commit ist enthalten in:
@ -651,10 +651,17 @@ pause
|
||||
else:
|
||||
self._start_activity()
|
||||
|
||||
def update_activity_status(self, is_active: bool = False, user_name: str = None):
|
||||
def update_activity_status(self, is_active: bool = False, user_name: str = None, is_own_activity: bool = False):
|
||||
"""Update activity indicator on tile"""
|
||||
if is_active:
|
||||
# Show indicator
|
||||
# Show indicator with appropriate color
|
||||
if is_own_activity:
|
||||
# Green for own activity
|
||||
self.activity_indicator.configure(text="🟢", text_color=COLORS['accent_success'])
|
||||
else:
|
||||
# Orange for others' activity
|
||||
self.activity_indicator.configure(text="🟠", text_color=COLORS['accent_warning'])
|
||||
|
||||
self.activity_indicator.pack(side="left", padx=(0, 5))
|
||||
if user_name:
|
||||
# Create tooltip with user name
|
||||
@ -664,7 +671,11 @@ pause
|
||||
|
||||
# Update activity button if exists
|
||||
if hasattr(self, 'activity_button'):
|
||||
self.activity_button.configure(text="⏹")
|
||||
if is_own_activity:
|
||||
self.activity_button.configure(text="⏹")
|
||||
else:
|
||||
# Keep play button if someone else is active
|
||||
self.activity_button.configure(text="▶")
|
||||
else:
|
||||
# Hide indicator
|
||||
self.activity_indicator.pack_forget()
|
||||
@ -680,14 +691,25 @@ pause
|
||||
self.tooltip.wm_overrideredirect(True)
|
||||
self.tooltip.configure(fg_color=COLORS['bg_secondary'])
|
||||
|
||||
# Format text for multiple users
|
||||
if ", " in user_name:
|
||||
users = user_name.split(", ")
|
||||
if len(users) == 1:
|
||||
text = f"{users[0]} arbeitet hieran"
|
||||
else:
|
||||
text = f"{len(users)} Personen arbeiten hieran:\n" + "\n".join(f"• {u}" for u in users)
|
||||
else:
|
||||
text = f"{user_name} arbeitet hieran"
|
||||
|
||||
label = ctk.CTkLabel(
|
||||
self.tooltip,
|
||||
text=f"{user_name} arbeitet hieran",
|
||||
text=text,
|
||||
font=FONTS['small'],
|
||||
text_color=COLORS['text_primary'],
|
||||
fg_color=COLORS['bg_secondary']
|
||||
fg_color=COLORS['bg_secondary'],
|
||||
justify="left"
|
||||
)
|
||||
label.pack(padx=5, pady=2)
|
||||
label.pack(padx=8, pady=5)
|
||||
|
||||
# Position tooltip
|
||||
x = self.activity_indicator.winfo_rootx()
|
||||
@ -703,9 +725,26 @@ pause
|
||||
"""Check if this project has active users"""
|
||||
from services.activity_sync import activity_service
|
||||
|
||||
activity = activity_service.is_project_active(self.project.name)
|
||||
if activity:
|
||||
self.update_activity_status(True, activity.get('userName'))
|
||||
# Get all activities for this project
|
||||
active_users = []
|
||||
is_own_activity = False
|
||||
has_other_users = False
|
||||
|
||||
for activity in activity_service.activities:
|
||||
if activity.get('projectName') == self.project.name and activity.get('isActive'):
|
||||
user_name = activity.get('userName', 'Unknown')
|
||||
active_users.append(user_name)
|
||||
# Check if it's the current user's activity
|
||||
if activity.get('userId') == activity_service.user_id:
|
||||
is_own_activity = True
|
||||
else:
|
||||
has_other_users = True
|
||||
|
||||
if active_users:
|
||||
# Show indicator with all active users
|
||||
user_text = ", ".join(active_users)
|
||||
# If both own and others are active, show as others (orange) to indicate collaboration
|
||||
self.update_activity_status(True, user_text, is_own_activity and not has_other_users)
|
||||
else:
|
||||
self.update_activity_status(False)
|
||||
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren