Fixed button sizes and types
This commit is contained in:
parent
b41a9a02d1
commit
36ba619d5a
|
@ -286,7 +286,7 @@ function angeltypes_list_controller()
|
|||
button(
|
||||
page_link_to('angeltypes', ['action' => 'view', 'angeltype_id' => $angeltype['id']]),
|
||||
__('view'),
|
||||
'btn-xs'
|
||||
'btn-sm'
|
||||
)
|
||||
];
|
||||
|
||||
|
@ -294,12 +294,12 @@ function angeltypes_list_controller()
|
|||
$actions[] = button(
|
||||
page_link_to('angeltypes', ['action' => 'edit', 'angeltype_id' => $angeltype['id']]),
|
||||
__('edit'),
|
||||
'btn-xs'
|
||||
'btn-sm'
|
||||
);
|
||||
$actions[] = button(
|
||||
page_link_to('angeltypes', ['action' => 'delete', 'angeltype_id' => $angeltype['id']]),
|
||||
__('delete'),
|
||||
'btn-xs'
|
||||
'btn-sm'
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -310,13 +310,13 @@ function angeltypes_list_controller()
|
|||
['action' => 'delete', 'user_angeltype_id' => $angeltype['user_angeltype_id']]
|
||||
),
|
||||
__('leave'),
|
||||
'btn-xs'
|
||||
'btn-sm'
|
||||
);
|
||||
} else {
|
||||
$actions[] = button(
|
||||
page_link_to('user_angeltypes', ['action' => 'add', 'angeltype_id' => $angeltype['id']]),
|
||||
__('join'),
|
||||
'btn-xs'
|
||||
'btn-sm'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -231,7 +231,7 @@ function admin_active()
|
|||
$parameters['show_all_shifts'] = 1;
|
||||
}
|
||||
$actions[] = form(
|
||||
[form_submit('submit', __('set active'), 'btn-xs', false)],
|
||||
[form_submit('submit', __('set active'), 'btn-sm', false)],
|
||||
page_link_to('admin_active', $parameters)
|
||||
);
|
||||
}
|
||||
|
@ -244,7 +244,7 @@ function admin_active()
|
|||
$parametersRemove['show_all_shifts'] = 1;
|
||||
}
|
||||
$actions[] = form(
|
||||
[form_submit('submit', __('remove active'), 'btn-xs', false)],
|
||||
[form_submit('submit', __('remove active'), 'btn-sm', false)],
|
||||
page_link_to('admin_active', $parametersRemove)
|
||||
);
|
||||
}
|
||||
|
@ -257,7 +257,7 @@ function admin_active()
|
|||
$parametersShirt['show_all_shifts'] = 1;
|
||||
}
|
||||
$actions[] = form(
|
||||
[form_submit('submit', __('got t-shirt'), 'btn-xs', false)],
|
||||
[form_submit('submit', __('got t-shirt'), 'btn-sm', false)],
|
||||
page_link_to('admin_active', $parametersShirt)
|
||||
);
|
||||
}
|
||||
|
@ -270,7 +270,7 @@ function admin_active()
|
|||
$parameters['show_all_shifts'] = 1;
|
||||
}
|
||||
$actions[] = form(
|
||||
[form_submit('submit', __('remove t-shirt'), 'btn-xs', false)],
|
||||
[form_submit('submit', __('remove t-shirt'), 'btn-sm', false)],
|
||||
page_link_to('admin_active', $parameters)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -95,7 +95,9 @@ function admin_arrive()
|
|||
$plannedDepartureDate = $usr->personalData->planned_departure_date;
|
||||
$arrivalDate = $usr->state->arrival_date;
|
||||
$plannedArrivalDate = $usr->personalData->planned_arrival_date;
|
||||
$usr['rendered_planned_departure_date'] = $plannedDepartureDate ? $plannedDepartureDate->format(__('Y-m-d')) : '-';
|
||||
$usr['rendered_planned_departure_date'] = $plannedDepartureDate
|
||||
? $plannedDepartureDate->format(__('Y-m-d'))
|
||||
: '-';
|
||||
$usr['rendered_planned_arrival_date'] = $plannedArrivalDate ? $plannedArrivalDate->format(__('Y-m-d')) : '-';
|
||||
$usr['rendered_arrival_date'] = $arrivalDate ? $arrivalDate->format(__('Y-m-d')) : '-';
|
||||
$usr['arrived'] = icon_bool($usr->state->arrived);
|
||||
|
@ -103,8 +105,11 @@ function admin_arrive()
|
|||
form_hidden('action', $usr->state->arrived ? 'reset' : 'arrived'),
|
||||
form_hidden('user', $usr->id),
|
||||
form_submit(
|
||||
'submit', $usr->state->arrived ? __('reset') : __('arrived'), 'btn-xs', true,
|
||||
$usr->state->arrived ? 'default' : 'primary'
|
||||
'submit',
|
||||
$usr->state->arrived ? __('reset') : __('arrived'),
|
||||
'btn-sm',
|
||||
true,
|
||||
$usr->state->arrived ? 'secondary' : 'primary'
|
||||
),
|
||||
]);
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ function admin_free()
|
|||
: icon('eye-slash'),
|
||||
'actions' =>
|
||||
auth()->can('admin_user')
|
||||
? button(page_link_to('admin_user', ['id' => $usr->id]), __('edit'), 'btn-xs')
|
||||
? button(page_link_to('admin_user', ['id' => $usr->id]), __('edit'), 'btn-sm')
|
||||
: ''
|
||||
];
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ function admin_groups()
|
|||
page_link_to('admin_groups',
|
||||
['action' => 'edit', 'id' => $group['UID']]),
|
||||
__('edit'),
|
||||
'btn-xs'
|
||||
'btn-sm'
|
||||
)
|
||||
];
|
||||
}
|
||||
|
|
|
@ -27,12 +27,12 @@ function admin_rooms()
|
|||
button(
|
||||
page_link_to('admin_rooms', ['show' => 'edit', 'id' => $room->id]),
|
||||
__('edit'),
|
||||
'btn-xs'
|
||||
'btn-sm'
|
||||
),
|
||||
button(
|
||||
page_link_to('admin_rooms', ['show' => 'delete', 'id' => $room->id]),
|
||||
__('delete'),
|
||||
'btn-xs'
|
||||
'btn-sm'
|
||||
)
|
||||
])
|
||||
];
|
||||
|
|
|
@ -87,14 +87,14 @@ function user_messages()
|
|||
$messages_table_entry['actions'] = button(
|
||||
page_link_to('user_messages', ['action' => 'read', 'id' => $message->id]),
|
||||
__('mark as read'),
|
||||
'btn-xs'
|
||||
'btn-sm'
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$messages_table_entry['actions'] = button(
|
||||
page_link_to('user_messages', ['action' => 'delete', 'id' => $message->id]),
|
||||
__('delete message'),
|
||||
'btn-xs'
|
||||
'btn-sm'
|
||||
);
|
||||
}
|
||||
$messages_table[] = $messages_table_entry;
|
||||
|
|
|
@ -313,7 +313,7 @@ function ical_hint()
|
|||
page_link_to('shifts_json_export', ['key' => $user->api_key]),
|
||||
page_link_to('user_myshifts', ['reset' => 1])
|
||||
)
|
||||
. ' <button class="btn btn-xs btn-danger" data-toggle="collapse" data-target="#collapseApiKey" aria-expanded="false" aria-controls="collapseApiKey">
|
||||
. ' <button class="btn btn-sm btn-danger" data-toggle="collapse" data-target="#collapseApiKey" aria-expanded="false" aria-controls="collapseApiKey">
|
||||
' . __('Show API Key') . '
|
||||
</button>'
|
||||
. '</p>'
|
||||
|
|
|
@ -30,10 +30,10 @@ function form_spinner($name, $label, $value)
|
|||
<div class="input-group">
|
||||
<input id="spinner-' . $name . '" class="form-control" name="' . $name . '" value="' . $value . '" />
|
||||
<div class="input-group-btn">
|
||||
<button id="spinner-' . $name . '-down" class="btn btn-default" type="button">
|
||||
<button id="spinner-' . $name . '-down" class="btn btn-primary" type="button">
|
||||
' . icon('dash-lg') . '
|
||||
</button>
|
||||
<button id="spinner-' . $name . '-up" class="btn btn-default" type="button">
|
||||
<button id="spinner-' . $name . '-up" class="btn btn-primary" type="button">
|
||||
' . icon('plus-lg') . '
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
@ -386,7 +386,7 @@ function render_table($columns, $rows, $data = true)
|
|||
*/
|
||||
function button($href, $label, $class = '')
|
||||
{
|
||||
return '<a href="' . $href . '" class="btn btn-default ' . $class . '">' . $label . '</a>';
|
||||
return '<a href="' . $href . '" class="btn btn-primary ' . $class . '">' . $label . '</a>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -399,7 +399,7 @@ function button($href, $label, $class = '')
|
|||
*/
|
||||
function button_js($javascript, $label, $class = '')
|
||||
{
|
||||
return '<a onclick="' . $javascript . '" href="#" class="btn btn-default ' . $class . '">' . $label . '</a>';
|
||||
return '<a onclick="' . $javascript . '" href="#" class="btn btn-primary ' . $class . '">' . $label . '</a>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -222,7 +222,7 @@ function AngelType_view_members($angeltype, $members, $admin_user_angeltypes, $a
|
|||
['action' => 'confirm', 'user_angeltype_id' => $member['user_angeltype_id']]
|
||||
),
|
||||
__('confirm'),
|
||||
'btn-xs'
|
||||
'btn-sm'
|
||||
),
|
||||
button(
|
||||
page_link_to(
|
||||
|
@ -230,7 +230,7 @@ function AngelType_view_members($angeltype, $members, $admin_user_angeltypes, $a
|
|||
['action' => 'delete', 'user_angeltype_id' => $member['user_angeltype_id']]
|
||||
),
|
||||
__('deny'),
|
||||
'btn-xs'
|
||||
'btn-sm'
|
||||
)
|
||||
]);
|
||||
$members_unconfirmed[] = $member;
|
||||
|
@ -244,7 +244,7 @@ function AngelType_view_members($angeltype, $members, $admin_user_angeltypes, $a
|
|||
'supporter' => 0
|
||||
]),
|
||||
__('Remove supporter rights'),
|
||||
'btn-xs'
|
||||
'btn-sm'
|
||||
)
|
||||
]);
|
||||
} else {
|
||||
|
@ -260,7 +260,7 @@ function AngelType_view_members($angeltype, $members, $admin_user_angeltypes, $a
|
|||
'user_angeltype_id' => $member['user_angeltype_id'],
|
||||
'supporter' => 1
|
||||
]),
|
||||
__('Add supporter rights'), 'btn-xs')
|
||||
__('Add supporter rights'), 'btn-sm')
|
||||
: '',
|
||||
button(
|
||||
page_link_to('user_angeltypes', [
|
||||
|
@ -268,7 +268,7 @@ function AngelType_view_members($angeltype, $members, $admin_user_angeltypes, $a
|
|||
'user_angeltype_id' => $member['user_angeltype_id']
|
||||
]),
|
||||
__('remove'),
|
||||
'btn-xs'
|
||||
'btn-sm'
|
||||
)
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -136,7 +136,7 @@ class ShiftCalendarShiftRenderer
|
|||
$html .= '<li class="list-group-item">';
|
||||
$html .= button(shift_entry_create_link_admin($shift),
|
||||
icon('plus-lg') . __('Add more angels'),
|
||||
'btn-xs'
|
||||
'btn-sm'
|
||||
);
|
||||
$html .= '</li>';
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ class ShiftCalendarShiftRenderer
|
|||
. '</a> '
|
||||
. button(
|
||||
shift_entry_create_link($shift, $angeltype),
|
||||
__('Sign up'), 'btn-xs btn-primary hidden-print'
|
||||
__('Sign up'), 'btn-sm btn-primary hidden-print'
|
||||
);
|
||||
break;
|
||||
|
||||
|
@ -224,7 +224,7 @@ class ShiftCalendarShiftRenderer
|
|||
['action' => 'add', 'angeltype_id' => $angeltype['id']]
|
||||
),
|
||||
sprintf(__('Become %s'), $angeltype['name']),
|
||||
'btn-xs'
|
||||
'btn-sm'
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
@ -265,12 +265,12 @@ class ShiftCalendarShiftRenderer
|
|||
button(
|
||||
page_link_to('user_shifts', ['edit_shift' => $shift['SID']]),
|
||||
icon('pencil'),
|
||||
"btn-$class btn-xs"
|
||||
"btn-$class btn-sm"
|
||||
),
|
||||
button(
|
||||
page_link_to('user_shifts', ['delete_shift' => $shift['SID']]),
|
||||
icon('trash'),
|
||||
"btn-$class btn-xs"
|
||||
"btn-$class btn-sm"
|
||||
)
|
||||
]) . '</div>';
|
||||
}
|
||||
|
|
|
@ -121,12 +121,12 @@ function ShiftTypes_list_view($shifttypes)
|
|||
['action' => 'edit', 'shifttype_id' => $shifttype['id']]
|
||||
),
|
||||
__('edit'),
|
||||
'btn-xs'
|
||||
'btn-sm'
|
||||
),
|
||||
button(
|
||||
page_link_to('shifttypes', ['action' => 'delete', 'shifttype_id' => $shifttype['id']]),
|
||||
__('delete'),
|
||||
'btn-xs'
|
||||
'btn-sm'
|
||||
)
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -258,10 +258,10 @@ function Shift_view_render_shift_entry($shift_entry, $user_shift_admin, $angelty
|
|||
$entry .= button_icon(
|
||||
page_link_to('user_myshifts', ['edit' => $shift_entry['id'], 'id' => $shift_entry['UID']]),
|
||||
'pencil',
|
||||
'btn-xs'
|
||||
'btn-sm'
|
||||
);
|
||||
}
|
||||
$entry .= button_icon(shift_entry_delete_link($shift_entry), 'trash', 'btn-xs');
|
||||
$entry .= button_icon(shift_entry_delete_link($shift_entry), 'trash', 'btn-sm');
|
||||
$entry .= '</div>';
|
||||
}
|
||||
return $entry;
|
||||
|
|
|
@ -221,7 +221,7 @@ function Users_view(
|
|||
? $user->personalData->planned_departure_date->format(__('Y-m-d')) : '';
|
||||
$u['last_login_at'] = $user->last_login_at ? $user->last_login_at->format(__('m/d/Y h:i a')) : '';
|
||||
$u['actions'] = table_buttons([
|
||||
button_icon(page_link_to('admin_user', ['id' => $user->id]), 'pencil-square', 'btn-xs')
|
||||
button_icon(page_link_to('admin_user', ['id' => $user->id]), 'pencil-square', 'btn-sm')
|
||||
]);
|
||||
$usersList[] = $u;
|
||||
}
|
||||
|
@ -418,20 +418,20 @@ function User_view_myshift($shift, $user_source, $its_me)
|
|||
}
|
||||
|
||||
$myshift['actions'] = [
|
||||
button(shift_link($shift), icon('eye') . __('view'), 'btn-xs')
|
||||
button(shift_link($shift), icon('eye') . __('view'), 'btn-sm')
|
||||
];
|
||||
if ($its_me || auth()->can('user_shifts_admin')) {
|
||||
$myshift['actions'][] = button(
|
||||
page_link_to('user_myshifts', ['edit' => $shift['id'], 'id' => $user_source->id]),
|
||||
icon('pencil-square') . __('edit'),
|
||||
'btn-xs'
|
||||
'btn-sm'
|
||||
);
|
||||
}
|
||||
if (Shift_signout_allowed($shift, ['id' => $shift['TID']], $user_source->id)) {
|
||||
$myshift['actions'][] = button(
|
||||
shift_entry_delete_link($shift),
|
||||
icon('trash') . __('sign off'),
|
||||
'btn-xs'
|
||||
'btn-sm'
|
||||
);
|
||||
}
|
||||
$myshift['actions'] = table_buttons($myshift['actions']);
|
||||
|
@ -519,12 +519,12 @@ function User_view_worklog(Worklog $worklog, $admin_user_worklog_privilege)
|
|||
button(
|
||||
user_worklog_edit_link($worklog),
|
||||
icon('pencil-square') . __('edit'),
|
||||
'btn-xs'
|
||||
'btn-sm'
|
||||
),
|
||||
button(
|
||||
user_worklog_delete_link($worklog),
|
||||
icon('trash') . __('delete'),
|
||||
'btn-xs'
|
||||
'btn-sm'
|
||||
)
|
||||
]);
|
||||
}
|
||||
|
@ -630,7 +630,7 @@ function User_view(
|
|||
form([
|
||||
form_hidden('action', 'arrived'),
|
||||
form_hidden('user', $user_source->id),
|
||||
form_submit('submit', __('arrived'), '', false, 'default')
|
||||
form_submit('submit', __('arrived'), '', false, 'primary')
|
||||
], page_link_to('admin_arrive'), true) : '',
|
||||
$admin_user_privilege ? button(
|
||||
page_link_to(
|
||||
|
|
|
@ -40,12 +40,12 @@
|
|||
<div class="btn-group">
|
||||
<a
|
||||
href="{{ url('/admin/schedule/load/' ~ schedule.id) }}"
|
||||
class="btn btn-xs btn-default">
|
||||
class="btn btn-sm btn-primary">
|
||||
{{ __('form.import') }}
|
||||
</a>
|
||||
<a
|
||||
href="{{ url('/admin/schedule/edit/' ~ schedule.id) }}"
|
||||
class="btn btn-xs btn-default">
|
||||
class="btn btn-sm btn-primary">
|
||||
{{ __('form.edit') }}
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
{%- endmacro %}
|
||||
|
||||
{% macro button(label, opt) %}
|
||||
<button class="btn btn-{{ opt.btn_type|default('primary') }} btn-{{ opt.btn_size|default('m') }}"
|
||||
<button class="btn btn-{{ opt.btn_type|default('primary') }} btn-{{ opt.btn_size|default('sm') }}"
|
||||
{%- if opt.type is defined %} type="{{ opt.type }}"{% endif %}
|
||||
{%- if opt.name is defined %} name="{{ opt.name }}"{% endif %}
|
||||
{%- if opt.title is defined %} title="{{ opt.title }}"{% endif %}
|
||||
|
|
|
@ -211,7 +211,7 @@
|
|||
<div class="col-md-2">
|
||||
<label class="form-label">Button</label>
|
||||
<div>
|
||||
{{ f.button('Button', {'btn_type': 'default'}) }}
|
||||
{{ f.button('Button', {'btn_type': 'primary'}) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
|
@ -310,7 +310,7 @@
|
|||
<div class="col-md-3">
|
||||
<h4><code>button(label, opt)</code></h4>
|
||||
<p>
|
||||
{{ f.button('Label', {'btn_type': 'default', 'name': 'button-name', 'value': 'buton-value'}) }}
|
||||
{{ f.button('Label', {'btn_type': 'primary', 'name': 'button-name', 'value': 'buton-value'}) }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
|
||||
{% if has_permission_to('faq.edit') %}
|
||||
<span class="pull-right">
|
||||
{{ m.button(m.icon('pencil-square'), url('admin/faq/' ~ item.id), null, 'xs') }}
|
||||
{{ m.button(m.icon('pencil-square'), url('admin/faq/' ~ item.id), null, 'sm') }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
|
|
@ -100,7 +100,7 @@
|
|||
{% if has_permission_to('register') and config('registration_enabled') %}
|
||||
<p>{{ __('Please sign up, if you want to help us!') }}</p>
|
||||
<div class="form-group">
|
||||
<a href="{{ url('register') }}" class="btn btn-default">{{ __('Register') }} »</a>
|
||||
<a href="{{ url('register') }}" class="btn btn-primary">{{ __('Register') }} »</a>
|
||||
</div>
|
||||
{% else %}
|
||||
{{ m.alert(__('Registration is disabled.'), 'danger') }}
|
||||
|
@ -111,7 +111,7 @@
|
|||
<h2>{{ __('What can I do?') }}</h2>
|
||||
<p>{{ __('Please read about the jobs you can do to help us.') }}</p>
|
||||
<div class="form-group">
|
||||
<a href="{{ url('angeltypes', {'action': 'about'}) }}" class="btn btn-default">
|
||||
<a href="{{ url('angeltypes', {'action': 'about'}) }}" class="btn btn-primary">
|
||||
{{ __('Teams/Job description') }} »
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
@ -87,7 +87,7 @@
|
|||
|
||||
{% if has_permission_to('admin_news') %}
|
||||
<div class="pull-right">
|
||||
{{ m.button(m.icon('pencil-square'), url('admin/news/' ~ news.id), null, 'xs') }}
|
||||
{{ m.button(m.icon('pencil-square'), url('admin/news/' ~ news.id), null, 'sm') }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
|
|
@ -48,13 +48,13 @@
|
|||
>
|
||||
{{ csrf() }}
|
||||
{{ f.hidden('id', question.id) }}
|
||||
{{ f.submit(m.icon('trash'), {'name': 'delete', 'btn_type': 'danger', 'btn_size': 'xs', 'title': __('form.delete')}) }}
|
||||
{{ f.submit(m.icon('trash'), {'name': 'delete', 'btn_type': 'danger', 'btn_size': 'sm', 'title': __('form.delete')}) }}
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
{% if has_permission_to('question.edit') %}
|
||||
<span class="pull-right">
|
||||
{{ m.button(m.icon('pencil-square'), url('admin/questions/' ~ question.id), null, 'xs') }}
|
||||
{{ m.button(m.icon('pencil-square'), url('admin/questions/' ~ question.id), null, 'sm') }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
|
|
@ -35,13 +35,13 @@
|
|||
<form method="POST" action="{{ url('/oauth/' ~ name ~ '/connect') }}">
|
||||
{{ csrf() }}
|
||||
|
||||
{{ f.submit(__('form.connect'), {'btn_size' : 'xs'}) }}
|
||||
{{ f.submit(__('form.connect'), {'btn_size' : 'sm'}) }}
|
||||
</form>
|
||||
{% else %}
|
||||
<form method="POST" action="{{ url('/oauth/' ~ name ~ '/disconnect') }}">
|
||||
{{ csrf() }}
|
||||
|
||||
{{ f.submit(__('form.disconnect'), {'btn_type': 'danger', 'btn_size' : 'xs'}) }}
|
||||
{{ f.submit(__('form.disconnect'), {'btn_type': 'danger', 'btn_size' : 'sm'}) }}
|
||||
</form>
|
||||
{% endif %}
|
||||
</td>
|
||||
|
|
Loading…
Reference in New Issue