mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Add possibility to link to mastodon
This commit is contained in:
parent
979377f2df
commit
e1e0bdb4fc
13 changed files with 92 additions and 4 deletions
BIN
app/assets/fonts/mastodon.eot
Executable file
BIN
app/assets/fonts/mastodon.eot
Executable file
Binary file not shown.
BIN
app/assets/fonts/mastodon.otf
Executable file
BIN
app/assets/fonts/mastodon.otf
Executable file
Binary file not shown.
14
app/assets/fonts/mastodon.svg
Executable file
14
app/assets/fonts/mastodon.svg
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>Copyright (C) 2017 by original authors @ fontello.com</metadata>
|
||||
<defs>
|
||||
<font id="mastodon" horiz-adv-x="1000" >
|
||||
<font-face font-family="mastodon" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
|
||||
<missing-glyph horiz-adv-x="1000" />
|
||||
<glyph glyph-name="logo" unicode="" d="M947 251c-14-71-123-148-248-163-66-8-130-15-199-12-112 5-200 27-200 27 0-11 0-21 2-31 14-111 109-118 200-121 91-3 172 23 172 23l3-83c0 0-63-34-177-40-62-3-140 2-230 25-197 52-230 262-235 474-2 63-1 122-1 172 0 217 142 280 142 280 72 33 195 47 323 48l3 0c128-1 251-15 322-48 0 0 142-63 142-280 0 0 2-160-19-271m-148 254l0-263-104 0 0 255c0 54-23 81-68 81-50 0-75-32-75-96l0-140-104 0 0 140c0 64-25 96-75 96-45 0-68-27-68-81l0-255-104 0 0 263c0 54 14 96 41 128 29 31 66 48 112 48 53 0 93-21 120-62l26-43 26 43c27 41 67 62 120 62 46 0 83-17 112-48 27-32 41-74 41-128" horiz-adv-x="1000" />
|
||||
|
||||
<glyph glyph-name="logo_alt" unicode="" d="M945 251c-14-71-122-148-247-163-65-8-129-15-198-12-112 5-200 27-200 27 0-11 1-22 2-31 15-111 110-118 199-121 91-3 172 23 172 23l4-83c0 0-64-34-177-40-62-4-139 1-230 25-195 52-229 262-234 474-1 63 0 122 0 172 0 217 141 280 141 280 72 33 194 47 322 48l3 0c127-1 250-15 321-48 0 0 142-63 142-280 0 0 2-160-20-271m-628 183c0-39-31-70-70-70-38 0-70 31-70 70 0 39 32 71 70 71 39 0 70-32 70-71m253 0c0-39-31-70-70-70-39 0-70 31-70 70 0 39 31 71 70 71 39 0 70-32 70-71m253 0c0-39-32-70-70-70-39 0-70 31-70 70 0 39 31 71 70 71 38 0 70-32 70-71" horiz-adv-x="1000" />
|
||||
</font>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
BIN
app/assets/fonts/mastodon.ttf
Executable file
BIN
app/assets/fonts/mastodon.ttf
Executable file
Binary file not shown.
BIN
app/assets/fonts/mastodon.woff
Executable file
BIN
app/assets/fonts/mastodon.woff
Executable file
Binary file not shown.
|
|
@ -18,4 +18,5 @@
|
|||
*= require osem-navbar
|
||||
*= require selectize
|
||||
*= require selectize.bootstrap3
|
||||
*= require mastodon
|
||||
*/
|
||||
|
|
|
|||
45
app/assets/stylesheets/mastodon.css.scss
Executable file
45
app/assets/stylesheets/mastodon.css.scss
Executable file
|
|
@ -0,0 +1,45 @@
|
|||
@font-face {
|
||||
font-family: 'mastodon';
|
||||
src: font-url('mastodon.eot');
|
||||
src: local('☺'),
|
||||
font-url('mastodon.otf') format('opentype'),
|
||||
font-url('mastodon.woff') format('woff'),
|
||||
font-url('mastodon.ttf') format('truetype'),
|
||||
font-url('mastodon.svg') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
[class^="icon-"]:before, [class*=" icon-"]:before {
|
||||
font-family: "mastodon";
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
speak: none;
|
||||
|
||||
display: inline-block;
|
||||
text-decoration: inherit;
|
||||
width: 1em;
|
||||
margin-right: .2em;
|
||||
text-align: center;
|
||||
/* opacity: .8; */
|
||||
|
||||
/* For safety - reset parent styles, that can break glyph codes*/
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
|
||||
/* fix buttons height, for twitter bootstrap */
|
||||
line-height: 1em;
|
||||
|
||||
/* you can be more comfortable with increased icons size */
|
||||
/* font-size: 120%; */
|
||||
|
||||
/* Font smoothing. That was taken from TWBS */
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
|
||||
/* Uncomment for 3D effect */
|
||||
/* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
|
||||
}
|
||||
|
||||
.icon-mastodon:before { content: '\e800'; } /* '' */
|
||||
.icon-mastodon_alt:before { content: '\e801'; } /* '' */
|
||||
|
|
@ -22,7 +22,7 @@ module Admin
|
|||
|
||||
# Only allow a trusted parameter "white list" through.
|
||||
def contact_params
|
||||
params.require(:contact).permit(:social_tag, :email, :facebook, :googleplus, :twitter, :instagram, :public, :sponsor_email)
|
||||
params.require(:contact).permit(:social_tag, :email, :facebook, :googleplus, :twitter, :instagram, :mastodon, :public, :sponsor_email)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@ class Contact < ApplicationRecord
|
|||
|
||||
validates :conference, presence: true
|
||||
# Conferences only have one contact
|
||||
validates :facebook, :twitter, :googleplus, :instagram,
|
||||
validates :facebook, :twitter, :googleplus, :instagram, :mastodon,
|
||||
format: URI::regexp(%w(http https)), allow_blank: true
|
||||
|
||||
def has_social_media?
|
||||
return true if facebook.present? || twitter.present? || googleplus.present? || instagram.present? || email.present?
|
||||
return true if facebook.present? || twitter.present? || googleplus.present? || instagram.present? || mastodon.present? || email.present?
|
||||
false
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -16,4 +16,5 @@
|
|||
= f.input :googleplus, label: 'Google+ Url', hint: 'This will appear in the social media section as the link to the Google+ Page of your Conference'
|
||||
= f.input :twitter, hint: 'This will appear in the social media section as the link to the Twitter Page of your Conference'
|
||||
= f.input :instagram, hint: 'This will appear in the social media section as the link to the Instagram Page of your Conference'
|
||||
= f.input :mastodon, hint: 'This will appear in the social media section as the link to the Mastodon Page of your Conference'
|
||||
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }
|
||||
|
|
|
|||
21
app/views/conferences/_social_media.html.haml
Normal file
21
app/views/conferences/_social_media.html.haml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
.container
|
||||
.row
|
||||
.col-md-12.text-center
|
||||
- unless @conference.contact.facebook.blank?
|
||||
= link_to "#{ @conference.contact.facebook }" do
|
||||
%i.fa.fa-facebook-square.fa-4x
|
||||
- unless @conference.contact.twitter.blank?
|
||||
= link_to "#{ @conference.contact.twitter }" do
|
||||
%i.fa.fa-twitter.fa-4x
|
||||
- unless @conference.contact.instagram.blank?
|
||||
= link_to "#{ @conference.contact.instagram }" do
|
||||
%i.fa.fa-instagram.fa-4x
|
||||
- unless @conference.contact.googleplus.blank?
|
||||
= link_to "#{ @conference.contact.googleplus }" do
|
||||
%i.fa.fa-google-plus-square.fa-4x
|
||||
- unless @conference.contact.mastodon.blank?
|
||||
= link_to "#{ @conference.contact.mastodon }" do
|
||||
%i.fa.icon-mastodon.fa-4x
|
||||
- unless @conference.contact.email.blank?
|
||||
= mail_to "#{ @conference.contact.email }" do
|
||||
%i.fa.fa-envelope-o.fa-4x
|
||||
5
db/migrate/20171201163628_add_mastodon_to_contact.rb
Normal file
5
db/migrate/20171201163628_add_mastodon_to_contact.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
class AddMastodonToContact < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :contacts, :mastodon, :string
|
||||
end
|
||||
end
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20171130172334) do
|
||||
ActiveRecord::Schema.define(version: 20171201163628) do
|
||||
|
||||
create_table "ahoy_events", force: :cascade do |t|
|
||||
t.integer "visit_id"
|
||||
|
|
@ -145,6 +145,7 @@ ActiveRecord::Schema.define(version: 20171130172334) do
|
|||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "sponsor_email"
|
||||
t.string "mastodon"
|
||||
end
|
||||
|
||||
create_table "delayed_jobs", force: :cascade do |t|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue