summaryrefslogtreecommitdiffstats
path: root/app/view/common/group.setting.modal.view.php
blob: bf6b6c5f0a55e507f60080b35c0c7b20a0f55c7d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php

/*
 * SCROTT Copyright (C) 2016 Malf Furious
 *
 * Scrott is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published
 * by the Free Software Foundation, either version 3 of the License,
 * or (at your option) any later version.
 *
 * Scrott is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
 * License for more details.
 */

?>

<?php require_once "view/common/permissions.setting.modal.view.php"; ?>
<?php require_once "view/common/ownership.setting.modal.view.php"; ?>

<div class="tab-pane fade <?=$mod->getSettingModalTabDispClasses()?>" id="settGroupTab">
    <p>&nbsp;</p>

    <form method="post" action="<?=$mod->ap()?>" enctype="multipart/form-data">
        <input type="hidden" name="input[action]" value="common-setting-group" />
        <input type="hidden" name="input[guid]" value="<?=$mod->group->guid?>" />

        <div class="row">
            <div class="col-md-8">
                <div class="form-group">
                    <label>Group name</label>
                    <input type="text" name="input[name]" class="form-control" value="<?=$mod->group->name?>" required="true" maxlength="50" <?=($mod->group->canModify($mod->getCurrentUser()) ? "" : "disabled")?> />
                </div>
            </div>

            <div class="col-md-4 text-center">
                <img src="<?=$mod->group->getHeadImage()?>" alt="<?=$mod->group->name?>" class="img-circle" height="100" />

                <?php if ($mod->group->canModify($mod->getCurrentUser())) { ?>
                    <br />
                    <br />
                    <button type="button" class="btn btn-default btn-xs" data-toggle="collapse" data-target="#inputGroupImageCollapse">
                        <span class="glyphicon glyphicon-camera"></span> Upload new image
                    </button>
                    <br />
                    <button type="submit" name="input[rmImage]" class="btn btn-danger btn-xs" onclick="return assertConfirm()">
                        <span class="glyphicon glyphicon-remove"></span> Remove image
                    </button>
                <?php } ?>
            </div>
        </div>

        <div class="collapse" id="inputGroupImageCollapse">
            <div class="form-group">
                <label>Group Image</label>
                <input type="file" name="attachment" />
            </div>
        </div>

        <?php common_setting_permissions($mod, $mod->group); ?>
        <?php common_setting_ownership($mod, $mod->group); ?>

        <button type="submit" class="btn btn-success pull-right">Save</button>

        <p>&nbsp;</p>
        <p>&nbsp;</p>

        <button type="submit" name="input[rmGroup]" class="btn btn-danger btn-xs pull-right">
            <span class="glyphicon glyphicon-trash"></span> Delete Group
        </button>
    </form>

    <p>&nbsp;</p>
</div>