Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from sublimecoder:master #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/ex_admin/form.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,7 @@ defmodule ExAdmin.Form do
end

def build_control({:array, type}, resource, opts, model_name, field_name, ext_name)
when type in ~w(string integer)a do
when type in ~w(string integer float)a do
name = "#{model_name}-#{field_name}"

# currently we only support select 2
Expand Down
10 changes: 8 additions & 2 deletions web/ex_admin/errors_helper.ex
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ defmodule ExAdmin.ErrorsHelper do
end)
end

defp is_struct(%{__struct__: _}), do: true
defp is_struct(_), do: false
# Checking via version since Kernel.function_exported?(Kernel, :is_struct, 1) reports false
System.version()
|> Version.parse!
|> Version.match?("~> 1.10")
|> unless do
defp is_struct(%{__struct__: _}), do: true
defp is_struct(_), do: false
end
end
6 changes: 3 additions & 3 deletions web/templates/layout/active_admin.html.eex
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
<meta name="csrf-token" id="_csrf_token" content="<%= Plug.CSRFProtection.get_csrf_token %>" />
<%= favicon() %>
<title><%= site_title() %></title>
<link rel="stylesheet" media="screen" type="text/css" href="<%= static_url(@conn, "/css/active_admin.css.css") %>">
<link rel="stylesheet" media="screen" type="text/css" href="<%= static_path(@conn, "/css/active_admin.css.css") %>">

<!-- jQuery 2.1.4 & jquery-ui 1.11.4 -->
<script src="<%= static_url(@conn, "/js/jquery.min.js") %>"></script>
<script src="<%= static_path(@conn, "/js/jquery.min.js") %>"></script>
<%=
case Application.get_env(:ex_admin, :head_template) do
{layout, template} ->
Expand Down Expand Up @@ -55,7 +55,7 @@
</footer>
</div>
</body>
<script src='<%= static_url(@conn, "/js/ex_admin_common.js") %>'></script>
<script src='<%= static_path(@conn, "/js/ex_admin_common.js") %>'></script>
<script type="text/javascript">
$(function() {
$('#theme-selector').change(function(e) {
Expand Down
8 changes: 4 additions & 4 deletions web/templates/layout/admin_lte2.html.eex
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
<meta name="csrf-token" id="_csrf_token" content="<%= Plug.CSRFProtection.get_csrf_token %>" />
<%= favicon() %>
<title><%= site_title() %></title>
<link rel="stylesheet" href="<%= static_url(@conn, "/css/admin_lte2.css") %>">
<link rel="stylesheet" href="<%= static_path(@conn, "/css/admin_lte2.css") %>">
<!-- Ionicons -->
<%# <link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css"> %>
<!-- Theme style -->

<!-- jQuery 2.1.4 & jquery-ui 1.11.4 -->
<script src="<%= static_url(@conn, "/js/jquery.min.js") %>"></script>
<script src="<%= static_path(@conn, "/js/jquery.min.js") %>"></script>

<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
Expand Down Expand Up @@ -69,8 +69,8 @@
$.widget.bridge('uibutton', $.ui.button);
</script>
<!-- Bootstrap 3.3.5 -->
<script src='<%= static_url(@conn, "/js/ex_admin_common.js") %>'></script>
<script src='<%= static_url(@conn, "/js/admin_lte2.js") %>'></script>
<script src='<%= static_path(@conn, "/js/ex_admin_common.js") %>'></script>
<script src='<%= static_path(@conn, "/js/admin_lte2.js") %>'></script>
</body>
<script type="text/javascript">
$(function() {
Expand Down