<!DOCTYPE html>
<html>
<head>
    <title>대표 공유폴더 권한 관리</title>
    <style>
      .share-box { border:1px solid #ddd; margin:30px auto; max-width:500px; border-radius:8px; padding:28px; background:#fafbfc; }
      .user-list label { margin-right:18px; }
      .user-list { margin-top:14px; }
      .btn { padding:7px 22px; border-radius:6px; border:none; background:#1566c1; color:#fff; font-weight:600; }
      .btn:hover { background:#11408b; }
    </style>
</head>
<body>
    <div class="share-box">
        <h2>대표 공유폴더 접근 권한 관리</h2>
        {% if share %}
        <form method="post">
            <div><strong>{{ share.name }}</strong> <span style="color:#888;">({{ share.path }})</span></div>
            <div class="user-list">
                {% for u in users %}
                  <label>
                    <input type="checkbox" name="allowed_users" value="{{ u.id }}"
                           {% if u.id in share.allowed_users %}checked{% endif %}>
                    {{ u.id }}
                  </label>
                {% endfor %}
                {% if not users %}
                  <span style="color:#aaa;">등록된 사용자가 없습니다.</span>
                {% endif %}
            </div>
            <button type="submit" class="btn" style="margin-top:14px;">저장</button>
        </form>
        {% else %}
        <div style="color:red;">대표 공유폴더 정보가 없습니다!</div>
        {% endif %}
    </div>
</body>
</html>
