Merge branch 'master' of github.com:fetsite/fetsite

This commit is contained in:
Thomas Blazek
2013-11-05 09:25:28 +01:00
14 changed files with 149 additions and 16 deletions

View File

@@ -8,7 +8,7 @@ gem 'rails', '3.2.9'
gem 'sqlite3' gem 'sqlite3'
gem 'execjs', '~>1.4.0' gem 'execjs', '~>1.4.0'
gem 'sanitize'
# Gems used only for assets and not required # Gems used only for assets and not required
# in production environments by default. # in production environments by default.
group :assets do group :assets do

View File

@@ -62,7 +62,7 @@ a:hover {
div.header { div.header {
display: block; display: block;
background: url('/assets/fet_icon_small.png') no-repeat; background: url('/assets/fet_icon_small.png') no-repeat;
background-color: #0A64A4; background-color: #000;
background-position:15px center; background-position:15px center;
border-bottom:1px solid black; border-bottom:1px solid black;
height:41px; height:41px;

View File

@@ -20,6 +20,8 @@ class FetprofilesController < ApplicationController
# GET /fetprofiles/1.json # GET /fetprofiles/1.json
def show def show
@fetprofile = Fetprofile.find(params[:id]) @fetprofile = Fetprofile.find(params[:id])
@gremientabs = Gremium.tabs
if params["verwalten"] if params["verwalten"]
@toolbar_elements << {:hicon=>'icon-plus', :text=> I18n.t('fetprofile.newmembership'),:path => new_fetprofile_membership_path(@fetprofile) , :confirm=>"Sure?" } if can? :new, Membership @toolbar_elements << {:hicon=>'icon-plus', :text=> I18n.t('fetprofile.newmembership'),:path => new_fetprofile_membership_path(@fetprofile) , :confirm=>"Sure?" } if can? :new, Membership
@toolbar_elements << {:hicon=>'icon-pencil', :text=> I18n.t('common.edit'),:path => edit_fetprofile_path(@fetprofile),:confirm=>"Sure?" } if can? :edit, @fetprofile @toolbar_elements << {:hicon=>'icon-pencil', :text=> I18n.t('common.edit'),:path => edit_fetprofile_path(@fetprofile),:confirm=>"Sure?" } if can? :edit, @fetprofile

View File

@@ -62,4 +62,10 @@ class Studium < ActiveRecord::Base
semester.save semester.save
self.semester << semester self.semester << semester
end end
def desc_first_words
md = /<p>(?<text>[\w\s,\.!\?]*)/.match self.desc
md[:text].split(" ")[0..100].join(" ")+ " ..."
end
end end

View File

@@ -1,10 +1,11 @@
<%= render 'fetprofiles/tabs' %>
<p id="notice"><%= notice %></p> <p id="notice"><%= notice %></p>
<div class="container-fluid"> <div style="max-width:70em">
<div class="row-fluid"> <div class="media">
<div class="span3"> <span class="pull-left">
<%= image_tag @fetprofile.picture.portrait.url %> <%= image_tag @fetprofile.picture.portrait.url %>
</div> </span>
<div class="span9"> <div class="media-body">
<h2><%= @fetprofile.name %></h2> <h2><%= @fetprofile.name %></h2>
<p> <p>
<%= @fetprofile.fetmailalias %> <%= @fetprofile.fetmailalias %>
@@ -12,14 +13,7 @@
<p> <p>
<%= @fetprofile.desc %> <%= @fetprofile.desc %>
</p> </p>
<p>
</p>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<ul> <ul>
<% @fetprofile.memberships.each do |m| %> <% @fetprofile.memberships.each do |m| %>
<li> <li>
@@ -29,6 +23,8 @@
</li> </li>
<% end %> <% end %>
</ul> </ul>
<%= render 'layouts/pretty_toolbar' %>
</div> </div>
</div></div> </div>
</div>
<%= render 'layouts/pretty_toolbar' %>

View File

@@ -2,6 +2,11 @@
theme_advanced_toolbar_location: top theme_advanced_toolbar_location: top
theme_advanced_toolbar_align: left theme_advanced_toolbar_align: left
theme_advanced_statusbar_location: bottom theme_advanced_statusbar_location: bottom
theme_advanced_buttons1_add_before:
- h2
- h3
- h4
- separator
theme_advanced_buttons3_add: theme_advanced_buttons3_add:
- tablecontrols - tablecontrols
- fullscreen - fullscreen
@@ -9,3 +14,5 @@ plugins:
- table - table
- fullscreen - fullscreen
- advimage - advimage
- heading
heading_clear_tag: p

View File

@@ -0,0 +1,59 @@
Plugin: Heading
===============
Here is a Heading plugin for TinyMCE by WSL.RU
This plugin adds H1-H6 buttons to TinyMCE.
This plugin was developed by Andrey G and modified by ggoodd.
Further modifications made by Merten van Gerven.
Version History
===============
### 1.4 by Merten van Gerven
* refactored to reduce code duplication by using closures
* changed button icons to fit the default theme.
* fix for broken command execution (http://www.tinymce.com/forum/viewtopic.php?id=25260)
### 1.3
* rewrited for TinyMCE 3.x
- removed keyboard shortcuts (use Ctrl+1-6)
### 1.2 by ggoodd
+ added keyboard shortcuts
+ added heading_clear_tag option
- removed language pack, advansed theme variables used instead
### 1.1 by ggoodd
+ added buttons switching
- removed NoHeading button
### 1.0 by Andrey G
* initial version
Installation
============
* clone this repository to your TinyMCE plugins directory and rename to 'heading'.
* Add plugin to TinyMCE plugin option list.
* Add heading buttons to button list.
* Set heading_clear_tag option if you need. Default value is undefined.
This option holds formating tag which is added on heading removal.
Initialization Example
======================
```js
tinyMCE.init({
theme : "advanced",
mode : "exact",
plugins : "heading",
heading_clear_tag : "p",
theme_advanced_buttons1_add_before : "h1,h2,h3,h4,h5,h6,separator",
});
```

View File

@@ -0,0 +1,63 @@
/**
*
* @author WSL.RU
* @copyright Copyright (c) 2006-2009. All rights reserved.
*
*/
(function(tinymce) {
/**
* Add a new command to tiny MCE
*/
function addCommand(ed, url, headingNumber) {
var headingTag = 'h' + headingNumber;
ed.addButton(headingTag, {
title : ed.getLang('advanced.' + headingTag, headingTag) + ' (Ctrl+' + headingNumber + ')',
image : url + '/img/' + headingTag + '.gif',
cmd: 'mceHeading' + headingNumber
});
ed.addCommand('mceHeading' + headingNumber, function() {
var ct = ed.getParam("heading_clear_tag", false) ? ed.getParam("heading_clear_tag", "") : "";
if (ed.selection.getNode().nodeName.toLowerCase() != headingTag) {
ct = headingTag;
}
ed.execCommand('FormatBlock', false, ct)
});
ed.onNodeChange.add( function(ed, cm, n) {
cm.setActive(headingTag, n.nodeName.toLowerCase() == headingTag);
});
}
tinymce.create('tinymce.plugins.heading', {
/**
* Initialize the plugin
*/
init : function(ed, url) {
for (var headingNumber = 1; headingNumber <= 6; headingNumber++) {
addCommand(ed, url, headingNumber);
}
},
/**
* Plugin information
*/
getInfo : function() {
return {
longname : 'Heading plugin',
author : 'WSL.RU / Andrey G, ggoodd, Merten van Gerven',
authorurl : 'http://wsl.ru',
infourl : 'mailto:merten.vg@gmail.com',
version : '1.4'
};
}
});
tinymce.PluginManager.add('heading', tinymce.plugins.heading);
})(tinymce);

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB